FA-72071 / Error-correcting codes / Open access
Reed-Muller decoder correlates raw bits · case 01
Decoded messages are wrong because correlations are not symmetric around zero.
ROOT CAUSE
The received bits are fed as 0/1 values instead of the bipolar map 1 - 2b.
VERIFIED REPAIR
Map bit 0 to +1 and bit 1 to -1 before the transform.
Unsuccessful approach: Using 2b - 1 flips every correlation sign and inverts m0.
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 = list(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, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['regression [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 0, 1, 0, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 0, 1]], [[0, 0, 0, 1], 8]], ['control [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['control [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['control [[0, 0, 1, 1, 0, 0, 0, 1]]', [[0, 0, 1, 1, 0, 0, 0, 1]], [[0, 0, 1, 0], 6]], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]]], [['regression [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['regression [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]], ['control [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['control [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 0], 8]], ['control [[0, 0, 0, 1, 1, 1, 1, 1]]', [[0, 0, 0, 1, 1, 1, 1, 1]], [[0, 1, 0, 0], 6]], ['control [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]]], [['regression [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]], ['regression [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], [[0, 1, 0, 1], 6]], ['control [[0, 0, 1, 1, 1, 1, 0, 0]]', [[0, 0, 1, 1, 1, 1, 0, 0]], [[0, 1, 1, 0], 8]], ['control [[0, 0, 1, 1, 1, 1, 1, 0]]', [[0, 0, 1, 1, 1, 1, 1, 0]], [[0, 1, 1, 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 [[0, 0, 0, 1, 1, 1, 1, 1]]', [[0, 0, 0, 1, 1, 1, 1, 1]], [[0, 1, 0, 0], 6]], ['regression [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['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, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 8]], ['control [[0, 0, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 6]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], [[1, 0, 1, 0], 8]]], [['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]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[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, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], [[1, 0, 1, 1], 8]], ['control [[1, 0, 0, 1, 1, 1, 0, 1]]', [[1, 0, 0, 1, 1, 1, 0, 1]], [[1, 0, 1, 1], 6]], ['control [[1, 1, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 8]], ['control [[0, 1, 1, 1, 0, 0, 0, 0]]', [[0, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 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, 0, 0, 0, 0, 0, 0, 0]] | [[1, 0, 0, 0], 0] | [[0, 0, 0, 0], 8] | Failed |
| regression [[0, 0, 0, 0, 0, 0, 1, 0]] | [[0, 0, 0, 0], 1] | [[0, 0, 0, 0], 6] | Failed |
| control [[0, 1, 2, 0, 0, 0, 0, 0]] | None | None | Passed |
| control [[0, 1, 0, 1, 0, 1, 0, 1]] | [[0, 0, 0, 0], 4] | [[0, 0, 0, 1], 8] | Failed |
| control [[0, 1, 0, 1, 0, 1, 0, 0]] | [[0, 0, 0, 0], 3] | [[0, 0, 0, 1], 6] | Failed |
| control [[0, 0, 1, 1, 0, 0, 1, 1]] | [[0, 0, 0, 0], 4] | [[0, 0, 1, 0], 8] | Failed |
| control [[0, 0, 1, 1, 0, 0, 0, 1]] | [[0, 0, 0, 0], 3] | [[0, 0, 1, 0], 6] | Failed |
| control [[0, 1, 1, 0, 0, 1, 1, 0]] | [[0, 0, 0, 0], 4] | [[0, 0, 1, 1], 8] | Failed |
SHA-256 / de2acbb92fec3eea6f6ef3fd9904e439cad138db06b9dba772a7355f27e3699e
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 = [2 * b - 1 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, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['regression [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 0, 1, 0, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 0, 1]], [[0, 0, 0, 1], 8]], ['control [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['control [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['control [[0, 0, 1, 1, 0, 0, 0, 1]]', [[0, 0, 1, 1, 0, 0, 0, 1]], [[0, 0, 1, 0], 6]], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]]], [['regression [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['regression [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]], ['control [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['control [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 0], 8]], ['control [[0, 0, 0, 1, 1, 1, 1, 1]]', [[0, 0, 0, 1, 1, 1, 1, 1]], [[0, 1, 0, 0], 6]], ['control [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]]], [['regression [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]], ['regression [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], [[0, 1, 0, 1], 6]], ['control [[0, 0, 1, 1, 1, 1, 0, 0]]', [[0, 0, 1, 1, 1, 1, 0, 0]], [[0, 1, 1, 0], 8]], ['control [[0, 0, 1, 1, 1, 1, 1, 0]]', [[0, 0, 1, 1, 1, 1, 1, 0]], [[0, 1, 1, 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 [[0, 0, 0, 1, 1, 1, 1, 1]]', [[0, 0, 0, 1, 1, 1, 1, 1]], [[0, 1, 0, 0], 6]], ['regression [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['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, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 8]], ['control [[0, 0, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 6]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], [[1, 0, 1, 0], 8]]], [['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]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[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, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], [[1, 0, 1, 1], 8]], ['control [[1, 0, 0, 1, 1, 1, 0, 1]]', [[1, 0, 0, 1, 1, 1, 0, 1]], [[1, 0, 1, 1], 6]], ['control [[1, 1, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 8]], ['control [[0, 1, 1, 1, 0, 0, 0, 0]]', [[0, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 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, 0, 0, 0, 0, 0, 0, 0]] | [[1, 0, 0, 0], 8] | [[0, 0, 0, 0], 8] | Failed |
| regression [[0, 0, 0, 0, 0, 0, 1, 0]] | [[1, 0, 0, 0], 6] | [[0, 0, 0, 0], 6] | Failed |
| control [[0, 1, 2, 0, 0, 0, 0, 0]] | None | None | Passed |
| control [[0, 1, 0, 1, 0, 1, 0, 1]] | [[1, 0, 0, 1], 8] | [[0, 0, 0, 1], 8] | Failed |
| control [[0, 1, 0, 1, 0, 1, 0, 0]] | [[1, 0, 0, 1], 6] | [[0, 0, 0, 1], 6] | Failed |
| control [[0, 0, 1, 1, 0, 0, 1, 1]] | [[1, 0, 1, 0], 8] | [[0, 0, 1, 0], 8] | Failed |
| control [[0, 0, 1, 1, 0, 0, 0, 1]] | [[1, 0, 1, 0], 6] | [[0, 0, 1, 0], 6] | Failed |
| control [[0, 1, 1, 0, 0, 1, 1, 0]] | [[1, 0, 1, 1], 8] | [[0, 0, 1, 1], 8] | Failed |
SHA-256 / cd7b6081f90c0d901c57fb37608a101e9c71c52e63fc49b311c263c2f8b97ac9
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, 0, 0, 0, 0, 0, 0, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0], 8]], ['regression [[0, 0, 0, 0, 0, 0, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 0]], [[0, 0, 0, 0], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 0, 1, 0, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 0, 1]], [[0, 0, 0, 1], 8]], ['control [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['control [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['control [[0, 0, 1, 1, 0, 0, 0, 1]]', [[0, 0, 1, 1, 0, 0, 0, 1]], [[0, 0, 1, 0], 6]], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]]], [['regression [[0, 1, 0, 1, 0, 1, 0, 0]]', [[0, 1, 0, 1, 0, 1, 0, 0]], [[0, 0, 0, 1], 6]], ['regression [[0, 0, 1, 1, 0, 0, 1, 1]]', [[0, 0, 1, 1, 0, 0, 1, 1]], [[0, 0, 1, 0], 8]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]], ['control [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['control [[0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 0], 8]], ['control [[0, 0, 0, 1, 1, 1, 1, 1]]', [[0, 0, 0, 1, 1, 1, 1, 1]], [[0, 1, 0, 0], 6]], ['control [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]]], [['regression [[0, 1, 1, 0, 0, 1, 1, 0]]', [[0, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 8]], ['regression [[1, 1, 1, 0, 0, 1, 1, 0]]', [[1, 1, 1, 0, 0, 1, 1, 0]], [[0, 0, 1, 1], 6]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[0, 1, 0, 0, 1, 0, 1, 0]]', [[0, 1, 0, 0, 1, 0, 1, 0]], [[0, 1, 0, 1], 6]], ['control [[0, 0, 1, 1, 1, 1, 0, 0]]', [[0, 0, 1, 1, 1, 1, 0, 0]], [[0, 1, 1, 0], 8]], ['control [[0, 0, 1, 1, 1, 1, 1, 0]]', [[0, 0, 1, 1, 1, 1, 1, 0]], [[0, 1, 1, 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 [[0, 0, 0, 1, 1, 1, 1, 1]]', [[0, 0, 0, 1, 1, 1, 1, 1]], [[0, 1, 0, 0], 6]], ['regression [[0, 1, 0, 1, 1, 0, 1, 0]]', [[0, 1, 0, 1, 1, 0, 1, 0]], [[0, 1, 0, 1], 8]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['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, 1, 0, 1, 0, 1, 0]]', [[1, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 8]], ['control [[0, 0, 1, 0, 1, 0, 1, 0]]', [[0, 0, 1, 0, 1, 0, 1, 0]], [[1, 0, 0, 1], 6]], ['control [[1, 1, 0, 0, 1, 1, 0, 0]]', [[1, 1, 0, 0, 1, 1, 0, 0]], [[1, 0, 1, 0], 8]]], [['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]], ['control [[0, 1, 2, 0, 0, 0, 0, 0]]', [[0, 1, 2, 0, 0, 0, 0, 0]], None], ['control [[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, 1, 0, 0, 1]]', [[1, 0, 0, 1, 1, 0, 0, 1]], [[1, 0, 1, 1], 8]], ['control [[1, 0, 0, 1, 1, 1, 0, 1]]', [[1, 0, 0, 1, 1, 1, 0, 1]], [[1, 0, 1, 1], 6]], ['control [[1, 1, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 8]], ['control [[0, 1, 1, 1, 0, 0, 0, 0]]', [[0, 1, 1, 1, 0, 0, 0, 0]], [[1, 1, 0, 0], 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, 0, 0, 0, 0, 0, 0, 0]] | [[0, 0, 0, 0], 8] | [[0, 0, 0, 0], 8] | Passed |
| regression [[0, 0, 0, 0, 0, 0, 1, 0]] | [[0, 0, 0, 0], 6] | [[0, 0, 0, 0], 6] | Passed |
| control [[0, 1, 2, 0, 0, 0, 0, 0]] | None | None | Passed |
| control [[0, 1, 0, 1, 0, 1, 0, 1]] | [[0, 0, 0, 1], 8] | [[0, 0, 0, 1], 8] | Passed |
| control [[0, 1, 0, 1, 0, 1, 0, 0]] | [[0, 0, 0, 1], 6] | [[0, 0, 0, 1], 6] | Passed |
| control [[0, 0, 1, 1, 0, 0, 1, 1]] | [[0, 0, 1, 0], 8] | [[0, 0, 1, 0], 8] | Passed |
| control [[0, 0, 1, 1, 0, 0, 0, 1]] | [[0, 0, 1, 0], 6] | [[0, 0, 1, 0], 6] | Passed |
| control [[0, 1, 1, 0, 0, 1, 1, 0]] | [[0, 0, 1, 1], 8] | [[0, 0, 1, 1], 8] | Passed |
SHA-256 / c4692736b7a51919fd22a5dee898970872fa8dd4bb3b868321e6dc3a1cc0a55d
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.303184+00:00.
Case digest / 7f05ce6b673cc7a3b565f79afa80de95b459f4f972d8fb0c670353bf024f13d5