FA-72086 / Error-correcting codes / Open access
Reed-Muller decoder reads the index bits little-endian · case 01
m1 and m3 come back swapped.
ROOT CAUSE
The message bits are taken from u starting at the least-significant bit.
VERIFIED REPAIR
m1 is bit 2 of u, m2 bit 1, m3 bit 0.
Unsuccessful approach: Swapping only m1 and m2 still misassigns two bits.
Case contract
Maximum-likelihood decoding of the first-order Reed-Muller code RM(1,3) by fast Hadamard transform. Codeword bit x (0..7) is m0 ^ m1*x2 ^ m2*x1 ^ m3*x0 where x2 x1 x0 are the bits of x. Map bit b to 1 - 2b, transform, pick u with the largest |W[u]| (smallest u on ties); m1 m2 m3 are the bits of u from the top, m0 = 0 when W[u] > 0 else 1. Return [[m0, m1, m2, m3], |W[u]|]; invalid input returns None.
Why this case matters
Deep-space and control channels use RM(1,m) codes decoded with the Hadamard transform.
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
W = [1 - 2 * b for b in r]
h = 1
while h < 8:
for i in range(0, 8, 2 * h):
for j in range(i, i + h):
a, b = W[j], W[j + h]
W[j], W[j + h] = a + b, a - b
h *= 2
best = 0
for u in range(1, 8):
if abs(W[u]) > abs(W[best]):
best = u
m0 = 0 if W[best] > 0 else 1
return [[m0, best & 1, (best >> 1) & 1, (best >> 2) & 1], abs(W[best])]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 0, 1, 0, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 0, 1]], [[0, 0, 0, 1], 8]], ['regression [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['partial-repair [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['partial-repair [[0, 0, 1, 1, 0, 0, 0, 1]]', [[0, 0, 1, 1, 0, 0, 0, 1]], [[0, 0, 1, 0], 6]], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]]], [['regression [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['regression [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 0], 8]], ['control [[1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]]], [['regression [[0, 0, 1, 1, 1, 1, 0, 0]]', [[0, 0, 1, 1, 1, 1, 0, 0]], [[0, 1, 1, 0], 8]], ['regression [[0, 0, 1, 1, 1, 1, 1, 0]]', [[0, 0, 1, 1, 1, 1, 1, 0]], [[0, 1, 1, 0], 6]], ['partial-repair [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]], ['partial-repair [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], [[0, 1, 0, 1], 6]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]], ['control [[1, 1, 1, 1, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 8]]], [['regression [[0, 0, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 6]], ['regression [[1, 0, 0, 1, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], [[1, 0, 1, 1], 8]], ['partial-repair [[0, 1, 0, 0, 1, 1, 0, 0]]', [[0, 1, 0, 0, 1, 1, 0, 0]], [[1, 0, 1, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]]], [['regression [[1, 1, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 8]], ['regression [[0, 1, 1, 1, 0, 0, 0, 0]]', [[0, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]], ['control [[1, 1, 1, 1, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 8]], ['control [[1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]]]]
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, 0, 1, 0, 1, 0, 1]] | [[0, 1, 0, 0], 8] | [[0, 0, 0, 1], 8] | Failed |
| regression [[0, 1, 0, 1, 0, 1, 0, 0]] | [[0, 1, 0, 0], 6] | [[0, 0, 0, 1], 6] | Failed |
| partial-repair [[0, 0, 1, 1, 0, 0, 1, 1]] | [[0, 0, 1, 0], 8] | [[0, 0, 1, 0], 8] | Passed |
| partial-repair [[0, 0, 1, 1, 0, 0, 0, 1]] | [[0, 0, 1, 0], 6] | [[0, 0, 1, 0], 6] | Passed |
| control [[0, 0, 0, 0, 0, 0, 0, 0]] | [[0, 0, 0, 0], 8] | [[0, 0, 0, 0], 8] | Passed |
| control [[0, 0, 0, 0, 0, 0, 1, 0]] | [[0, 0, 0, 0], 6] | [[0, 0, 0, 0], 6] | Passed |
| control [[0, 1, 1, 0, 1, 0, 0, 1]] | [[0, 1, 1, 1], 8] | [[0, 1, 1, 1], 8] | Passed |
| control [[0, 1, 1, 0, 1, 0, 1, 1]] | [[0, 1, 1, 1], 6] | [[0, 1, 1, 1], 6] | Passed |
SHA-256 / 0a2e4ebcc82d2de5bd07f5516682a1e5a07a5f313fe3e99f972d58df5e63bf9d
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
W = [1 - 2 * b for b in r]
h = 1
while h < 8:
for i in range(0, 8, 2 * h):
for j in range(i, i + h):
a, b = W[j], W[j + h]
W[j], W[j + h] = a + b, a - b
h *= 2
best = 0
for u in range(1, 8):
if abs(W[u]) > abs(W[best]):
best = u
m0 = 0 if W[best] > 0 else 1
return [[m0, (best >> 1) & 1, (best >> 2) & 1, best & 1], abs(W[best])]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 0, 1, 0, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 0, 1]], [[0, 0, 0, 1], 8]], ['regression [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['partial-repair [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['partial-repair [[0, 0, 1, 1, 0, 0, 0, 1]]', [[0, 0, 1, 1, 0, 0, 0, 1]], [[0, 0, 1, 0], 6]], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]]], [['regression [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['regression [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 0], 8]], ['control [[1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]]], [['regression [[0, 0, 1, 1, 1, 1, 0, 0]]', [[0, 0, 1, 1, 1, 1, 0, 0]], [[0, 1, 1, 0], 8]], ['regression [[0, 0, 1, 1, 1, 1, 1, 0]]', [[0, 0, 1, 1, 1, 1, 1, 0]], [[0, 1, 1, 0], 6]], ['partial-repair [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]], ['partial-repair [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], [[0, 1, 0, 1], 6]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]], ['control [[1, 1, 1, 1, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 8]]], [['regression [[0, 0, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 6]], ['regression [[1, 0, 0, 1, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], [[1, 0, 1, 1], 8]], ['partial-repair [[0, 1, 0, 0, 1, 1, 0, 0]]', [[0, 1, 0, 0, 1, 1, 0, 0]], [[1, 0, 1, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]]], [['regression [[1, 1, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 8]], ['regression [[0, 1, 1, 1, 0, 0, 0, 0]]', [[0, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]], ['control [[1, 1, 1, 1, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 8]], ['control [[1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]]]]
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, 0, 1, 0, 1, 0, 1]] | [[0, 0, 0, 1], 8] | [[0, 0, 0, 1], 8] | Passed |
| regression [[0, 1, 0, 1, 0, 1, 0, 0]] | [[0, 0, 0, 1], 6] | [[0, 0, 0, 1], 6] | Passed |
| partial-repair [[0, 0, 1, 1, 0, 0, 1, 1]] | [[0, 1, 0, 0], 8] | [[0, 0, 1, 0], 8] | Failed |
| partial-repair [[0, 0, 1, 1, 0, 0, 0, 1]] | [[0, 1, 0, 0], 6] | [[0, 0, 1, 0], 6] | Failed |
| control [[0, 0, 0, 0, 0, 0, 0, 0]] | [[0, 0, 0, 0], 8] | [[0, 0, 0, 0], 8] | Passed |
| control [[0, 0, 0, 0, 0, 0, 1, 0]] | [[0, 0, 0, 0], 6] | [[0, 0, 0, 0], 6] | Passed |
| control [[0, 1, 1, 0, 1, 0, 0, 1]] | [[0, 1, 1, 1], 8] | [[0, 1, 1, 1], 8] | Passed |
| control [[0, 1, 1, 0, 1, 0, 1, 1]] | [[0, 1, 1, 1], 6] | [[0, 1, 1, 1], 6] | Passed |
SHA-256 / 1217b2ace4b9df700bc26914620bad45688960652cea014521b46ee913511640
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
W = [1 - 2 * b for b in r]
h = 1
while h < 8:
for i in range(0, 8, 2 * h):
for j in range(i, i + h):
a, b = W[j], W[j + h]
W[j], W[j + h] = a + b, a - b
h *= 2
best = 0
for u in range(1, 8):
if abs(W[u]) > abs(W[best]):
best = u
m0 = 0 if W[best] > 0 else 1
return [[m0, (best >> 2) & 1, (best >> 1) & 1, best & 1], abs(W[best])]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[0, 1, 0, 1, 0, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 0, 1]], [[0, 0, 0, 1], 8]], ['regression [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['partial-repair [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['partial-repair [[0, 0, 1, 1, 0, 0, 0, 1]]', [[0, 0, 1, 1, 0, 0, 0, 1]], [[0, 0, 1, 0], 6]], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]]], [['regression [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['regression [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 0], 8]], ['control [[1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]]], [['regression [[0, 0, 1, 1, 1, 1, 0, 0]]', [[0, 0, 1, 1, 1, 1, 0, 0]], [[0, 1, 1, 0], 8]], ['regression [[0, 0, 1, 1, 1, 1, 1, 0]]', [[0, 0, 1, 1, 1, 1, 1, 0]], [[0, 1, 1, 0], 6]], ['partial-repair [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]], ['partial-repair [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], [[0, 1, 0, 1], 6]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]], ['control [[1, 1, 1, 1, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 8]]], [['regression [[0, 0, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 6]], ['regression [[1, 0, 0, 1, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], [[1, 0, 1, 1], 8]], ['partial-repair [[0, 1, 0, 0, 1, 1, 0, 0]]', [[0, 1, 0, 0, 1, 1, 0, 0]], [[1, 0, 1, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['control [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]]], [['regression [[1, 1, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 8]], ['regression [[0, 1, 1, 1, 0, 0, 0, 0]]', [[0, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 6]], ['control [[0, 1, 1, 0, 1, 0, 0, 1]]', [[0, 1, 1, 0, 1, 0, 0, 1]], [[0, 1, 1, 1], 8]], ['control [[0, 1, 1, 0, 1, 0, 1, 1]]', [[0, 1, 1, 0, 1, 0, 1, 1]], [[0, 1, 1, 1], 6]], ['control [[1, 1, 1, 1, 1, 1, 1, 1]]', [[1, 1, 1, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 8]], ['control [[1, 1, 0, 1, 1, 1, 1, 1]]', [[1, 1, 0, 1, 1, 1, 1, 1]], [[1, 0, 0, 0], 6]], ['control [[1, 0, 0, 1, 0, 1, 1, 0]]', [[1, 0, 0, 1, 0, 1, 1, 0]], [[1, 1, 1, 1], 8]], ['control [[1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 0, 0, 1, 0, 1, 0, 0]], [[1, 1, 1, 1], 6]]]]
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, 0, 1, 0, 1, 0, 1]] | [[0, 0, 0, 1], 8] | [[0, 0, 0, 1], 8] | Passed |
| regression [[0, 1, 0, 1, 0, 1, 0, 0]] | [[0, 0, 0, 1], 6] | [[0, 0, 0, 1], 6] | Passed |
| partial-repair [[0, 0, 1, 1, 0, 0, 1, 1]] | [[0, 0, 1, 0], 8] | [[0, 0, 1, 0], 8] | Passed |
| partial-repair [[0, 0, 1, 1, 0, 0, 0, 1]] | [[0, 0, 1, 0], 6] | [[0, 0, 1, 0], 6] | Passed |
| control [[0, 0, 0, 0, 0, 0, 0, 0]] | [[0, 0, 0, 0], 8] | [[0, 0, 0, 0], 8] | Passed |
| control [[0, 0, 0, 0, 0, 0, 1, 0]] | [[0, 0, 0, 0], 6] | [[0, 0, 0, 0], 6] | Passed |
| control [[0, 1, 1, 0, 1, 0, 0, 1]] | [[0, 1, 1, 1], 8] | [[0, 1, 1, 1], 8] | Passed |
| control [[0, 1, 1, 0, 1, 0, 1, 1]] | [[0, 1, 1, 1], 6] | [[0, 1, 1, 1], 6] | Passed |
SHA-256 / 375c4bb4619a3f68173cc613bd40154a8cb8a4163e22a45fe235d831c704be7b
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.388714+00:00.
Case digest / 657e68e5e26bd8c7f7ad3685db632e9ff897387c972f7538ef2ef79f27e3cede