FAILURE MAP
← Case archive

FA-71851 / Error-correcting codes / Open access

Hamming data extraction keeps parity position four · case 01

Decoded data contains check bits and is one bit too long.

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

ROOT CAUSE

Data are taken from every position above 2, including the parity positions 4, 8, ...

VERIFIED REPAIR

Take data from positions that are not powers of two (pos & (pos - 1) != 0).

Unsuccessful approach: Taking odd positions only drops data at 6, 10, 12 and keeps parity bit 1.

Case contract

Single-error-correcting Hamming decoder for a full or shortened code of length n >= 3 (bits 0/1, else None). Positions are 1-based; parity bits sit at powers of two. The syndrome is the XOR of the positions holding a 1. A syndrome above n points outside the shortened code and is "uncorrectable" (data None); otherwise the bit at the syndrome position is flipped. Return [status, data bits from non-power-of-two positions, syndrome].

Why this case matters

Memory and link controllers use (shortened) Hamming codes to repair single-bit upsets.

1 / The failure

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

N = 1
observations = []
def solve(r):
    n = len(r)
    if n < 3 or any(b not in (0, 1) for b in r):
        return None
    s = 0
    for pos in range(1, n + 1):
        if r[pos - 1]:
            s ^= pos
    if s > n:
        return ['uncorrectable', None, s]
    c = list(r)
    if s:
        c[s - 1] ^= 1
    data = [c[pos - 1] for pos in range(1, n + 1) if pos > 2]
    return ['corrected' if s else 'clean', data, s]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 1, 0, 1, 1, 1]]', [[0, 1, 1, 0, 1, 1, 1]], ['corrected', [1, 0, 1, 1], 5]], ['regression [[0, 1, 1, 0, 0, 1, 1]]', [[0, 1, 1, 0, 0, 1, 1]], ['clean', [1, 0, 1, 1], 0]], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]]], [['regression [[1, 1, 0, 1, 0, 1, 0]]', [[1, 1, 0, 1, 0, 1, 0]], ['corrected', [0, 0, 1, 0], 1]], ['regression [[0, 1, 0, 1, 0, 1, 1]]', [[0, 1, 0, 1, 0, 1, 1]], ['corrected', [0, 0, 1, 0], 7]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1]], ['uncorrectable', None, 12]], ['control [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]], ['uncorrectable', None, 15]], ['control [[0, 1]]', [[0, 1]], None], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None]], [['regression [[0, 1, 1, 1, 0, 1, 0]]', [[0, 1, 1, 1, 0, 1, 0]], ['corrected', [0, 0, 1, 0], 3]], ['regression [[1, 0, 0, 0, 0, 1, 1]]', [[1, 0, 0, 0, 0, 1, 1]], ['clean', [0, 0, 1, 1], 0]], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]]], [['regression [[1, 0, 0, 0, 0, 1, 0]]', [[1, 0, 0, 0, 0, 1, 0]], ['corrected', [0, 0, 1, 1], 7]], ['regression [[0, 1, 0, 0, 0, 1, 1]]', [[0, 1, 0, 0, 0, 1, 1]], ['corrected', [1, 0, 1, 1], 3]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1]], ['uncorrectable', None, 12]], ['control [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]], ['uncorrectable', None, 15]], ['control [[0, 1]]', [[0, 1]], None]], [['regression [[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0]]', [[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0]], ['corrected', [0, 1, 1, 0, 1, 1, 1, 0], 4]], ['regression [[1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1]], ['corrected', [0, 1, 1, 0, 1, 1, 1, 0], 12]], ['control [[0, 1]]', [[0, 1]], None], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]]]]
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, 1, 1, 0, 1, 1, 1]]['corrected', [1, 0, 0, 1, 1], 5]['corrected', [1, 0, 1, 1], 5]Failed
regression [[0, 1, 1, 0, 0, 1, 1]]['clean', [1, 0, 0, 1, 1], 0]['clean', [1, 0, 1, 1], 0]Failed
control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]['uncorrectable', None, 12]['uncorrectable', None, 12]Passed
control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]['uncorrectable', None, 15]['uncorrectable', None, 15]Passed
control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed
control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]['uncorrectable', None, 14]['uncorrectable', None, 14]Passed
control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed
control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed

SHA-256 / ff8868bbd4bbc3e372baedfeeedd694cabb976fe061720dbe5bc5f4c6015f1ce

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(r):
    n = len(r)
    if n < 3 or any(b not in (0, 1) for b in r):
        return None
    s = 0
    for pos in range(1, n + 1):
        if r[pos - 1]:
            s ^= pos
    if s > n:
        return ['uncorrectable', None, s]
    c = list(r)
    if s:
        c[s - 1] ^= 1
    data = [c[pos - 1] for pos in range(1, n + 1) if pos % 2]
    return ['corrected' if s else 'clean', data, s]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 1, 0, 1, 1, 1]]', [[0, 1, 1, 0, 1, 1, 1]], ['corrected', [1, 0, 1, 1], 5]], ['regression [[0, 1, 1, 0, 0, 1, 1]]', [[0, 1, 1, 0, 0, 1, 1]], ['clean', [1, 0, 1, 1], 0]], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]]], [['regression [[1, 1, 0, 1, 0, 1, 0]]', [[1, 1, 0, 1, 0, 1, 0]], ['corrected', [0, 0, 1, 0], 1]], ['regression [[0, 1, 0, 1, 0, 1, 1]]', [[0, 1, 0, 1, 0, 1, 1]], ['corrected', [0, 0, 1, 0], 7]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1]], ['uncorrectable', None, 12]], ['control [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]], ['uncorrectable', None, 15]], ['control [[0, 1]]', [[0, 1]], None], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None]], [['regression [[0, 1, 1, 1, 0, 1, 0]]', [[0, 1, 1, 1, 0, 1, 0]], ['corrected', [0, 0, 1, 0], 3]], ['regression [[1, 0, 0, 0, 0, 1, 1]]', [[1, 0, 0, 0, 0, 1, 1]], ['clean', [0, 0, 1, 1], 0]], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]]], [['regression [[1, 0, 0, 0, 0, 1, 0]]', [[1, 0, 0, 0, 0, 1, 0]], ['corrected', [0, 0, 1, 1], 7]], ['regression [[0, 1, 0, 0, 0, 1, 1]]', [[0, 1, 0, 0, 0, 1, 1]], ['corrected', [1, 0, 1, 1], 3]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1]], ['uncorrectable', None, 12]], ['control [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]], ['uncorrectable', None, 15]], ['control [[0, 1]]', [[0, 1]], None]], [['regression [[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0]]', [[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0]], ['corrected', [0, 1, 1, 0, 1, 1, 1, 0], 4]], ['regression [[1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1]], ['corrected', [0, 1, 1, 0, 1, 1, 1, 0], 12]], ['control [[0, 1]]', [[0, 1]], None], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]]]]
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, 1, 1, 0, 1, 1, 1]]['corrected', [0, 1, 0, 1], 5]['corrected', [1, 0, 1, 1], 5]Failed
regression [[0, 1, 1, 0, 0, 1, 1]]['clean', [0, 1, 0, 1], 0]['clean', [1, 0, 1, 1], 0]Failed
control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]['uncorrectable', None, 12]['uncorrectable', None, 12]Passed
control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]['uncorrectable', None, 15]['uncorrectable', None, 15]Passed
control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed
control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]['uncorrectable', None, 14]['uncorrectable', None, 14]Passed
control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed
control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed

SHA-256 / ece81e5a532fda2436d0a315791b4c43284ceb7ea975d1f076cbde8796f94468

3 / The verified repair

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

N = 1
observations = []
def solve(r):
    n = len(r)
    if n < 3 or any(b not in (0, 1) for b in r):
        return None
    s = 0
    for pos in range(1, n + 1):
        if r[pos - 1]:
            s ^= pos
    if s > n:
        return ['uncorrectable', None, s]
    c = list(r)
    if s:
        c[s - 1] ^= 1
    data = [c[pos - 1] for pos in range(1, n + 1) if pos & (pos - 1)]
    return ['corrected' if s else 'clean', data, s]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 1, 0, 1, 1, 1]]', [[0, 1, 1, 0, 1, 1, 1]], ['corrected', [1, 0, 1, 1], 5]], ['regression [[0, 1, 1, 0, 0, 1, 1]]', [[0, 1, 1, 0, 0, 1, 1]], ['clean', [1, 0, 1, 1], 0]], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]]], [['regression [[1, 1, 0, 1, 0, 1, 0]]', [[1, 1, 0, 1, 0, 1, 0]], ['corrected', [0, 0, 1, 0], 1]], ['regression [[0, 1, 0, 1, 0, 1, 1]]', [[0, 1, 0, 1, 0, 1, 1]], ['corrected', [0, 0, 1, 0], 7]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1]], ['uncorrectable', None, 12]], ['control [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]], ['uncorrectable', None, 15]], ['control [[0, 1]]', [[0, 1]], None], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None]], [['regression [[0, 1, 1, 1, 0, 1, 0]]', [[0, 1, 1, 1, 0, 1, 0]], ['corrected', [0, 0, 1, 0], 3]], ['regression [[1, 0, 0, 0, 0, 1, 1]]', [[1, 0, 0, 0, 0, 1, 1]], ['clean', [0, 0, 1, 1], 0]], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]]], [['regression [[1, 0, 0, 0, 0, 1, 0]]', [[1, 0, 0, 0, 0, 1, 0]], ['corrected', [0, 0, 1, 1], 7]], ['regression [[0, 1, 0, 0, 0, 1, 1]]', [[0, 1, 0, 0, 0, 1, 1]], ['corrected', [1, 0, 1, 1], 3]], ['control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]], ['uncorrectable', None, 13]], ['control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0]], ['uncorrectable', None, 14]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1]], ['uncorrectable', None, 12]], ['control [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0]], ['uncorrectable', None, 15]], ['control [[0, 1]]', [[0, 1]], None]], [['regression [[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0]]', [[1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0]], ['corrected', [0, 1, 1, 0, 1, 1, 1, 0], 4]], ['regression [[1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1]], ['corrected', [0, 1, 1, 0, 1, 1, 1, 0], 12]], ['control [[0, 1]]', [[0, 1]], None], ['control [[0, 1, 2, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0]], None], ['control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]], ['uncorrectable', None, 12]], ['control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]], ['uncorrectable', None, 15]], ['control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]', [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]], ['uncorrectable', None, 13]], ['control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]], ['uncorrectable', None, 14]]]]
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, 1, 1, 0, 1, 1, 1]]['corrected', [1, 0, 1, 1], 5]['corrected', [1, 0, 1, 1], 5]Passed
regression [[0, 1, 1, 0, 0, 1, 1]]['clean', [1, 0, 1, 1], 0]['clean', [1, 0, 1, 1], 0]Passed
control [[0, 0, 1, 1, 1, 0, 1, 0, 1, 0]]['uncorrectable', None, 12]['uncorrectable', None, 12]Passed
control [[0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1]]['uncorrectable', None, 15]['uncorrectable', None, 15]Passed
control [[1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed
control [[1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0]]['uncorrectable', None, 14]['uncorrectable', None, 14]Passed
control [[1, 1, 1, 1, 1, 0, 1, 1, 1, 1]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed
control [[0, 0, 1, 0, 0, 0, 1, 0, 1, 0]]['uncorrectable', None, 13]['uncorrectable', None, 13]Passed

SHA-256 / f098f24d2db540fca95cb635dcb27efc4fd45b8ab59f23187cb88a281287dc46

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

Case digest / 9c9161634e669d49894426bedf5260873c337b0e0fe740885fcb33c5f0082ff1