FAILURE MAP
← Case archive

FA-72146 / Error-correcting codes / Open access

Syndrome table ORs the error pattern into the word · case 01

Errors on bits that were received as 1 are never removed.

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

ROOT CAUSE

The correction combines word and leader with OR instead of XOR.

VERIFIED REPAIR

XOR the coset leader into the received word.

Unsuccessful approach: Only clearing bits (a and not b) cannot repair a 0 that should be 1.

Case contract

Syndrome decoding of a binary linear code from its parity-check matrix H (rows). The coset-leader table is built by enumerating error patterns by increasing weight and, within a weight, in lexicographic order of error positions; the first pattern seen for a syndrome is its leader. Decode r by XORing the leader of its syndrome. Return [codeword, leader weight] (None if the syndrome has no leader).

Why this case matters

Short block codes in control channels are decoded with precomputed coset-leader tables.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import itertools
N = 1
observations = []
def solve(H, r):
    n = len(H[0])
    def syn(v):
        return tuple(sum(h[k] & v[k] for k in range(n)) % 2 for h in H)
    table = {}
    for w in range(n + 1):
        for pos in itertools.combinations(range(n), w):
            e = [1 if k in pos else 0 for k in range(n)]
            table.setdefault(syn(e), e)
    e = table.get(syn(r))
    if e is None:
        return None
    return [[a | b for a, b in zip(r, e)], sum(e)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0, 0, 0, 0], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 1, 0, 1, 1]], [[0, 0, 1, 1, 0, 1, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 1, 1, 0, 0]], [[0, 1, 0, 1, 1, 0, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 1, 0, 1, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['regression [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 0]], [[1, 1, 0, 0, 1, 1], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 1, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0], 1]], ['regression [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 0, 1, 1]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 0, 1, 1]], [[0, 1, 0, 1, 0], 1]], ['partial-repair [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 1, 0, 0]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 1, 0, 0]], [[0, 1, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 0, 0, 1, 0]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 0, 0, 1, 0]], [[0, 1, 0, 1, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [1, 1, 1, 0, 1]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [1, 1, 1, 0, 1]], [[0, 1, 1, 0, 1], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0, 0, 0, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 1, 1, 0, 0]], [[0, 1, 0, 1, 1, 0, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 1, 1]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 1, 0, 1, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 0]], [[1, 1, 0, 0, 1, 1], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]]]
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, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 0, 0, 0, 1, 0], 1][[0, 0, 0, 0, 0, 0, 0], 1]Failed
regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 1, 1, 0, 1, 1], 1][[0, 0, 1, 1, 0, 1, 0], 1]Failed
partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 1, 1, 1, 0, 0, 1], 1][[0, 1, 1, 1, 0, 0, 1], 1]Passed
partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 1, 0, 1, 1, 0, 0], 1][[0, 1, 0, 1, 1, 0, 0], 1]Passed
control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 1, 0, 1, 0, 1], 0][[0, 0, 1, 0, 1, 0, 1], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...[[1, 0, 1, 1, 1, 0], 0][[1, 0, 1, 1, 1, 0], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...[[1, 1, 0, 0, 1, 1], 0][[1, 1, 0, 0, 1, 1], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...[[0, 0, 1, 0, 1, 1], 0][[0, 0, 1, 0, 1, 1], 0]Passed

SHA-256 / f91735872b8ae8314013ae9858f9744cc3ecb803d8d78a73304556268fb12e39

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import itertools
N = 1
observations = []
def solve(H, r):
    n = len(H[0])
    def syn(v):
        return tuple(sum(h[k] & v[k] for k in range(n)) % 2 for h in H)
    table = {}
    for w in range(n + 1):
        for pos in itertools.combinations(range(n), w):
            e = [1 if k in pos else 0 for k in range(n)]
            table.setdefault(syn(e), e)
    e = table.get(syn(r))
    if e is None:
        return None
    return [[a if not b else 0 for a, b in zip(r, e)], sum(e)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0, 0, 0, 0], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 1, 0, 1, 1]], [[0, 0, 1, 1, 0, 1, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 1, 1, 0, 0]], [[0, 1, 0, 1, 1, 0, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 1, 0, 1, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['regression [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 0]], [[1, 1, 0, 0, 1, 1], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 1, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0], 1]], ['regression [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 0, 1, 1]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 0, 1, 1]], [[0, 1, 0, 1, 0], 1]], ['partial-repair [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 1, 0, 0]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 1, 0, 0]], [[0, 1, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 0, 0, 1, 0]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 0, 0, 1, 0]], [[0, 1, 0, 1, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [1, 1, 1, 0, 1]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [1, 1, 1, 0, 1]], [[0, 1, 1, 0, 1], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0, 0, 0, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 1, 1, 0, 0]], [[0, 1, 0, 1, 1, 0, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 1, 1]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 1, 0, 1, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 0]], [[1, 1, 0, 0, 1, 1], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]]]
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, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 0, 0, 0, 0, 0], 1][[0, 0, 0, 0, 0, 0, 0], 1]Passed
regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 1, 1, 0, 1, 0], 1][[0, 0, 1, 1, 0, 1, 0], 1]Passed
partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 1, 1, 1, 0, 0, 0], 1][[0, 1, 1, 1, 0, 0, 1], 1]Failed
partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 0, 1, 1, 0, 0], 1][[0, 1, 0, 1, 1, 0, 0], 1]Failed
control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 1, 0, 1, 0, 1], 0][[0, 0, 1, 0, 1, 0, 1], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...[[1, 0, 1, 1, 1, 0], 0][[1, 0, 1, 1, 1, 0], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...[[1, 1, 0, 0, 1, 1], 0][[1, 1, 0, 0, 1, 1], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...[[0, 0, 1, 0, 1, 1], 0][[0, 0, 1, 0, 1, 1], 0]Passed

SHA-256 / ed1c846d787d94c6a8cdcb0ea0d224a1f7b0024aea61ee3d104bc910915caee3

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import itertools
N = 1
observations = []
def solve(H, r):
    n = len(H[0])
    def syn(v):
        return tuple(sum(h[k] & v[k] for k in range(n)) % 2 for h in H)
    table = {}
    for w in range(n + 1):
        for pos in itertools.combinations(range(n), w):
            e = [1 if k in pos else 0 for k in range(n)]
            table.setdefault(syn(e), e)
    e = table.get(syn(r))
    if e is None:
        return None
    return [[a ^ b for a, b in zip(r, e)], sum(e)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0, 0, 0, 0], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 1, 0, 1, 1]], [[0, 0, 1, 1, 0, 1, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 1, 1, 0, 0]], [[0, 1, 0, 1, 1, 0, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 1, 0, 1, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['regression [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 0]], [[1, 1, 0, 0, 1, 1], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 1, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0], 1]], ['regression [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 0, 1, 1]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 0, 1, 1]], [[0, 1, 0, 1, 0], 1]], ['partial-repair [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 1, 0, 0]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 1, 1, 0, 0]], [[0, 1, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 0, 0, 1, 0]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [0, 0, 0, 1, 0]], [[0, 1, 0, 1, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [1, 1, 1, 0, 1]]', [[[1, 1, 1, 1, 0], [1, 0, 1, 0, 1]], [1, 1, 1, 0, 1]], [[0, 1, 1, 0, 1], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0, 0, 0, 0], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 0, 0]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 0, 1, 1, 0, 0]], [[0, 1, 0, 1, 1, 0, 0], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]], [['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 1, 1, 1, 0, 1, 1]], [[0, 1, 1, 1, 0, 0, 1], 1]], ['regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 1, 0, 1, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [1, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 1, 0, 1], 1]], ['partial-repair [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 0]], [[1, 1, 0, 0, 1, 1], 1]], ['control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...', [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 0, 1]], [[0, 0, 1, 0, 1, 0, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 0, 1, 1, 1, 0]], [[1, 0, 1, 1, 1, 0], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, 1, 0, 0, 1, 1]], [[1, 1, 0, 0, 1, 1], 0]], ['control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...', [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, 0, 1, 0, 1, 1]], [[0, 0, 1, 0, 1, 1], 0]]]]
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, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 0, 0, 0, 0, 0], 1][[0, 0, 0, 0, 0, 0, 0], 1]Passed
regression [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 1, 1, 0, 1, 0], 1][[0, 0, 1, 1, 0, 1, 0], 1]Passed
partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 1, 1, 1, 0, 0, 1], 1][[0, 1, 1, 1, 0, 0, 1], 1]Passed
partial-repair [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 1, 0, 1, 1, 0, 0], 1][[0, 1, 0, 1, 1, 0, 0], 1]Passed
control [[[1, 0, 1, 1, 1, 0, 0], [1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 1, 0, 0, ...[[0, 0, 1, 0, 1, 0, 1], 0][[0, 0, 1, 0, 1, 0, 1], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...[[1, 0, 1, 1, 1, 0], 0][[1, 0, 1, 1, 1, 0], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [1, ...[[1, 1, 0, 0, 1, 1], 0][[1, 1, 0, 0, 1, 1], 0]Passed
control [[[1, 1, 0, 1, 0, 0], [0, 1, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1]], [0, ...[[0, 0, 1, 0, 1, 1], 0][[0, 0, 1, 0, 1, 1], 0]Passed

SHA-256 / 78fd4649a834869862eb82c6860230c425504c5f48e6c0d631d2d45739f3fe3f

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

Case digest / ab6652bd5e8618db875d0dfa9cc423c2fef8dfe3d146b4626d58b1dfaccd71b5