FAILURE MAP
← Case archive

FA-78866 / Image orientation metadata / Open access

Pixel bake keeps stored dimensions for transpose tags · case 01

Tag 5 and 7 images are cropped or indexed out of shape because output width and height are not exchanged.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Only the pure rotations 6 and 8 swap the output dimensions; transpose and transverse also swap axes.

VERIFIED REPAIR

Swap output width and height for every tag from 5 through 8.

Unsuccessful approach: Testing for even tags also swaps the mirror tags 2 and 4 and still misses 5 and 7.

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 (6, 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][w - 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], [21, 22, 23], [31, 32, 33]], 7), [[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 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]], 6), [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[1], [11], [21], [31]], 8), [[1, 11, 21, 31]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 6), [[21, 11, 1], [22, 12, 2], [23, 13, 3]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 5), [[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 5), [[1, 11, 21], [2, 12, 22], [3, 13, 23]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24]], 7), [[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]]]], [[([[2, 3], [12, 13], [22, 23], [32, 33]], 7), [[33, 23, 13, 3], [32, 22, 12, 2]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24], [32, 33, 34]], 2), [[4, 3, 2], [14, 13, 12], [24, 23, 22], [34, 33, 32]]], [([[2, 3]], 7), [[3], [2]]], [([[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], [12, 13, 14, 15]], 6), [[12, 2], [13, 3], [14, 4], [15, 5]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 7), [[15, 5], [14, 4], [13, 3], [12, 2]]]], [[([[3, 4], [13, 14], [23, 24]], 7), [[24, 14, 4], [23, 13, 3]]], [([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26]], 7), [[26, 16, 6], [25, 15, 5], [24, 14, 4], [23, 13, 3]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 7), [[16, 6], [15, 5], [14, 4], [13, 3]]], [([[3, 4, 5, 6]], 8), [[6], [5], [4], [3]]], [([[3, 4], [13, 14], [23, 24], [33, 34]], 8), [[4, 14, 24, 34], [3, 13, 23, 33]]], [([[3]], 8), [[3]]], [([[3, 4], [13, 14], [23, 24]], 6), [[23, 13, 3], [24, 14, 4]]], [([[3, 4]], 7), [[4], [3]]]], [[([[4, 5, 6], [14, 15, 16], [24, 25, 26], [34, 35, 36]], 7), [[36, 26, 16, 6], [35, 25, 15, 5], [34, 24, 14, 4]]], [([[4, 5], [14, 15], [24, 25], [34, 35]], 7), [[35, 25, 15, 5], [34, 24, 14, 4]]], [([[4, 5, 6], [14, 15, 16]], 7), [[16, 6], [15, 5], [14, 4]]], [([[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, 7], [14, 15, 16, 17]], 7), [[17, 7], [16, 6], [15, 5], [14, 4]]]], [[([[5, 6, 7, 8], [15, 16, 17, 18], [25, 26, 27, 28]], 7), [[28, 18, 8], [27, 17, 7], [26, 16, 6], [25, 15, 5]]], [([[5], [15]], 2), [[5], [15]]], [([[5, 6, 7], [15, 16, 17], [25, 26, 27], [35, 36, 37]], 7), [[37, 27, 17, 7], [36, 26, 16, 6], [35, 25, 15, 5]]], [([[5]], 6), [[5]]], [([[5, 6, 7, 8], [15, 16, 17, 18], [25, 26, 27, 28]], 3), [[28, 27, 26, 25], [18, 17, 16, 15], [8, 7, 6, 5]]], [([[5, 6], [15, 16]], 7), [[16, 6], [15, 5]]], [([[5, 6, 7], [15, 16, 17]], 6), [[15, 5], [16, 6], [17, 7]]], [([[5, 6]], 7), [[6], [5]]]]]
labels = ["regression: dimension swap tag set", "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 fixtureActualExpectedOutcome
regression: dimension swap tag set 0[[33, 23, 13], [32, 22, 12], [31, 21, 11], [33, 23, 13]][[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 1]]Failed
repair trap 1[[2, 1], [12, 11], [22, 21], [32, 31]][[2, 1], [12, 11], [22, 21], [32, 31]]Passed
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[[1, 11, 21, 31]][[1, 11, 21, 31]]Passed
control 4[[21, 11, 1], [22, 12, 2], [23, 13, 3]][[21, 11, 1], [22, 12, 2], [23, 13, 3]]Passed
boundary 5[[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]][[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]]Passed
boundary 6[[1, 11, 21], [2, 12, 22], [3, 13, 23]][[1, 11, 21], [2, 12, 22], [3, 13, 23]]Passed
control 7[[24, 14, 4, 24], [23, 13, 3, 23], [22, 12, 2, 22]][[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]]Failed

SHA-256 / ef6d88b72ae4356ff482ace93d5d72f1c8f37a7277be6aa5b76d4c3a1db378e7

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 % 2 == 0:
        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][w - 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], [21, 22, 23], [31, 32, 33]], 7), [[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 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]], 6), [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[1], [11], [21], [31]], 8), [[1, 11, 21, 31]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 6), [[21, 11, 1], [22, 12, 2], [23, 13, 3]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 5), [[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 5), [[1, 11, 21], [2, 12, 22], [3, 13, 23]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24]], 7), [[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]]]], [[([[2, 3], [12, 13], [22, 23], [32, 33]], 7), [[33, 23, 13, 3], [32, 22, 12, 2]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24], [32, 33, 34]], 2), [[4, 3, 2], [14, 13, 12], [24, 23, 22], [34, 33, 32]]], [([[2, 3]], 7), [[3], [2]]], [([[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], [12, 13, 14, 15]], 6), [[12, 2], [13, 3], [14, 4], [15, 5]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 7), [[15, 5], [14, 4], [13, 3], [12, 2]]]], [[([[3, 4], [13, 14], [23, 24]], 7), [[24, 14, 4], [23, 13, 3]]], [([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26]], 7), [[26, 16, 6], [25, 15, 5], [24, 14, 4], [23, 13, 3]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 7), [[16, 6], [15, 5], [14, 4], [13, 3]]], [([[3, 4, 5, 6]], 8), [[6], [5], [4], [3]]], [([[3, 4], [13, 14], [23, 24], [33, 34]], 8), [[4, 14, 24, 34], [3, 13, 23, 33]]], [([[3]], 8), [[3]]], [([[3, 4], [13, 14], [23, 24]], 6), [[23, 13, 3], [24, 14, 4]]], [([[3, 4]], 7), [[4], [3]]]], [[([[4, 5, 6], [14, 15, 16], [24, 25, 26], [34, 35, 36]], 7), [[36, 26, 16, 6], [35, 25, 15, 5], [34, 24, 14, 4]]], [([[4, 5], [14, 15], [24, 25], [34, 35]], 7), [[35, 25, 15, 5], [34, 24, 14, 4]]], [([[4, 5, 6], [14, 15, 16]], 7), [[16, 6], [15, 5], [14, 4]]], [([[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, 7], [14, 15, 16, 17]], 7), [[17, 7], [16, 6], [15, 5], [14, 4]]]], [[([[5, 6, 7, 8], [15, 16, 17, 18], [25, 26, 27, 28]], 7), [[28, 18, 8], [27, 17, 7], [26, 16, 6], [25, 15, 5]]], [([[5], [15]], 2), [[5], [15]]], [([[5, 6, 7], [15, 16, 17], [25, 26, 27], [35, 36, 37]], 7), [[37, 27, 17, 7], [36, 26, 16, 6], [35, 25, 15, 5]]], [([[5]], 6), [[5]]], [([[5, 6, 7, 8], [15, 16, 17, 18], [25, 26, 27, 28]], 3), [[28, 27, 26, 25], [18, 17, 16, 15], [8, 7, 6, 5]]], [([[5, 6], [15, 16]], 7), [[16, 6], [15, 5]]], [([[5, 6, 7], [15, 16, 17]], 6), [[15, 5], [16, 6], [17, 7]]], [([[5, 6]], 7), [[6], [5]]]]]
labels = ["regression: dimension swap tag set", "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 fixtureActualExpectedOutcome
regression: dimension swap tag set 0[[33, 23, 13], [32, 22, 12], [31, 21, 11], [33, 23, 13]][[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 1]]Failed
repair trap 1[[2, 1, 2, 1], [12, 11, 12, 11]][[2, 1], [12, 11], [22, 21], [32, 31]]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[[1, 11, 21, 31]][[1, 11, 21, 31]]Passed
control 4[[21, 11, 1], [22, 12, 2], [23, 13, 3]][[21, 11, 1], [22, 12, 2], [23, 13, 3]]Passed
boundary 5[[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]][[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]]Passed
boundary 6[[1, 11, 21], [2, 12, 22], [3, 13, 23]][[1, 11, 21], [2, 12, 22], [3, 13, 23]]Passed
control 7[[24, 14, 4, 24], [23, 13, 3, 23], [22, 12, 2, 22]][[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]]Failed

SHA-256 / 1f7b879dc8e4b4d41fca6c056fa2649a5e7699fb9a09008869ac38f844e6ff62

3 / The verified repair

Exit 0
"""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][w - 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], [21, 22, 23], [31, 32, 33]], 7), [[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 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]], 6), [[31, 21, 11, 1], [32, 22, 12, 2], [33, 23, 13, 3], [34, 24, 14, 4]]], [([[1], [11], [21], [31]], 8), [[1, 11, 21, 31]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 6), [[21, 11, 1], [22, 12, 2], [23, 13, 3]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34]], 5), [[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]]], [([[1, 2, 3], [11, 12, 13], [21, 22, 23]], 5), [[1, 11, 21], [2, 12, 22], [3, 13, 23]]], [([[1, 2, 3, 4], [11, 12, 13, 14], [21, 22, 23, 24]], 7), [[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]]]], [[([[2, 3], [12, 13], [22, 23], [32, 33]], 7), [[33, 23, 13, 3], [32, 22, 12, 2]]], [([[2, 3, 4], [12, 13, 14], [22, 23, 24], [32, 33, 34]], 2), [[4, 3, 2], [14, 13, 12], [24, 23, 22], [34, 33, 32]]], [([[2, 3]], 7), [[3], [2]]], [([[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], [12, 13, 14, 15]], 6), [[12, 2], [13, 3], [14, 4], [15, 5]]], [([[2, 3, 4, 5], [12, 13, 14, 15]], 7), [[15, 5], [14, 4], [13, 3], [12, 2]]]], [[([[3, 4], [13, 14], [23, 24]], 7), [[24, 14, 4], [23, 13, 3]]], [([[3, 4, 5, 6], [13, 14, 15, 16], [23, 24, 25, 26]], 7), [[26, 16, 6], [25, 15, 5], [24, 14, 4], [23, 13, 3]]], [([[3, 4, 5, 6], [13, 14, 15, 16]], 7), [[16, 6], [15, 5], [14, 4], [13, 3]]], [([[3, 4, 5, 6]], 8), [[6], [5], [4], [3]]], [([[3, 4], [13, 14], [23, 24], [33, 34]], 8), [[4, 14, 24, 34], [3, 13, 23, 33]]], [([[3]], 8), [[3]]], [([[3, 4], [13, 14], [23, 24]], 6), [[23, 13, 3], [24, 14, 4]]], [([[3, 4]], 7), [[4], [3]]]], [[([[4, 5, 6], [14, 15, 16], [24, 25, 26], [34, 35, 36]], 7), [[36, 26, 16, 6], [35, 25, 15, 5], [34, 24, 14, 4]]], [([[4, 5], [14, 15], [24, 25], [34, 35]], 7), [[35, 25, 15, 5], [34, 24, 14, 4]]], [([[4, 5, 6], [14, 15, 16]], 7), [[16, 6], [15, 5], [14, 4]]], [([[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, 7], [14, 15, 16, 17]], 7), [[17, 7], [16, 6], [15, 5], [14, 4]]]], [[([[5, 6, 7, 8], [15, 16, 17, 18], [25, 26, 27, 28]], 7), [[28, 18, 8], [27, 17, 7], [26, 16, 6], [25, 15, 5]]], [([[5], [15]], 2), [[5], [15]]], [([[5, 6, 7], [15, 16, 17], [25, 26, 27], [35, 36, 37]], 7), [[37, 27, 17, 7], [36, 26, 16, 6], [35, 25, 15, 5]]], [([[5]], 6), [[5]]], [([[5, 6, 7, 8], [15, 16, 17, 18], [25, 26, 27, 28]], 3), [[28, 27, 26, 25], [18, 17, 16, 15], [8, 7, 6, 5]]], [([[5, 6], [15, 16]], 7), [[16, 6], [15, 5]]], [([[5, 6, 7], [15, 16, 17]], 6), [[15, 5], [16, 6], [17, 7]]], [([[5, 6]], 7), [[6], [5]]]]]
labels = ["regression: dimension swap tag set", "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 fixtureActualExpectedOutcome
regression: dimension swap tag set 0[[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 1]][[33, 23, 13, 3], [32, 22, 12, 2], [31, 21, 11, 1]]Passed
repair trap 1[[2, 1], [12, 11], [22, 21], [32, 31]][[2, 1], [12, 11], [22, 21], [32, 31]]Passed
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[[1, 11, 21, 31]][[1, 11, 21, 31]]Passed
control 4[[21, 11, 1], [22, 12, 2], [23, 13, 3]][[21, 11, 1], [22, 12, 2], [23, 13, 3]]Passed
boundary 5[[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]][[1, 11, 21, 31], [2, 12, 22, 32], [3, 13, 23, 33], [4, 14, 24, 34]]Passed
boundary 6[[1, 11, 21], [2, 12, 22], [3, 13, 23]][[1, 11, 21], [2, 12, 22], [3, 13, 23]]Passed
control 7[[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]][[24, 14, 4], [23, 13, 3], [22, 12, 2], [21, 11, 1]]Passed

SHA-256 / 9290bc23eb8e4c2da5f074ec1f221d7c182900d2204437e9807f403a9a44e754

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.251401+00:00.

Case digest / b40486da27885f16424a6ef903c9e4635e62796a582d9e58fc1067fbb42f8263