{"abstract":"A typo in a batch edit script produces a plausible but wrong orientation with no error.","category":"Image orientation metadata","checks":8,"contract":"A photo editor rotates and flips losslessly by rewriting only the orientation tag. An orientation is modelled as (k, m): mirror horizontally m times, then rotate k quarter turns clockwise (tag table 1:(0,0) 2:(0,1) 3:(2,0) 4:(2,1) 5:(3,1) 6:(1,0) 7:(1,1) 8:(3,0)). Editor operations act on the displayed image: cw, ccw, r180, flip_h (mirror left-right) and flip_v (mirror top-bottom). Invalid starting tags count as 1; an unknown operation returns {\"error\": \"unknown-op\", \"op\": op}. Return the final tag.","evaluation_group":"w2-image-orientation-metadata-editor-metadata-rotate","failed_approach":"Returning the partial result hides the error and skips the remaining operations.","family":"w2-image-orientation-metadata-editor-metadata-rotate-unknown-op","id":"FA-78966","implementations":{"attempt":{"sha256":"6a3ef203cfa04689ba91060725e160703d69e3330c3c593711fc3e5714be1219","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tag, ops):\n    to_km = {1: (0, 0), 2: (0, 1), 3: (2, 0), 4: (2, 1), 5: (3, 1), 6: (1, 0), 7: (1, 1), 8: (3, 0)}\n    from_km = {v: t for t, v in to_km.items()}\n    if tag not in to_km:\n        tag = 1\n    k, m = to_km[tag]\n    for op in ops:\n        if op == 'cw':\n            k = (k + 1) % 4\n        elif op == 'ccw':\n            k = (k + 3) % 4\n        elif op == 'r180':\n            k = (k + 2) % 4\n        elif op == 'flip_h':\n            k, m = (-k) % 4, 1 - m\n        elif op == 'flip_v':\n            k, m = (2 - k) % 4, 1 - m\n        else:\n            return from_km[(k, m)]\n    return from_km[(k, m)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[(3, ['rotate']), {'error': 'unknown-op', 'op': 'rotate'}], [(1, ['rotate']), {'error': 'unknown-op', 'op': 'rotate'}], [(8, ['ccw', 'flip_h', 'ccw']), 7], [(7, ['flip_v', 'ccw', 'r180']), 3], [(8, ['ccw', 'cw']), 8], [(1, ['cw', 'ccw', 'r180', 'cw']), 8], [(6, []), 6], [(0, ['cw', 'flip_v', 'rotate']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(4, ['mirror', 'flip_v', 'cw', 'r180']), {'error': 'unknown-op', 'op': 'mirror'}], [(9, ['mirror', 'flip_h']), {'error': 'unknown-op', 'op': 'mirror'}], [(0, []), 1], [(8, ['ccw', 'r180']), 1], [(2, ['flip_v', 'ccw', 'cw']), 3], [(7, ['cw', 'r180', 'flip_h']), 1], [(9, ['cw', 'flip_v', 'flip_v']), 6], [(5, ['ccw', 'mirror']), {'error': 'unknown-op', 'op': 'mirror'}]], [[(4, ['flip_h', 'r180', 'CW']), {'error': 'unknown-op', 'op': 'CW'}], [(0, ['mirror']), {'error': 'unknown-op', 'op': 'mirror'}], [(0, ['cw', 'r180']), 8], [(1, ['ccw', 'ccw', 'r180']), 1], [(11, ['r180', 'cw', 'flip_v', 'cw']), 2], [(9, ['cw', 'r180', 'flip_h']), 7], [(11, ['cw', 'flip_v', 'flip_h']), 8], [(9, ['cw', 'ccw', 'r180', 'flip_h', 'rotate']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(2, ['cw', 'ccw', 'mirror']), {'error': 'unknown-op', 'op': 'mirror'}], [(2, ['flip_v', 'r180', 'rotate', 'flip_v', 'r180']), {'error': 'unknown-op', 'op': 'rotate'}], [(0, ['r180', 'ccw', 'cw', 'cw']), 8], [(0, ['flip_v']), 4], [(2, ['ccw', 'r180', 'flip_h', 'flip_v']), 5], [(4, ['ccw']), 7], [(9, ['ccw', 'flip_h', 'flip_v']), 6], [(7, ['cw', 'ccw', 'rotate', 'cw']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(7, ['rotate', 'ccw']), {'error': 'unknown-op', 'op': 'rotate'}], [(11, ['flip_v', 'ccw', 'rotate', 'flip_h', 'ccw']), {'error': 'unknown-op', 'op': 'rotate'}], [(11, ['cw', 'cw', 'ccw']), 6], [(5, ['r180']), 7], [(6, ['ccw']), 1], [(0, ['ccw', 'cw']), 1], [(9, ['flip_v']), 4], [(1, ['r180', 'CW']), {'error': 'unknown-op', 'op': 'CW'}]]]\nlabels = [\"regression: unknown operation\", \"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":"194947cd6c3ad1bc39b4778a27de2b1844af27a2f89c8a8260e0d5a4cbd1f8c2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tag, ops):\n    to_km = {1: (0, 0), 2: (0, 1), 3: (2, 0), 4: (2, 1), 5: (3, 1), 6: (1, 0), 7: (1, 1), 8: (3, 0)}\n    from_km = {v: t for t, v in to_km.items()}\n    if tag not in to_km:\n        tag = 1\n    k, m = to_km[tag]\n    for op in ops:\n        if op == 'cw':\n            k = (k + 1) % 4\n        elif op == 'ccw':\n            k = (k + 3) % 4\n        elif op == 'r180':\n            k = (k + 2) % 4\n        elif op == 'flip_h':\n            k, m = (-k) % 4, 1 - m\n        elif op == 'flip_v':\n            k, m = (2 - k) % 4, 1 - m\n        else:\n            continue\n    return from_km[(k, m)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[(3, ['rotate']), {'error': 'unknown-op', 'op': 'rotate'}], [(1, ['rotate']), {'error': 'unknown-op', 'op': 'rotate'}], [(8, ['ccw', 'flip_h', 'ccw']), 7], [(7, ['flip_v', 'ccw', 'r180']), 3], [(8, ['ccw', 'cw']), 8], [(1, ['cw', 'ccw', 'r180', 'cw']), 8], [(6, []), 6], [(0, ['cw', 'flip_v', 'rotate']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(4, ['mirror', 'flip_v', 'cw', 'r180']), {'error': 'unknown-op', 'op': 'mirror'}], [(9, ['mirror', 'flip_h']), {'error': 'unknown-op', 'op': 'mirror'}], [(0, []), 1], [(8, ['ccw', 'r180']), 1], [(2, ['flip_v', 'ccw', 'cw']), 3], [(7, ['cw', 'r180', 'flip_h']), 1], [(9, ['cw', 'flip_v', 'flip_v']), 6], [(5, ['ccw', 'mirror']), {'error': 'unknown-op', 'op': 'mirror'}]], [[(4, ['flip_h', 'r180', 'CW']), {'error': 'unknown-op', 'op': 'CW'}], [(0, ['mirror']), {'error': 'unknown-op', 'op': 'mirror'}], [(0, ['cw', 'r180']), 8], [(1, ['ccw', 'ccw', 'r180']), 1], [(11, ['r180', 'cw', 'flip_v', 'cw']), 2], [(9, ['cw', 'r180', 'flip_h']), 7], [(11, ['cw', 'flip_v', 'flip_h']), 8], [(9, ['cw', 'ccw', 'r180', 'flip_h', 'rotate']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(2, ['cw', 'ccw', 'mirror']), {'error': 'unknown-op', 'op': 'mirror'}], [(2, ['flip_v', 'r180', 'rotate', 'flip_v', 'r180']), {'error': 'unknown-op', 'op': 'rotate'}], [(0, ['r180', 'ccw', 'cw', 'cw']), 8], [(0, ['flip_v']), 4], [(2, ['ccw', 'r180', 'flip_h', 'flip_v']), 5], [(4, ['ccw']), 7], [(9, ['ccw', 'flip_h', 'flip_v']), 6], [(7, ['cw', 'ccw', 'rotate', 'cw']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(7, ['rotate', 'ccw']), {'error': 'unknown-op', 'op': 'rotate'}], [(11, ['flip_v', 'ccw', 'rotate', 'flip_h', 'ccw']), {'error': 'unknown-op', 'op': 'rotate'}], [(11, ['cw', 'cw', 'ccw']), 6], [(5, ['r180']), 7], [(6, ['ccw']), 1], [(0, ['ccw', 'cw']), 1], [(9, ['flip_v']), 4], [(1, ['r180', 'CW']), {'error': 'unknown-op', 'op': 'CW'}]]]\nlabels = [\"regression: unknown operation\", \"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":"339c66aedf9a49360a03fd944461b0fd5e9f6b0e0842a84f4619068201204c4e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tag, ops):\n    to_km = {1: (0, 0), 2: (0, 1), 3: (2, 0), 4: (2, 1), 5: (3, 1), 6: (1, 0), 7: (1, 1), 8: (3, 0)}\n    from_km = {v: t for t, v in to_km.items()}\n    if tag not in to_km:\n        tag = 1\n    k, m = to_km[tag]\n    for op in ops:\n        if op == 'cw':\n            k = (k + 1) % 4\n        elif op == 'ccw':\n            k = (k + 3) % 4\n        elif op == 'r180':\n            k = (k + 2) % 4\n        elif op == 'flip_h':\n            k, m = (-k) % 4, 1 - m\n        elif op == 'flip_v':\n            k, m = (2 - k) % 4, 1 - m\n        else:\n            return {'error': 'unknown-op', 'op': op}\n    return from_km[(k, m)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[(3, ['rotate']), {'error': 'unknown-op', 'op': 'rotate'}], [(1, ['rotate']), {'error': 'unknown-op', 'op': 'rotate'}], [(8, ['ccw', 'flip_h', 'ccw']), 7], [(7, ['flip_v', 'ccw', 'r180']), 3], [(8, ['ccw', 'cw']), 8], [(1, ['cw', 'ccw', 'r180', 'cw']), 8], [(6, []), 6], [(0, ['cw', 'flip_v', 'rotate']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(4, ['mirror', 'flip_v', 'cw', 'r180']), {'error': 'unknown-op', 'op': 'mirror'}], [(9, ['mirror', 'flip_h']), {'error': 'unknown-op', 'op': 'mirror'}], [(0, []), 1], [(8, ['ccw', 'r180']), 1], [(2, ['flip_v', 'ccw', 'cw']), 3], [(7, ['cw', 'r180', 'flip_h']), 1], [(9, ['cw', 'flip_v', 'flip_v']), 6], [(5, ['ccw', 'mirror']), {'error': 'unknown-op', 'op': 'mirror'}]], [[(4, ['flip_h', 'r180', 'CW']), {'error': 'unknown-op', 'op': 'CW'}], [(0, ['mirror']), {'error': 'unknown-op', 'op': 'mirror'}], [(0, ['cw', 'r180']), 8], [(1, ['ccw', 'ccw', 'r180']), 1], [(11, ['r180', 'cw', 'flip_v', 'cw']), 2], [(9, ['cw', 'r180', 'flip_h']), 7], [(11, ['cw', 'flip_v', 'flip_h']), 8], [(9, ['cw', 'ccw', 'r180', 'flip_h', 'rotate']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(2, ['cw', 'ccw', 'mirror']), {'error': 'unknown-op', 'op': 'mirror'}], [(2, ['flip_v', 'r180', 'rotate', 'flip_v', 'r180']), {'error': 'unknown-op', 'op': 'rotate'}], [(0, ['r180', 'ccw', 'cw', 'cw']), 8], [(0, ['flip_v']), 4], [(2, ['ccw', 'r180', 'flip_h', 'flip_v']), 5], [(4, ['ccw']), 7], [(9, ['ccw', 'flip_h', 'flip_v']), 6], [(7, ['cw', 'ccw', 'rotate', 'cw']), {'error': 'unknown-op', 'op': 'rotate'}]], [[(7, ['rotate', 'ccw']), {'error': 'unknown-op', 'op': 'rotate'}], [(11, ['flip_v', 'ccw', 'rotate', 'flip_h', 'ccw']), {'error': 'unknown-op', 'op': 'rotate'}], [(11, ['cw', 'cw', 'ccw']), 6], [(5, ['r180']), 7], [(6, ['ccw']), 1], [(0, ['ccw', 'cw']), 1], [(9, ['flip_v']), 4], [(1, ['r180', 'CW']), {'error': 'unknown-op', 'op': 'CW'}]]]\nlabels = [\"regression: unknown operation\", \"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-editor-metadata-rotate-unknown-op","generated_at":"2026-09-29T14:49:40.220233+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":"Return the unknown-op error naming the operation.","root_cause":"The fallback branch continues the loop instead of reporting the unknown operation.","sha256":"99812c7b4bcc081cbcd82260c15c3bcd94349108606a7eab6a4bf06f5abccfa1","title":"Unknown editor operations are silently skipped · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.741,"exit_code":1,"observations":[{"actual":3,"check":"regression: unknown operation 0","expected":{"error":"unknown-op","op":"rotate"},"passed":false},{"actual":1,"check":"repair trap 1","expected":{"error":"unknown-op","op":"rotate"},"passed":false},{"actual":7,"check":"combined fault 2","expected":7,"passed":true},{"actual":3,"check":"control 3","expected":3,"passed":true},{"actual":8,"check":"control 4","expected":8,"passed":true},{"actual":8,"check":"boundary 5","expected":8,"passed":true},{"actual":6,"check":"boundary 6","expected":6,"passed":true},{"actual":7,"check":"control 7","expected":{"error":"unknown-op","op":"rotate"},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: unknown operation 0\", \"actual\": 3, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": 1, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"control 3\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"control 4\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"control 7\", \"actual\": 7, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.26,"exit_code":1,"observations":[{"actual":3,"check":"regression: unknown operation 0","expected":{"error":"unknown-op","op":"rotate"},"passed":false},{"actual":1,"check":"repair trap 1","expected":{"error":"unknown-op","op":"rotate"},"passed":false},{"actual":7,"check":"combined fault 2","expected":7,"passed":true},{"actual":3,"check":"control 3","expected":3,"passed":true},{"actual":8,"check":"control 4","expected":8,"passed":true},{"actual":8,"check":"boundary 5","expected":8,"passed":true},{"actual":6,"check":"boundary 6","expected":6,"passed":true},{"actual":7,"check":"control 7","expected":{"error":"unknown-op","op":"rotate"},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: unknown operation 0\", \"actual\": 3, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": 1, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"control 3\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"control 4\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"control 7\", \"actual\": 7, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.005,"exit_code":0,"observations":[{"actual":{"error":"unknown-op","op":"rotate"},"check":"regression: unknown operation 0","expected":{"error":"unknown-op","op":"rotate"},"passed":true},{"actual":{"error":"unknown-op","op":"rotate"},"check":"repair trap 1","expected":{"error":"unknown-op","op":"rotate"},"passed":true},{"actual":7,"check":"combined fault 2","expected":7,"passed":true},{"actual":3,"check":"control 3","expected":3,"passed":true},{"actual":8,"check":"control 4","expected":8,"passed":true},{"actual":8,"check":"boundary 5","expected":8,"passed":true},{"actual":6,"check":"boundary 6","expected":6,"passed":true},{"actual":{"error":"unknown-op","op":"rotate"},"check":"control 7","expected":{"error":"unknown-op","op":"rotate"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: unknown operation 0\", \"actual\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"control 3\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"control 4\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"control 7\", \"actual\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"expected\": {\"error\": \"unknown-op\", \"op\": \"rotate\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}