FA-72131 / Error-correcting codes / Open access
Code capability claims d detectable errors · case 01
Detection capability is overstated by one.
ROOT CAUSE
Detection is reported as d; d errors can turn one codeword into another.
VERIFIED REPAIR
Report d - 1 detectable errors.
Unsuccessful approach: Reporting 2t equals d - 1 only for odd distances.
Case contract
Given a block code as a list of equal-length codewords (duplicates allowed but ignored; fewer than two distinct words or unequal lengths return None), compute the minimum Hamming distance d, the guaranteed correction capability t = floor((d-1)/2), detection capability d-1, and whether a pattern of the given errors and erasures is decodable (2*errors + erasures < d). Return [d, t, detect, decodable].
Why this case matters
Link and storage designers budget error and erasure correction from the minimum distance.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codewords, errors, erasures):
words = [tuple(w) for w in codewords]
if len(set(words)) < 2 or len({len(w) for w in words}) != 1:
return None
uniq = sorted(set(words))
d = min(sum(a != b for a, b in zip(u, v)) for i, u in enumerate(uniq) for v in uniq[i + 1:])
return [d, (d - 1) // 2, d, 2 * errors + erasures < d]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0]', [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0], [1, 0, 0, True]], ['regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1...', [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1]], 1, 2], [1, 0, 0, False]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0]], 2, 3], [2, 0, 1, False]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1]], 1, 0], [2, 0, 1, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]]], [['regression [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1]], 1, 0], [2, 0, 1, False]], ['regression [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['partial-repair [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1]], 0, 3], [2, 0, 1, False]], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1]], 0, 0], [2, 0, 1, True]], ['control [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1]], 1, 3]', [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1]], 1, 3], [1, 0, 0, False]]], [['regression [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1]], 0, 3], [2, 0, 1, False]], ['regression [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1]], 0, 0], [2, 0, 1, True]], ['partial-repair [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0]], 0, 2], [2, 0, 1, False]], ['partial-repair [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0]], 1, 2], [2, 0, 1, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0]], 2, 1]', [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0]], 2, 1], [5, 2, 4, False]], ['control [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1]], 1, 0]', [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1]], 1, 0], [5, 2, 4, True]]], [['regression [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 1]], 1, 0]', [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 1]], 1, 0], [1, 0, 0, False]], ['regression [[[0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, ...', [[[0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, 1], [1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 3], [1, 0, 0, False]], ['partial-repair [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3], [4, 1, 3, True]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0]], 2, 3], [2, 0, 1, False]], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]], ['control [[[0, 0, 0], [1, 1, 1]], 1, 1]', [[[0, 0, 0], [1, 1, 1]], 1, 1], [3, 1, 2, False]]], [['regression [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0]], 0, 2], [2, 0, 1, False]], ['regression [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0]], 1, 2], [2, 0, 1, False]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, ...', [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1]], 1, 0], [3, 1, 2, True]], ['control [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, ...', [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1]], 1, 1], [3, 1, 2, False]]]]
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 [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0] | [1, 0, 1, True] | [1, 0, 0, True] | Failed |
| regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1... | [1, 0, 1, False] | [1, 0, 0, False] | Failed |
| partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 0, 2, False] | [2, 0, 1, False] | Failed |
| partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 0, 2, False] | [2, 0, 1, False] | Failed |
| control [[[0, 1], [0, 1]], 0, 0] | None | None | Passed |
| control [[[0, 1], [1, 0, 1]], 0, 0] | None | None | Passed |
| control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ... | [4, 1, 4, True] | [4, 1, 3, True] | Failed |
| control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ... | [4, 1, 4, False] | [4, 1, 3, False] | Failed |
SHA-256 / d2cd7337e99dd112d32a645c1612cc3c40d39cd39319dc24fe167afc1cc2d5b0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codewords, errors, erasures):
words = [tuple(w) for w in codewords]
if len(set(words)) < 2 or len({len(w) for w in words}) != 1:
return None
uniq = sorted(set(words))
d = min(sum(a != b for a, b in zip(u, v)) for i, u in enumerate(uniq) for v in uniq[i + 1:])
return [d, (d - 1) // 2, 2 * ((d - 1) // 2), 2 * errors + erasures < d]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0]', [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0], [1, 0, 0, True]], ['regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1...', [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1]], 1, 2], [1, 0, 0, False]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0]], 2, 3], [2, 0, 1, False]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1]], 1, 0], [2, 0, 1, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]]], [['regression [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1]], 1, 0], [2, 0, 1, False]], ['regression [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['partial-repair [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1]], 0, 3], [2, 0, 1, False]], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1]], 0, 0], [2, 0, 1, True]], ['control [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1]], 1, 3]', [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1]], 1, 3], [1, 0, 0, False]]], [['regression [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1]], 0, 3], [2, 0, 1, False]], ['regression [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1]], 0, 0], [2, 0, 1, True]], ['partial-repair [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0]], 0, 2], [2, 0, 1, False]], ['partial-repair [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0]], 1, 2], [2, 0, 1, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0]], 2, 1]', [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0]], 2, 1], [5, 2, 4, False]], ['control [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1]], 1, 0]', [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1]], 1, 0], [5, 2, 4, True]]], [['regression [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 1]], 1, 0]', [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 1]], 1, 0], [1, 0, 0, False]], ['regression [[[0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, ...', [[[0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, 1], [1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 3], [1, 0, 0, False]], ['partial-repair [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3], [4, 1, 3, True]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0]], 2, 3], [2, 0, 1, False]], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]], ['control [[[0, 0, 0], [1, 1, 1]], 1, 1]', [[[0, 0, 0], [1, 1, 1]], 1, 1], [3, 1, 2, False]]], [['regression [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0]], 0, 2], [2, 0, 1, False]], ['regression [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0]], 1, 2], [2, 0, 1, False]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, ...', [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1]], 1, 0], [3, 1, 2, True]], ['control [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, ...', [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1]], 1, 1], [3, 1, 2, False]]]]
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 [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0] | [1, 0, 0, True] | [1, 0, 0, True] | Passed |
| regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1... | [1, 0, 0, False] | [1, 0, 0, False] | Passed |
| partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 0, 0, False] | [2, 0, 1, False] | Failed |
| partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 0, 0, False] | [2, 0, 1, False] | Failed |
| control [[[0, 1], [0, 1]], 0, 0] | None | None | Passed |
| control [[[0, 1], [1, 0, 1]], 0, 0] | None | None | Passed |
| control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ... | [4, 1, 2, True] | [4, 1, 3, True] | Failed |
| control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ... | [4, 1, 2, False] | [4, 1, 3, False] | Failed |
SHA-256 / 4556b251c23a86988c9d0d37e4299a2b342361bce88ab26c148e09e5f2ddcecb
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codewords, errors, erasures):
words = [tuple(w) for w in codewords]
if len(set(words)) < 2 or len({len(w) for w in words}) != 1:
return None
uniq = sorted(set(words))
d = min(sum(a != b for a, b in zip(u, v)) for i, u in enumerate(uniq) for v in uniq[i + 1:])
return [d, (d - 1) // 2, d - 1, 2 * errors + erasures < d]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0]', [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0], [1, 0, 0, True]], ['regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1...', [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1]], 1, 2], [1, 0, 0, False]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0]], 2, 3], [2, 0, 1, False]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1]], 1, 0], [2, 0, 1, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]]], [['regression [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1]], 1, 0], [2, 0, 1, False]], ['regression [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['partial-repair [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1]], 0, 3], [2, 0, 1, False]], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1]], 0, 0], [2, 0, 1, True]], ['control [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1]], 1, 3]', [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1]], 1, 3], [1, 0, 0, False]]], [['regression [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1]], 0, 3], [2, 0, 1, False]], ['regression [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, ...', [[[0, 1, 1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1]], 0, 0], [2, 0, 1, True]], ['partial-repair [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0]], 0, 2], [2, 0, 1, False]], ['partial-repair [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0]], 1, 2], [2, 0, 1, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0]], 2, 1]', [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0]], 2, 1], [5, 2, 4, False]], ['control [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1]], 1, 0]', [[[1, 1, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 1, 1]], 1, 0], [5, 2, 4, True]]], [['regression [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 1]], 1, 0]', [[[0, 1, 0, 0, 1], [0, 0, 0, 0, 1], [0, 1, 0, 0, 1]], 1, 0], [1, 0, 0, False]], ['regression [[[0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, ...', [[[0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 1, 1], [0, 1, 1, 0, 0, 1, 1], [1, 1, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 3], [1, 0, 0, False]], ['partial-repair [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3], [4, 1, 3, True]], ['partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0...', [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 1, 1, 0]], 2, 3], [2, 0, 1, False]], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]], ['control [[[0, 0, 0], [1, 1, 1]], 1, 1]', [[[0, 0, 0], [1, 1, 1]], 1, 1], [3, 1, 2, False]]], [['regression [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0]], 0, 2], [2, 0, 1, False]], ['regression [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, ...', [[[0, 1, 1, 0, 0, 1, 0, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 1, 1, 0, 1, 1, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 1, 0]], 1, 2], [2, 0, 1, False]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0]], 0, 2], [4, 1, 3, True]], ['partial-repair [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ...', [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['control [[[0, 1], [0, 1]], 0, 0]', [[[0, 1], [0, 1]], 0, 0], None], ['control [[[0, 1], [1, 0, 1]], 0, 0]', [[[0, 1], [1, 0, 1]], 0, 0], None], ['control [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, ...', [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1]], 1, 0], [3, 1, 2, True]], ['control [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, ...', [[[0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 1, 0, 0, 1], [0, 1, 0, 1, 0, 1, 0], [1, 0, 0, 0, 0, 1, 1], [1, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1], [0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1]], 1, 1], [3, 1, 2, False]]]]
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 [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0] | [1, 0, 0, True] | [1, 0, 0, True] | Passed |
| regression [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1... | [1, 0, 0, False] | [1, 0, 0, False] | Passed |
| partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 0, 1, False] | [2, 0, 1, False] | Passed |
| partial-repair [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 0, 1, False] | [2, 0, 1, False] | Passed |
| control [[[0, 1], [0, 1]], 0, 0] | None | None | Passed |
| control [[[0, 1], [1, 0, 1]], 0, 0] | None | None | Passed |
| control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ... | [4, 1, 3, True] | [4, 1, 3, True] | Passed |
| control [[[0, 1, 1, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, ... | [4, 1, 3, False] | [4, 1, 3, False] | Passed |
SHA-256 / 6a923693af50ea7705fb858f9e70011b30286102329aca376e3a1106245edf6c
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.841998+00:00.
Case digest / f9d11863dc320ce6dcf653ec89ad5d5ca3f00e76388cd25e28dc9ad21bc76450