{"abstract":"Transposed copies of a square image are not recognised as duplicates.","category":"Image orientation metadata","checks":8,"contract":"For duplicate detection, bring a pixel grid into a canonical orientation: of the eight orientations (tags 1..8, same pixel mapping as EXIF baking), pick the one whose key (height, width, row-major pixels) is smallest; ties go to the lowest tag. Return [tag, inverse_tag, canonical_grid] where the inverse tag restores the original (6 and 8 are mutual inverses, every other tag is self-inverse).","contract_signature":"grid","evaluation_group":"w2-image-orientation-metadata-dedup-canonical-orientation","failed_approach":"Reversing the column gives a rotation, which is already covered by another tag.","family":"w2-image-orientation-metadata-dedup-canonical-orientation-transpose-source","id":"FA-79301","implementations":{"attempt":{"sha256":"d3530763af79286d823b61f86a849926429db4123de2705ff3ea2abc73671958","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid):\n    h = len(grid)\n    w = len(grid[0])\n    def src(t, r, c):\n        return {1: (r, c), 2: (r, w - 1 - c), 3: (h - 1 - r, w - 1 - c), 4: (h - 1 - r, c),\n                5: (w - 1 - c, r), 6: (h - 1 - c, r), 7: (h - 1 - c, w - 1 - r), 8: (c, w - 1 - r)}[t]\n    best = None\n    for t in range(1, 9):\n        oh, ow = (w, h) if t >= 5 else (h, w)\n        img = [[grid[src(t, r, c)[0]][src(t, r, c)[1]] for c in range(ow)] for r in range(oh)]\n        key = (oh, ow, [v for row in img for v in row])\n        if best is None or key < best[0]:\n            best = (key, t, img)\n    inverse = {6: 8, 8: 6}.get(best[1], best[1])\n    return [best[1], inverse, best[2]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[0, 8, 6], [8, 4, 4], [2, 9, 7]], [5, 5, [[0, 8, 2], [8, 4, 9], [6, 4, 7]]]], [[[3, 7, 5], [1, 5, 2], [4, 0, 8]], [5, 5, [[3, 1, 4], [7, 5, 0], [5, 2, 8]]]], [[[6, 3, 0], [0, 8, 5], [1, 5, 5]], [2, 2, [[0, 3, 6], [5, 8, 0], [5, 5, 1]]]], [[[7]], [1, 1, [[7]]]], [[[8]], [1, 1, [[8]]]], [[[9, 4, 8], [1, 6, 4], [6, 4, 0]], [3, 3, [[0, 4, 6], [4, 6, 1], [8, 4, 9]]]], [[[0, 1], [5, 1]], [1, 1, [[0, 1], [5, 1]]]], [[[3, 7], [4, 7]], [5, 5, [[3, 4], [7, 7]]]]], [[[[2, 6], [3, 3]], [5, 5, [[2, 3], [6, 3]]]], [[[2, 5, 2], [2, 8, 4], [8, 3, 9]], [5, 5, [[2, 2, 8], [5, 8, 3], [2, 4, 9]]]], [[[9]], [1, 1, [[9]]]], [[[8, 6, 5], [0, 7, 5], [2, 0, 8]], [4, 4, [[2, 0, 8], [0, 7, 5], [8, 6, 5]]]], [[[1]], [1, 1, [[1]]]], [[[8]], [1, 1, [[8]]]], [[[6, 6], [9, 4]], [7, 7, [[4, 6], [9, 6]]]], [[[0, 1, 1], [0, 0, 0], [1, 1, 0]], [5, 5, [[0, 0, 1], [1, 0, 1], [1, 0, 0]]]]], [[[[0, 1, 1], [0, 1, 1], [1, 0, 1]], [5, 5, [[0, 0, 1], [1, 1, 0], [1, 1, 1]]]], [[[4, 7, 6], [1, 6, 7], [2, 1, 6]], [6, 8, [[2, 1, 4], [1, 6, 7], [6, 7, 6]]]], [[[0, 0], [1, 1]], [1, 1, [[0, 0], [1, 1]]]], [[[0, 0, 0], [0, 1, 0], [1, 0, 1]], [1, 1, [[0, 0, 0], [0, 1, 0], [1, 0, 1]]]], [[[9, 3], [4, 8]], [8, 6, [[3, 8], [9, 4]]]], [[[9]], [1, 1, [[9]]]], [[[4]], [1, 1, [[4]]]], [[[1, 2], [1, 2]], [5, 5, [[1, 1], [2, 2]]]]], [[[[0, 1], [0, 1]], [5, 5, [[0, 0], [1, 1]]]], [[[2, 5, 7], [3, 3, 0], [9, 1, 5]], [5, 5, [[2, 3, 9], [5, 3, 1], [7, 0, 5]]]], [[[0, 1, 0], [0, 1, 1], [1, 1, 0]], [5, 5, [[0, 0, 1], [1, 1, 1], [0, 1, 0]]]], [[[9, 4], [2, 1]], [3, 3, [[1, 2], [4, 9]]]], [[[9, 6, 1], [5, 6, 6], [8, 1, 0]], [3, 3, [[0, 1, 8], [6, 6, 5], [1, 6, 9]]]], [[[2, 9], [0, 0]], [4, 4, [[0, 0], [2, 9]]]], [[[5, 7], [3, 0]], [3, 3, [[0, 3], [7, 5]]]], [[[1, 8, 6], [2, 9, 4], [8, 6, 4]], [5, 5, [[1, 2, 8], [8, 9, 6], [6, 4, 4]]]]], [[[[2, 7, 3], [4, 1, 3], [8, 4, 9]], [5, 5, [[2, 4, 8], [7, 1, 4], [3, 3, 9]]]], [[[0, 2, 9], [0, 9, 6], [1, 0, 8]], [5, 5, [[0, 0, 1], [2, 9, 0], [9, 6, 8]]]], [[[1, 9, 8], [9, 6, 0], [6, 3, 5]], [5, 5, [[1, 9, 6], [9, 6, 3], [8, 0, 5]]]], [[[1, 1], [1, 0]], [3, 3, [[0, 1], [1, 1]]]], [[[0, 0], [0, 1]], [1, 1, [[0, 0], [0, 1]]]], [[[1]], [1, 1, [[1]]]], [[[8]], [1, 1, [[8]]]], [[[0, 9], [1, 8]], [5, 5, [[0, 1], [9, 8]]]]]]\nlabels = [\"regression: tag 5 source index\", \"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":"3e718e33c0697c7898e2ac99d12df7617f324375d4b48fb7e577b7402e2a0c66","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid):\n    h = len(grid)\n    w = len(grid[0])\n    def src(t, r, c):\n        return {1: (r, c), 2: (r, w - 1 - c), 3: (h - 1 - r, w - 1 - c), 4: (h - 1 - r, c),\n                5: (r, c), 6: (h - 1 - c, r), 7: (h - 1 - c, w - 1 - r), 8: (c, w - 1 - r)}[t]\n    best = None\n    for t in range(1, 9):\n        oh, ow = (w, h) if t >= 5 else (h, w)\n        img = [[grid[src(t, r, c)[0]][src(t, r, c)[1]] for c in range(ow)] for r in range(oh)]\n        key = (oh, ow, [v for row in img for v in row])\n        if best is None or key < best[0]:\n            best = (key, t, img)\n    inverse = {6: 8, 8: 6}.get(best[1], best[1])\n    return [best[1], inverse, best[2]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[0, 8, 6], [8, 4, 4], [2, 9, 7]], [5, 5, [[0, 8, 2], [8, 4, 9], [6, 4, 7]]]], [[[3, 7, 5], [1, 5, 2], [4, 0, 8]], [5, 5, [[3, 1, 4], [7, 5, 0], [5, 2, 8]]]], [[[6, 3, 0], [0, 8, 5], [1, 5, 5]], [2, 2, [[0, 3, 6], [5, 8, 0], [5, 5, 1]]]], [[[7]], [1, 1, [[7]]]], [[[8]], [1, 1, [[8]]]], [[[9, 4, 8], [1, 6, 4], [6, 4, 0]], [3, 3, [[0, 4, 6], [4, 6, 1], [8, 4, 9]]]], [[[0, 1], [5, 1]], [1, 1, [[0, 1], [5, 1]]]], [[[3, 7], [4, 7]], [5, 5, [[3, 4], [7, 7]]]]], [[[[2, 6], [3, 3]], [5, 5, [[2, 3], [6, 3]]]], [[[2, 5, 2], [2, 8, 4], [8, 3, 9]], [5, 5, [[2, 2, 8], [5, 8, 3], [2, 4, 9]]]], [[[9]], [1, 1, [[9]]]], [[[8, 6, 5], [0, 7, 5], [2, 0, 8]], [4, 4, [[2, 0, 8], [0, 7, 5], [8, 6, 5]]]], [[[1]], [1, 1, [[1]]]], [[[8]], [1, 1, [[8]]]], [[[6, 6], [9, 4]], [7, 7, [[4, 6], [9, 6]]]], [[[0, 1, 1], [0, 0, 0], [1, 1, 0]], [5, 5, [[0, 0, 1], [1, 0, 1], [1, 0, 0]]]]], [[[[0, 1, 1], [0, 1, 1], [1, 0, 1]], [5, 5, [[0, 0, 1], [1, 1, 0], [1, 1, 1]]]], [[[4, 7, 6], [1, 6, 7], [2, 1, 6]], [6, 8, [[2, 1, 4], [1, 6, 7], [6, 7, 6]]]], [[[0, 0], [1, 1]], [1, 1, [[0, 0], [1, 1]]]], [[[0, 0, 0], [0, 1, 0], [1, 0, 1]], [1, 1, [[0, 0, 0], [0, 1, 0], [1, 0, 1]]]], [[[9, 3], [4, 8]], [8, 6, [[3, 8], [9, 4]]]], [[[9]], [1, 1, [[9]]]], [[[4]], [1, 1, [[4]]]], [[[1, 2], [1, 2]], [5, 5, [[1, 1], [2, 2]]]]], [[[[0, 1], [0, 1]], [5, 5, [[0, 0], [1, 1]]]], [[[2, 5, 7], [3, 3, 0], [9, 1, 5]], [5, 5, [[2, 3, 9], [5, 3, 1], [7, 0, 5]]]], [[[0, 1, 0], [0, 1, 1], [1, 1, 0]], [5, 5, [[0, 0, 1], [1, 1, 1], [0, 1, 0]]]], [[[9, 4], [2, 1]], [3, 3, [[1, 2], [4, 9]]]], [[[9, 6, 1], [5, 6, 6], [8, 1, 0]], [3, 3, [[0, 1, 8], [6, 6, 5], [1, 6, 9]]]], [[[2, 9], [0, 0]], [4, 4, [[0, 0], [2, 9]]]], [[[5, 7], [3, 0]], [3, 3, [[0, 3], [7, 5]]]], [[[1, 8, 6], [2, 9, 4], [8, 6, 4]], [5, 5, [[1, 2, 8], [8, 9, 6], [6, 4, 4]]]]], [[[[2, 7, 3], [4, 1, 3], [8, 4, 9]], [5, 5, [[2, 4, 8], [7, 1, 4], [3, 3, 9]]]], [[[0, 2, 9], [0, 9, 6], [1, 0, 8]], [5, 5, [[0, 0, 1], [2, 9, 0], [9, 6, 8]]]], [[[1, 9, 8], [9, 6, 0], [6, 3, 5]], [5, 5, [[1, 9, 6], [9, 6, 3], [8, 0, 5]]]], [[[1, 1], [1, 0]], [3, 3, [[0, 1], [1, 1]]]], [[[0, 0], [0, 1]], [1, 1, [[0, 0], [0, 1]]]], [[[1]], [1, 1, [[1]]]], [[[8]], [1, 1, [[8]]]], [[[0, 9], [1, 8]], [5, 5, [[0, 1], [9, 8]]]]]]\nlabels = [\"regression: tag 5 source index\", \"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-dedup-canonical-orientation-transpose-source","generated_at":"2026-09-29T14:49:43.181943+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":"Tag 5 samples (r, c), producing the identity instead of the transpose.","sha256":"a730b40dd53e0e8ea047f6d4b7088e5b36676d79f5afd5baadf18e43ce7b3c73","title":"Canonicalisation never considers the transpose · 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":38.471,"exit_code":1,"observations":[{"actual":[1,1,[[0,8,6],[8,4,4],[2,9,7]]],"check":"regression: tag 5 source index 0","expected":[5,5,[[0,8,2],[8,4,9],[6,4,7]]],"passed":false},{"actual":[1,1,[[3,7,5],[1,5,2],[4,0,8]]],"check":"repair trap 1","expected":[5,5,[[3,1,4],[7,5,0],[5,2,8]]],"passed":false},{"actual":[2,2,[[0,3,6],[5,8,0],[5,5,1]]],"check":"combined fault 2","expected":[2,2,[[0,3,6],[5,8,0],[5,5,1]]],"passed":true},{"actual":[1,1,[[7]]],"check":"control 3","expected":[1,1,[[7]]],"passed":true},{"actual":[1,1,[[8]]],"check":"control 4","expected":[1,1,[[8]]],"passed":true},{"actual":[3,3,[[0,4,6],[4,6,1],[8,4,9]]],"check":"boundary 5","expected":[3,3,[[0,4,6],[4,6,1],[8,4,9]]],"passed":true},{"actual":[1,1,[[0,1],[5,1]]],"check":"boundary 6","expected":[1,1,[[0,1],[5,1]]],"passed":true},{"actual":[1,1,[[3,7],[4,7]]],"check":"control 7","expected":[5,5,[[3,4],[7,7]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: tag 5 source index 0\", \"actual\": [1, 1, [[0, 8, 6], [8, 4, 4], [2, 9, 7]]], \"expected\": [5, 5, [[0, 8, 2], [8, 4, 9], [6, 4, 7]]], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [1, 1, [[3, 7, 5], [1, 5, 2], [4, 0, 8]]], \"expected\": [5, 5, [[3, 1, 4], [7, 5, 0], [5, 2, 8]]], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [2, 2, [[0, 3, 6], [5, 8, 0], [5, 5, 1]]], \"expected\": [2, 2, [[0, 3, 6], [5, 8, 0], [5, 5, 1]]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [1, 1, [[7]]], \"expected\": [1, 1, [[7]]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [1, 1, [[8]]], \"expected\": [1, 1, [[8]]], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [3, 3, [[0, 4, 6], [4, 6, 1], [8, 4, 9]]], \"expected\": [3, 3, [[0, 4, 6], [4, 6, 1], [8, 4, 9]]], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [1, 1, [[0, 1], [5, 1]]], \"expected\": [1, 1, [[0, 1], [5, 1]]], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [1, 1, [[3, 7], [4, 7]]], \"expected\": [5, 5, [[3, 4], [7, 7]]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.431,"exit_code":1,"observations":[{"actual":[1,1,[[0,8,6],[8,4,4],[2,9,7]]],"check":"regression: tag 5 source index 0","expected":[5,5,[[0,8,2],[8,4,9],[6,4,7]]],"passed":false},{"actual":[1,1,[[3,7,5],[1,5,2],[4,0,8]]],"check":"repair trap 1","expected":[5,5,[[3,1,4],[7,5,0],[5,2,8]]],"passed":false},{"actual":[2,2,[[0,3,6],[5,8,0],[5,5,1]]],"check":"combined fault 2","expected":[2,2,[[0,3,6],[5,8,0],[5,5,1]]],"passed":true},{"actual":[1,1,[[7]]],"check":"control 3","expected":[1,1,[[7]]],"passed":true},{"actual":[1,1,[[8]]],"check":"control 4","expected":[1,1,[[8]]],"passed":true},{"actual":[3,3,[[0,4,6],[4,6,1],[8,4,9]]],"check":"boundary 5","expected":[3,3,[[0,4,6],[4,6,1],[8,4,9]]],"passed":true},{"actual":[1,1,[[0,1],[5,1]]],"check":"boundary 6","expected":[1,1,[[0,1],[5,1]]],"passed":true},{"actual":[1,1,[[3,7],[4,7]]],"check":"control 7","expected":[5,5,[[3,4],[7,7]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: tag 5 source index 0\", \"actual\": [1, 1, [[0, 8, 6], [8, 4, 4], [2, 9, 7]]], \"expected\": [5, 5, [[0, 8, 2], [8, 4, 9], [6, 4, 7]]], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [1, 1, [[3, 7, 5], [1, 5, 2], [4, 0, 8]]], \"expected\": [5, 5, [[3, 1, 4], [7, 5, 0], [5, 2, 8]]], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [2, 2, [[0, 3, 6], [5, 8, 0], [5, 5, 1]]], \"expected\": [2, 2, [[0, 3, 6], [5, 8, 0], [5, 5, 1]]], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [1, 1, [[7]]], \"expected\": [1, 1, [[7]]], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [1, 1, [[8]]], \"expected\": [1, 1, [[8]]], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [3, 3, [[0, 4, 6], [4, 6, 1], [8, 4, 9]]], \"expected\": [3, 3, [[0, 4, 6], [4, 6, 1], [8, 4, 9]]], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [1, 1, [[0, 1], [5, 1]]], \"expected\": [1, 1, [[0, 1], [5, 1]]], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [1, 1, [[3, 7], [4, 7]]], \"expected\": [5, 5, [[3, 4], [7, 7]]], \"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."}}