FAILURE MAP
← Case archive

FA-72056 / Error-correcting codes / Open access

Product code corrects the first of several failing intersections · case 01

Two-bit errors are "corrected" into a third wrong bit.

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

ROOT CAUSE

Any nonempty sets of failing rows and columns trigger a flip at the first intersection.

VERIFIED REPAIR

Correct only when exactly one row and exactly one column fail.

Unsuccessful approach: Accepting equal numbers of failing rows and columns still guesses among multiple candidates.

Case contract

Two-dimensional parity product code. m is a (rows+1) x (cols+1) bit matrix: the last column holds row parities, the last row column parities, and the corner the overall parity, so every full row and column is even. A single failing row and single failing column locate one error (in data or parity) which is flipped. Return [status, data block without parity row/column] with status clean/corrected, or ["uncorrectable", None].

Why this case matters

Simple line-card and tape formats use row/column parity to correct single-bit errors.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(m):
    Rw = [i for i, row in enumerate(m) if sum(row) % 2]
    Cl = [j for j in range(len(m[0])) if sum(row[j] for row in m) % 2]
    if not Rw and not Cl:
        return ['clean', [row[:-1] for row in m[:-1]]]
    if Rw and Cl:
        fx = [list(row) for row in m]
        fx[Rw[0]][Cl[0]] ^= 1
        return ['corrected', [row[:-1] for row in fx[:-1]]]
    return ['uncorrectable', None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]', [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]], ['uncorrectable', None]], ['control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]], ['clean', [[0, 0], [0, 1]]]], ['control [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]], ['clean', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]]], [['regression [[[0, 0, 0, 0, 1], [0, 0, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[0, 0, 0, 0, 1], [0, 0, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['uncorrectable', None]], ['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['uncorrectable', None]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 0], [0, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 0], [0, 1, 0, 1]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [1, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [1, 1, 0, 1]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['clean', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]]], [['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 0, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 0, 1]]], ['uncorrectable', None]], ['regression [[[1, 0, 0, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[1, 0, 0, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['uncorrectable', None]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 0, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 0, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['clean', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[1, 0, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]]], [['regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]', [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]], ['uncorrectable', None]], ['regression [[[1, 1, 0, 1], [0, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[1, 1, 0, 1], [0, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['uncorrectable', None]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['clean', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [1, 1, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [1, 1, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['clean', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]]], [['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['uncorrectable', None]], ['regression [[[0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['uncorrectable', None]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['clean', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 0, 1]]], ['clean', [[0, 1], [1, 0], [0, 1]]]], ['control [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 1]]]', [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1]]]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, 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 [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 0]]]['uncorrectable', None]Failed
regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]['corrected', [[1, 0, 1], [1, 0, 1]]]['uncorrectable', None]Failed
control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]['clean', [[0, 0], [0, 1]]]['clean', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]]['clean', [[1, 0, 1], [1, 1, 1]]]['clean', [[1, 0, 1], [1, 1, 1]]]Passed
control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]['corrected', [[1, 0, 1], [1, 1, 1]]]['corrected', [[1, 0, 1], [1, 1, 1]]]Passed

SHA-256 / 7f4f34d99d7ce7dfc320da9ad9dd1a09585bf1f895a062835253a22f6f184309

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(m):
    Rw = [i for i, row in enumerate(m) if sum(row) % 2]
    Cl = [j for j in range(len(m[0])) if sum(row[j] for row in m) % 2]
    if not Rw and not Cl:
        return ['clean', [row[:-1] for row in m[:-1]]]
    if len(Rw) == len(Cl):
        fx = [list(row) for row in m]
        fx[Rw[0]][Cl[0]] ^= 1
        return ['corrected', [row[:-1] for row in fx[:-1]]]
    return ['uncorrectable', None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]', [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]], ['uncorrectable', None]], ['control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]], ['clean', [[0, 0], [0, 1]]]], ['control [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]], ['clean', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]]], [['regression [[[0, 0, 0, 0, 1], [0, 0, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[0, 0, 0, 0, 1], [0, 0, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['uncorrectable', None]], ['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['uncorrectable', None]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 0], [0, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 0], [0, 1, 0, 1]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [1, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [1, 1, 0, 1]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['clean', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]]], [['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 0, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 0, 1]]], ['uncorrectable', None]], ['regression [[[1, 0, 0, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[1, 0, 0, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['uncorrectable', None]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 0, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 0, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['clean', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[1, 0, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]]], [['regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]', [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]], ['uncorrectable', None]], ['regression [[[1, 1, 0, 1], [0, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[1, 1, 0, 1], [0, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['uncorrectable', None]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['clean', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [1, 1, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [1, 1, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['clean', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]]], [['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['uncorrectable', None]], ['regression [[[0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['uncorrectable', None]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['clean', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 0, 1]]], ['clean', [[0, 1], [1, 0], [0, 1]]]], ['control [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 1]]]', [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1]]]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, 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 [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 0]]]['uncorrectable', None]Failed
regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]['corrected', [[1, 0, 1], [1, 0, 1]]]['uncorrectable', None]Failed
control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]['clean', [[0, 0], [0, 1]]]['clean', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]]['clean', [[1, 0, 1], [1, 1, 1]]]['clean', [[1, 0, 1], [1, 1, 1]]]Passed
control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]['corrected', [[1, 0, 1], [1, 1, 1]]]['corrected', [[1, 0, 1], [1, 1, 1]]]Passed

SHA-256 / f6257d838c9705e7f0c6131d6e2b096a773e0071b73f460a58ddf059d5de2efd

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(m):
    Rw = [i for i, row in enumerate(m) if sum(row) % 2]
    Cl = [j for j in range(len(m[0])) if sum(row[j] for row in m) % 2]
    if not Rw and not Cl:
        return ['clean', [row[:-1] for row in m[:-1]]]
    if len(Rw) == 1 and len(Cl) == 1:
        fx = [list(row) for row in m]
        fx[Rw[0]][Cl[0]] ^= 1
        return ['corrected', [row[:-1] for row in fx[:-1]]]
    return ['uncorrectable', None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]', [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]], ['uncorrectable', None]], ['control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]], ['clean', [[0, 0], [0, 1]]]], ['control [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]], ['clean', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]]], [['regression [[[0, 0, 0, 0, 1], [0, 0, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[0, 0, 0, 0, 1], [0, 0, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['uncorrectable', None]], ['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['uncorrectable', None]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 0], [0, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 0], [0, 1, 0, 1]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[1, 0, 1, 0], [1, 1, 1, 1], [1, 1, 0, 1]]]', [[[1, 0, 1, 0], [1, 1, 1, 1], [1, 1, 0, 1]]], ['corrected', [[1, 0, 1], [1, 1, 1]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['clean', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]]], [['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 0, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 0, 1]]], ['uncorrectable', None]], ['regression [[[1, 0, 0, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[1, 0, 0, 1, 1], [0, 1, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['uncorrectable', None]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 0], [0, 0, 1, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 0, 1]]]', [[[0, 1, 0, 1], [0, 0, 1, 1], [0, 1, 0, 1], [0, 0, 0, 1]]], ['corrected', [[0, 1, 0], [0, 0, 1], [0, 1, 0]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['clean', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]]', [[[1, 0, 1, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]]], [['regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]', [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]], ['uncorrectable', None]], ['regression [[[1, 1, 0, 1], [0, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]]', [[[1, 1, 0, 1], [0, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]]], ['uncorrectable', None]], ['control [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]]', [[[1, 0, 0, 0, 1], [0, 1, 1, 1, 1], [0, 0, 1, 1, 0], [0, 1, 0, 0, 0]]], ['corrected', [[1, 0, 0, 0], [0, 1, 1, 1], [0, 0, 1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['clean', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [1, 1, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 1, 0], [1, 1, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1], [1, 1]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['clean', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]]], [['regression [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]]', [[[1, 1, 1], [1, 1, 1], [0, 1, 1], [1, 1, 0], [0, 1, 1]]], ['uncorrectable', None]], ['regression [[[0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['uncorrectable', None]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['clean', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 1, 0, 0, 0, 1], [0, 0, 1, 0, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]]]', [[[1, 0, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1], [0, 0, 1, 1, 1, 0]]], ['corrected', [[1, 0, 1, 0, 1], [1, 0, 0, 0, 0]]]], ['control [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [1, 0, 1]]], ['clean', [[0, 1], [1, 0], [0, 1]]]], ['control [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 1]]]', [[[0, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1]]]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, 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 [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]['uncorrectable', None]['uncorrectable', None]Passed
regression [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]['uncorrectable', None]['uncorrectable', None]Passed
control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]['clean', [[0, 0], [0, 1]]]['clean', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 1]]]['clean', [[1, 0, 1], [1, 1, 1]]]['clean', [[1, 0, 1], [1, 1, 1]]]Passed
control [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]['corrected', [[1, 0, 1], [1, 1, 1]]]['corrected', [[1, 0, 1], [1, 1, 1]]]Passed

SHA-256 / 26bca3f6ad9e9350fc781dd084279a6908393414e892e89460791d01894ec7bc

Verification & scope

A deterministic, bounded teaching model of the named code under the stated contract; not a production codec. 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:48:35.137657+00:00.

Case digest / d9a77351ab7dd2aeed18aca83cc79deccfe79540c06c3c50288cb4f622388e18