FA-71881 / Error-correcting codes / Open access
SECDED flips the bit before the syndrome position · case 01
Single-bit errors are moved rather than corrected.
ROOT CAUSE
The correction uses c[s - 1], forgetting that index 0 holds the overall parity bit.
VERIFIED REPAIR
Flip c[s]; s = 0 refers to the overall parity bit at index 0.
Unsuccessful approach: Clamping the index at 0 still shifts every other correction.
Case contract
Extended Hamming (8,4) SECDED decoder. r[0] is the overall parity bit; r[1..7] are Hamming positions 1..7 with data at 3, 5, 6, 7. s is the XOR of set positions 1..7 and p the parity of all eight bits. s=0,p=0: "clean"; p=1: single error at position s (s=0 means the overall parity bit) - "corrected"; s!=0,p=0: ["double", None]. Return [status, data]. Non-binary or wrong-length input returns None.
Why this case matters
ECC DRAM controllers must distinguish correctable single-bit errors from uncorrectable double-bit errors.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
if len(r) != 8 or any(b not in (0, 1) for b in r):
return None
s = 0
for pos in range(1, 8):
if r[pos]:
s ^= pos
p = sum(r) % 2
c = list(r)
if s == 0 and p == 0:
status = 'clean'
elif p == 1:
status = 'corrected'
c[s - 1] ^= 1
else:
return ['double', None]
return [status, [c[3], c[5], c[6], c[7]]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 1, 0, 1, 1, 0, 1]]', [[0, 1, 1, 0, 1, 1, 0, 1]], ['corrected', [0, 0, 0, 1]]], ['regression [[1, 0, 1, 0, 1, 1, 1, 0]]', [[1, 0, 1, 0, 1, 1, 1, 0]], ['corrected', [0, 0, 1, 0]]], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], ['clean', [0, 0, 0, 0]]], ['control [[0, 1, 0, 0, 0, 0, 0, 0]]', [[0, 1, 0, 0, 0, 0, 0, 0]], ['corrected', [0, 0, 0, 0]]], ['control [[0, 0, 0, 0, 0, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1]], ['double', None]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], ['clean', [0, 0, 0, 1]]], ['control [[0, 1, 0, 1, 1, 0, 0, 1]]', [[0, 1, 0, 1, 1, 0, 0, 1]], ['double', None]], ['control [[1, 0, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], ['clean', [0, 0, 1, 0]]]], [['regression [[0, 1, 1, 0, 0, 0, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 0]], ['corrected', [0, 1, 1, 0]]], ['regression [[0, 0, 0, 0, 1, 1, 1, 0]]', [[0, 0, 0, 0, 1, 1, 1, 0]], ['corrected', [0, 1, 1, 1]]], ['control [[1, 0, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], ['clean', [0, 0, 1, 0]]], ['control [[1, 0, 0, 1, 1, 0, 1, 0]]', [[1, 0, 0, 1, 1, 0, 1, 0]], ['double', None]], ['control [[1, 1, 0, 0, 0, 0, 1, 1]]', [[1, 1, 0, 0, 0, 0, 1, 1]], ['clean', [0, 0, 1, 1]]], ['control [[1, 1, 1, 0, 0, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 1, 1]], ['corrected', [0, 0, 1, 1]]], ['control [[1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 0, 1, 0, 0, 0, 1]], ['double', None]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], ['clean', [0, 1, 0, 0]]]], [['regression [[1, 0, 0, 1, 1, 0, 0, 0]]', [[1, 0, 0, 1, 1, 0, 0, 0]], ['corrected', [1, 0, 0, 1]]], ['regression [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], ['corrected', [1, 0, 1, 0]]], ['partial-repair [[0, 0, 1, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 0, 1, 1, 1]], ['corrected', [1, 0, 1, 1]]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], ['clean', [0, 1, 0, 0]]], ['control [[1, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 1, 1, 0, 0]], ['corrected', [0, 1, 0, 0]]], ['control [[1, 0, 0, 0, 1, 0, 0, 0]]', [[1, 0, 0, 0, 1, 0, 0, 0]], ['double', None]], ['control [[1, 0, 1, 0, 0, 1, 0, 1]]', [[1, 0, 1, 0, 0, 1, 0, 1]], ['clean', [0, 1, 0, 1]]], ['control [[1, 0, 1, 1, 0, 1, 1, 1]]', [[1, 0, 1, 1, 0, 1, 1, 1]], ['double', None]]], [['regression [[0, 1, 0, 0, 0, 1, 0, 1]]', [[0, 1, 0, 0, 0, 1, 0, 1]], ['corrected', [1, 1, 0, 1]]], ['regression [[0, 0, 0, 1, 0, 1, 1, 0]]', [[0, 0, 0, 1, 0, 1, 1, 0]], ['corrected', [1, 1, 1, 0]]], ['partial-repair [[1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 0, 1, 1, 1, 1]], ['corrected', [1, 1, 1, 1]]], ['partial-repair [[0, 0, 0, 0, 0, 0, 0, 1]]', [[0, 0, 0, 0, 0, 0, 0, 1]], ['corrected', [0, 0, 0, 0]]], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], ['clean', [0, 1, 1, 0]]], ['control [[0, 0, 1, 0, 0, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0]], ['double', None]], ['control [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], ['clean', [0, 1, 1, 1]]], ['control [[0, 0, 0, 0, 0, 1, 1, 0]]', [[0, 0, 0, 0, 0, 1, 1, 0]], ['double', None]]], [['regression [[1, 0, 0, 0, 0, 0, 0, 0]]', [[1, 0, 0, 0, 0, 0, 0, 0]], ['corrected', [0, 0, 0, 0]]], ['regression [[0, 0, 0, 0, 0, 0, 0, 1]]', [[0, 0, 0, 0, 0, 0, 0, 1]], ['corrected', [0, 0, 0, 0]]], ['partial-repair [[1, 0, 1, 0, 1, 1, 1, 0]]', [[1, 0, 1, 0, 1, 1, 1, 0]], ['corrected', [0, 0, 1, 0]]], ['partial-repair [[1, 0, 1, 0, 0, 1, 1, 1]]', [[1, 0, 1, 0, 0, 1, 1, 1]], ['corrected', [0, 1, 0, 1]]], ['control [[1, 1, 0, 1, 0, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 0, 0]], ['double', None]], ['control [[1, 0, 0, 1, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], ['clean', [1, 0, 0, 1]]], ['control [[1, 1, 0, 0, 1, 0, 0, 1]]', [[1, 1, 0, 0, 1, 0, 0, 1]], ['double', None]], ['control [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], ['clean', [1, 0, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[0, 1, 1, 0, 1, 1, 0, 1]] | ['corrected', [0, 1, 0, 1]] | ['corrected', [0, 0, 0, 1]] | Failed |
| regression [[1, 0, 1, 0, 1, 1, 1, 0]] | ['corrected', [0, 1, 1, 0]] | ['corrected', [0, 0, 1, 0]] | Failed |
| control [[0, 0, 0, 0, 0, 0, 0, 0]] | ['clean', [0, 0, 0, 0]] | ['clean', [0, 0, 0, 0]] | Passed |
| control [[0, 1, 0, 0, 0, 0, 0, 0]] | ['corrected', [0, 0, 0, 0]] | ['corrected', [0, 0, 0, 0]] | Passed |
| control [[0, 0, 0, 0, 0, 0, 1, 1]] | ['double', None] | ['double', None] | Passed |
| control [[0, 1, 1, 0, 1, 0, 0, 1]] | ['clean', [0, 0, 0, 1]] | ['clean', [0, 0, 0, 1]] | Passed |
| control [[0, 1, 0, 1, 1, 0, 0, 1]] | ['double', None] | ['double', None] | Passed |
| control [[1, 0, 1, 0, 1, 0, 1, 0]] | ['clean', [0, 0, 1, 0]] | ['clean', [0, 0, 1, 0]] | Passed |
SHA-256 / f8f5e759686191e7824587b0a7c3b9fe53aa28fac10848543bb935f98e7c2e13
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
if len(r) != 8 or any(b not in (0, 1) for b in r):
return None
s = 0
for pos in range(1, 8):
if r[pos]:
s ^= pos
p = sum(r) % 2
c = list(r)
if s == 0 and p == 0:
status = 'clean'
elif p == 1:
status = 'corrected'
c[max(s - 1, 0)] ^= 1
else:
return ['double', None]
return [status, [c[3], c[5], c[6], c[7]]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 1, 0, 1, 1, 0, 1]]', [[0, 1, 1, 0, 1, 1, 0, 1]], ['corrected', [0, 0, 0, 1]]], ['regression [[1, 0, 1, 0, 1, 1, 1, 0]]', [[1, 0, 1, 0, 1, 1, 1, 0]], ['corrected', [0, 0, 1, 0]]], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], ['clean', [0, 0, 0, 0]]], ['control [[0, 1, 0, 0, 0, 0, 0, 0]]', [[0, 1, 0, 0, 0, 0, 0, 0]], ['corrected', [0, 0, 0, 0]]], ['control [[0, 0, 0, 0, 0, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1]], ['double', None]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], ['clean', [0, 0, 0, 1]]], ['control [[0, 1, 0, 1, 1, 0, 0, 1]]', [[0, 1, 0, 1, 1, 0, 0, 1]], ['double', None]], ['control [[1, 0, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], ['clean', [0, 0, 1, 0]]]], [['regression [[0, 1, 1, 0, 0, 0, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 0]], ['corrected', [0, 1, 1, 0]]], ['regression [[0, 0, 0, 0, 1, 1, 1, 0]]', [[0, 0, 0, 0, 1, 1, 1, 0]], ['corrected', [0, 1, 1, 1]]], ['control [[1, 0, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], ['clean', [0, 0, 1, 0]]], ['control [[1, 0, 0, 1, 1, 0, 1, 0]]', [[1, 0, 0, 1, 1, 0, 1, 0]], ['double', None]], ['control [[1, 1, 0, 0, 0, 0, 1, 1]]', [[1, 1, 0, 0, 0, 0, 1, 1]], ['clean', [0, 0, 1, 1]]], ['control [[1, 1, 1, 0, 0, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 1, 1]], ['corrected', [0, 0, 1, 1]]], ['control [[1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 0, 1, 0, 0, 0, 1]], ['double', None]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], ['clean', [0, 1, 0, 0]]]], [['regression [[1, 0, 0, 1, 1, 0, 0, 0]]', [[1, 0, 0, 1, 1, 0, 0, 0]], ['corrected', [1, 0, 0, 1]]], ['regression [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], ['corrected', [1, 0, 1, 0]]], ['partial-repair [[0, 0, 1, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 0, 1, 1, 1]], ['corrected', [1, 0, 1, 1]]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], ['clean', [0, 1, 0, 0]]], ['control [[1, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 1, 1, 0, 0]], ['corrected', [0, 1, 0, 0]]], ['control [[1, 0, 0, 0, 1, 0, 0, 0]]', [[1, 0, 0, 0, 1, 0, 0, 0]], ['double', None]], ['control [[1, 0, 1, 0, 0, 1, 0, 1]]', [[1, 0, 1, 0, 0, 1, 0, 1]], ['clean', [0, 1, 0, 1]]], ['control [[1, 0, 1, 1, 0, 1, 1, 1]]', [[1, 0, 1, 1, 0, 1, 1, 1]], ['double', None]]], [['regression [[0, 1, 0, 0, 0, 1, 0, 1]]', [[0, 1, 0, 0, 0, 1, 0, 1]], ['corrected', [1, 1, 0, 1]]], ['regression [[0, 0, 0, 1, 0, 1, 1, 0]]', [[0, 0, 0, 1, 0, 1, 1, 0]], ['corrected', [1, 1, 1, 0]]], ['partial-repair [[1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 0, 1, 1, 1, 1]], ['corrected', [1, 1, 1, 1]]], ['partial-repair [[0, 0, 0, 0, 0, 0, 0, 1]]', [[0, 0, 0, 0, 0, 0, 0, 1]], ['corrected', [0, 0, 0, 0]]], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], ['clean', [0, 1, 1, 0]]], ['control [[0, 0, 1, 0, 0, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0]], ['double', None]], ['control [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], ['clean', [0, 1, 1, 1]]], ['control [[0, 0, 0, 0, 0, 1, 1, 0]]', [[0, 0, 0, 0, 0, 1, 1, 0]], ['double', None]]], [['regression [[1, 0, 0, 0, 0, 0, 0, 0]]', [[1, 0, 0, 0, 0, 0, 0, 0]], ['corrected', [0, 0, 0, 0]]], ['regression [[0, 0, 0, 0, 0, 0, 0, 1]]', [[0, 0, 0, 0, 0, 0, 0, 1]], ['corrected', [0, 0, 0, 0]]], ['partial-repair [[1, 0, 1, 0, 1, 1, 1, 0]]', [[1, 0, 1, 0, 1, 1, 1, 0]], ['corrected', [0, 0, 1, 0]]], ['partial-repair [[1, 0, 1, 0, 0, 1, 1, 1]]', [[1, 0, 1, 0, 0, 1, 1, 1]], ['corrected', [0, 1, 0, 1]]], ['control [[1, 1, 0, 1, 0, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 0, 0]], ['double', None]], ['control [[1, 0, 0, 1, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], ['clean', [1, 0, 0, 1]]], ['control [[1, 1, 0, 0, 1, 0, 0, 1]]', [[1, 1, 0, 0, 1, 0, 0, 1]], ['double', None]], ['control [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], ['clean', [1, 0, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[0, 1, 1, 0, 1, 1, 0, 1]] | ['corrected', [0, 1, 0, 1]] | ['corrected', [0, 0, 0, 1]] | Failed |
| regression [[1, 0, 1, 0, 1, 1, 1, 0]] | ['corrected', [0, 1, 1, 0]] | ['corrected', [0, 0, 1, 0]] | Failed |
| control [[0, 0, 0, 0, 0, 0, 0, 0]] | ['clean', [0, 0, 0, 0]] | ['clean', [0, 0, 0, 0]] | Passed |
| control [[0, 1, 0, 0, 0, 0, 0, 0]] | ['corrected', [0, 0, 0, 0]] | ['corrected', [0, 0, 0, 0]] | Passed |
| control [[0, 0, 0, 0, 0, 0, 1, 1]] | ['double', None] | ['double', None] | Passed |
| control [[0, 1, 1, 0, 1, 0, 0, 1]] | ['clean', [0, 0, 0, 1]] | ['clean', [0, 0, 0, 1]] | Passed |
| control [[0, 1, 0, 1, 1, 0, 0, 1]] | ['double', None] | ['double', None] | Passed |
| control [[1, 0, 1, 0, 1, 0, 1, 0]] | ['clean', [0, 0, 1, 0]] | ['clean', [0, 0, 1, 0]] | Passed |
SHA-256 / baefb946d5b4413bd520500cc2550adfd3ed3bbd9a9ea91d0c8c91373a3c97a3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
if len(r) != 8 or any(b not in (0, 1) for b in r):
return None
s = 0
for pos in range(1, 8):
if r[pos]:
s ^= pos
p = sum(r) % 2
c = list(r)
if s == 0 and p == 0:
status = 'clean'
elif p == 1:
status = 'corrected'
c[s] ^= 1
else:
return ['double', None]
return [status, [c[3], c[5], c[6], c[7]]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 1, 0, 1, 1, 0, 1]]', [[0, 1, 1, 0, 1, 1, 0, 1]], ['corrected', [0, 0, 0, 1]]], ['regression [[1, 0, 1, 0, 1, 1, 1, 0]]', [[1, 0, 1, 0, 1, 1, 1, 0]], ['corrected', [0, 0, 1, 0]]], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], ['clean', [0, 0, 0, 0]]], ['control [[0, 1, 0, 0, 0, 0, 0, 0]]', [[0, 1, 0, 0, 0, 0, 0, 0]], ['corrected', [0, 0, 0, 0]]], ['control [[0, 0, 0, 0, 0, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1]], ['double', None]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], ['clean', [0, 0, 0, 1]]], ['control [[0, 1, 0, 1, 1, 0, 0, 1]]', [[0, 1, 0, 1, 1, 0, 0, 1]], ['double', None]], ['control [[1, 0, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], ['clean', [0, 0, 1, 0]]]], [['regression [[0, 1, 1, 0, 0, 0, 1, 0]]', [[0, 1, 1, 0, 0, 0, 1, 0]], ['corrected', [0, 1, 1, 0]]], ['regression [[0, 0, 0, 0, 1, 1, 1, 0]]', [[0, 0, 0, 0, 1, 1, 1, 0]], ['corrected', [0, 1, 1, 1]]], ['control [[1, 0, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], ['clean', [0, 0, 1, 0]]], ['control [[1, 0, 0, 1, 1, 0, 1, 0]]', [[1, 0, 0, 1, 1, 0, 1, 0]], ['double', None]], ['control [[1, 1, 0, 0, 0, 0, 1, 1]]', [[1, 1, 0, 0, 0, 0, 1, 1]], ['clean', [0, 0, 1, 1]]], ['control [[1, 1, 1, 0, 0, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 1, 1]], ['corrected', [0, 0, 1, 1]]], ['control [[1, 1, 0, 1, 0, 0, 0, 1]]', [[1, 1, 0, 1, 0, 0, 0, 1]], ['double', None]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], ['clean', [0, 1, 0, 0]]]], [['regression [[1, 0, 0, 1, 1, 0, 0, 0]]', [[1, 0, 0, 1, 1, 0, 0, 0]], ['corrected', [1, 0, 0, 1]]], ['regression [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], ['corrected', [1, 0, 1, 0]]], ['partial-repair [[0, 0, 1, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 0, 1, 1, 1]], ['corrected', [1, 0, 1, 1]]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], ['clean', [0, 1, 0, 0]]], ['control [[1, 1, 1, 0, 1, 1, 0, 0]]', [[1, 1, 1, 0, 1, 1, 0, 0]], ['corrected', [0, 1, 0, 0]]], ['control [[1, 0, 0, 0, 1, 0, 0, 0]]', [[1, 0, 0, 0, 1, 0, 0, 0]], ['double', None]], ['control [[1, 0, 1, 0, 0, 1, 0, 1]]', [[1, 0, 1, 0, 0, 1, 0, 1]], ['clean', [0, 1, 0, 1]]], ['control [[1, 0, 1, 1, 0, 1, 1, 1]]', [[1, 0, 1, 1, 0, 1, 1, 1]], ['double', None]]], [['regression [[0, 1, 0, 0, 0, 1, 0, 1]]', [[0, 1, 0, 0, 0, 1, 0, 1]], ['corrected', [1, 1, 0, 1]]], ['regression [[0, 0, 0, 1, 0, 1, 1, 0]]', [[0, 0, 0, 1, 0, 1, 1, 0]], ['corrected', [1, 1, 1, 0]]], ['partial-repair [[1, 1, 1, 0, 1, 1, 1, 1]]', [[1, 1, 1, 0, 1, 1, 1, 1]], ['corrected', [1, 1, 1, 1]]], ['partial-repair [[0, 0, 0, 0, 0, 0, 0, 1]]', [[0, 0, 0, 0, 0, 0, 0, 1]], ['corrected', [0, 0, 0, 0]]], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], ['clean', [0, 1, 1, 0]]], ['control [[0, 0, 1, 0, 0, 0, 1, 0]]', [[0, 0, 1, 0, 0, 0, 1, 0]], ['double', None]], ['control [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], ['clean', [0, 1, 1, 1]]], ['control [[0, 0, 0, 0, 0, 1, 1, 0]]', [[0, 0, 0, 0, 0, 1, 1, 0]], ['double', None]]], [['regression [[1, 0, 0, 0, 0, 0, 0, 0]]', [[1, 0, 0, 0, 0, 0, 0, 0]], ['corrected', [0, 0, 0, 0]]], ['regression [[0, 0, 0, 0, 0, 0, 0, 1]]', [[0, 0, 0, 0, 0, 0, 0, 1]], ['corrected', [0, 0, 0, 0]]], ['partial-repair [[1, 0, 1, 0, 1, 1, 1, 0]]', [[1, 0, 1, 0, 1, 1, 1, 0]], ['corrected', [0, 0, 1, 0]]], ['partial-repair [[1, 0, 1, 0, 0, 1, 1, 1]]', [[1, 0, 1, 0, 0, 1, 1, 1]], ['corrected', [0, 1, 0, 1]]], ['control [[1, 1, 0, 1, 0, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 0, 0]], ['double', None]], ['control [[1, 0, 0, 1, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], ['clean', [1, 0, 0, 1]]], ['control [[1, 1, 0, 0, 1, 0, 0, 1]]', [[1, 1, 0, 0, 1, 0, 0, 1]], ['double', None]], ['control [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], ['clean', [1, 0, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[0, 1, 1, 0, 1, 1, 0, 1]] | ['corrected', [0, 0, 0, 1]] | ['corrected', [0, 0, 0, 1]] | Passed |
| regression [[1, 0, 1, 0, 1, 1, 1, 0]] | ['corrected', [0, 0, 1, 0]] | ['corrected', [0, 0, 1, 0]] | Passed |
| control [[0, 0, 0, 0, 0, 0, 0, 0]] | ['clean', [0, 0, 0, 0]] | ['clean', [0, 0, 0, 0]] | Passed |
| control [[0, 1, 0, 0, 0, 0, 0, 0]] | ['corrected', [0, 0, 0, 0]] | ['corrected', [0, 0, 0, 0]] | Passed |
| control [[0, 0, 0, 0, 0, 0, 1, 1]] | ['double', None] | ['double', None] | Passed |
| control [[0, 1, 1, 0, 1, 0, 0, 1]] | ['clean', [0, 0, 0, 1]] | ['clean', [0, 0, 0, 1]] | Passed |
| control [[0, 1, 0, 1, 1, 0, 0, 1]] | ['double', None] | ['double', None] | Passed |
| control [[1, 0, 1, 0, 1, 0, 1, 0]] | ['clean', [0, 0, 1, 0]] | ['clean', [0, 0, 1, 0]] | Passed |
SHA-256 / 545cf636fa4568e54f83d4a060956968722c3abd7cb3d6520198de32435d33e0
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.569145+00:00.
Case digest / 10b99e2ba093870e40a7e17062af6f764d7601d64383c3a1d2b4c1f213dff465