{"abstract":"On tag 5 and 7 photos the fit and bounds use the stored aspect ratio.","category":"Image orientation metadata","checks":8,"contract":"A viewer letterboxes the displayed image (contain fit, centred) inside a view [vw, vh]. Map a tap [tx, ty] in view coordinates to the stored pixel [x, y] of an image of stored size [w, h] with orientation tag 1..8 (invalid -> 1); tags 5..8 swap displayed axes. Taps in the letterbox bars or on the far edge return None; the displayed pixel is floor of the exact position, then mapped back through the inverse of the orientation.","contract_signature":"view, size, tag, tap","evaluation_group":"w2-image-orientation-metadata-tap-to-stored-pixel","failed_approach":"A strict > 5 test still misses tag 5.","family":"w2-image-orientation-metadata-tap-to-stored-pixel-display-swap","id":"FA-79286","implementations":{"attempt":{"sha256":"f4c04279e48d781decd2d36845be68d0394f5802179e5681962584a9b2fb28e7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(view, size, tag, tap):\n    vw, vh = view\n    w, h = size\n    tx, ty = tap\n    if tag not in range(1, 9):\n        tag = 1\n    dw, dh = (h, w) if tag > 5 else (w, h)\n    s = min(Fraction(vw, dw), Fraction(vh, dh))\n    ox = (vw - dw * s) / 2\n    oy = (vh - dh * s) / 2\n    dx = (tx - ox) / s\n    dy = (ty - oy) / s\n    if dx < 0 or dy < 0 or dx >= dw or dy >= dh:\n        return None\n    px, py = math.floor(dx), math.floor(dy)\n    if tag == 1:\n        return [px, py]\n    if tag == 2:\n        return [w - 1 - px, py]\n    if tag == 3:\n        return [w - 1 - px, h - 1 - py]\n    if tag == 4:\n        return [px, h - 1 - py]\n    if tag == 5:\n        return [py, px]\n    if tag == 6:\n        return [py, h - 1 - px]\n    if tag == 7:\n        return [w - 1 - py, h - 1 - px]\n    return [w - 1 - py, px]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[([35, 16], [9, 2], 5, [3, 11]), None], [([29, 25], [7, 6], 5, [23, 24]), [6, 5]], [([40, 25], [5, 4], 8, [32, 13]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([13, 26], [7, 5], 8, [9, 3]), None], [([22, 31], [4, 9], 8, [16, 29]), None], [([8, 10], [4, 8], 5, [4, 8]), None]], [[([26, 22], [9, 7], 7, [0, 13]), None], [([24, 14], [5, 8], 5, [7, 8]), [2, 2]], [([16, 30], [4, 2], 5, [9, 29]), [3, 1]], [([40, 21], [2, 9], 3, [13, 12]), None], [([26, 29], [2, 4], 6, [11, 12]), [0, 2]], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([40, 35], [8, 6], 5, [27, 26]), [5, 4]]], [[([17, 21], [6, 3], 5, [7, 3]), [0, 1]], [([39, 28], [2, 4], 5, [14, 12]), [0, 1]], [([31, 21], [7, 5], 5, [2, 18]), None], [([11, 19], [8, 2], 8, [8, 11]), None], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]], [([35, 17], [7, 6], 1, [31, 5]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([29, 33], [4, 5], 5, [5, 29]), None]], [[([27, 39], [2, 3], 7, [8, 5]), None], [([31, 38], [2, 6], 5, [4, 16]), [0, 0]], [([27, 31], [6, 9], 5, [15, 23]), [5, 5]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([39, 33], [9, 7], 1, [6, 23]), [1, 5]], [([20, 23], [3, 9], 0, [20, 12]), None], [([17, 29], [5, 8], 5, [14, 8]), None]], [[([26, 16], [5, 6], 7, [22, 12]), [1, 0]], [([31, 9], [5, 9], 5, [10, 8]), [4, 1]], [([22, 21], [2, 4], 5, [18, 6]), [0, 3]], [([29, 20], [4, 2], 6, [24, 13]), None], [([29, 29], [7, 9], 8, [12, 2]), None], [([36, 16], [8, 2], 3, [32, 16]), None], [([31, 20], [7, 7], 6, [7, 16]), [5, 6]], [([15, 21], [6, 7], 7, [6, 5]), [5, 4]]]]\nlabels = [\"regression: displayed axis 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":"42581596716b252c52cae2cafebf8f2a3bb221f3e5343f3b25e5785724b868ac","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(view, size, tag, tap):\n    vw, vh = view\n    w, h = size\n    tx, ty = tap\n    if tag not in range(1, 9):\n        tag = 1\n    dw, dh = (h, w) if tag in (6, 8) else (w, h)\n    s = min(Fraction(vw, dw), Fraction(vh, dh))\n    ox = (vw - dw * s) / 2\n    oy = (vh - dh * s) / 2\n    dx = (tx - ox) / s\n    dy = (ty - oy) / s\n    if dx < 0 or dy < 0 or dx >= dw or dy >= dh:\n        return None\n    px, py = math.floor(dx), math.floor(dy)\n    if tag == 1:\n        return [px, py]\n    if tag == 2:\n        return [w - 1 - px, py]\n    if tag == 3:\n        return [w - 1 - px, h - 1 - py]\n    if tag == 4:\n        return [px, h - 1 - py]\n    if tag == 5:\n        return [py, px]\n    if tag == 6:\n        return [py, h - 1 - px]\n    if tag == 7:\n        return [w - 1 - py, h - 1 - px]\n    return [w - 1 - py, px]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[([35, 16], [9, 2], 5, [3, 11]), None], [([29, 25], [7, 6], 5, [23, 24]), [6, 5]], [([40, 25], [5, 4], 8, [32, 13]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([13, 26], [7, 5], 8, [9, 3]), None], [([22, 31], [4, 9], 8, [16, 29]), None], [([8, 10], [4, 8], 5, [4, 8]), None]], [[([26, 22], [9, 7], 7, [0, 13]), None], [([24, 14], [5, 8], 5, [7, 8]), [2, 2]], [([16, 30], [4, 2], 5, [9, 29]), [3, 1]], [([40, 21], [2, 9], 3, [13, 12]), None], [([26, 29], [2, 4], 6, [11, 12]), [0, 2]], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([40, 35], [8, 6], 5, [27, 26]), [5, 4]]], [[([17, 21], [6, 3], 5, [7, 3]), [0, 1]], [([39, 28], [2, 4], 5, [14, 12]), [0, 1]], [([31, 21], [7, 5], 5, [2, 18]), None], [([11, 19], [8, 2], 8, [8, 11]), None], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]], [([35, 17], [7, 6], 1, [31, 5]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([29, 33], [4, 5], 5, [5, 29]), None]], [[([27, 39], [2, 3], 7, [8, 5]), None], [([31, 38], [2, 6], 5, [4, 16]), [0, 0]], [([27, 31], [6, 9], 5, [15, 23]), [5, 5]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([39, 33], [9, 7], 1, [6, 23]), [1, 5]], [([20, 23], [3, 9], 0, [20, 12]), None], [([17, 29], [5, 8], 5, [14, 8]), None]], [[([26, 16], [5, 6], 7, [22, 12]), [1, 0]], [([31, 9], [5, 9], 5, [10, 8]), [4, 1]], [([22, 21], [2, 4], 5, [18, 6]), [0, 3]], [([29, 20], [4, 2], 6, [24, 13]), None], [([29, 29], [7, 9], 8, [12, 2]), None], [([36, 16], [8, 2], 3, [32, 16]), None], [([31, 20], [7, 7], 6, [7, 16]), [5, 6]], [([15, 21], [6, 7], 7, [6, 5]), [5, 4]]]]\nlabels = [\"regression: displayed axis 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-tap-to-stored-pixel-display-swap","generated_at":"2026-09-29T14:49:43.159131+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":"Only the pure rotations swap displayed width and height.","sha256":"5ac656d36e8199c04ba0bcfde3d727a70f02b0e1b8f423c19d62a96aa218c63f","title":"Tap mapping ignores the axis swap for transpose tags · 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":40.512,"exit_code":1,"observations":[{"actual":[1,0],"check":"regression: displayed axis swap 0","expected":null,"passed":false},{"actual":[5,5],"check":"repair trap 1","expected":[6,5],"passed":false},{"actual":null,"check":"combined fault 2","expected":null,"passed":true},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":[0,5],"check":"control 4","expected":[0,5],"passed":true},{"actual":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[6,2],"check":"control 7","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed axis swap 0\", \"actual\": [1, 0], \"expected\": null, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [5, 5], \"expected\": [6, 5], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": [0, 5], \"expected\": [0, 5], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [6, 2], \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.186,"exit_code":1,"observations":[{"actual":[1,0],"check":"regression: displayed axis swap 0","expected":null,"passed":false},{"actual":[5,5],"check":"repair trap 1","expected":[6,5],"passed":false},{"actual":null,"check":"combined fault 2","expected":null,"passed":true},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":[0,5],"check":"control 4","expected":[0,5],"passed":true},{"actual":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[6,2],"check":"control 7","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed axis swap 0\", \"actual\": [1, 0], \"expected\": null, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [5, 5], \"expected\": [6, 5], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": [0, 5], \"expected\": [0, 5], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [6, 2], \"expected\": null, \"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."}}