FAILURE MAP
← Case archive

FA-72286 / Error-correcting codes / Open access

Weight distribution skips the zero message · case 01

The histogram totals 2^k - 1 and weight 0 is missing.

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

ROOT CAUSE

Enumeration starts at message 1.

VERIFIED REPAIR

Include message 0, which always yields the all-zero codeword.

Unsuccessful approach: Stopping one message early drops the all-rows combination instead.

Case contract

Weight distribution of the binary linear code spanned by the rows of generator matrix G (rows may be dependent). Enumerate all 2^k messages including the zero message, form codewords as XOR combinations of rows, and histogram their Hamming weights (index 0..n). dmin is the smallest nonzero weight present (0 if the code is only the zero word). Return [histogram, dmin].

Why this case matters

Code designers use weight enumerators to estimate undetected-error probability and minimum distance.

1 / The failure

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

N = 1
observations = []
def solve(G):
    k, n = len(G), len(G[0])
    hist = [0] * (n + 1)
    for msg in range(1, 2 ** k):
        c = [0] * n
        for i in range(k):
            if msg >> i & 1:
                c = [a ^ b for a, b in zip(c, G[i])]
        hist[sum(c)] += 1
    dmin = min(w for w in range(1, n + 1) if hist[w]) if any(hist[1:]) else 0
    return [hist, dmin]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...', [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1]]], [[1, 0, 0, 7, 7, 0, 0, 1], 3]], ['regression [[[1, 1, 1]]]', [[[1, 1, 1]]], [[1, 0, 0, 1], 3]], ['control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]]', [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]], [[1, 0, 6, 0, 1], 2]], ['control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['control [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]], ['control [[[0, 0, 0]]]', [[[0, 0, 0]]], [[2, 0, 0, 0], 0]], ['control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]]], [['regression [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['regression [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]], ['control [[[0, 0, 0]]]', [[[0, 0, 0]]], [[2, 0, 0, 0], 0]], ['control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 0]]], [[1, 0, 2, 5, 5, 2, 0, 1], 2]], ['control [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0...', [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 0]]], [[1, 3, 3, 2, 3, 3, 1], 1]], ['control [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]]], [['regression [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['regression [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]], ['control [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]], ['control [[[1, 1, 1, 0, 0, 0, 1]]]', [[[1, 1, 1, 0, 0, 0, 1]]], [[1, 0, 0, 0, 1, 0, 0, 0], 4]], ['control [[[1, 0, 1, 1], [0, 0, 0, 1]]]', [[[1, 0, 1, 1], [0, 0, 0, 1]]], [[1, 1, 1, 1, 0], 1]], ['control [[[1, 0]]]', [[[1, 0]]], [[1, 1, 0], 1]], ['control [[[0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1, ...', [[[0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1, 0], [0, 1, 1, 1, 1, 0, 1]]], [[1, 1, 1, 4, 5, 3, 1, 0], 1]], ['control [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]]', [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]], [[1, 0, 0, 4, 3, 0, 0], 3]]], [['regression [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0...', [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 0]]], [[1, 3, 3, 2, 3, 3, 1], 1]], ['regression [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]], ['control [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]]', [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]], [[1, 0, 0, 4, 3, 0, 0], 3]], ['control [[[0, 1, 0, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, ...', [[[0, 1, 0, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, 0]]], [[1, 0, 2, 2, 1, 2, 0, 0], 2]], ['control [[[0, 0, 1], [1, 1, 0]]]', [[[0, 0, 1], [1, 1, 0]]], [[1, 1, 1, 1], 1]], ['control [[[0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1, ...', [[[0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1, 1]]], [[1, 0, 0, 3, 2, 1, 1, 0], 3]], ['control [[[0, 0, 1, 0]]]', [[[0, 0, 1, 0]]], [[1, 1, 0, 0, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1]]], [[2, 0, 2, 0, 0, 0, 4, 0], 2]]], [['regression [[[1, 0, 1, 1], [0, 0, 0, 1]]]', [[[1, 0, 1, 1], [0, 0, 0, 1]]], [[1, 1, 1, 1, 0], 1]], ['regression [[[1, 0]]]', [[[1, 0]]], [[1, 1, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1]]], [[2, 0, 2, 0, 0, 0, 4, 0], 2]], ['control [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...', [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1]]], [[1, 0, 0, 7, 7, 0, 0, 1], 3]], ['control [[[1, 1, 1]]]', [[[1, 1, 1]]], [[1, 0, 0, 1], 3]], ['control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]]', [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]], [[1, 0, 6, 0, 1], 2]], ['control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['control [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]]]]
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, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...[[0, 0, 0, 7, 7, 0, 0, 1], 3][[1, 0, 0, 7, 7, 0, 0, 1], 3]Failed
regression [[[1, 1, 1]]][[0, 0, 0, 1], 3][[1, 0, 0, 1], 3]Failed
control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]][[0, 0, 6, 0, 1], 2][[1, 0, 6, 0, 1], 2]Failed
control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]][[0, 0, 0, 2, 1, 0], 3][[1, 0, 0, 2, 1, 0], 3]Failed
control [[[1, 1, 0], [1, 1, 0]]][[1, 0, 2, 0], 2][[2, 0, 2, 0], 2]Failed
control [[[0, 0, 0]]][[1, 0, 0, 0], 0][[2, 0, 0, 0], 0]Failed
control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]][[1, 2, 4, 4, 2, 2], 1][[2, 2, 4, 4, 2, 2], 1]Failed
control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...[[0, 1, 6, 6, 1, 1, 0, 0], 1][[1, 1, 6, 6, 1, 1, 0, 0], 1]Failed

SHA-256 / 6f3f0980c00f40540207f50484d616bb2972187492b69426260676718b684fea

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(G):
    k, n = len(G), len(G[0])
    hist = [0] * (n + 1)
    for msg in range(2 ** k - 1):
        c = [0] * n
        for i in range(k):
            if msg >> i & 1:
                c = [a ^ b for a, b in zip(c, G[i])]
        hist[sum(c)] += 1
    dmin = min(w for w in range(1, n + 1) if hist[w]) if any(hist[1:]) else 0
    return [hist, dmin]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...', [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1]]], [[1, 0, 0, 7, 7, 0, 0, 1], 3]], ['regression [[[1, 1, 1]]]', [[[1, 1, 1]]], [[1, 0, 0, 1], 3]], ['control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]]', [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]], [[1, 0, 6, 0, 1], 2]], ['control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['control [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]], ['control [[[0, 0, 0]]]', [[[0, 0, 0]]], [[2, 0, 0, 0], 0]], ['control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]]], [['regression [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['regression [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]], ['control [[[0, 0, 0]]]', [[[0, 0, 0]]], [[2, 0, 0, 0], 0]], ['control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 0]]], [[1, 0, 2, 5, 5, 2, 0, 1], 2]], ['control [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0...', [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 0]]], [[1, 3, 3, 2, 3, 3, 1], 1]], ['control [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]]], [['regression [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['regression [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]], ['control [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]], ['control [[[1, 1, 1, 0, 0, 0, 1]]]', [[[1, 1, 1, 0, 0, 0, 1]]], [[1, 0, 0, 0, 1, 0, 0, 0], 4]], ['control [[[1, 0, 1, 1], [0, 0, 0, 1]]]', [[[1, 0, 1, 1], [0, 0, 0, 1]]], [[1, 1, 1, 1, 0], 1]], ['control [[[1, 0]]]', [[[1, 0]]], [[1, 1, 0], 1]], ['control [[[0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1, ...', [[[0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1, 0], [0, 1, 1, 1, 1, 0, 1]]], [[1, 1, 1, 4, 5, 3, 1, 0], 1]], ['control [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]]', [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]], [[1, 0, 0, 4, 3, 0, 0], 3]]], [['regression [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0...', [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 0]]], [[1, 3, 3, 2, 3, 3, 1], 1]], ['regression [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]], ['control [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]]', [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]], [[1, 0, 0, 4, 3, 0, 0], 3]], ['control [[[0, 1, 0, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, ...', [[[0, 1, 0, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, 0]]], [[1, 0, 2, 2, 1, 2, 0, 0], 2]], ['control [[[0, 0, 1], [1, 1, 0]]]', [[[0, 0, 1], [1, 1, 0]]], [[1, 1, 1, 1], 1]], ['control [[[0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1, ...', [[[0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1, 1]]], [[1, 0, 0, 3, 2, 1, 1, 0], 3]], ['control [[[0, 0, 1, 0]]]', [[[0, 0, 1, 0]]], [[1, 1, 0, 0, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1]]], [[2, 0, 2, 0, 0, 0, 4, 0], 2]]], [['regression [[[1, 0, 1, 1], [0, 0, 0, 1]]]', [[[1, 0, 1, 1], [0, 0, 0, 1]]], [[1, 1, 1, 1, 0], 1]], ['regression [[[1, 0]]]', [[[1, 0]]], [[1, 1, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1]]], [[2, 0, 2, 0, 0, 0, 4, 0], 2]], ['control [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...', [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1]]], [[1, 0, 0, 7, 7, 0, 0, 1], 3]], ['control [[[1, 1, 1]]]', [[[1, 1, 1]]], [[1, 0, 0, 1], 3]], ['control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]]', [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]], [[1, 0, 6, 0, 1], 2]], ['control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['control [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]]]]
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, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...[[1, 0, 0, 7, 7, 0, 0, 0], 3][[1, 0, 0, 7, 7, 0, 0, 1], 3]Failed
regression [[[1, 1, 1]]][[1, 0, 0, 0], 0][[1, 0, 0, 1], 3]Failed
control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]][[1, 0, 5, 0, 1], 2][[1, 0, 6, 0, 1], 2]Failed
control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]][[1, 0, 0, 1, 1, 0], 3][[1, 0, 0, 2, 1, 0], 3]Failed
control [[[1, 1, 0], [1, 1, 0]]][[1, 0, 2, 0], 2][[2, 0, 2, 0], 2]Failed
control [[[0, 0, 0]]][[1, 0, 0, 0], 0][[2, 0, 0, 0], 0]Failed
control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]][[2, 2, 4, 4, 2, 1], 1][[2, 2, 4, 4, 2, 2], 1]Failed
control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...[[1, 1, 5, 6, 1, 1, 0, 0], 1][[1, 1, 6, 6, 1, 1, 0, 0], 1]Failed

SHA-256 / b7440ba0a9bc44926c28a37ea1d0b82abedd44aceff3fb27929b7d3908eefe65

3 / The verified repair

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

N = 1
observations = []
def solve(G):
    k, n = len(G), len(G[0])
    hist = [0] * (n + 1)
    for msg in range(2 ** k):
        c = [0] * n
        for i in range(k):
            if msg >> i & 1:
                c = [a ^ b for a, b in zip(c, G[i])]
        hist[sum(c)] += 1
    dmin = min(w for w in range(1, n + 1) if hist[w]) if any(hist[1:]) else 0
    return [hist, dmin]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...', [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1]]], [[1, 0, 0, 7, 7, 0, 0, 1], 3]], ['regression [[[1, 1, 1]]]', [[[1, 1, 1]]], [[1, 0, 0, 1], 3]], ['control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]]', [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]], [[1, 0, 6, 0, 1], 2]], ['control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['control [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]], ['control [[[0, 0, 0]]]', [[[0, 0, 0]]], [[2, 0, 0, 0], 0]], ['control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]]], [['regression [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['regression [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]], ['control [[[0, 0, 0]]]', [[[0, 0, 0]]], [[2, 0, 0, 0], 0]], ['control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 1, 0]]], [[1, 0, 2, 5, 5, 2, 0, 1], 2]], ['control [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0...', [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 0]]], [[1, 3, 3, 2, 3, 3, 1], 1]], ['control [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]]], [['regression [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]]', [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]], [[2, 2, 4, 4, 2, 2], 1]], ['regression [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...', [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 1], [0, 0, 0, 1, 1, 0, 0]]], [[1, 1, 6, 6, 1, 1, 0, 0], 1]], ['control [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]], ['control [[[1, 1, 1, 0, 0, 0, 1]]]', [[[1, 1, 1, 0, 0, 0, 1]]], [[1, 0, 0, 0, 1, 0, 0, 0], 4]], ['control [[[1, 0, 1, 1], [0, 0, 0, 1]]]', [[[1, 0, 1, 1], [0, 0, 0, 1]]], [[1, 1, 1, 1, 0], 1]], ['control [[[1, 0]]]', [[[1, 0]]], [[1, 1, 0], 1]], ['control [[[0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1, ...', [[[0, 0, 1, 0, 1, 1, 1], [0, 1, 0, 1, 0, 1, 1], [1, 1, 1, 0, 1, 1, 0], [0, 1, 1, 1, 1, 0, 1]]], [[1, 1, 1, 4, 5, 3, 1, 0], 1]], ['control [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]]', [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]], [[1, 0, 0, 4, 3, 0, 0], 3]]], [['regression [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0...', [[[0, 0, 0, 1, 0, 0], [1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 0, 1], [1, 0, 0, 0, 1, 0]]], [[1, 3, 3, 2, 3, 3, 1], 1]], ['regression [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]]', [[[1, 0, 0, 1, 1, 0], [1, 1, 1, 0, 0, 0], [1, 0, 1, 1, 1, 0]]], [[1, 1, 1, 3, 2, 0, 0], 1]], ['control [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]]', [[[0, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1], [1, 0, 1, 1, 0, 1]]], [[1, 0, 0, 4, 3, 0, 0], 3]], ['control [[[0, 1, 0, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, ...', [[[0, 1, 0, 0, 1, 0, 0], [1, 1, 1, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, 0]]], [[1, 0, 2, 2, 1, 2, 0, 0], 2]], ['control [[[0, 0, 1], [1, 1, 0]]]', [[[0, 0, 1], [1, 1, 0]]], [[1, 1, 1, 1], 1]], ['control [[[0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1, ...', [[[0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 1, 1, 1]]], [[1, 0, 0, 3, 2, 1, 1, 0], 3]], ['control [[[0, 0, 1, 0]]]', [[[0, 0, 1, 0]]], [[1, 1, 0, 0, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1]]], [[2, 0, 2, 0, 0, 0, 4, 0], 2]]], [['regression [[[1, 0, 1, 1], [0, 0, 0, 1]]]', [[[1, 0, 1, 1], [0, 0, 0, 1]]], [[1, 1, 1, 1, 0], 1]], ['regression [[[1, 0]]]', [[[1, 0]]], [[1, 1, 0], 1]], ['control [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, ...', [[[1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1]]], [[2, 0, 2, 0, 0, 0, 4, 0], 2]], ['control [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...', [[[1, 0, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1]]], [[1, 0, 0, 7, 7, 0, 0, 1], 3]], ['control [[[1, 1, 1]]]', [[[1, 1, 1]]], [[1, 0, 0, 1], 3]], ['control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]]', [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]], [[1, 0, 6, 0, 1], 2]], ['control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]]', [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]], [[1, 0, 0, 2, 1, 0], 3]], ['control [[[1, 1, 0], [1, 1, 0]]]', [[[1, 1, 0], [1, 1, 0]]], [[2, 0, 2, 0], 2]]]]
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, 1, 1, 0], [0, 1, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, ...[[1, 0, 0, 7, 7, 0, 0, 1], 3][[1, 0, 0, 7, 7, 0, 0, 1], 3]Passed
regression [[[1, 1, 1]]][[1, 0, 0, 1], 3][[1, 0, 0, 1], 3]Passed
control [[[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1]]][[1, 0, 6, 0, 1], 2][[1, 0, 6, 0, 1], 2]Passed
control [[[1, 0, 1, 1, 0], [0, 1, 1, 1, 1]]][[1, 0, 0, 2, 1, 0], 3][[1, 0, 0, 2, 1, 0], 3]Passed
control [[[1, 1, 0], [1, 1, 0]]][[2, 0, 2, 0], 2][[2, 0, 2, 0], 2]Passed
control [[[0, 0, 0]]][[2, 0, 0, 0], 0][[2, 0, 0, 0], 0]Passed
control [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 1], [0, 0, 1, 1, 1], [1, 1, 0, 0, 1]]][[2, 2, 4, 4, 2, 2], 1][[2, 2, 4, 4, 2, 2], 1]Passed
control [[[0, 0, 0, 1, 0, 1, 1], [1, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, ...[[1, 1, 6, 6, 1, 1, 0, 0], 1][[1, 1, 6, 6, 1, 1, 0, 0], 1]Passed

SHA-256 / 02044ee1861328c0828939c930c3baee998450b9e08490be0ba6f04c55ef0153

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

Case digest / 41ebc711a9c453be7daf9ee83e96082b9a277341b2a1926d047ee9781cfeefcf