{"abstract":"Taps in the right half of a pixel select its neighbour.","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.","evaluation_group":"w2-image-orientation-metadata-tap-to-stored-pixel","failed_approach":"ceil - 1 maps a tap exactly on a pixel boundary to the previous pixel.","family":"w2-image-orientation-metadata-tap-to-stored-pixel-pixel-floor","id":"FA-79281","implementations":{"attempt":{"sha256":"70e3ca296f511766224ea39fc4b09a775010e45152bb55b5f40be11dad8c861e","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.ceil(dx) - 1, math.ceil(dy) - 1\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 = [[[([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([19, 9], [3, 5], 6, [5, 4]), [1, 3]], [([9, 8], [6, 2], 2, [3, 5]), [3, 1]], [([40, 25], [5, 4], 8, [32, 13]), None], [([35, 16], [9, 2], 5, [3, 11]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([13, 26], [7, 5], 8, [9, 3]), None], [([18, 19], [5, 7], 4, [10, 11]), [2, 2]]], [[([29, 40], [2, 5], 3, [22, 11]), [0, 3]], [([34, 20], [5, 5], 1, [18, 16]), [2, 4]], [([34, 33], [9, 7], 5, [15, 22]), [6, 2]], [([40, 21], [2, 9], 3, [13, 12]), None], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([17, 18], [6, 7], 3, [1, 6]), [5, 4]], [([36, 27], [4, 5], 3, [22, 3]), [1, 4]]], [[([17, 21], [6, 3], 5, [7, 3]), [0, 1]], [([8, 14], [3, 5], 4, [0, 5]), [0, 3]], [([40, 37], [2, 7], 6, [0, 22]), [1, 6]], [([35, 17], [7, 6], 1, [31, 5]), None], [([22, 15], [4, 6], 7, [16, 2]), [3, 1]], [([29, 33], [4, 5], 5, [5, 29]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]]], [[([19, 25], [6, 8], 2, [5, 18]), [4, 5]], [([28, 27], [9, 4], 7, [12, 3]), [7, 2]], [([9, 38], [8, 3], 8, [2, 16]), [4, 0]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([20, 23], [3, 9], 0, [20, 12]), None], [([29, 39], [9, 2], 8, [0, 36]), None], [([10, 8], [6, 8], 8, [6, 2]), [4, 4]]], [[([24, 8], [4, 7], 8, [16, 3]), [2, 5]], [([15, 24], [4, 3], 7, [12, 2]), [3, 0]], [([12, 29], [7, 4], 7, [9, 15]), [3, 0]], [([29, 29], [7, 9], 8, [12, 2]), None], [([36, 16], [8, 2], 3, [32, 16]), None], [([16, 18], [3, 4], 0, [6, 14]), [1, 3]], [([33, 36], [7, 2], 0, [24, 19]), [5, 1]], [([14, 27], [3, 9], 3, [3, 26]), [2, 0]]]]\nlabels = [\"regression: displayed pixel quantisation\", \"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":"2736288f30d131522d8da9444b36c9dc2303346bb04ee3dda79117044e709281","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 = round(dx), round(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 = [[[([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([19, 9], [3, 5], 6, [5, 4]), [1, 3]], [([9, 8], [6, 2], 2, [3, 5]), [3, 1]], [([40, 25], [5, 4], 8, [32, 13]), None], [([35, 16], [9, 2], 5, [3, 11]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([13, 26], [7, 5], 8, [9, 3]), None], [([18, 19], [5, 7], 4, [10, 11]), [2, 2]]], [[([29, 40], [2, 5], 3, [22, 11]), [0, 3]], [([34, 20], [5, 5], 1, [18, 16]), [2, 4]], [([34, 33], [9, 7], 5, [15, 22]), [6, 2]], [([40, 21], [2, 9], 3, [13, 12]), None], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([17, 18], [6, 7], 3, [1, 6]), [5, 4]], [([36, 27], [4, 5], 3, [22, 3]), [1, 4]]], [[([17, 21], [6, 3], 5, [7, 3]), [0, 1]], [([8, 14], [3, 5], 4, [0, 5]), [0, 3]], [([40, 37], [2, 7], 6, [0, 22]), [1, 6]], [([35, 17], [7, 6], 1, [31, 5]), None], [([22, 15], [4, 6], 7, [16, 2]), [3, 1]], [([29, 33], [4, 5], 5, [5, 29]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]]], [[([19, 25], [6, 8], 2, [5, 18]), [4, 5]], [([28, 27], [9, 4], 7, [12, 3]), [7, 2]], [([9, 38], [8, 3], 8, [2, 16]), [4, 0]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([20, 23], [3, 9], 0, [20, 12]), None], [([29, 39], [9, 2], 8, [0, 36]), None], [([10, 8], [6, 8], 8, [6, 2]), [4, 4]]], [[([24, 8], [4, 7], 8, [16, 3]), [2, 5]], [([15, 24], [4, 3], 7, [12, 2]), [3, 0]], [([12, 29], [7, 4], 7, [9, 15]), [3, 0]], [([29, 29], [7, 9], 8, [12, 2]), None], [([36, 16], [8, 2], 3, [32, 16]), None], [([16, 18], [3, 4], 0, [6, 14]), [1, 3]], [([33, 36], [7, 2], 0, [24, 19]), [5, 1]], [([14, 27], [3, 9], 3, [3, 26]), [2, 0]]]]\nlabels = [\"regression: displayed pixel quantisation\", \"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"},"fixed":{"sha256":"f8ae0968867c6fb63549c1fd040a9f2f26851f7ea735e5d367f36b2ade8e08b1","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 = [[[([17, 19], [3, 9], 1, [7, 11]), [0, 5]], [([19, 9], [3, 5], 6, [5, 4]), [1, 3]], [([9, 8], [6, 2], 2, [3, 5]), [3, 1]], [([40, 25], [5, 4], 8, [32, 13]), None], [([35, 16], [9, 2], 5, [3, 11]), None], [([13, 34], [5, 3], 1, [10, 31]), None], [([13, 26], [7, 5], 8, [9, 3]), None], [([18, 19], [5, 7], 4, [10, 11]), [2, 2]]], [[([29, 40], [2, 5], 3, [22, 11]), [0, 3]], [([34, 20], [5, 5], 1, [18, 16]), [2, 4]], [([34, 33], [9, 7], 5, [15, 22]), [6, 2]], [([40, 21], [2, 9], 3, [13, 12]), None], [([25, 26], [2, 9], 6, [18, 0]), None], [([21, 19], [8, 6], 3, [19, 2]), [0, 5]], [([17, 18], [6, 7], 3, [1, 6]), [5, 4]], [([36, 27], [4, 5], 3, [22, 3]), [1, 4]]], [[([17, 21], [6, 3], 5, [7, 3]), [0, 1]], [([8, 14], [3, 5], 4, [0, 5]), [0, 3]], [([40, 37], [2, 7], 6, [0, 22]), [1, 6]], [([35, 17], [7, 6], 1, [31, 5]), None], [([22, 15], [4, 6], 7, [16, 2]), [3, 1]], [([29, 33], [4, 5], 5, [5, 29]), None], [([37, 32], [8, 3], 3, [9, 25]), None], [([17, 38], [4, 3], 4, [2, 16]), [0, 2]]], [[([19, 25], [6, 8], 2, [5, 18]), [4, 5]], [([28, 27], [9, 4], 7, [12, 3]), [7, 2]], [([9, 38], [8, 3], 8, [2, 16]), [4, 0]], [([22, 29], [9, 2], 3, [8, 26]), None], [([35, 16], [3, 9], 2, [10, 1]), None], [([20, 23], [3, 9], 0, [20, 12]), None], [([29, 39], [9, 2], 8, [0, 36]), None], [([10, 8], [6, 8], 8, [6, 2]), [4, 4]]], [[([24, 8], [4, 7], 8, [16, 3]), [2, 5]], [([15, 24], [4, 3], 7, [12, 2]), [3, 0]], [([12, 29], [7, 4], 7, [9, 15]), [3, 0]], [([29, 29], [7, 9], 8, [12, 2]), None], [([36, 16], [8, 2], 3, [32, 16]), None], [([16, 18], [3, 4], 0, [6, 14]), [1, 3]], [([33, 36], [7, 2], 0, [24, 19]), [5, 1]], [([14, 27], [3, 9], 3, [3, 26]), [2, 0]]]]\nlabels = [\"regression: displayed pixel quantisation\", \"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-pixel-floor","generated_at":"2026-09-29T14:49:43.140137+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.","repair":"Floor the continuous display position to get the pixel index.","root_cause":"The continuous position is rounded instead of floored.","sha256":"f4b503c16fb206bb122dee48e15a9da3560330ade42349caa807d43cac1020c6","title":"Tap position is rounded to the nearest pixel corner · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.374,"exit_code":1,"observations":[{"actual":[0,5],"check":"regression: displayed pixel quantisation 0","expected":[0,5],"passed":true},{"actual":[1,4],"check":"repair trap 1","expected":[1,3],"passed":false},{"actual":[4,1],"check":"combined fault 2","expected":[3,1],"passed":false},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":null,"check":"control 4","expected":null,"passed":true},{"actual":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[2,2],"check":"control 7","expected":[2,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed pixel quantisation 0\", \"actual\": [0, 5], \"expected\": [0, 5], \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": [1, 4], \"expected\": [1, 3], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [4, 1], \"expected\": [3, 1], \"passed\": false}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [2, 2], \"expected\": [2, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.512,"exit_code":1,"observations":[{"actual":[1,5],"check":"regression: displayed pixel quantisation 0","expected":[0,5],"passed":false},{"actual":[1,3],"check":"repair trap 1","expected":[1,3],"passed":true},{"actual":[3,2],"check":"combined fault 2","expected":[3,1],"passed":false},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":null,"check":"control 4","expected":null,"passed":true},{"actual":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[3,2],"check":"control 7","expected":[2,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed pixel quantisation 0\", \"actual\": [1, 5], \"expected\": [0, 5], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": [3, 2], \"expected\": [3, 1], \"passed\": false}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [3, 2], \"expected\": [2, 2], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.574,"exit_code":0,"observations":[{"actual":[0,5],"check":"regression: displayed pixel quantisation 0","expected":[0,5],"passed":true},{"actual":[1,3],"check":"repair trap 1","expected":[1,3],"passed":true},{"actual":[3,1],"check":"combined fault 2","expected":[3,1],"passed":true},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":null,"check":"control 4","expected":null,"passed":true},{"actual":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[2,2],"check":"control 7","expected":[2,2],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: displayed pixel quantisation 0\", \"actual\": [0, 5], \"expected\": [0, 5], \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": [3, 1], \"expected\": [3, 1], \"passed\": true}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [2, 2], \"expected\": [2, 2], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}