FA-72116 / Error-correcting codes / Open access
Code capability rounds the correction radius up · case 01
Even-distance codes are credited with one more correctable error.
ROOT CAUSE
t is computed as d // 2.
THE FAILURE
t is computed as d // 2.
Unsuccessful approach: Using d // 2 - 1 undercounts 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 // 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, 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]], ['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]], ['partial-repair [[[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]], ['partial-repair [[[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]], ['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 [[[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 [[[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]], ['partial-repair [[[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]], ['partial-repair [[[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]], ['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, 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 [[[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]], ['partial-repair [[[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]], ['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], [1, 1, 1]], 1, 0]', [[[0, 0, 0], [1, 1, 1]], 1, 0], [3, 1, 2, True]], ['control [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]]], [['regression [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3], [4, 1, 3, True]], ['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]], 2, 3], [2, 0, 1, False]], ['partial-repair [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]], ['partial-repair [[[0, 0, 0], [1, 1, 1]], 1, 1]', [[[0, 0, 0], [1, 1, 1]], 1, 1], [3, 1, 2, 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, 0], [1, 1, 1, 1]], 1, 1]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 1, 1], [4, 1, 3, True]], ['control [[[0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]], 2, 0]', [[[0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]], 2, 0], [5, 2, 4, True]]], [['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]], ['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, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['partial-repair [[[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]], ['partial-repair [[[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]], ['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, 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]], ['control [[[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]]]]
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, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 1, 1, False] | [2, 0, 1, False] | Failed |
| regression [[[1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0... | [2, 1, 1, False] | [2, 0, 1, False] | Failed |
| partial-repair [[[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 |
| partial-repair [[[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 |
| 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, 2, 3, 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, 2, 3, False] | [4, 1, 3, False] | Failed |
SHA-256 / 09e6290280ac2d832559f8042a336039ae96095b8f7ffb43a47c06a1a1ddc0a1
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 // 2 - 1, 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, 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]], ['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]], ['partial-repair [[[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]], ['partial-repair [[[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]], ['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 [[[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 [[[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]], ['partial-repair [[[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]], ['partial-repair [[[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]], ['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, 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 [[[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]], ['partial-repair [[[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]], ['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], [1, 1, 1]], 1, 0]', [[[0, 0, 0], [1, 1, 1]], 1, 0], [3, 1, 2, True]], ['control [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]]], [['regression [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 0, 3], [4, 1, 3, True]], ['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]], 2, 3], [2, 0, 1, False]], ['partial-repair [[[0, 0, 0], [1, 1, 1]], 0, 2]', [[[0, 0, 0], [1, 1, 1]], 0, 2], [3, 1, 2, True]], ['partial-repair [[[0, 0, 0], [1, 1, 1]], 1, 1]', [[[0, 0, 0], [1, 1, 1]], 1, 1], [3, 1, 2, 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, 0], [1, 1, 1, 1]], 1, 1]', [[[0, 0, 0, 0], [1, 1, 1, 1]], 1, 1], [4, 1, 3, True]], ['control [[[0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]], 2, 0]', [[[0, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 0]], 2, 0], [5, 2, 4, True]]], [['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]], ['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, 1, 1, 1, 1, 0, 0]], 1, 2], [4, 1, 3, False]], ['partial-repair [[[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]], ['partial-repair [[[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]], ['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, 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]], ['control [[[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]]]]
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, 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 |
| regression [[[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, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1]], 0, 0] | [1, -1, 0, True] | [1, 0, 0, True] | Failed |
| partial-repair [[[1, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 1, 1, 1, 1], [1, 0, 1, 0, 1... | [1, -1, 0, False] | [1, 0, 0, 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, 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 / 30e97478d8f36cfe2ebd8dd85c66ca10cbba9f225056e12f92b207fc675cccd1
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.592618+00:00.
Case digest / 643c6b3fb9bab12fbf9e63ad4398a1f02e16604893c2cbce39d60c71caafc159