FA-87551 / Collision detection broadphase / Open access
Sleeping island contacts end because the broadphase skipped them · case 01
Stacks that fall asleep lose their contacts and wake up falling.
ROOT CAUSE
Sleeping pairs are not carried over when absent from curr.
VERIFIED REPAIR
Carry previous pairs between two sleeping bodies into the current set.
Unsuccessful approach: Iterating over the current set to add sleeping pairs changes nothing.
Case contract
solve(prev, curr, asleep): contact pair cache update. Pairs are unordered; self pairs in curr are ignored. Previous pairs whose two bodies are both asleep persist even if not re-reported. Return [begin, end, persist] as sorted [min,max] lists.
Why this case matters
Broadphase stages decide which object pairs ever reach narrowphase; a wrong boundary, ordering or bookkeeping rule silently drops real contacts or floods the solver with false candidates.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(prev, curr, asleep):
def norm(p):
return (min(p), max(p))
P = {norm(p) for p in prev}
C = {norm(p) for p in curr if p[0] != p[1]}
sl = set(asleep)
begin = sorted(C - P)
end = sorted(P - C)
keep = sorted(P & C)
return [[list(p) for p in begin], [list(p) for p in end], [list(p) for p in keep]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[1, 3], [5, 6], [1, 5], [3, 1], [6, 2], [5, 3]], [[7, 6], [1, 5], [7, 2], [6, 7], [1, 7]], [1, 7, 6]], [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]]], [[[[6, 7]], [[1, 3], [2, 1], [6, 4], [1, 4], [5, 5]], [7, 6, 5]], [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]]], [[[[5, 3], [5, 2], [4, 3], [6, 5], [5, 4], [1, 2]], [[7, 3], [4, 7], [4, 5]], [6, 5, 2, 4]], [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]]], [[[[5, 7]], [[2, 7], [5, 1]], [1, 5, 7]], [[[1, 5], [2, 7]], [], [[5, 7]]]], [[[[6, 5], [5, 4]], [[3, 1], [5, 2], [5, 3], [2, 4], [1, 7], [4, 7]], [7, 1]], [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []]], [[[[7, 2], [2, 5], [4, 2]], [[7, 5], [3, 4], [5, 6]], [7, 4, 1, 6]], [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []]], [[[[1, 2], [2, 4], [3, 1], [6, 5], [4, 6]], [[2, 3], [1, 7], [7, 4], [1, 6]], [6, 7, 1, 4]], [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]]], [[[[2, 5]], [[5, 1], [2, 3], [3, 1], [4, 7], [4, 4]], [3]], [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []]]], [[[[[2, 7], [1, 2], [1, 5]], [[6, 1], [7, 5], [1, 2], [3, 1], [7, 2], [6, 5]], [1, 5]], [[[1, 3], [1, 6], [5, 6], [5, 7]], [], [[1, 2], [1, 5], [2, 7]]]], [[[[3, 4], [4, 2], [1, 5], [5, 6], [3, 4], [3, 5]], [[1, 4]], [3, 6, 4]], [[[1, 4]], [[1, 5], [2, 4], [3, 5], [5, 6]], [[3, 4]]]], [[[[1, 3], [1, 7], [5, 3], [2, 7], [6, 1]], [[1, 5], [3, 6]], [2, 4, 6]], [[[1, 5], [3, 6]], [[1, 3], [1, 6], [1, 7], [2, 7], [3, 5]], []]], [[[[5, 3], [2, 4], [1, 2], [2, 7]], [[3, 4], [4, 5], [2, 7], [2, 7], [6, 2]], [5, 4, 1, 2]], [[[2, 6], [3, 4], [4, 5]], [[3, 5]], [[1, 2], [2, 4], [2, 7]]]], [[[[5, 3], [3, 2], [7, 3], [3, 2], [5, 1], [5, 2]], [[6, 5], [7, 3], [2, 2]], [4, 7]], [[[5, 6]], [[1, 5], [2, 3], [2, 5], [3, 5]], [[3, 7]]]], [[[[4, 5], [4, 6], [3, 5], [5, 6], [5, 1]], [[7, 3], [1, 3], [6, 1], [4, 3]], [4, 5]], [[[1, 3], [1, 6], [3, 4], [3, 7]], [[1, 5], [3, 5], [4, 6], [5, 6]], [[4, 5]]]], [[[[2, 6], [5, 1]], [[7, 1], [7, 6], [1, 2], [3, 7], [6, 2]], [3, 2, 1]], [[[1, 2], [1, 7], [3, 7], [6, 7]], [[1, 5]], [[2, 6]]]], [[[[2, 1], [3, 2]], [[1, 7], [7, 4], [1, 3], [6, 2], [2, 2]], [7, 2, 1, 6]], [[[1, 3], [1, 7], [2, 6], [4, 7]], [[2, 3]], [[1, 2]]]]], [[[[[7, 4], [3, 6]], [[6, 5], [5, 2], [7, 6], [6, 6]], [7, 5, 6, 3]], [[[2, 5], [5, 6], [6, 7]], [[4, 7]], [[3, 6]]]], [[[[7, 2], [7, 6], [4, 7], [6, 2], [4, 2], [7, 2]], [[6, 5], [5, 5]], [3, 2, 7, 5]], [[[5, 6]], [[2, 4], [2, 6], [4, 7], [6, 7]], [[2, 7]]]], [[[[1, 3], [4, 7], [6, 5]], [[3, 1]], [5, 6, 3]], [[], [[4, 7]], [[1, 3], [5, 6]]]], [[[[5, 3], [4, 2], [7, 5], [2, 5], [7, 4]], [[3, 7], [1, 7], [4, 5], [7, 4], [4, 4]], [6, 5, 1]], [[[1, 7], [3, 7], [4, 5]], [[2, 4], [2, 5], [3, 5], [5, 7]], [[4, 7]]]], [[[[5, 4], [3, 5], [3, 2], [2, 7]], [[2, 1], [3, 6], [2, 2]], [3, 1, 5, 7]], [[[1, 2], [3, 6]], [[2, 3], [2, 7], [4, 5]], [[3, 5]]]], [[[[3, 4]], [[6, 3], [5, 3], [6, 4]], [3, 1, 6]], [[[3, 5], [3, 6], [4, 6]], [[3, 4]], []]], [[[[2, 1], [5, 2], [2, 3], [4, 1], [7, 4], [3, 1]], [[2, 7], [6, 5], [4, 5], [1, 1]], [4, 2]], [[[2, 7], [4, 5], [5, 6]], [[1, 2], [1, 3], [1, 4], [2, 3], [2, 5], [4, 7]], []]], [[[[3, 2], [7, 2], [1, 7], [4, 6]], [[6, 4], [5, 1], [3, 6], [5, 7], [6, 3], [4, 2]], [4, 2, 7, 6]], [[[1, 5], [2, 4], [3, 6], [5, 7]], [[1, 7], [2, 3]], [[2, 7], [4, 6]]]]], [[[[[6, 7], [5, 4], [3, 2], [3, 5]], [[1, 2], [6, 7], [5, 3], [3, 1]], []], [[[1, 2], [1, 3]], [[2, 3], [4, 5]], [[3, 5], [6, 7]]]], [[[[4, 2]], [[7, 5], [5, 3], [7, 3]], [4, 5, 2, 3]], [[[3, 5], [3, 7], [5, 7]], [], [[2, 4]]]], [[[[7, 4], [1, 5], [6, 7], [6, 5]], [[2, 3], [3, 4], [2, 4], [5, 4], [7, 2], [4, 5]], [4, 1, 7, 5]], [[[2, 3], [2, 4], [2, 7], [3, 4], [4, 5]], [[5, 6], [6, 7]], [[1, 5], [4, 7]]]], [[[[1, 7], [6, 4], [1, 6]], [[2, 3], [6, 4], [7, 3]], [4, 1]], [[[2, 3], [3, 7]], [[1, 6], [1, 7]], [[4, 6]]]], [[[[3, 4]], [[1, 7], [3, 5], [7, 3], [1, 6]], [6, 1]], [[[1, 6], [1, 7], [3, 5], [3, 7]], [[3, 4]], []]], [[[[4, 7], [3, 1], [7, 5], [5, 7], [6, 2]], [[2, 4], [7, 4], [4, 6], [4, 1], [5, 7], [5, 5]], [1, 3, 5, 6]], [[[1, 4], [2, 4], [4, 6]], [[2, 6]], [[1, 3], [4, 7], [5, 7]]]], [[[[2, 4], [4, 5], [4, 6], [1, 5], [6, 7]], [[6, 5], [2, 1]], [6, 3, 2]], [[[1, 2], [5, 6]], [[1, 5], [2, 4], [4, 5], [4, 6], [6, 7]], []]], [[[[7, 1], [6, 4], [3, 1]], [[1, 5], [6, 4], [5, 2], [3, 7], [6, 6]], [6, 2, 3, 1]], [[[1, 5], [2, 5], [3, 7]], [[1, 7]], [[1, 3], [4, 6]]]]], [[[[[3, 6], [5, 7], [7, 3]], [[3, 2], [3, 3]], [6, 4, 1]], [[[2, 3]], [[3, 6], [3, 7], [5, 7]], []]], [[[[5, 1], [7, 1], [5, 3], [6, 2], [7, 5]], [[3, 7], [4, 1], [5, 6], [4, 7]], [1, 6, 4, 5]], [[[1, 4], [3, 7], [4, 7], [5, 6]], [[1, 7], [2, 6], [3, 5], [5, 7]], [[1, 5]]]], [[[[5, 1], [2, 5], [5, 1], [6, 2], [6, 3], [6, 4]], [[5, 4], [4, 5], [2, 4], [7, 4], [4, 1], [4, 4]], [2, 3, 5, 4]], [[[1, 4], [2, 4], [4, 5], [4, 7]], [[1, 5], [2, 6], [3, 6], [4, 6]], [[2, 5]]]], [[[[1, 5], [3, 5], [1, 4], [3, 2], [5, 4]], [[4, 3], [4, 5], [2, 5], [2, 3], [1, 5], [6, 4], [5, 5]], [1, 4]], [[[2, 5], [3, 4], [4, 6]], [[3, 5]], [[1, 4], [1, 5], [2, 3], [4, 5]]]], [[[[5, 1], [6, 5], [6, 4], [3, 2]], [[5, 1], [4, 6], [6, 3], [6, 1]], [6, 2, 4, 5]], [[[1, 6], [3, 6]], [[2, 3]], [[1, 5], [4, 6], [5, 6]]]], [[[[1, 6], [3, 5], [6, 2], [6, 7]], [[1, 5], [5, 3], [2, 5], [5, 2]], [6, 5, 3, 2]], [[[1, 5], [2, 5]], [[1, 6], [6, 7]], [[2, 6], [3, 5]]]], [[[[7, 3]], [[3, 2], [1, 2], [6, 2], [7, 3], [1, 5], [6, 3]], []], [[[1, 2], [1, 5], [2, 3], [2, 6], [3, 6]], [], [[3, 7]]]], [[[[5, 2]], [[6, 3], [5, 6], [2, 7], [4, 7], [5, 5]], [4]], [[[2, 7], [3, 6], [4, 7], [5, 6]], [[2, 5]], []]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("case %d" % i, 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 |
|---|---|---|---|
| case 0 | [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]] | [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]] | Passed |
| case 1 | [[[1, 2], [1, 3], [1, 4], [4, 6]], [[6, 7]], []] | [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]] | Failed |
| case 2 | [[[3, 7], [4, 7]], [[1, 2], [2, 5], [3, 4], [3, 5], [5, 6]], [[4, 5]]] | [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]] | Failed |
| case 3 | [[[1, 5], [2, 7]], [[5, 7]], []] | [[[1, 5], [2, 7]], [], [[5, 7]]] | Failed |
| case 4 | [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []] | [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []] | Passed |
| case 5 | [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []] | [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []] | Passed |
| case 6 | [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [4, 6], [5, 6]], []] | [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]] | Failed |
| case 7 | [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []] | [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []] | Passed |
SHA-256 / bdd04c4de28ae36d331d6c984d70944b244724969b2da2709294af50f0897a82
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(prev, curr, asleep):
def norm(p):
return (min(p), max(p))
P = {norm(p) for p in prev}
C = {norm(p) for p in curr if p[0] != p[1]}
sl = set(asleep)
for p in set(C):
if p[0] in sl and p[1] in sl:
C.add(p)
begin = sorted(C - P)
end = sorted(P - C)
keep = sorted(P & C)
return [[list(p) for p in begin], [list(p) for p in end], [list(p) for p in keep]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[1, 3], [5, 6], [1, 5], [3, 1], [6, 2], [5, 3]], [[7, 6], [1, 5], [7, 2], [6, 7], [1, 7]], [1, 7, 6]], [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]]], [[[[6, 7]], [[1, 3], [2, 1], [6, 4], [1, 4], [5, 5]], [7, 6, 5]], [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]]], [[[[5, 3], [5, 2], [4, 3], [6, 5], [5, 4], [1, 2]], [[7, 3], [4, 7], [4, 5]], [6, 5, 2, 4]], [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]]], [[[[5, 7]], [[2, 7], [5, 1]], [1, 5, 7]], [[[1, 5], [2, 7]], [], [[5, 7]]]], [[[[6, 5], [5, 4]], [[3, 1], [5, 2], [5, 3], [2, 4], [1, 7], [4, 7]], [7, 1]], [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []]], [[[[7, 2], [2, 5], [4, 2]], [[7, 5], [3, 4], [5, 6]], [7, 4, 1, 6]], [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []]], [[[[1, 2], [2, 4], [3, 1], [6, 5], [4, 6]], [[2, 3], [1, 7], [7, 4], [1, 6]], [6, 7, 1, 4]], [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]]], [[[[2, 5]], [[5, 1], [2, 3], [3, 1], [4, 7], [4, 4]], [3]], [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []]]], [[[[[2, 7], [1, 2], [1, 5]], [[6, 1], [7, 5], [1, 2], [3, 1], [7, 2], [6, 5]], [1, 5]], [[[1, 3], [1, 6], [5, 6], [5, 7]], [], [[1, 2], [1, 5], [2, 7]]]], [[[[3, 4], [4, 2], [1, 5], [5, 6], [3, 4], [3, 5]], [[1, 4]], [3, 6, 4]], [[[1, 4]], [[1, 5], [2, 4], [3, 5], [5, 6]], [[3, 4]]]], [[[[1, 3], [1, 7], [5, 3], [2, 7], [6, 1]], [[1, 5], [3, 6]], [2, 4, 6]], [[[1, 5], [3, 6]], [[1, 3], [1, 6], [1, 7], [2, 7], [3, 5]], []]], [[[[5, 3], [2, 4], [1, 2], [2, 7]], [[3, 4], [4, 5], [2, 7], [2, 7], [6, 2]], [5, 4, 1, 2]], [[[2, 6], [3, 4], [4, 5]], [[3, 5]], [[1, 2], [2, 4], [2, 7]]]], [[[[5, 3], [3, 2], [7, 3], [3, 2], [5, 1], [5, 2]], [[6, 5], [7, 3], [2, 2]], [4, 7]], [[[5, 6]], [[1, 5], [2, 3], [2, 5], [3, 5]], [[3, 7]]]], [[[[4, 5], [4, 6], [3, 5], [5, 6], [5, 1]], [[7, 3], [1, 3], [6, 1], [4, 3]], [4, 5]], [[[1, 3], [1, 6], [3, 4], [3, 7]], [[1, 5], [3, 5], [4, 6], [5, 6]], [[4, 5]]]], [[[[2, 6], [5, 1]], [[7, 1], [7, 6], [1, 2], [3, 7], [6, 2]], [3, 2, 1]], [[[1, 2], [1, 7], [3, 7], [6, 7]], [[1, 5]], [[2, 6]]]], [[[[2, 1], [3, 2]], [[1, 7], [7, 4], [1, 3], [6, 2], [2, 2]], [7, 2, 1, 6]], [[[1, 3], [1, 7], [2, 6], [4, 7]], [[2, 3]], [[1, 2]]]]], [[[[[7, 4], [3, 6]], [[6, 5], [5, 2], [7, 6], [6, 6]], [7, 5, 6, 3]], [[[2, 5], [5, 6], [6, 7]], [[4, 7]], [[3, 6]]]], [[[[7, 2], [7, 6], [4, 7], [6, 2], [4, 2], [7, 2]], [[6, 5], [5, 5]], [3, 2, 7, 5]], [[[5, 6]], [[2, 4], [2, 6], [4, 7], [6, 7]], [[2, 7]]]], [[[[1, 3], [4, 7], [6, 5]], [[3, 1]], [5, 6, 3]], [[], [[4, 7]], [[1, 3], [5, 6]]]], [[[[5, 3], [4, 2], [7, 5], [2, 5], [7, 4]], [[3, 7], [1, 7], [4, 5], [7, 4], [4, 4]], [6, 5, 1]], [[[1, 7], [3, 7], [4, 5]], [[2, 4], [2, 5], [3, 5], [5, 7]], [[4, 7]]]], [[[[5, 4], [3, 5], [3, 2], [2, 7]], [[2, 1], [3, 6], [2, 2]], [3, 1, 5, 7]], [[[1, 2], [3, 6]], [[2, 3], [2, 7], [4, 5]], [[3, 5]]]], [[[[3, 4]], [[6, 3], [5, 3], [6, 4]], [3, 1, 6]], [[[3, 5], [3, 6], [4, 6]], [[3, 4]], []]], [[[[2, 1], [5, 2], [2, 3], [4, 1], [7, 4], [3, 1]], [[2, 7], [6, 5], [4, 5], [1, 1]], [4, 2]], [[[2, 7], [4, 5], [5, 6]], [[1, 2], [1, 3], [1, 4], [2, 3], [2, 5], [4, 7]], []]], [[[[3, 2], [7, 2], [1, 7], [4, 6]], [[6, 4], [5, 1], [3, 6], [5, 7], [6, 3], [4, 2]], [4, 2, 7, 6]], [[[1, 5], [2, 4], [3, 6], [5, 7]], [[1, 7], [2, 3]], [[2, 7], [4, 6]]]]], [[[[[6, 7], [5, 4], [3, 2], [3, 5]], [[1, 2], [6, 7], [5, 3], [3, 1]], []], [[[1, 2], [1, 3]], [[2, 3], [4, 5]], [[3, 5], [6, 7]]]], [[[[4, 2]], [[7, 5], [5, 3], [7, 3]], [4, 5, 2, 3]], [[[3, 5], [3, 7], [5, 7]], [], [[2, 4]]]], [[[[7, 4], [1, 5], [6, 7], [6, 5]], [[2, 3], [3, 4], [2, 4], [5, 4], [7, 2], [4, 5]], [4, 1, 7, 5]], [[[2, 3], [2, 4], [2, 7], [3, 4], [4, 5]], [[5, 6], [6, 7]], [[1, 5], [4, 7]]]], [[[[1, 7], [6, 4], [1, 6]], [[2, 3], [6, 4], [7, 3]], [4, 1]], [[[2, 3], [3, 7]], [[1, 6], [1, 7]], [[4, 6]]]], [[[[3, 4]], [[1, 7], [3, 5], [7, 3], [1, 6]], [6, 1]], [[[1, 6], [1, 7], [3, 5], [3, 7]], [[3, 4]], []]], [[[[4, 7], [3, 1], [7, 5], [5, 7], [6, 2]], [[2, 4], [7, 4], [4, 6], [4, 1], [5, 7], [5, 5]], [1, 3, 5, 6]], [[[1, 4], [2, 4], [4, 6]], [[2, 6]], [[1, 3], [4, 7], [5, 7]]]], [[[[2, 4], [4, 5], [4, 6], [1, 5], [6, 7]], [[6, 5], [2, 1]], [6, 3, 2]], [[[1, 2], [5, 6]], [[1, 5], [2, 4], [4, 5], [4, 6], [6, 7]], []]], [[[[7, 1], [6, 4], [3, 1]], [[1, 5], [6, 4], [5, 2], [3, 7], [6, 6]], [6, 2, 3, 1]], [[[1, 5], [2, 5], [3, 7]], [[1, 7]], [[1, 3], [4, 6]]]]], [[[[[3, 6], [5, 7], [7, 3]], [[3, 2], [3, 3]], [6, 4, 1]], [[[2, 3]], [[3, 6], [3, 7], [5, 7]], []]], [[[[5, 1], [7, 1], [5, 3], [6, 2], [7, 5]], [[3, 7], [4, 1], [5, 6], [4, 7]], [1, 6, 4, 5]], [[[1, 4], [3, 7], [4, 7], [5, 6]], [[1, 7], [2, 6], [3, 5], [5, 7]], [[1, 5]]]], [[[[5, 1], [2, 5], [5, 1], [6, 2], [6, 3], [6, 4]], [[5, 4], [4, 5], [2, 4], [7, 4], [4, 1], [4, 4]], [2, 3, 5, 4]], [[[1, 4], [2, 4], [4, 5], [4, 7]], [[1, 5], [2, 6], [3, 6], [4, 6]], [[2, 5]]]], [[[[1, 5], [3, 5], [1, 4], [3, 2], [5, 4]], [[4, 3], [4, 5], [2, 5], [2, 3], [1, 5], [6, 4], [5, 5]], [1, 4]], [[[2, 5], [3, 4], [4, 6]], [[3, 5]], [[1, 4], [1, 5], [2, 3], [4, 5]]]], [[[[5, 1], [6, 5], [6, 4], [3, 2]], [[5, 1], [4, 6], [6, 3], [6, 1]], [6, 2, 4, 5]], [[[1, 6], [3, 6]], [[2, 3]], [[1, 5], [4, 6], [5, 6]]]], [[[[1, 6], [3, 5], [6, 2], [6, 7]], [[1, 5], [5, 3], [2, 5], [5, 2]], [6, 5, 3, 2]], [[[1, 5], [2, 5]], [[1, 6], [6, 7]], [[2, 6], [3, 5]]]], [[[[7, 3]], [[3, 2], [1, 2], [6, 2], [7, 3], [1, 5], [6, 3]], []], [[[1, 2], [1, 5], [2, 3], [2, 6], [3, 6]], [], [[3, 7]]]], [[[[5, 2]], [[6, 3], [5, 6], [2, 7], [4, 7], [5, 5]], [4]], [[[2, 7], [3, 6], [4, 7], [5, 6]], [[2, 5]], []]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("case %d" % i, 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 |
|---|---|---|---|
| case 0 | [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]] | [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]] | Passed |
| case 1 | [[[1, 2], [1, 3], [1, 4], [4, 6]], [[6, 7]], []] | [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]] | Failed |
| case 2 | [[[3, 7], [4, 7]], [[1, 2], [2, 5], [3, 4], [3, 5], [5, 6]], [[4, 5]]] | [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]] | Failed |
| case 3 | [[[1, 5], [2, 7]], [[5, 7]], []] | [[[1, 5], [2, 7]], [], [[5, 7]]] | Failed |
| case 4 | [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []] | [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []] | Passed |
| case 5 | [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []] | [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []] | Passed |
| case 6 | [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [4, 6], [5, 6]], []] | [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]] | Failed |
| case 7 | [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []] | [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []] | Passed |
SHA-256 / bb2562aa65ec0b0131fc15a485657a3b92c3074cea3ee9a4a8f165074c14a759
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(prev, curr, asleep):
def norm(p):
return (min(p), max(p))
P = {norm(p) for p in prev}
C = {norm(p) for p in curr if p[0] != p[1]}
sl = set(asleep)
for p in P:
if p[0] in sl and p[1] in sl:
C.add(p)
begin = sorted(C - P)
end = sorted(P - C)
keep = sorted(P & C)
return [[list(p) for p in begin], [list(p) for p in end], [list(p) for p in keep]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[1, 3], [5, 6], [1, 5], [3, 1], [6, 2], [5, 3]], [[7, 6], [1, 5], [7, 2], [6, 7], [1, 7]], [1, 7, 6]], [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]]], [[[[6, 7]], [[1, 3], [2, 1], [6, 4], [1, 4], [5, 5]], [7, 6, 5]], [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]]], [[[[5, 3], [5, 2], [4, 3], [6, 5], [5, 4], [1, 2]], [[7, 3], [4, 7], [4, 5]], [6, 5, 2, 4]], [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]]], [[[[5, 7]], [[2, 7], [5, 1]], [1, 5, 7]], [[[1, 5], [2, 7]], [], [[5, 7]]]], [[[[6, 5], [5, 4]], [[3, 1], [5, 2], [5, 3], [2, 4], [1, 7], [4, 7]], [7, 1]], [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []]], [[[[7, 2], [2, 5], [4, 2]], [[7, 5], [3, 4], [5, 6]], [7, 4, 1, 6]], [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []]], [[[[1, 2], [2, 4], [3, 1], [6, 5], [4, 6]], [[2, 3], [1, 7], [7, 4], [1, 6]], [6, 7, 1, 4]], [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]]], [[[[2, 5]], [[5, 1], [2, 3], [3, 1], [4, 7], [4, 4]], [3]], [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []]]], [[[[[2, 7], [1, 2], [1, 5]], [[6, 1], [7, 5], [1, 2], [3, 1], [7, 2], [6, 5]], [1, 5]], [[[1, 3], [1, 6], [5, 6], [5, 7]], [], [[1, 2], [1, 5], [2, 7]]]], [[[[3, 4], [4, 2], [1, 5], [5, 6], [3, 4], [3, 5]], [[1, 4]], [3, 6, 4]], [[[1, 4]], [[1, 5], [2, 4], [3, 5], [5, 6]], [[3, 4]]]], [[[[1, 3], [1, 7], [5, 3], [2, 7], [6, 1]], [[1, 5], [3, 6]], [2, 4, 6]], [[[1, 5], [3, 6]], [[1, 3], [1, 6], [1, 7], [2, 7], [3, 5]], []]], [[[[5, 3], [2, 4], [1, 2], [2, 7]], [[3, 4], [4, 5], [2, 7], [2, 7], [6, 2]], [5, 4, 1, 2]], [[[2, 6], [3, 4], [4, 5]], [[3, 5]], [[1, 2], [2, 4], [2, 7]]]], [[[[5, 3], [3, 2], [7, 3], [3, 2], [5, 1], [5, 2]], [[6, 5], [7, 3], [2, 2]], [4, 7]], [[[5, 6]], [[1, 5], [2, 3], [2, 5], [3, 5]], [[3, 7]]]], [[[[4, 5], [4, 6], [3, 5], [5, 6], [5, 1]], [[7, 3], [1, 3], [6, 1], [4, 3]], [4, 5]], [[[1, 3], [1, 6], [3, 4], [3, 7]], [[1, 5], [3, 5], [4, 6], [5, 6]], [[4, 5]]]], [[[[2, 6], [5, 1]], [[7, 1], [7, 6], [1, 2], [3, 7], [6, 2]], [3, 2, 1]], [[[1, 2], [1, 7], [3, 7], [6, 7]], [[1, 5]], [[2, 6]]]], [[[[2, 1], [3, 2]], [[1, 7], [7, 4], [1, 3], [6, 2], [2, 2]], [7, 2, 1, 6]], [[[1, 3], [1, 7], [2, 6], [4, 7]], [[2, 3]], [[1, 2]]]]], [[[[[7, 4], [3, 6]], [[6, 5], [5, 2], [7, 6], [6, 6]], [7, 5, 6, 3]], [[[2, 5], [5, 6], [6, 7]], [[4, 7]], [[3, 6]]]], [[[[7, 2], [7, 6], [4, 7], [6, 2], [4, 2], [7, 2]], [[6, 5], [5, 5]], [3, 2, 7, 5]], [[[5, 6]], [[2, 4], [2, 6], [4, 7], [6, 7]], [[2, 7]]]], [[[[1, 3], [4, 7], [6, 5]], [[3, 1]], [5, 6, 3]], [[], [[4, 7]], [[1, 3], [5, 6]]]], [[[[5, 3], [4, 2], [7, 5], [2, 5], [7, 4]], [[3, 7], [1, 7], [4, 5], [7, 4], [4, 4]], [6, 5, 1]], [[[1, 7], [3, 7], [4, 5]], [[2, 4], [2, 5], [3, 5], [5, 7]], [[4, 7]]]], [[[[5, 4], [3, 5], [3, 2], [2, 7]], [[2, 1], [3, 6], [2, 2]], [3, 1, 5, 7]], [[[1, 2], [3, 6]], [[2, 3], [2, 7], [4, 5]], [[3, 5]]]], [[[[3, 4]], [[6, 3], [5, 3], [6, 4]], [3, 1, 6]], [[[3, 5], [3, 6], [4, 6]], [[3, 4]], []]], [[[[2, 1], [5, 2], [2, 3], [4, 1], [7, 4], [3, 1]], [[2, 7], [6, 5], [4, 5], [1, 1]], [4, 2]], [[[2, 7], [4, 5], [5, 6]], [[1, 2], [1, 3], [1, 4], [2, 3], [2, 5], [4, 7]], []]], [[[[3, 2], [7, 2], [1, 7], [4, 6]], [[6, 4], [5, 1], [3, 6], [5, 7], [6, 3], [4, 2]], [4, 2, 7, 6]], [[[1, 5], [2, 4], [3, 6], [5, 7]], [[1, 7], [2, 3]], [[2, 7], [4, 6]]]]], [[[[[6, 7], [5, 4], [3, 2], [3, 5]], [[1, 2], [6, 7], [5, 3], [3, 1]], []], [[[1, 2], [1, 3]], [[2, 3], [4, 5]], [[3, 5], [6, 7]]]], [[[[4, 2]], [[7, 5], [5, 3], [7, 3]], [4, 5, 2, 3]], [[[3, 5], [3, 7], [5, 7]], [], [[2, 4]]]], [[[[7, 4], [1, 5], [6, 7], [6, 5]], [[2, 3], [3, 4], [2, 4], [5, 4], [7, 2], [4, 5]], [4, 1, 7, 5]], [[[2, 3], [2, 4], [2, 7], [3, 4], [4, 5]], [[5, 6], [6, 7]], [[1, 5], [4, 7]]]], [[[[1, 7], [6, 4], [1, 6]], [[2, 3], [6, 4], [7, 3]], [4, 1]], [[[2, 3], [3, 7]], [[1, 6], [1, 7]], [[4, 6]]]], [[[[3, 4]], [[1, 7], [3, 5], [7, 3], [1, 6]], [6, 1]], [[[1, 6], [1, 7], [3, 5], [3, 7]], [[3, 4]], []]], [[[[4, 7], [3, 1], [7, 5], [5, 7], [6, 2]], [[2, 4], [7, 4], [4, 6], [4, 1], [5, 7], [5, 5]], [1, 3, 5, 6]], [[[1, 4], [2, 4], [4, 6]], [[2, 6]], [[1, 3], [4, 7], [5, 7]]]], [[[[2, 4], [4, 5], [4, 6], [1, 5], [6, 7]], [[6, 5], [2, 1]], [6, 3, 2]], [[[1, 2], [5, 6]], [[1, 5], [2, 4], [4, 5], [4, 6], [6, 7]], []]], [[[[7, 1], [6, 4], [3, 1]], [[1, 5], [6, 4], [5, 2], [3, 7], [6, 6]], [6, 2, 3, 1]], [[[1, 5], [2, 5], [3, 7]], [[1, 7]], [[1, 3], [4, 6]]]]], [[[[[3, 6], [5, 7], [7, 3]], [[3, 2], [3, 3]], [6, 4, 1]], [[[2, 3]], [[3, 6], [3, 7], [5, 7]], []]], [[[[5, 1], [7, 1], [5, 3], [6, 2], [7, 5]], [[3, 7], [4, 1], [5, 6], [4, 7]], [1, 6, 4, 5]], [[[1, 4], [3, 7], [4, 7], [5, 6]], [[1, 7], [2, 6], [3, 5], [5, 7]], [[1, 5]]]], [[[[5, 1], [2, 5], [5, 1], [6, 2], [6, 3], [6, 4]], [[5, 4], [4, 5], [2, 4], [7, 4], [4, 1], [4, 4]], [2, 3, 5, 4]], [[[1, 4], [2, 4], [4, 5], [4, 7]], [[1, 5], [2, 6], [3, 6], [4, 6]], [[2, 5]]]], [[[[1, 5], [3, 5], [1, 4], [3, 2], [5, 4]], [[4, 3], [4, 5], [2, 5], [2, 3], [1, 5], [6, 4], [5, 5]], [1, 4]], [[[2, 5], [3, 4], [4, 6]], [[3, 5]], [[1, 4], [1, 5], [2, 3], [4, 5]]]], [[[[5, 1], [6, 5], [6, 4], [3, 2]], [[5, 1], [4, 6], [6, 3], [6, 1]], [6, 2, 4, 5]], [[[1, 6], [3, 6]], [[2, 3]], [[1, 5], [4, 6], [5, 6]]]], [[[[1, 6], [3, 5], [6, 2], [6, 7]], [[1, 5], [5, 3], [2, 5], [5, 2]], [6, 5, 3, 2]], [[[1, 5], [2, 5]], [[1, 6], [6, 7]], [[2, 6], [3, 5]]]], [[[[7, 3]], [[3, 2], [1, 2], [6, 2], [7, 3], [1, 5], [6, 3]], []], [[[1, 2], [1, 5], [2, 3], [2, 6], [3, 6]], [], [[3, 7]]]], [[[[5, 2]], [[6, 3], [5, 6], [2, 7], [4, 7], [5, 5]], [4]], [[[2, 7], [3, 6], [4, 7], [5, 6]], [[2, 5]], []]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("case %d" % i, 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 |
|---|---|---|---|
| case 0 | [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]] | [[[1, 7], [2, 7], [6, 7]], [[1, 3], [2, 6], [3, 5], [5, 6]], [[1, 5]]] | Passed |
| case 1 | [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]] | [[[1, 2], [1, 3], [1, 4], [4, 6]], [], [[6, 7]]] | Passed |
| case 2 | [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]] | [[[3, 7], [4, 7]], [[1, 2], [3, 4], [3, 5]], [[2, 5], [4, 5], [5, 6]]] | Passed |
| case 3 | [[[1, 5], [2, 7]], [], [[5, 7]]] | [[[1, 5], [2, 7]], [], [[5, 7]]] | Passed |
| case 4 | [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []] | [[[1, 3], [1, 7], [2, 4], [2, 5], [3, 5], [4, 7]], [[4, 5], [5, 6]], []] | Passed |
| case 5 | [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []] | [[[3, 4], [5, 6], [5, 7]], [[2, 4], [2, 5], [2, 7]], []] | Passed |
| case 6 | [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]] | [[[1, 6], [1, 7], [2, 3], [4, 7]], [[1, 2], [1, 3], [2, 4], [5, 6]], [[4, 6]]] | Passed |
| case 7 | [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []] | [[[1, 3], [1, 5], [2, 3], [4, 7]], [[2, 5]], []] | Passed |
SHA-256 / 10950f56e6b4db6f5e127634ed32b70cdcacb4fc54466366882e7f62fc3afb0f
Verification & scope
A deterministic bounded teaching model with stipulated toy conventions; not a production physics engine or spatial index. 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:50:59.835069+00:00.
Case digest / 211d6a3511d30f56cfef447d4fdac84c436d200e99fb2ba3960010c9a7568aaa