{"abstract":"Rotated videos are laid out in a landscape box and letterboxed.","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 only for 90 degrees leaves 270 degree tracks in the wrong box.","family":"w2-image-orientation-metadata-video-display-matrix-display-swap","id":"FA-79051","implementations":{"attempt":{"sha256":"ec22a7af5efadf3765cac173a07101b549a5e9fd783a8b414adcf77762378bb6","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 = -a, -b\n    deg = {(U, 0): 0, (0, U): 90, (-U, 0): 180, (0, -U): 270}[(a, b)]\n    if deg == 90:\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 = [[[[[65536, 0, 0, 4294901760], 3304, 252], {'rotate': 180, 'mirror': True, 'display': [3304, 252]}], [[[0, 65536, 65536, 0], 3950, 2395], {'rotate': 270, 'mirror': True, 'display': [2395, 3950]}], [[[0, 4294901760, 65536, 0], 307, 2589], {'rotate': 270, 'mirror': False, 'display': [2589, 307]}], [[[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'], [[[4294901760, 0, 0, 65536], 3623, 1679], {'rotate': 0, 'mirror': True, 'display': [3623, 1679]}]], [[[[4294901760, 0, 0, 65536], 2552, 3331], {'rotate': 0, 'mirror': True, 'display': [2552, 3331]}], [[[0, 65536, 65536, 0], 3389, 3534], {'rotate': 270, 'mirror': True, 'display': [3534, 3389]}], [[[0, 4294901760, 65536, 0], 1556, 1750], {'rotate': 270, 'mirror': False, 'display': [1750, 1556]}], [[[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'], [[[65536, 0, 0, 4294901760], 2680, 1583], {'rotate': 180, 'mirror': True, 'display': [2680, 1583]}]], [[[[0, 65536, 4294901760, 0], 3412, 3662], {'rotate': 90, 'mirror': False, 'display': [3662, 3412]}], [[[0, 4294901760, 65536, 0], 2441, 118], {'rotate': 270, 'mirror': False, 'display': [118, 2441]}], [[[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]}]], [[[[65536, 0, 0, 4294901760], 2538, 1637], {'rotate': 180, 'mirror': True, 'display': [2538, 1637]}], [[[0, 4294901760, 65536, 0], 1828, 292], {'rotate': 270, 'mirror': False, 'display': [292, 1828]}], [[[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'], [[[0, 65536, 4294901760, 0], 2560, 3677], {'rotate': 90, 'mirror': False, 'display': [3677, 2560]}]], [[[[0, 65536, 4294901760, 0], 1708, 2732], {'rotate': 90, 'mirror': False, 'display': [2732, 1708]}], [[[0, 65536, 65536, 0], 787, 2116], {'rotate': 270, 'mirror': True, 'display': [2116, 787]}], [[[0, 4294901760, 65536, 0], 3539, 3680], {'rotate': 270, 'mirror': False, 'display': [3680, 3539]}], [[[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: displayed size swap\", \"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":"26c36923b23057108e51f5d0c55e8fd10c59cf40a07801fe6d022576f736b4eb","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 = -a, -b\n    deg = {(U, 0): 0, (0, U): 90, (-U, 0): 180, (0, -U): 270}[(a, b)]\n    if mirror:\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 = [[[[[65536, 0, 0, 4294901760], 3304, 252], {'rotate': 180, 'mirror': True, 'display': [3304, 252]}], [[[0, 65536, 65536, 0], 3950, 2395], {'rotate': 270, 'mirror': True, 'display': [2395, 3950]}], [[[0, 4294901760, 65536, 0], 307, 2589], {'rotate': 270, 'mirror': False, 'display': [2589, 307]}], [[[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'], [[[4294901760, 0, 0, 65536], 3623, 1679], {'rotate': 0, 'mirror': True, 'display': [3623, 1679]}]], [[[[4294901760, 0, 0, 65536], 2552, 3331], {'rotate': 0, 'mirror': True, 'display': [2552, 3331]}], [[[0, 65536, 65536, 0], 3389, 3534], {'rotate': 270, 'mirror': True, 'display': [3534, 3389]}], [[[0, 4294901760, 65536, 0], 1556, 1750], {'rotate': 270, 'mirror': False, 'display': [1750, 1556]}], [[[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'], [[[65536, 0, 0, 4294901760], 2680, 1583], {'rotate': 180, 'mirror': True, 'display': [2680, 1583]}]], [[[[0, 65536, 4294901760, 0], 3412, 3662], {'rotate': 90, 'mirror': False, 'display': [3662, 3412]}], [[[0, 4294901760, 65536, 0], 2441, 118], {'rotate': 270, 'mirror': False, 'display': [118, 2441]}], [[[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]}]], [[[[65536, 0, 0, 4294901760], 2538, 1637], {'rotate': 180, 'mirror': True, 'display': [2538, 1637]}], [[[0, 4294901760, 65536, 0], 1828, 292], {'rotate': 270, 'mirror': False, 'display': [292, 1828]}], [[[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'], [[[0, 65536, 4294901760, 0], 2560, 3677], {'rotate': 90, 'mirror': False, 'display': [3677, 2560]}]], [[[[0, 65536, 4294901760, 0], 1708, 2732], {'rotate': 90, 'mirror': False, 'display': [2732, 1708]}], [[[0, 65536, 65536, 0], 787, 2116], {'rotate': 270, 'mirror': True, 'display': [2116, 787]}], [[[0, 4294901760, 65536, 0], 3539, 3680], {'rotate': 270, 'mirror': False, 'display': [3680, 3539]}], [[[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: displayed size swap\", \"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-display-swap","generated_at":"2026-09-29T14:49:41.125789+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":"The width and height swap is keyed on the mirror flag rather than on quarter-turn rotations.","sha256":"b774be7568eed2e31e803c0065e76167d5f063bdc4076fe64fb8840344d1997f","title":"Displayed video size ignores quarter turns · 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":37.451,"exit_code":1,"observations":[{"actual":{"display":[3304,252],"mirror":true,"rotate":180},"check":"regression: displayed size swap 0","expected":{"display":[3304,252],"mirror":true,"rotate":180},"passed":true},{"actual":{"display":[3950,2395],"mirror":true,"rotate":270},"check":"repair trap 1","expected":{"display":[2395,3950],"mirror":true,"rotate":270},"passed":false},{"actual":{"display":[307,2589],"mirror":false,"rotate":270},"check":"combined fault 2","expected":{"display":[2589,307],"mirror":false,"rotate":270},"passed":false},{"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":[3623,1679],"mirror":true,"rotate":0},"check":"control 7","expected":{"display":[3623,1679],"mirror":true,"rotate":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed size swap 0\", \"actual\": {\"rotate\": 180, \"mirror\": true, \"display\": [3304, 252]}, \"expected\": {\"rotate\": 180, \"mirror\": true, \"display\": [3304, 252]}, \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": {\"rotate\": 270, \"mirror\": true, \"display\": [3950, 2395]}, \"expected\": {\"rotate\": 270, \"mirror\": true, \"display\": [2395, 3950]}, \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": {\"rotate\": 270, \"mirror\": false, \"display\": [307, 2589]}, \"expected\": {\"rotate\": 270, \"mirror\": false, \"display\": [2589, 307]}, \"passed\": false}, {\"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\": [3623, 1679]}, \"expected\": {\"rotate\": 0, \"mirror\": true, \"display\": [3623, 1679]}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.816,"exit_code":1,"observations":[{"actual":{"display":[252,3304],"mirror":true,"rotate":180},"check":"regression: displayed size swap 0","expected":{"display":[3304,252],"mirror":true,"rotate":180},"passed":false},{"actual":{"display":[2395,3950],"mirror":true,"rotate":270},"check":"repair trap 1","expected":{"display":[2395,3950],"mirror":true,"rotate":270},"passed":true},{"actual":{"display":[307,2589],"mirror":false,"rotate":270},"check":"combined fault 2","expected":{"display":[2589,307],"mirror":false,"rotate":270},"passed":false},{"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":[1679,3623],"mirror":true,"rotate":0},"check":"control 7","expected":{"display":[3623,1679],"mirror":true,"rotate":0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed size swap 0\", \"actual\": {\"rotate\": 180, \"mirror\": true, \"display\": [252, 3304]}, \"expected\": {\"rotate\": 180, \"mirror\": true, \"display\": [3304, 252]}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": {\"rotate\": 270, \"mirror\": true, \"display\": [2395, 3950]}, \"expected\": {\"rotate\": 270, \"mirror\": true, \"display\": [2395, 3950]}, \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": {\"rotate\": 270, \"mirror\": false, \"display\": [307, 2589]}, \"expected\": {\"rotate\": 270, \"mirror\": false, \"display\": [2589, 307]}, \"passed\": false}, {\"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\": [1679, 3623]}, \"expected\": {\"rotate\": 0, \"mirror\": true, \"display\": [3623, 1679]}, \"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."}}