FAILURE MAP
← Case archive

FA-72061 / Error-correcting codes / Open access

Product code never checks the row-parity column · case 01

An error in a row parity bit is reported uncorrectable.

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

ROOT CAUSE

The column checks stop before the last (row-parity) column.

VERIFIED REPAIR

Check every column including the parity column.

Unsuccessful approach: Excluding the parity row from the row checks instead misses column-parity errors.

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]) - 1) 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 [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['regression [[[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]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['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 [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['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 [[[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 [[[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, 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]]]], ['partial-repair [[[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]]]], ['partial-repair [[[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 [[[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 [[[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], [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]]]]], [['regression [[[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]]]], ['regression [[[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]]]], ['partial-repair [[[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]]]], ['partial-repair [[[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 [[[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 [[[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, 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]]]]], [['regression [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['regression [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1]]]], ['partial-repair [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['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 [[[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]], ['control [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['clean', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['control [[[1, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[1, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]]], [['regression [[[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]]]], ['regression [[[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]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[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 [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]], ['clean', [[0, 0], [0, 1]]]], ['control [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['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 [[[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]]]]
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 [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]['uncorrectable', None]['corrected', [[0, 0], [0, 1]]]Failed
regression [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]['uncorrectable', None]['corrected', [[1, 0, 1], [1, 1, 1]]]Failed
partial-repair [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]['clean', [[0, 0], [0, 1]]]['clean', [[0, 0], [0, 1]]]Passed
control [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]['uncorrectable', None]['uncorrectable', None]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 [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]['uncorrectable', None]['uncorrectable', None]Passed

SHA-256 / 8a1201a65f72c1e57c8beb34fd6d5e555f516c0d4848e1855e6ad28eab5f5422

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[:-1]) 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 [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['regression [[[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]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['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 [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['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 [[[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 [[[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, 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]]]], ['partial-repair [[[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]]]], ['partial-repair [[[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 [[[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 [[[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], [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]]]]], [['regression [[[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]]]], ['regression [[[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]]]], ['partial-repair [[[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]]]], ['partial-repair [[[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 [[[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 [[[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, 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]]]]], [['regression [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['regression [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1]]]], ['partial-repair [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['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 [[[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]], ['control [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['clean', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['control [[[1, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[1, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]]], [['regression [[[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]]]], ['regression [[[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]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[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 [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]], ['clean', [[0, 0], [0, 1]]]], ['control [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['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 [[[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]]]]
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 [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
regression [[[1, 0, 1, 0], [1, 1, 1, 1], [0, 1, 0, 0]]]['uncorrectable', None]['corrected', [[1, 0, 1], [1, 1, 1]]]Failed
partial-repair [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]['uncorrectable', None]['corrected', [[0, 0], [0, 1]]]Failed
partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]['uncorrectable', None]['corrected', [[0, 0], [0, 1]]]Failed
control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]['clean', [[0, 0], [0, 1]]]['clean', [[0, 0], [0, 1]]]Passed
control [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]['uncorrectable', None]['uncorrectable', None]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 [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]['uncorrectable', None]['uncorrectable', None]Passed

SHA-256 / b2ced874a12c41565ce47a806f5ee540fa10a8b15d3e443ab6f54c30766b77e2

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 [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['regression [[[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]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['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 [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['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 [[[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 [[[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, 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]]]], ['partial-repair [[[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]]]], ['partial-repair [[[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 [[[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 [[[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], [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]]]]], [['regression [[[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]]]], ['regression [[[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]]]], ['partial-repair [[[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]]]], ['partial-repair [[[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 [[[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 [[[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, 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]]]]], [['regression [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 1], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['regression [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 1]]]', [[[0, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 1]]], ['corrected', [[0, 1], [1, 0], [0, 1]]]], ['partial-repair [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['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 [[[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]], ['control [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[0, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['clean', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]], ['control [[[1, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0...', [[[1, 0, 0, 1, 1], [0, 0, 1, 1, 0], [1, 1, 0, 1, 1], [0, 1, 0, 1, 0], [1, 0, 1, 0, 0]]], ['corrected', [[0, 0, 0, 1], [0, 0, 1, 1], [1, 1, 0, 1], [0, 1, 0, 1]]]]], [['regression [[[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]]]], ['regression [[[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]]]], ['partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]], ['corrected', [[0, 0], [0, 1]]]], ['partial-repair [[[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 [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]', [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]], ['clean', [[0, 0], [0, 1]]]], ['control [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]', [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]], ['uncorrectable', None]], ['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 [[[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]]]]
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 [[[0, 0, 1], [0, 1, 1], [0, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
regression [[[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
partial-repair [[[0, 0, 0], [0, 1, 1], [0, 0, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
partial-repair [[[0, 0, 0], [0, 1, 1], [1, 1, 1]]]['corrected', [[0, 0], [0, 1]]]['corrected', [[0, 0], [0, 1]]]Passed
control [[[0, 0, 0], [0, 1, 1], [0, 1, 1]]]['clean', [[0, 0], [0, 1]]]['clean', [[0, 0], [0, 1]]]Passed
control [[[1, 0, 0], [0, 0, 1], [0, 1, 1]]]['uncorrectable', None]['uncorrectable', None]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 [[[0, 0, 1, 0], [1, 0, 1, 1], [0, 1, 0, 1]]]['uncorrectable', None]['uncorrectable', None]Passed

SHA-256 / 18808f1302fc46338ec3c673487e398c76b4bc778ed59907870d1b2148d86307

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

Case digest / 25aa4210ac097c573ca09e16b16b650eee6eeae63edd8aec605566c21518d62b