FA-78846 / Image orientation metadata / Open access
Pixel bake treats tag 8 as a plain transpose · case 01
Images tagged 8 come out mirrored after baking even though their dimensions look right.
ROOT CAUSE
The tag-8 branch reads grid[c][r], dropping the horizontal reversal that distinguishes a 90 degree counter-clockwise turn from a transpose.
THE FAILURE
The tag-8 branch reads grid[c][r], dropping the horizontal reversal that distinguishes a 90 degree counter-clockwise turn from a transpose.
Unsuccessful approach: Reversing by the height (h-1-r) matches only square grids; non-square photos sample the wrong column.
Case contract
Bake an EXIF-style orientation tag (1..8) into a row-major pixel grid so the result displays upright. Tags 2/4 mirror horizontally/vertically, 3 rotates 180, 6 rotates 90 clockwise, 8 rotates 90 counter-clockwise, 5 transposes and 7 transverses; tags outside 1..8 are treated as 1. Tags 5..8 swap the output width and height.
Why this case matters
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.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(grid, tag):
h = len(grid)
w = len(grid[0]) if h else 0
if tag not in range(1, 9):
tag = 1
if tag in (5, 6, 7, 8):
out_h, out_w = w, h
else:
out_h, out_w = h, w
out = []
for r in range(out_h):
row = []
for c in range(out_w):
if tag == 1:
v = grid[r][c]
elif tag == 2:
v = grid[r][w - 1 - c]
elif tag == 3:
v = grid[h - 1 - r][w - 1 - c]
elif tag == 4:
v = grid[h - 1 - r][c]
elif tag == 5:
v = grid[c][r]
elif tag == 6:
v = grid[h - 1 - c][r]
elif tag == 7:
v = grid[h - 1 - c][w - 1 - r]
else:
v = grid[c][r]
row.append(v)
out.append(row)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[([[1, 2, 3], [11, 12, 13]], 8), [[3, 13], [2, 12], [1, 11]]], [([[1, 2, 3]], 8), [[3], [2], [1]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 6), [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 6), [[21, 11, 1], [22, 12, 2], [23, 13, 3]]], [([[1, 2, 3, 4]], 5), [[1], [2], [3], [4]]], [([[1, 2, 3, 4]], 2), [[4, 3, 2, 1]]], [([[1, 2], [11, 12], [21, 22], [31, 32]], 2), [[2, 1], [12, 11], [22, 21], [32, 31]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 8), [[4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32], [1, 11, 21, 31]]]], [[([[2, 3, 4, 5], [12, 13, 14, 15], [22, 23, 24, 25], [32, 33, 34, 35]], 8), [[5, 15, 25, 35], [4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 8), [[5, 15], [4, 14], [3, 13], [2, 12]]], [([[2, 3, 4], [12, 13, 14]], 8), [[4, 14], [3, 13], [2, 12]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 9), [[2, 3, 4, 5], [12, 13, 14, 15]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24]], 0), [[2, 3, 4], [12, 13, 14], [22, 23, 24]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24], [32, 33, 34]], 6), [[32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[2]], 1), [[2]]], [([[2, 3, 4, 5]], 8), [[5], [4], [3], [2]]]], [[([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26], [33, 34, 35, 36]], 8), [[6, 16, 26, 36], [5, 15, 25, 35], [4, 14, 24, 34], [3, 13, 23, 33]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 8), [[6, 16], [5, 15], [4, 14], [3, 13]]], [([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26]], 8), [[6, 16, 26], [5, 15, 25], [4, 14, 24], [3, 13, 23]]], [([[3]], 8), [[3]]], [([[3, 4], [13, 14], [23, 24]], 6), [[23, 13, 3], [24, 14, 4]]], [([[3], [13]], 3), [[13], [3]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 0), [[3, 4, 5, 6], [13, 14, 15, 16]]], [([[3, 4]], 8), [[4], [3]]]], [[([[4, 5]], 8), [[5], [4]]], [([[4, 5, 6, 7]], 8), [[7], [6], [5], [4]]], [([[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27]], 9), [[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27]]], [([[4, 5, 6], [14, 15, 16]], 3), [[16, 15, 14], [6, 5, 4]]], [([[4, 5], [14, 15]], 5), [[4, 14], [5, 15]]], [([[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27], [34, 35, 36, 37]], 9), [[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27], [34, 35, 36, 37]]], [([[4]], 5), [[4]]], [([[4, 5, 6], [14, 15, 16]], 8), [[6, 16], [5, 15], [4, 14]]]], [[([[5, 6]], 8), [[6], [5]]], [([[5, 6, 7], [15, 16, 17]], 8), [[7, 17], [6, 16], [5, 15]]], [([[5], [15], [25]], 2), [[5], [15], [25]]], [([[5], [15]], 4), [[15], [5]]], [([[5, 6]], 9), [[5, 6]]], [([[5]], 6), [[5]]], [([[5], [15], [25], [35]], 2), [[5], [15], [25], [35]]], [([[5, 6, 7, 8], [15, 16, 17, 18]], 3), [[18, 17, 16, 15], [8, 7, 6, 5]]]]]
labels = ["regression: tag 8 mirrored source column", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: tag 8 mirrored source column 0 | [[1, 11], [2, 12], [3, 13]] | [[3, 13], [2, 12], [1, 11]] | Failed |
| repair trap 1 | [[1], [2], [3]] | [[3], [2], [1]] | Failed |
| combined fault 2 | [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]] | [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]] | Passed |
| control 3 | [[21, 11, 1], [22, 12, 2], [23, 13, 3]] | [[21, 11, 1], [22, 12, 2], [23, 13, 3]] | Passed |
| control 4 | [[1], [2], [3], [4]] | [[1], [2], [3], [4]] | Passed |
| boundary 5 | [[4, 3, 2, 1]] | [[4, 3, 2, 1]] | Passed |
| boundary 6 | [[2, 1], [12, 11], [22, 21], [32, 31]] | [[2, 1], [12, 11], [22, 21], [32, 31]] | Passed |
| control 7 | [[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]] | [[4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32], [1, 11, 21, 31]] | Failed |
SHA-256 / 6ec3585bf2af203f4c294791bd9f28a755cbc5ecd029175c2963557551c7b10c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(grid, tag):
h = len(grid)
w = len(grid[0]) if h else 0
if tag not in range(1, 9):
tag = 1
if tag in (5, 6, 7, 8):
out_h, out_w = w, h
else:
out_h, out_w = h, w
out = []
for r in range(out_h):
row = []
for c in range(out_w):
if tag == 1:
v = grid[r][c]
elif tag == 2:
v = grid[r][w - 1 - c]
elif tag == 3:
v = grid[h - 1 - r][w - 1 - c]
elif tag == 4:
v = grid[h - 1 - r][c]
elif tag == 5:
v = grid[c][r]
elif tag == 6:
v = grid[h - 1 - c][r]
elif tag == 7:
v = grid[h - 1 - c][w - 1 - r]
else:
v = grid[c][h - 1 - r]
row.append(v)
out.append(row)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[([[1, 2, 3], [11, 12, 13]], 8), [[3, 13], [2, 12], [1, 11]]], [([[1, 2, 3]], 8), [[3], [2], [1]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 6), [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 6), [[21, 11, 1], [22, 12, 2], [23, 13, 3]]], [([[1, 2, 3, 4]], 5), [[1], [2], [3], [4]]], [([[1, 2, 3, 4]], 2), [[4, 3, 2, 1]]], [([[1, 2], [11, 12], [21, 22], [31, 32]], 2), [[2, 1], [12, 11], [22, 21], [32, 31]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 8), [[4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32], [1, 11, 21, 31]]]], [[([[2, 3, 4, 5], [12, 13, 14, 15], [22, 23, 24, 25], [32, 33, 34, 35]], 8), [[5, 15, 25, 35], [4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 8), [[5, 15], [4, 14], [3, 13], [2, 12]]], [([[2, 3, 4], [12, 13, 14]], 8), [[4, 14], [3, 13], [2, 12]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 9), [[2, 3, 4, 5], [12, 13, 14, 15]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24]], 0), [[2, 3, 4], [12, 13, 14], [22, 23, 24]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24], [32, 33, 34]], 6), [[32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[2]], 1), [[2]]], [([[2, 3, 4, 5]], 8), [[5], [4], [3], [2]]]], [[([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26], [33, 34, 35, 36]], 8), [[6, 16, 26, 36], [5, 15, 25, 35], [4, 14, 24, 34], [3, 13, 23, 33]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 8), [[6, 16], [5, 15], [4, 14], [3, 13]]], [([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26]], 8), [[6, 16, 26], [5, 15, 25], [4, 14, 24], [3, 13, 23]]], [([[3]], 8), [[3]]], [([[3, 4], [13, 14], [23, 24]], 6), [[23, 13, 3], [24, 14, 4]]], [([[3], [13]], 3), [[13], [3]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 0), [[3, 4, 5, 6], [13, 14, 15, 16]]], [([[3, 4]], 8), [[4], [3]]]], [[([[4, 5]], 8), [[5], [4]]], [([[4, 5, 6, 7]], 8), [[7], [6], [5], [4]]], [([[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27]], 9), [[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27]]], [([[4, 5, 6], [14, 15, 16]], 3), [[16, 15, 14], [6, 5, 4]]], [([[4, 5], [14, 15]], 5), [[4, 14], [5, 15]]], [([[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27], [34, 35, 36, 37]], 9), [[4, 5, 6, 7], [14, 15, 16, 17], [24, 25, 26, 27], [34, 35, 36, 37]]], [([[4]], 5), [[4]]], [([[4, 5, 6], [14, 15, 16]], 8), [[6, 16], [5, 15], [4, 14]]]], [[([[5, 6]], 8), [[6], [5]]], [([[5, 6, 7], [15, 16, 17]], 8), [[7, 17], [6, 16], [5, 15]]], [([[5], [15], [25]], 2), [[5], [15], [25]]], [([[5], [15]], 4), [[15], [5]]], [([[5, 6]], 9), [[5, 6]]], [([[5]], 6), [[5]]], [([[5], [15], [25], [35]], 2), [[5], [15], [25], [35]]], [([[5, 6, 7, 8], [15, 16, 17, 18]], 3), [[18, 17, 16, 15], [8, 7, 6, 5]]]]]
labels = ["regression: tag 8 mirrored source column", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: tag 8 mirrored source column 0 | [[2, 12], [1, 11], [3, 13]] | [[3, 13], [2, 12], [1, 11]] | Failed |
| repair trap 1 | [[1], [3], [2]] | [[3], [2], [1]] | Failed |
| combined fault 2 | [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]] | [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]] | Passed |
| control 3 | [[21, 11, 1], [22, 12, 2], [23, 13, 3]] | [[21, 11, 1], [22, 12, 2], [23, 13, 3]] | Passed |
| control 4 | [[1], [2], [3], [4]] | [[1], [2], [3], [4]] | Passed |
| boundary 5 | [[4, 3, 2, 1]] | [[4, 3, 2, 1]] | Passed |
| boundary 6 | [[2, 1], [12, 11], [22, 21], [32, 31]] | [[2, 1], [12, 11], [22, 21], [32, 31]] | Passed |
| control 7 | [[4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32], [1, 11, 21, 31]] | [[4, 14, 24, 34], [3, 13, 23, 33], [2, 12, 22, 32], [1, 11, 21, 31]] | Passed |
SHA-256 / 86d503c42a717256a38eb6a70b24f9f8b1bc84e5377449a3a7251f156da07ae6
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:49:39.207075+00:00.
Case digest / 9e43e8e266a9902b601c9a605911950568821ea369a59ec8137643443675b9f3