{"abstract":"Mirrored front-camera clips report the wrong rotation.","category":"Image orientation metadata","checks":8,"contract":"Input [matrix, width, height] where matrix is the [a, b, c, d] part of a track display matrix stored as unsigned 32-bit 16.16 fixed-point words (x' = a*x + c*y, y' = b*x + d*y, screen y down). Only signed permutation matrices of unit entries are supported, otherwise \"unsupported\". A negative determinant means a left-right mirror applied before the rotation; the clockwise rotation is read from the image of the x axis after removing the mirror. Return rotate (0/90/180/270), mirror and the displayed [width, height].","contract_signature":"x","evaluation_group":"w2-image-orientation-metadata-video-display-matrix","failed_approach":"Swapping a and b is a transpose, not a mirror removal.","family":"w2-image-orientation-metadata-video-display-matrix-mirror-column","id":"FA-79036","implementations":{"attempt":{"sha256":"ab6a361c979dace78f0b1e42e18f700a799e24928061b24bb9d06c0ad19c0df7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    m, w, h = x\n    U = 65536\n    m = [v - (1 << 32) if v >= (1 << 31) else v for v in m]\n    a, b, c, d = m\n    if any(v not in (-U, 0, U) for v in m):\n        return 'unsupported'\n    if not ((b == 0 and c == 0 and a != 0 and d != 0) or (a == 0 and d == 0 and b != 0 and c != 0)):\n        return 'unsupported'\n    det = (a * d - b * c) // (U * U)\n    mirror = det == -1\n    if mirror:\n        a, b = b, a\n    deg = {(U, 0): 0, (0, U): 90, (-U, 0): 180, (0, -U): 270}[(a, b)]\n    if deg in (90, 270):\n        w, h = h, w\n    return {'rotate': deg, 'mirror': mirror, 'display': [w, h]}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[0, 4294901760, 4294901760, 0], 760, 3281], {'rotate': 90, 'mirror': True, 'display': [3281, 760]}], [[[4294901760, 0, 0, 65536], 3623, 1679], {'rotate': 0, 'mirror': True, 'display': [3623, 1679]}], [[[4294901760, 0, 65536, 4294901760], 3830, 2696], 'unsupported'], [[[0, 65536, 4294901760, 65536], 559, 2713], 'unsupported'], [[[0, 65536, 4294901760, 65536], 1463, 780], 'unsupported'], [[[65536, 4294901760, 65536, 65536], 2751, 608], 'unsupported'], [[[0, 0, 4294901760, 0], 1243, 3391], 'unsupported'], [[[65536, 0, 0, 4294901760], 3304, 252], {'rotate': 180, 'mirror': True, 'display': [3304, 252]}]], [[[[0, 65536, 65536, 0], 1609, 1135], {'rotate': 270, 'mirror': True, 'display': [1135, 1609]}], [[[4294901760, 0, 0, 65536], 2607, 2935], {'rotate': 0, 'mirror': True, 'display': [2607, 2935]}], [[[4294901760, 0, 4294901760, 4294901760], 2730, 1220], 'unsupported'], [[[65536, 4294901760, 0, 4294901760], 3622, 60], 'unsupported'], [[[0, 4294901760, 65536, 65536], 1290, 2847], 'unsupported'], [[[65536, 0, 4294901760, 65536], 1369, 1577], 'unsupported'], [[[0, 4294901760, 65536, 0], 1556, 1750], {'rotate': 270, 'mirror': False, 'display': [1750, 1556]}], [[[4294901760, 0, 0, 65536], 2552, 3331], {'rotate': 0, 'mirror': True, 'display': [2552, 3331]}]], [[[[0, 65536, 65536, 0], 967, 3689], {'rotate': 270, 'mirror': True, 'display': [3689, 967]}], [[[0, 4294901760, 4294901760, 0], 251, 651], {'rotate': 90, 'mirror': True, 'display': [651, 251]}], [[[4294901760, 0, 65536, 0], 3442, 2421], 'unsupported'], [[[4294901760, 65536, 4294901760, 0], 392, 1027], 'unsupported'], [[[4294901760, 0, 4294901760, 65536], 1363, 2590], 'unsupported'], [[[4294901760, 0, 65536, 0], 3783, 1537], 'unsupported'], [[[0, 0, 0, 65536], 714, 1938], 'unsupported'], [[[4294901760, 0, 0, 65536], 3751, 979], {'rotate': 0, 'mirror': True, 'display': [3751, 979]}]], [[[[0, 65536, 65536, 0], 2244, 3320], {'rotate': 270, 'mirror': True, 'display': [3320, 2244]}], [[[4294901760, 0, 0, 65536], 1021, 3478], {'rotate': 0, 'mirror': True, 'display': [1021, 3478]}], [[[0, 0, 46341, 0], 991, 438], 'unsupported'], [[[65536, 0, 65536, 65536], 1287, 3950], 'unsupported'], [[[0, 65536, 0, 0], 2790, 437], 'unsupported'], [[[0, 4294901760, 65536, 4294901760], 3527, 100], 'unsupported'], [[[65536, 4294901760, 65536, 4294901760], 2961, 612], 'unsupported'], [[[65536, 0, 0, 4294901760], 2895, 2725], {'rotate': 180, 'mirror': True, 'display': [2895, 2725]}]], [[[[4294901760, 0, 0, 65536], 543, 1291], {'rotate': 0, 'mirror': True, 'display': [543, 1291]}], [[[0, 4294901760, 4294901760, 0], 1518, 2324], {'rotate': 90, 'mirror': True, 'display': [2324, 1518]}], [[[4294901760, 65536, 65536, 65536], 1654, 584], 'unsupported'], [[[4294901760, 65536, 65536, 0], 1703, 3849], 'unsupported'], [[[65536, 4294901760, 4294901760, 4294901760], 132, 2157], 'unsupported'], [[[0, 4294901760, 0, 0], 3596, 3944], 'unsupported'], [[[4294901760, 32768, 32768, 4294901760], 1623, 1094], 'unsupported'], [[[65536, 0, 0, 4294901760], 1985, 3076], {'rotate': 180, 'mirror': True, 'display': [1985, 3076]}]]]\nlabels = [\"regression: mirror removal column\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"0ddc76294bc75fde6adcf0ff287a0d338a437bd095fd4c1024f415a95ce50dc3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    m, w, h = x\n    U = 65536\n    m = [v - (1 << 32) if v >= (1 << 31) else v for v in m]\n    a, b, c, d = m\n    if any(v not in (-U, 0, U) for v in m):\n        return 'unsupported'\n    if not ((b == 0 and c == 0 and a != 0 and d != 0) or (a == 0 and d == 0 and b != 0 and c != 0)):\n        return 'unsupported'\n    det = (a * d - b * c) // (U * U)\n    mirror = det == -1\n    if mirror:\n        c, d = -c, -d\n    deg = {(U, 0): 0, (0, U): 90, (-U, 0): 180, (0, -U): 270}[(a, b)]\n    if deg in (90, 270):\n        w, h = h, w\n    return {'rotate': deg, 'mirror': mirror, 'display': [w, h]}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[0, 4294901760, 4294901760, 0], 760, 3281], {'rotate': 90, 'mirror': True, 'display': [3281, 760]}], [[[4294901760, 0, 0, 65536], 3623, 1679], {'rotate': 0, 'mirror': True, 'display': [3623, 1679]}], [[[4294901760, 0, 65536, 4294901760], 3830, 2696], 'unsupported'], [[[0, 65536, 4294901760, 65536], 559, 2713], 'unsupported'], [[[0, 65536, 4294901760, 65536], 1463, 780], 'unsupported'], [[[65536, 4294901760, 65536, 65536], 2751, 608], 'unsupported'], [[[0, 0, 4294901760, 0], 1243, 3391], 'unsupported'], [[[65536, 0, 0, 4294901760], 3304, 252], {'rotate': 180, 'mirror': True, 'display': [3304, 252]}]], [[[[0, 65536, 65536, 0], 1609, 1135], {'rotate': 270, 'mirror': True, 'display': [1135, 1609]}], [[[4294901760, 0, 0, 65536], 2607, 2935], {'rotate': 0, 'mirror': True, 'display': [2607, 2935]}], [[[4294901760, 0, 4294901760, 4294901760], 2730, 1220], 'unsupported'], [[[65536, 4294901760, 0, 4294901760], 3622, 60], 'unsupported'], [[[0, 4294901760, 65536, 65536], 1290, 2847], 'unsupported'], [[[65536, 0, 4294901760, 65536], 1369, 1577], 'unsupported'], [[[0, 4294901760, 65536, 0], 1556, 1750], {'rotate': 270, 'mirror': False, 'display': [1750, 1556]}], [[[4294901760, 0, 0, 65536], 2552, 3331], {'rotate': 0, 'mirror': True, 'display': [2552, 3331]}]], [[[[0, 65536, 65536, 0], 967, 3689], {'rotate': 270, 'mirror': True, 'display': [3689, 967]}], [[[0, 4294901760, 4294901760, 0], 251, 651], {'rotate': 90, 'mirror': True, 'display': [651, 251]}], [[[4294901760, 0, 65536, 0], 3442, 2421], 'unsupported'], [[[4294901760, 65536, 4294901760, 0], 392, 1027], 'unsupported'], [[[4294901760, 0, 4294901760, 65536], 1363, 2590], 'unsupported'], [[[4294901760, 0, 65536, 0], 3783, 1537], 'unsupported'], [[[0, 0, 0, 65536], 714, 1938], 'unsupported'], [[[4294901760, 0, 0, 65536], 3751, 979], {'rotate': 0, 'mirror': True, 'display': [3751, 979]}]], [[[[0, 65536, 65536, 0], 2244, 3320], {'rotate': 270, 'mirror': True, 'display': [3320, 2244]}], [[[4294901760, 0, 0, 65536], 1021, 3478], {'rotate': 0, 'mirror': True, 'display': [1021, 3478]}], [[[0, 0, 46341, 0], 991, 438], 'unsupported'], [[[65536, 0, 65536, 65536], 1287, 3950], 'unsupported'], [[[0, 65536, 0, 0], 2790, 437], 'unsupported'], [[[0, 4294901760, 65536, 4294901760], 3527, 100], 'unsupported'], [[[65536, 4294901760, 65536, 4294901760], 2961, 612], 'unsupported'], [[[65536, 0, 0, 4294901760], 2895, 2725], {'rotate': 180, 'mirror': True, 'display': [2895, 2725]}]], [[[[4294901760, 0, 0, 65536], 543, 1291], {'rotate': 0, 'mirror': True, 'display': [543, 1291]}], [[[0, 4294901760, 4294901760, 0], 1518, 2324], {'rotate': 90, 'mirror': True, 'display': [2324, 1518]}], [[[4294901760, 65536, 65536, 65536], 1654, 584], 'unsupported'], [[[4294901760, 65536, 65536, 0], 1703, 3849], 'unsupported'], [[[65536, 4294901760, 4294901760, 4294901760], 132, 2157], 'unsupported'], [[[0, 4294901760, 0, 0], 3596, 3944], 'unsupported'], [[[4294901760, 32768, 32768, 4294901760], 1623, 1094], 'unsupported'], [[[65536, 0, 0, 4294901760], 1985, 3076], {'rotate': 180, 'mirror': True, 'display': [1985, 3076]}]]]\nlabels = [\"regression: mirror removal column\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic bounded teaching model with a stipulated contract; it makes no claim of conformance to any published specification. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-image-orientation-metadata-video-display-matrix-mirror-column","generated_at":"2026-09-29T14:49:40.858781+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Camera, phone and scanner images carry an orientation hint separately from the stored pixels; galleries, thumbnailers, editors and upload pipelines must interpret it consistently or photos appear sideways, mirrored or doubly rotated.","root_cause":"Undoing the left-right mirror must negate the image of the x axis, but the code negates the y column.","sha256":"82f0978ee10ae7d8037bbad1ac55bc9f66eeaa5984005474cd12dd407caaf981","title":"Mirror removal negates the y-axis column · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.619,"exit_code":1,"observations":[{"actual":{"display":[760,3281],"mirror":true,"rotate":180},"check":"regression: mirror removal column 0","expected":{"display":[3281,760],"mirror":true,"rotate":90},"passed":false},{"actual":{"display":[1679,3623],"mirror":true,"rotate":270},"check":"repair trap 1","expected":{"display":[3623,1679],"mirror":true,"rotate":0},"passed":false},{"actual":"unsupported","check":"combined fault 2","expected":"unsupported","passed":true},{"actual":"unsupported","check":"control 3","expected":"unsupported","passed":true},{"actual":"unsupported","check":"control 4","expected":"unsupported","passed":true},{"actual":"unsupported","check":"boundary 5","expected":"unsupported","passed":true},{"actual":"unsupported","check":"boundary 6","expected":"unsupported","passed":true},{"actual":{"display":[252,3304],"mirror":true,"rotate":90},"check":"control 7","expected":{"display":[3304,252],"mirror":true,"rotate":180},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: mirror removal column 0\", \"actual\": {\"rotate\": 180, \"mirror\": true, \"display\": [760, 3281]}, \"expected\": {\"rotate\": 90, \"mirror\": true, \"display\": [3281, 760]}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": {\"rotate\": 270, \"mirror\": true, \"display\": [1679, 3623]}, \"expected\": {\"rotate\": 0, \"mirror\": true, \"display\": [3623, 1679]}, \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": {\"rotate\": 90, \"mirror\": true, \"display\": [252, 3304]}, \"expected\": {\"rotate\": 180, \"mirror\": true, \"display\": [3304, 252]}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.386,"exit_code":1,"observations":[{"actual":{"display":[3281,760],"mirror":true,"rotate":270},"check":"regression: mirror removal column 0","expected":{"display":[3281,760],"mirror":true,"rotate":90},"passed":false},{"actual":{"display":[3623,1679],"mirror":true,"rotate":180},"check":"repair trap 1","expected":{"display":[3623,1679],"mirror":true,"rotate":0},"passed":false},{"actual":"unsupported","check":"combined fault 2","expected":"unsupported","passed":true},{"actual":"unsupported","check":"control 3","expected":"unsupported","passed":true},{"actual":"unsupported","check":"control 4","expected":"unsupported","passed":true},{"actual":"unsupported","check":"boundary 5","expected":"unsupported","passed":true},{"actual":"unsupported","check":"boundary 6","expected":"unsupported","passed":true},{"actual":{"display":[3304,252],"mirror":true,"rotate":0},"check":"control 7","expected":{"display":[3304,252],"mirror":true,"rotate":180},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: mirror removal column 0\", \"actual\": {\"rotate\": 270, \"mirror\": true, \"display\": [3281, 760]}, \"expected\": {\"rotate\": 90, \"mirror\": true, \"display\": [3281, 760]}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": {\"rotate\": 180, \"mirror\": true, \"display\": [3623, 1679]}, \"expected\": {\"rotate\": 0, \"mirror\": true, \"display\": [3623, 1679]}, \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"control 3\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"control 4\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"unsupported\", \"expected\": \"unsupported\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": {\"rotate\": 0, \"mirror\": true, \"display\": [3304, 252]}, \"expected\": {\"rotate\": 180, \"mirror\": true, \"display\": [3304, 252]}, \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}