FA-87521 / Collision detection broadphase / Open access
Fixtures on the same body are paired · case 01
Compound bodies collide with themselves.
ROOT CAUSE
The same-body check compares fixture ids.
VERIFIED REPAIR
Compare the owning body ids.
Unsuccessful approach: Comparing categories rejects unrelated fixtures that share a layer.
Case contract
solve(fixtures, candidates): fixture [id, body, category bits, mask bits, group, sensor, body type]. A candidate [a,b] is accepted unless: same body; neither body is dynamic; both are sensors. Group rule: equal nonzero groups override masks (positive always collide, negative never); otherwise require (catA & maskB) and (catB & maskA). Return sorted unique [min,max] accepted pairs.
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(fixtures, candidates):
fx = {f[0]: f for f in fixtures}
out = set()
for a, b in candidates:
fa, fb = fx[a], fx[b]
if fa[0] == fb[0]:
continue
if fa[6] != 'dynamic' and fb[6] != 'dynamic':
continue
ga, gb = fa[4], fb[4]
if ga == gb and ga != 0:
ok = ga > 0
else:
ok = (fa[2] & fb[3]) != 0 and (fb[2] & fa[3]) != 0
if not ok:
continue
if fa[5] and fb[5]:
continue
out.add((min(a, b), max(a, b)))
return [list(p) for p in sorted(out)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[1, 2, 8, 6, -2, False, 'dynamic'], [2, 4, 4, 12, -1, False, 'kinematic'], [3, 4, 4, 15, 1, True, 'kinematic']], [[2, 3], [3, 1], [2, 1], [2, 3], [1, 2], [3, 1]]], [[1, 2], [1, 3]]], [[[[1, 4, 8, 7, 2, False, 'kinematic'], [2, 1, 2, 7, 0, False, 'kinematic'], [3, 2, 1, 15, 0, False, 'kinematic'], [4, 4, 2, 12, 2, False, 'dynamic']], [[3, 1], [3, 2], [2, 4], [3, 1], [1, 4], [2, 1]]], []], [[[[1, 3, 8, 12, -1, True, 'dynamic'], [2, 4, 4, 15, -2, True, 'dynamic'], [3, 1, 4, 6, -2, False, 'dynamic'], [4, 2, 4, 7, 2, True, 'kinematic'], [5, 3, 8, 12, -2, False, 'dynamic']], [[2, 1], [1, 5], [4, 3], [2, 4], [2, 1], [4, 2], [3, 1]]], [[3, 4]]], [[[[1, 3, 2, 6, 0, False, 'dynamic'], [2, 4, 2, 1, 0, False, 'dynamic'], [3, 2, 8, 6, -1, True, 'dynamic'], [4, 4, 8, 15, 1, False, 'kinematic'], [5, 1, 1, 12, -2, False, 'dynamic']], [[3, 4], [4, 1], [4, 3], [4, 3], [2, 5], [2, 5], [4, 1], [3, 5]]], []], [[[[1, 4, 8, 7, -2, False, 'dynamic'], [2, 1, 2, 3, 0, True, 'kinematic'], [3, 2, 8, 15, 0, False, 'dynamic'], [4, 2, 8, 7, 1, False, 'kinematic'], [5, 3, 8, 1, 2, False, 'static'], [6, 4, 2, 15, -2, False, 'dynamic']], [[3, 5], [2, 5], [1, 3], [6, 2], [6, 1], [1, 6], [5, 6], [2, 6]]], [[2, 6]]], [[[[1, 2, 4, 15, 0, False, 'dynamic'], [2, 2, 1, 15, -1, False, 'kinematic']], [[1, 2], [2, 1], [1, 2], [2, 1], [2, 1]]], []], [[[[1, 3, 1, 7, 0, False, 'dynamic'], [2, 2, 2, 1, -1, True, 'kinematic'], [3, 1, 2, 3, 0, True, 'dynamic'], [4, 1, 2, 1, 0, False, 'dynamic'], [5, 3, 1, 1, 0, False, 'static'], [6, 4, 1, 1, -1, False, 'kinematic']], [[6, 1], [6, 2], [3, 1], [1, 6], [3, 6], [4, 1], [1, 6]]], [[1, 3], [1, 4], [1, 6]]], [[[[1, 2, 1, 15, 0, False, 'static'], [2, 2, 4, 1, 0, False, 'dynamic']], [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1]]], []]], [[[[[1, 3, 4, 12, -2, False, 'dynamic'], [2, 1, 2, 6, 2, True, 'kinematic'], [3, 2, 8, 12, 2, True, 'kinematic'], [4, 4, 2, 1, -2, False, 'kinematic'], [5, 4, 8, 15, 2, False, 'kinematic'], [6, 2, 4, 7, 2, False, 'dynamic'], [7, 1, 1, 15, 2, False, 'static']], [[6, 5], [4, 1], [2, 4], [5, 1], [4, 3], [4, 5], [2, 6], [2, 4], [4, 7], [2, 3]]], [[1, 5], [2, 6], [5, 6]]], [[[[1, 3, 1, 7, 1, False, 'dynamic'], [2, 2, 8, 12, -2, False, 'dynamic'], [3, 3, 2, 7, 2, False, 'static']], [[3, 2], [2, 1], [1, 2], [3, 2], [3, 1], [2, 1], [1, 2], [1, 2], [2, 3]]], []], [[[[1, 4, 2, 15, 2, True, 'kinematic'], [2, 4, 8, 12, -1, False, 'kinematic']], [[2, 1], [2, 1], [2, 1], [2, 1], [2, 1]]], []], [[[[1, 1, 2, 15, -1, False, 'dynamic'], [2, 4, 8, 15, -1, False, 'static'], [3, 1, 4, 1, -1, False, 'dynamic'], [4, 1, 1, 6, 2, False, 'dynamic'], [5, 4, 8, 7, 0, True, 'static']], [[2, 4], [5, 3], [4, 3], [2, 3], [3, 2], [1, 5], [5, 2], [1, 4]]], [[1, 5]]], [[[[1, 1, 4, 15, 1, False, 'kinematic'], [2, 1, 1, 6, 1, False, 'dynamic'], [3, 1, 2, 15, -2, False, 'dynamic'], [4, 4, 2, 7, 0, False, 'dynamic'], [5, 3, 8, 6, 2, False, 'dynamic'], [6, 1, 1, 15, -2, False, 'dynamic'], [7, 4, 2, 15, 0, False, 'dynamic']], [[4, 3], [7, 1], [1, 7], [2, 1], [4, 6], [5, 2], [4, 5], [4, 5]]], [[1, 7], [3, 4], [4, 6]]], [[[[1, 3, 1, 15, 0, False, 'dynamic'], [2, 1, 1, 6, -2, True, 'kinematic']], [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1], [2, 1]]], []], [[[[1, 2, 4, 12, 1, False, 'kinematic'], [2, 4, 1, 1, 1, False, 'dynamic'], [3, 1, 1, 6, -2, True, 'static'], [4, 4, 2, 7, 2, False, 'dynamic'], [5, 2, 1, 15, 1, True, 'dynamic'], [6, 4, 1, 12, 1, True, 'dynamic'], [7, 1, 1, 1, 0, False, 'dynamic']], [[1, 7], [1, 6], [5, 6], [5, 6], [6, 2], [5, 2], [6, 7], [5, 3], [1, 7]]], [[1, 6], [2, 5]]], [[[[1, 3, 1, 6, -2, False, 'dynamic'], [2, 4, 8, 12, -1, False, 'dynamic'], [3, 3, 2, 6, 1, False, 'kinematic'], [4, 3, 4, 3, 1, False, 'kinematic'], [5, 4, 8, 15, -1, True, 'static']], [[4, 2], [2, 1], [5, 1], [1, 4]]], []]], [[[[[1, 2, 1, 15, -2, False, 'kinematic'], [2, 3, 4, 12, 0, False, 'static'], [3, 2, 8, 15, 0, False, 'dynamic']], [[3, 2], [1, 2], [3, 1], [3, 2], [3, 2], [2, 1], [3, 2], [2, 1], [2, 1]]], [[2, 3]]], [[[[1, 4, 1, 7, 1, False, 'dynamic'], [2, 4, 8, 15, -2, False, 'dynamic']], [[1, 2], [1, 2], [1, 2]]], []], [[[[1, 1, 8, 7, -1, True, 'static'], [2, 3, 1, 3, 0, False, 'dynamic'], [3, 2, 4, 15, -2, False, 'dynamic'], [4, 1, 2, 15, -2, False, 'static'], [5, 1, 2, 1, 0, False, 'dynamic'], [6, 1, 2, 1, -2, True, 'dynamic'], [7, 4, 4, 6, -1, False, 'dynamic']], [[2, 4], [6, 5], [7, 2], [5, 1], [1, 2], [6, 3], [7, 1], [6, 3]]], [[2, 4]]], [[[[1, 3, 1, 7, 0, True, 'kinematic'], [2, 2, 1, 12, 0, False, 'dynamic'], [3, 1, 2, 1, 1, False, 'static'], [4, 3, 2, 12, 0, True, 'kinematic'], [5, 2, 4, 3, 1, False, 'dynamic'], [6, 4, 2, 12, 2, True, 'kinematic'], [7, 3, 2, 15, -2, True, 'dynamic'], [8, 2, 1, 7, -1, False, 'kinematic']], [[8, 5], [3, 8], [3, 4], [2, 5], [8, 2], [7, 5]]], [[5, 7]]], [[[[1, 1, 4, 12, 0, False, 'kinematic'], [2, 2, 2, 6, 2, False, 'static'], [3, 4, 1, 6, 2, True, 'dynamic'], [4, 4, 2, 15, 1, False, 'static'], [5, 4, 8, 3, 0, False, 'dynamic']], [[5, 3], [3, 4], [4, 1], [2, 4], [3, 1], [1, 3], [2, 1]]], []], [[[[1, 2, 1, 6, 2, False, 'static'], [2, 1, 4, 1, 1, False, 'dynamic'], [3, 4, 8, 7, 0, False, 'kinematic'], [4, 2, 8, 7, 1, True, 'dynamic'], [5, 2, 1, 12, 2, False, 'dynamic'], [6, 3, 8, 15, 0, False, 'dynamic'], [7, 2, 1, 12, -2, False, 'static']], [[2, 3], [5, 3], [2, 6]]], [[3, 5]]], [[[[1, 4, 2, 6, 0, False, 'static'], [2, 4, 1, 6, 1, False, 'dynamic'], [3, 4, 8, 12, 1, False, 'static'], [4, 4, 1, 1, -1, True, 'dynamic'], [5, 1, 1, 3, 1, False, 'dynamic'], [6, 2, 1, 7, 1, False, 'dynamic'], [7, 4, 8, 6, 2, False, 'dynamic'], [8, 4, 2, 15, 2, False, 'static']], [[5, 1], [5, 1], [6, 7], [3, 2], [1, 2], [5, 7], [4, 7], [7, 3], [6, 4]]], [[4, 6]]], [[[[1, 4, 4, 6, 1, True, 'dynamic'], [2, 4, 2, 3, 2, False, 'dynamic'], [3, 2, 8, 3, -1, True, 'dynamic'], [4, 3, 2, 15, 0, False, 'static'], [5, 3, 2, 7, 0, False, 'static']], [[5, 3], [4, 2], [4, 3], [4, 2], [3, 2], [2, 5], [5, 1], [2, 4], [4, 2]]], [[1, 5], [2, 4], [2, 5], [3, 4]]]], [[[[[1, 4, 4, 6, 1, False, 'kinematic'], [2, 4, 1, 12, 0, True, 'dynamic'], [3, 1, 2, 15, -1, False, 'dynamic'], [4, 2, 2, 7, 1, True, 'static'], [5, 1, 2, 6, -1, False, 'dynamic']], [[1, 4], [5, 3], [4, 2], [4, 5], [3, 1], [3, 1], [1, 2], [4, 3], [4, 3], [1, 3]]], [[1, 3], [3, 4], [4, 5]]], [[[[1, 2, 1, 6, 1, False, 'dynamic'], [2, 1, 2, 3, -2, True, 'static'], [3, 2, 4, 7, -1, False, 'dynamic'], [4, 4, 2, 12, -1, False, 'kinematic'], [5, 4, 2, 15, 0, False, 'kinematic'], [6, 2, 2, 12, 1, False, 'static'], [7, 2, 1, 1, 2, False, 'kinematic'], [8, 2, 4, 6, 0, True, 'static']], [[3, 8], [2, 1], [4, 7]]], [[1, 2]]], [[[[1, 4, 2, 1, -2, False, 'dynamic'], [2, 4, 4, 15, -2, False, 'dynamic'], [3, 1, 8, 15, -1, False, 'dynamic'], [4, 4, 2, 6, -1, False, 'dynamic'], [5, 4, 2, 12, 0, False, 'static'], [6, 2, 2, 6, 0, False, 'dynamic']], [[4, 2], [3, 2], [2, 4], [6, 3], [6, 2]]], [[2, 3], [2, 6]]], [[[[1, 1, 4, 1, 0, False, 'kinematic'], [2, 3, 4, 7, -2, False, 'dynamic'], [3, 1, 4, 12, 0, True, 'dynamic']], [[1, 3], [3, 2], [3, 1], [3, 1], [2, 1], [3, 2], [2, 3], [1, 2], [1, 3]]], [[2, 3]]], [[[[1, 1, 4, 6, 2, False, 'kinematic'], [2, 2, 2, 7, -2, False, 'static'], [3, 4, 8, 7, -2, False, 'dynamic'], [4, 3, 4, 6, 0, False, 'dynamic'], [5, 1, 2, 15, 2, False, 'dynamic'], [6, 1, 2, 3, -2, False, 'dynamic'], [7, 1, 8, 15, 1, False, 'dynamic'], [8, 4, 1, 3, 1, False, 'static'], [9, 3, 1, 12, 0, False, 'kinematic']], [[4, 8], [9, 2], [7, 9], [6, 5], [3, 4], [1, 4]]], [[1, 4], [7, 9]]], [[[[1, 3, 1, 15, 1, False, 'dynamic'], [2, 4, 4, 1, 1, False, 'dynamic'], [3, 4, 8, 15, 0, False, 'dynamic'], [4, 4, 8, 1, 2, True, 'dynamic'], [5, 2, 4, 1, 0, False, 'dynamic'], [6, 3, 2, 15, -1, False, 'kinematic'], [7, 2, 1, 6, 1, True, 'kinematic'], [8, 3, 2, 3, 1, True, 'kinematic']], [[1, 7], [2, 5], [3, 4]]], [[1, 7]]], [[[[1, 3, 8, 1, 0, False, 'dynamic'], [2, 1, 4, 6, 2, False, 'dynamic'], [3, 3, 1, 3, 2, True, 'dynamic'], [4, 1, 4, 12, -2, True, 'dynamic']], [[3, 4], [1, 4], [1, 2], [4, 1], [2, 1], [3, 4], [2, 3], [4, 1], [3, 1], [3, 4]]], [[2, 3]]], [[[[1, 4, 2, 15, 0, False, 'static'], [2, 3, 4, 7, -1, False, 'dynamic'], [3, 1, 8, 15, 2, False, 'kinematic'], [4, 4, 2, 6, 2, False, 'dynamic'], [5, 1, 2, 7, 1, True, 'kinematic'], [6, 3, 1, 12, -1, False, 'dynamic'], [7, 1, 2, 12, -1, False, 'dynamic'], [8, 2, 2, 12, -1, False, 'kinematic']], [[8, 5], [3, 1], [4, 7]]], []]], [[[[[1, 4, 8, 15, -1, False, 'kinematic'], [2, 1, 8, 3, 2, True, 'static'], [3, 1, 2, 6, -1, True, 'dynamic'], [4, 2, 4, 15, 0, True, 'static'], [5, 2, 4, 1, 2, True, 'dynamic'], [6, 3, 4, 15, 0, False, 'dynamic'], [7, 3, 4, 1, -1, True, 'kinematic'], [8, 4, 2, 15, 0, False, 'dynamic'], [9, 3, 1, 7, -2, False, 'dynamic'], [10, 1, 4, 3, 0, True, 'static']], [[5, 1], [9, 6], [7, 2], [5, 2], [6, 1]]], [[1, 6]]], [[[[1, 4, 1, 3, 0, False, 'kinematic'], [2, 4, 1, 6, -1, False, 'dynamic']], [[1, 2], [2, 1], [1, 2], [1, 2], [2, 1], [2, 1], [1, 2], [1, 2]]], []], [[[[1, 1, 2, 1, 0, False, 'static'], [2, 3, 8, 6, 2, False, 'dynamic'], [3, 2, 1, 15, 1, False, 'dynamic'], [4, 2, 2, 1, 0, True, 'static'], [5, 2, 1, 6, 2, False, 'dynamic'], [6, 1, 2, 6, -2, False, 'kinematic'], [7, 4, 1, 3, 0, False, 'static'], [8, 2, 1, 15, 0, True, 'dynamic'], [9, 2, 2, 3, 2, False, 'dynamic']], [[2, 8], [9, 7], [2, 1]]], [[7, 9]]], [[[[1, 3, 4, 15, 2, False, 'dynamic'], [2, 4, 8, 15, -1, False, 'static'], [3, 1, 4, 12, -1, False, 'dynamic'], [4, 3, 2, 1, 0, True, 'static'], [5, 1, 8, 7, -2, False, 'static']], [[3, 2], [3, 4], [3, 1], [5, 3], [1, 5]]], [[1, 3], [1, 5]]], [[[[1, 1, 2, 7, 2, False, 'dynamic'], [2, 2, 4, 15, 0, False, 'kinematic'], [3, 4, 8, 15, -1, False, 'static'], [4, 4, 1, 7, -1, False, 'static'], [5, 1, 2, 1, -2, False, 'dynamic'], [6, 4, 1, 15, 1, False, 'dynamic'], [7, 4, 4, 1, -1, False, 'dynamic'], [8, 4, 1, 15, 0, False, 'static'], [9, 3, 1, 15, 0, False, 'dynamic'], [10, 3, 2, 3, 1, False, 'dynamic']], [[2, 6], [9, 6], [7, 9], [9, 6], [7, 3]]], [[2, 6], [6, 9], [7, 9]]], [[[[1, 2, 1, 1, -2, False, 'kinematic'], [2, 1, 1, 12, -2, False, 'kinematic'], [3, 2, 2, 7, 2, False, 'dynamic'], [4, 4, 4, 1, -1, True, 'dynamic'], [5, 2, 4, 6, 0, False, 'dynamic'], [6, 2, 8, 6, 0, False, 'dynamic'], [7, 1, 1, 15, 0, True, 'kinematic'], [8, 1, 1, 1, 1, False, 'static'], [9, 2, 8, 3, -2, False, 'dynamic']], [[8, 3], [3, 5], [7, 1]]], []], [[[[1, 3, 4, 1, 0, False, 'kinematic'], [2, 1, 1, 7, -1, False, 'static'], [3, 3, 1, 15, -2, False, 'static'], [4, 3, 4, 12, 1, True, 'dynamic'], [5, 3, 1, 15, 1, False, 'dynamic'], [6, 4, 8, 1, 0, False, 'kinematic'], [7, 3, 2, 1, 2, False, 'dynamic'], [8, 2, 8, 15, 0, False, 'static'], [9, 4, 8, 3, 1, True, 'static']], [[7, 9], [5, 4], [6, 2], [6, 3], [9, 7]]], []], [[[[1, 1, 2, 15, -1, False, 'dynamic'], [2, 2, 2, 12, 0, False, 'dynamic'], [3, 4, 4, 6, 0, False, 'dynamic'], [4, 2, 2, 6, 1, False, 'dynamic'], [5, 4, 4, 12, 0, False, 'dynamic'], [6, 2, 8, 15, -2, False, 'dynamic'], [7, 1, 8, 3, 2, False, 'kinematic'], [8, 4, 1, 1, 0, False, 'kinematic'], [9, 1, 1, 15, 0, True, 'kinematic']], [[1, 5], [2, 3], [9, 1], [1, 4], [6, 7], [2, 9]]], [[1, 4], [2, 3]]]]]
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, 2], [1, 3]] | [[1, 2], [1, 3]] | Passed |
| case 1 | [[1, 4]] | [] | Failed |
| case 2 | [[1, 5], [3, 4]] | [[3, 4]] | Failed |
| case 3 | [] | [] | Passed |
| case 4 | [[2, 6]] | [[2, 6]] | Passed |
| case 5 | [[1, 2]] | [] | Failed |
| case 6 | [[1, 3], [1, 4], [1, 6]] | [[1, 3], [1, 4], [1, 6]] | Passed |
| case 7 | [[1, 2]] | [] | Failed |
SHA-256 / 0d31e6d2ad6b303b9c0a90148bedcf0679aac144e8097b831b417044909454d1
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(fixtures, candidates):
fx = {f[0]: f for f in fixtures}
out = set()
for a, b in candidates:
fa, fb = fx[a], fx[b]
if fa[2] == fb[2]:
continue
if fa[6] != 'dynamic' and fb[6] != 'dynamic':
continue
ga, gb = fa[4], fb[4]
if ga == gb and ga != 0:
ok = ga > 0
else:
ok = (fa[2] & fb[3]) != 0 and (fb[2] & fa[3]) != 0
if not ok:
continue
if fa[5] and fb[5]:
continue
out.add((min(a, b), max(a, b)))
return [list(p) for p in sorted(out)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[1, 2, 8, 6, -2, False, 'dynamic'], [2, 4, 4, 12, -1, False, 'kinematic'], [3, 4, 4, 15, 1, True, 'kinematic']], [[2, 3], [3, 1], [2, 1], [2, 3], [1, 2], [3, 1]]], [[1, 2], [1, 3]]], [[[[1, 4, 8, 7, 2, False, 'kinematic'], [2, 1, 2, 7, 0, False, 'kinematic'], [3, 2, 1, 15, 0, False, 'kinematic'], [4, 4, 2, 12, 2, False, 'dynamic']], [[3, 1], [3, 2], [2, 4], [3, 1], [1, 4], [2, 1]]], []], [[[[1, 3, 8, 12, -1, True, 'dynamic'], [2, 4, 4, 15, -2, True, 'dynamic'], [3, 1, 4, 6, -2, False, 'dynamic'], [4, 2, 4, 7, 2, True, 'kinematic'], [5, 3, 8, 12, -2, False, 'dynamic']], [[2, 1], [1, 5], [4, 3], [2, 4], [2, 1], [4, 2], [3, 1]]], [[3, 4]]], [[[[1, 3, 2, 6, 0, False, 'dynamic'], [2, 4, 2, 1, 0, False, 'dynamic'], [3, 2, 8, 6, -1, True, 'dynamic'], [4, 4, 8, 15, 1, False, 'kinematic'], [5, 1, 1, 12, -2, False, 'dynamic']], [[3, 4], [4, 1], [4, 3], [4, 3], [2, 5], [2, 5], [4, 1], [3, 5]]], []], [[[[1, 4, 8, 7, -2, False, 'dynamic'], [2, 1, 2, 3, 0, True, 'kinematic'], [3, 2, 8, 15, 0, False, 'dynamic'], [4, 2, 8, 7, 1, False, 'kinematic'], [5, 3, 8, 1, 2, False, 'static'], [6, 4, 2, 15, -2, False, 'dynamic']], [[3, 5], [2, 5], [1, 3], [6, 2], [6, 1], [1, 6], [5, 6], [2, 6]]], [[2, 6]]], [[[[1, 2, 4, 15, 0, False, 'dynamic'], [2, 2, 1, 15, -1, False, 'kinematic']], [[1, 2], [2, 1], [1, 2], [2, 1], [2, 1]]], []], [[[[1, 3, 1, 7, 0, False, 'dynamic'], [2, 2, 2, 1, -1, True, 'kinematic'], [3, 1, 2, 3, 0, True, 'dynamic'], [4, 1, 2, 1, 0, False, 'dynamic'], [5, 3, 1, 1, 0, False, 'static'], [6, 4, 1, 1, -1, False, 'kinematic']], [[6, 1], [6, 2], [3, 1], [1, 6], [3, 6], [4, 1], [1, 6]]], [[1, 3], [1, 4], [1, 6]]], [[[[1, 2, 1, 15, 0, False, 'static'], [2, 2, 4, 1, 0, False, 'dynamic']], [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1]]], []]], [[[[[1, 3, 4, 12, -2, False, 'dynamic'], [2, 1, 2, 6, 2, True, 'kinematic'], [3, 2, 8, 12, 2, True, 'kinematic'], [4, 4, 2, 1, -2, False, 'kinematic'], [5, 4, 8, 15, 2, False, 'kinematic'], [6, 2, 4, 7, 2, False, 'dynamic'], [7, 1, 1, 15, 2, False, 'static']], [[6, 5], [4, 1], [2, 4], [5, 1], [4, 3], [4, 5], [2, 6], [2, 4], [4, 7], [2, 3]]], [[1, 5], [2, 6], [5, 6]]], [[[[1, 3, 1, 7, 1, False, 'dynamic'], [2, 2, 8, 12, -2, False, 'dynamic'], [3, 3, 2, 7, 2, False, 'static']], [[3, 2], [2, 1], [1, 2], [3, 2], [3, 1], [2, 1], [1, 2], [1, 2], [2, 3]]], []], [[[[1, 4, 2, 15, 2, True, 'kinematic'], [2, 4, 8, 12, -1, False, 'kinematic']], [[2, 1], [2, 1], [2, 1], [2, 1], [2, 1]]], []], [[[[1, 1, 2, 15, -1, False, 'dynamic'], [2, 4, 8, 15, -1, False, 'static'], [3, 1, 4, 1, -1, False, 'dynamic'], [4, 1, 1, 6, 2, False, 'dynamic'], [5, 4, 8, 7, 0, True, 'static']], [[2, 4], [5, 3], [4, 3], [2, 3], [3, 2], [1, 5], [5, 2], [1, 4]]], [[1, 5]]], [[[[1, 1, 4, 15, 1, False, 'kinematic'], [2, 1, 1, 6, 1, False, 'dynamic'], [3, 1, 2, 15, -2, False, 'dynamic'], [4, 4, 2, 7, 0, False, 'dynamic'], [5, 3, 8, 6, 2, False, 'dynamic'], [6, 1, 1, 15, -2, False, 'dynamic'], [7, 4, 2, 15, 0, False, 'dynamic']], [[4, 3], [7, 1], [1, 7], [2, 1], [4, 6], [5, 2], [4, 5], [4, 5]]], [[1, 7], [3, 4], [4, 6]]], [[[[1, 3, 1, 15, 0, False, 'dynamic'], [2, 1, 1, 6, -2, True, 'kinematic']], [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1], [2, 1]]], []], [[[[1, 2, 4, 12, 1, False, 'kinematic'], [2, 4, 1, 1, 1, False, 'dynamic'], [3, 1, 1, 6, -2, True, 'static'], [4, 4, 2, 7, 2, False, 'dynamic'], [5, 2, 1, 15, 1, True, 'dynamic'], [6, 4, 1, 12, 1, True, 'dynamic'], [7, 1, 1, 1, 0, False, 'dynamic']], [[1, 7], [1, 6], [5, 6], [5, 6], [6, 2], [5, 2], [6, 7], [5, 3], [1, 7]]], [[1, 6], [2, 5]]], [[[[1, 3, 1, 6, -2, False, 'dynamic'], [2, 4, 8, 12, -1, False, 'dynamic'], [3, 3, 2, 6, 1, False, 'kinematic'], [4, 3, 4, 3, 1, False, 'kinematic'], [5, 4, 8, 15, -1, True, 'static']], [[4, 2], [2, 1], [5, 1], [1, 4]]], []]], [[[[[1, 2, 1, 15, -2, False, 'kinematic'], [2, 3, 4, 12, 0, False, 'static'], [3, 2, 8, 15, 0, False, 'dynamic']], [[3, 2], [1, 2], [3, 1], [3, 2], [3, 2], [2, 1], [3, 2], [2, 1], [2, 1]]], [[2, 3]]], [[[[1, 4, 1, 7, 1, False, 'dynamic'], [2, 4, 8, 15, -2, False, 'dynamic']], [[1, 2], [1, 2], [1, 2]]], []], [[[[1, 1, 8, 7, -1, True, 'static'], [2, 3, 1, 3, 0, False, 'dynamic'], [3, 2, 4, 15, -2, False, 'dynamic'], [4, 1, 2, 15, -2, False, 'static'], [5, 1, 2, 1, 0, False, 'dynamic'], [6, 1, 2, 1, -2, True, 'dynamic'], [7, 4, 4, 6, -1, False, 'dynamic']], [[2, 4], [6, 5], [7, 2], [5, 1], [1, 2], [6, 3], [7, 1], [6, 3]]], [[2, 4]]], [[[[1, 3, 1, 7, 0, True, 'kinematic'], [2, 2, 1, 12, 0, False, 'dynamic'], [3, 1, 2, 1, 1, False, 'static'], [4, 3, 2, 12, 0, True, 'kinematic'], [5, 2, 4, 3, 1, False, 'dynamic'], [6, 4, 2, 12, 2, True, 'kinematic'], [7, 3, 2, 15, -2, True, 'dynamic'], [8, 2, 1, 7, -1, False, 'kinematic']], [[8, 5], [3, 8], [3, 4], [2, 5], [8, 2], [7, 5]]], [[5, 7]]], [[[[1, 1, 4, 12, 0, False, 'kinematic'], [2, 2, 2, 6, 2, False, 'static'], [3, 4, 1, 6, 2, True, 'dynamic'], [4, 4, 2, 15, 1, False, 'static'], [5, 4, 8, 3, 0, False, 'dynamic']], [[5, 3], [3, 4], [4, 1], [2, 4], [3, 1], [1, 3], [2, 1]]], []], [[[[1, 2, 1, 6, 2, False, 'static'], [2, 1, 4, 1, 1, False, 'dynamic'], [3, 4, 8, 7, 0, False, 'kinematic'], [4, 2, 8, 7, 1, True, 'dynamic'], [5, 2, 1, 12, 2, False, 'dynamic'], [6, 3, 8, 15, 0, False, 'dynamic'], [7, 2, 1, 12, -2, False, 'static']], [[2, 3], [5, 3], [2, 6]]], [[3, 5]]], [[[[1, 4, 2, 6, 0, False, 'static'], [2, 4, 1, 6, 1, False, 'dynamic'], [3, 4, 8, 12, 1, False, 'static'], [4, 4, 1, 1, -1, True, 'dynamic'], [5, 1, 1, 3, 1, False, 'dynamic'], [6, 2, 1, 7, 1, False, 'dynamic'], [7, 4, 8, 6, 2, False, 'dynamic'], [8, 4, 2, 15, 2, False, 'static']], [[5, 1], [5, 1], [6, 7], [3, 2], [1, 2], [5, 7], [4, 7], [7, 3], [6, 4]]], [[4, 6]]], [[[[1, 4, 4, 6, 1, True, 'dynamic'], [2, 4, 2, 3, 2, False, 'dynamic'], [3, 2, 8, 3, -1, True, 'dynamic'], [4, 3, 2, 15, 0, False, 'static'], [5, 3, 2, 7, 0, False, 'static']], [[5, 3], [4, 2], [4, 3], [4, 2], [3, 2], [2, 5], [5, 1], [2, 4], [4, 2]]], [[1, 5], [2, 4], [2, 5], [3, 4]]]], [[[[[1, 4, 4, 6, 1, False, 'kinematic'], [2, 4, 1, 12, 0, True, 'dynamic'], [3, 1, 2, 15, -1, False, 'dynamic'], [4, 2, 2, 7, 1, True, 'static'], [5, 1, 2, 6, -1, False, 'dynamic']], [[1, 4], [5, 3], [4, 2], [4, 5], [3, 1], [3, 1], [1, 2], [4, 3], [4, 3], [1, 3]]], [[1, 3], [3, 4], [4, 5]]], [[[[1, 2, 1, 6, 1, False, 'dynamic'], [2, 1, 2, 3, -2, True, 'static'], [3, 2, 4, 7, -1, False, 'dynamic'], [4, 4, 2, 12, -1, False, 'kinematic'], [5, 4, 2, 15, 0, False, 'kinematic'], [6, 2, 2, 12, 1, False, 'static'], [7, 2, 1, 1, 2, False, 'kinematic'], [8, 2, 4, 6, 0, True, 'static']], [[3, 8], [2, 1], [4, 7]]], [[1, 2]]], [[[[1, 4, 2, 1, -2, False, 'dynamic'], [2, 4, 4, 15, -2, False, 'dynamic'], [3, 1, 8, 15, -1, False, 'dynamic'], [4, 4, 2, 6, -1, False, 'dynamic'], [5, 4, 2, 12, 0, False, 'static'], [6, 2, 2, 6, 0, False, 'dynamic']], [[4, 2], [3, 2], [2, 4], [6, 3], [6, 2]]], [[2, 3], [2, 6]]], [[[[1, 1, 4, 1, 0, False, 'kinematic'], [2, 3, 4, 7, -2, False, 'dynamic'], [3, 1, 4, 12, 0, True, 'dynamic']], [[1, 3], [3, 2], [3, 1], [3, 1], [2, 1], [3, 2], [2, 3], [1, 2], [1, 3]]], [[2, 3]]], [[[[1, 1, 4, 6, 2, False, 'kinematic'], [2, 2, 2, 7, -2, False, 'static'], [3, 4, 8, 7, -2, False, 'dynamic'], [4, 3, 4, 6, 0, False, 'dynamic'], [5, 1, 2, 15, 2, False, 'dynamic'], [6, 1, 2, 3, -2, False, 'dynamic'], [7, 1, 8, 15, 1, False, 'dynamic'], [8, 4, 1, 3, 1, False, 'static'], [9, 3, 1, 12, 0, False, 'kinematic']], [[4, 8], [9, 2], [7, 9], [6, 5], [3, 4], [1, 4]]], [[1, 4], [7, 9]]], [[[[1, 3, 1, 15, 1, False, 'dynamic'], [2, 4, 4, 1, 1, False, 'dynamic'], [3, 4, 8, 15, 0, False, 'dynamic'], [4, 4, 8, 1, 2, True, 'dynamic'], [5, 2, 4, 1, 0, False, 'dynamic'], [6, 3, 2, 15, -1, False, 'kinematic'], [7, 2, 1, 6, 1, True, 'kinematic'], [8, 3, 2, 3, 1, True, 'kinematic']], [[1, 7], [2, 5], [3, 4]]], [[1, 7]]], [[[[1, 3, 8, 1, 0, False, 'dynamic'], [2, 1, 4, 6, 2, False, 'dynamic'], [3, 3, 1, 3, 2, True, 'dynamic'], [4, 1, 4, 12, -2, True, 'dynamic']], [[3, 4], [1, 4], [1, 2], [4, 1], [2, 1], [3, 4], [2, 3], [4, 1], [3, 1], [3, 4]]], [[2, 3]]], [[[[1, 4, 2, 15, 0, False, 'static'], [2, 3, 4, 7, -1, False, 'dynamic'], [3, 1, 8, 15, 2, False, 'kinematic'], [4, 4, 2, 6, 2, False, 'dynamic'], [5, 1, 2, 7, 1, True, 'kinematic'], [6, 3, 1, 12, -1, False, 'dynamic'], [7, 1, 2, 12, -1, False, 'dynamic'], [8, 2, 2, 12, -1, False, 'kinematic']], [[8, 5], [3, 1], [4, 7]]], []]], [[[[[1, 4, 8, 15, -1, False, 'kinematic'], [2, 1, 8, 3, 2, True, 'static'], [3, 1, 2, 6, -1, True, 'dynamic'], [4, 2, 4, 15, 0, True, 'static'], [5, 2, 4, 1, 2, True, 'dynamic'], [6, 3, 4, 15, 0, False, 'dynamic'], [7, 3, 4, 1, -1, True, 'kinematic'], [8, 4, 2, 15, 0, False, 'dynamic'], [9, 3, 1, 7, -2, False, 'dynamic'], [10, 1, 4, 3, 0, True, 'static']], [[5, 1], [9, 6], [7, 2], [5, 2], [6, 1]]], [[1, 6]]], [[[[1, 4, 1, 3, 0, False, 'kinematic'], [2, 4, 1, 6, -1, False, 'dynamic']], [[1, 2], [2, 1], [1, 2], [1, 2], [2, 1], [2, 1], [1, 2], [1, 2]]], []], [[[[1, 1, 2, 1, 0, False, 'static'], [2, 3, 8, 6, 2, False, 'dynamic'], [3, 2, 1, 15, 1, False, 'dynamic'], [4, 2, 2, 1, 0, True, 'static'], [5, 2, 1, 6, 2, False, 'dynamic'], [6, 1, 2, 6, -2, False, 'kinematic'], [7, 4, 1, 3, 0, False, 'static'], [8, 2, 1, 15, 0, True, 'dynamic'], [9, 2, 2, 3, 2, False, 'dynamic']], [[2, 8], [9, 7], [2, 1]]], [[7, 9]]], [[[[1, 3, 4, 15, 2, False, 'dynamic'], [2, 4, 8, 15, -1, False, 'static'], [3, 1, 4, 12, -1, False, 'dynamic'], [4, 3, 2, 1, 0, True, 'static'], [5, 1, 8, 7, -2, False, 'static']], [[3, 2], [3, 4], [3, 1], [5, 3], [1, 5]]], [[1, 3], [1, 5]]], [[[[1, 1, 2, 7, 2, False, 'dynamic'], [2, 2, 4, 15, 0, False, 'kinematic'], [3, 4, 8, 15, -1, False, 'static'], [4, 4, 1, 7, -1, False, 'static'], [5, 1, 2, 1, -2, False, 'dynamic'], [6, 4, 1, 15, 1, False, 'dynamic'], [7, 4, 4, 1, -1, False, 'dynamic'], [8, 4, 1, 15, 0, False, 'static'], [9, 3, 1, 15, 0, False, 'dynamic'], [10, 3, 2, 3, 1, False, 'dynamic']], [[2, 6], [9, 6], [7, 9], [9, 6], [7, 3]]], [[2, 6], [6, 9], [7, 9]]], [[[[1, 2, 1, 1, -2, False, 'kinematic'], [2, 1, 1, 12, -2, False, 'kinematic'], [3, 2, 2, 7, 2, False, 'dynamic'], [4, 4, 4, 1, -1, True, 'dynamic'], [5, 2, 4, 6, 0, False, 'dynamic'], [6, 2, 8, 6, 0, False, 'dynamic'], [7, 1, 1, 15, 0, True, 'kinematic'], [8, 1, 1, 1, 1, False, 'static'], [9, 2, 8, 3, -2, False, 'dynamic']], [[8, 3], [3, 5], [7, 1]]], []], [[[[1, 3, 4, 1, 0, False, 'kinematic'], [2, 1, 1, 7, -1, False, 'static'], [3, 3, 1, 15, -2, False, 'static'], [4, 3, 4, 12, 1, True, 'dynamic'], [5, 3, 1, 15, 1, False, 'dynamic'], [6, 4, 8, 1, 0, False, 'kinematic'], [7, 3, 2, 1, 2, False, 'dynamic'], [8, 2, 8, 15, 0, False, 'static'], [9, 4, 8, 3, 1, True, 'static']], [[7, 9], [5, 4], [6, 2], [6, 3], [9, 7]]], []], [[[[1, 1, 2, 15, -1, False, 'dynamic'], [2, 2, 2, 12, 0, False, 'dynamic'], [3, 4, 4, 6, 0, False, 'dynamic'], [4, 2, 2, 6, 1, False, 'dynamic'], [5, 4, 4, 12, 0, False, 'dynamic'], [6, 2, 8, 15, -2, False, 'dynamic'], [7, 1, 8, 3, 2, False, 'kinematic'], [8, 4, 1, 1, 0, False, 'kinematic'], [9, 1, 1, 15, 0, True, 'kinematic']], [[1, 5], [2, 3], [9, 1], [1, 4], [6, 7], [2, 9]]], [[1, 4], [2, 3]]]]]
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, 2], [1, 3]] | [[1, 2], [1, 3]] | Passed |
| case 1 | [[1, 4]] | [] | Failed |
| case 2 | [] | [[3, 4]] | Failed |
| case 3 | [] | [] | Passed |
| case 4 | [] | [[2, 6]] | Failed |
| case 5 | [[1, 2]] | [] | Failed |
| case 6 | [[1, 3], [1, 4]] | [[1, 3], [1, 4], [1, 6]] | Failed |
| case 7 | [[1, 2]] | [] | Failed |
SHA-256 / bbfbdd2ce9553fad0dc8ac5e74a29bbd5fd4e3a9b7234044f3ef7eba44973c7b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(fixtures, candidates):
fx = {f[0]: f for f in fixtures}
out = set()
for a, b in candidates:
fa, fb = fx[a], fx[b]
if fa[1] == fb[1]:
continue
if fa[6] != 'dynamic' and fb[6] != 'dynamic':
continue
ga, gb = fa[4], fb[4]
if ga == gb and ga != 0:
ok = ga > 0
else:
ok = (fa[2] & fb[3]) != 0 and (fb[2] & fa[3]) != 0
if not ok:
continue
if fa[5] and fb[5]:
continue
out.add((min(a, b), max(a, b)))
return [list(p) for p in sorted(out)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[1, 2, 8, 6, -2, False, 'dynamic'], [2, 4, 4, 12, -1, False, 'kinematic'], [3, 4, 4, 15, 1, True, 'kinematic']], [[2, 3], [3, 1], [2, 1], [2, 3], [1, 2], [3, 1]]], [[1, 2], [1, 3]]], [[[[1, 4, 8, 7, 2, False, 'kinematic'], [2, 1, 2, 7, 0, False, 'kinematic'], [3, 2, 1, 15, 0, False, 'kinematic'], [4, 4, 2, 12, 2, False, 'dynamic']], [[3, 1], [3, 2], [2, 4], [3, 1], [1, 4], [2, 1]]], []], [[[[1, 3, 8, 12, -1, True, 'dynamic'], [2, 4, 4, 15, -2, True, 'dynamic'], [3, 1, 4, 6, -2, False, 'dynamic'], [4, 2, 4, 7, 2, True, 'kinematic'], [5, 3, 8, 12, -2, False, 'dynamic']], [[2, 1], [1, 5], [4, 3], [2, 4], [2, 1], [4, 2], [3, 1]]], [[3, 4]]], [[[[1, 3, 2, 6, 0, False, 'dynamic'], [2, 4, 2, 1, 0, False, 'dynamic'], [3, 2, 8, 6, -1, True, 'dynamic'], [4, 4, 8, 15, 1, False, 'kinematic'], [5, 1, 1, 12, -2, False, 'dynamic']], [[3, 4], [4, 1], [4, 3], [4, 3], [2, 5], [2, 5], [4, 1], [3, 5]]], []], [[[[1, 4, 8, 7, -2, False, 'dynamic'], [2, 1, 2, 3, 0, True, 'kinematic'], [3, 2, 8, 15, 0, False, 'dynamic'], [4, 2, 8, 7, 1, False, 'kinematic'], [5, 3, 8, 1, 2, False, 'static'], [6, 4, 2, 15, -2, False, 'dynamic']], [[3, 5], [2, 5], [1, 3], [6, 2], [6, 1], [1, 6], [5, 6], [2, 6]]], [[2, 6]]], [[[[1, 2, 4, 15, 0, False, 'dynamic'], [2, 2, 1, 15, -1, False, 'kinematic']], [[1, 2], [2, 1], [1, 2], [2, 1], [2, 1]]], []], [[[[1, 3, 1, 7, 0, False, 'dynamic'], [2, 2, 2, 1, -1, True, 'kinematic'], [3, 1, 2, 3, 0, True, 'dynamic'], [4, 1, 2, 1, 0, False, 'dynamic'], [5, 3, 1, 1, 0, False, 'static'], [6, 4, 1, 1, -1, False, 'kinematic']], [[6, 1], [6, 2], [3, 1], [1, 6], [3, 6], [4, 1], [1, 6]]], [[1, 3], [1, 4], [1, 6]]], [[[[1, 2, 1, 15, 0, False, 'static'], [2, 2, 4, 1, 0, False, 'dynamic']], [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1]]], []]], [[[[[1, 3, 4, 12, -2, False, 'dynamic'], [2, 1, 2, 6, 2, True, 'kinematic'], [3, 2, 8, 12, 2, True, 'kinematic'], [4, 4, 2, 1, -2, False, 'kinematic'], [5, 4, 8, 15, 2, False, 'kinematic'], [6, 2, 4, 7, 2, False, 'dynamic'], [7, 1, 1, 15, 2, False, 'static']], [[6, 5], [4, 1], [2, 4], [5, 1], [4, 3], [4, 5], [2, 6], [2, 4], [4, 7], [2, 3]]], [[1, 5], [2, 6], [5, 6]]], [[[[1, 3, 1, 7, 1, False, 'dynamic'], [2, 2, 8, 12, -2, False, 'dynamic'], [3, 3, 2, 7, 2, False, 'static']], [[3, 2], [2, 1], [1, 2], [3, 2], [3, 1], [2, 1], [1, 2], [1, 2], [2, 3]]], []], [[[[1, 4, 2, 15, 2, True, 'kinematic'], [2, 4, 8, 12, -1, False, 'kinematic']], [[2, 1], [2, 1], [2, 1], [2, 1], [2, 1]]], []], [[[[1, 1, 2, 15, -1, False, 'dynamic'], [2, 4, 8, 15, -1, False, 'static'], [3, 1, 4, 1, -1, False, 'dynamic'], [4, 1, 1, 6, 2, False, 'dynamic'], [5, 4, 8, 7, 0, True, 'static']], [[2, 4], [5, 3], [4, 3], [2, 3], [3, 2], [1, 5], [5, 2], [1, 4]]], [[1, 5]]], [[[[1, 1, 4, 15, 1, False, 'kinematic'], [2, 1, 1, 6, 1, False, 'dynamic'], [3, 1, 2, 15, -2, False, 'dynamic'], [4, 4, 2, 7, 0, False, 'dynamic'], [5, 3, 8, 6, 2, False, 'dynamic'], [6, 1, 1, 15, -2, False, 'dynamic'], [7, 4, 2, 15, 0, False, 'dynamic']], [[4, 3], [7, 1], [1, 7], [2, 1], [4, 6], [5, 2], [4, 5], [4, 5]]], [[1, 7], [3, 4], [4, 6]]], [[[[1, 3, 1, 15, 0, False, 'dynamic'], [2, 1, 1, 6, -2, True, 'kinematic']], [[1, 2], [2, 1], [1, 2], [2, 1], [1, 2], [2, 1], [2, 1]]], []], [[[[1, 2, 4, 12, 1, False, 'kinematic'], [2, 4, 1, 1, 1, False, 'dynamic'], [3, 1, 1, 6, -2, True, 'static'], [4, 4, 2, 7, 2, False, 'dynamic'], [5, 2, 1, 15, 1, True, 'dynamic'], [6, 4, 1, 12, 1, True, 'dynamic'], [7, 1, 1, 1, 0, False, 'dynamic']], [[1, 7], [1, 6], [5, 6], [5, 6], [6, 2], [5, 2], [6, 7], [5, 3], [1, 7]]], [[1, 6], [2, 5]]], [[[[1, 3, 1, 6, -2, False, 'dynamic'], [2, 4, 8, 12, -1, False, 'dynamic'], [3, 3, 2, 6, 1, False, 'kinematic'], [4, 3, 4, 3, 1, False, 'kinematic'], [5, 4, 8, 15, -1, True, 'static']], [[4, 2], [2, 1], [5, 1], [1, 4]]], []]], [[[[[1, 2, 1, 15, -2, False, 'kinematic'], [2, 3, 4, 12, 0, False, 'static'], [3, 2, 8, 15, 0, False, 'dynamic']], [[3, 2], [1, 2], [3, 1], [3, 2], [3, 2], [2, 1], [3, 2], [2, 1], [2, 1]]], [[2, 3]]], [[[[1, 4, 1, 7, 1, False, 'dynamic'], [2, 4, 8, 15, -2, False, 'dynamic']], [[1, 2], [1, 2], [1, 2]]], []], [[[[1, 1, 8, 7, -1, True, 'static'], [2, 3, 1, 3, 0, False, 'dynamic'], [3, 2, 4, 15, -2, False, 'dynamic'], [4, 1, 2, 15, -2, False, 'static'], [5, 1, 2, 1, 0, False, 'dynamic'], [6, 1, 2, 1, -2, True, 'dynamic'], [7, 4, 4, 6, -1, False, 'dynamic']], [[2, 4], [6, 5], [7, 2], [5, 1], [1, 2], [6, 3], [7, 1], [6, 3]]], [[2, 4]]], [[[[1, 3, 1, 7, 0, True, 'kinematic'], [2, 2, 1, 12, 0, False, 'dynamic'], [3, 1, 2, 1, 1, False, 'static'], [4, 3, 2, 12, 0, True, 'kinematic'], [5, 2, 4, 3, 1, False, 'dynamic'], [6, 4, 2, 12, 2, True, 'kinematic'], [7, 3, 2, 15, -2, True, 'dynamic'], [8, 2, 1, 7, -1, False, 'kinematic']], [[8, 5], [3, 8], [3, 4], [2, 5], [8, 2], [7, 5]]], [[5, 7]]], [[[[1, 1, 4, 12, 0, False, 'kinematic'], [2, 2, 2, 6, 2, False, 'static'], [3, 4, 1, 6, 2, True, 'dynamic'], [4, 4, 2, 15, 1, False, 'static'], [5, 4, 8, 3, 0, False, 'dynamic']], [[5, 3], [3, 4], [4, 1], [2, 4], [3, 1], [1, 3], [2, 1]]], []], [[[[1, 2, 1, 6, 2, False, 'static'], [2, 1, 4, 1, 1, False, 'dynamic'], [3, 4, 8, 7, 0, False, 'kinematic'], [4, 2, 8, 7, 1, True, 'dynamic'], [5, 2, 1, 12, 2, False, 'dynamic'], [6, 3, 8, 15, 0, False, 'dynamic'], [7, 2, 1, 12, -2, False, 'static']], [[2, 3], [5, 3], [2, 6]]], [[3, 5]]], [[[[1, 4, 2, 6, 0, False, 'static'], [2, 4, 1, 6, 1, False, 'dynamic'], [3, 4, 8, 12, 1, False, 'static'], [4, 4, 1, 1, -1, True, 'dynamic'], [5, 1, 1, 3, 1, False, 'dynamic'], [6, 2, 1, 7, 1, False, 'dynamic'], [7, 4, 8, 6, 2, False, 'dynamic'], [8, 4, 2, 15, 2, False, 'static']], [[5, 1], [5, 1], [6, 7], [3, 2], [1, 2], [5, 7], [4, 7], [7, 3], [6, 4]]], [[4, 6]]], [[[[1, 4, 4, 6, 1, True, 'dynamic'], [2, 4, 2, 3, 2, False, 'dynamic'], [3, 2, 8, 3, -1, True, 'dynamic'], [4, 3, 2, 15, 0, False, 'static'], [5, 3, 2, 7, 0, False, 'static']], [[5, 3], [4, 2], [4, 3], [4, 2], [3, 2], [2, 5], [5, 1], [2, 4], [4, 2]]], [[1, 5], [2, 4], [2, 5], [3, 4]]]], [[[[[1, 4, 4, 6, 1, False, 'kinematic'], [2, 4, 1, 12, 0, True, 'dynamic'], [3, 1, 2, 15, -1, False, 'dynamic'], [4, 2, 2, 7, 1, True, 'static'], [5, 1, 2, 6, -1, False, 'dynamic']], [[1, 4], [5, 3], [4, 2], [4, 5], [3, 1], [3, 1], [1, 2], [4, 3], [4, 3], [1, 3]]], [[1, 3], [3, 4], [4, 5]]], [[[[1, 2, 1, 6, 1, False, 'dynamic'], [2, 1, 2, 3, -2, True, 'static'], [3, 2, 4, 7, -1, False, 'dynamic'], [4, 4, 2, 12, -1, False, 'kinematic'], [5, 4, 2, 15, 0, False, 'kinematic'], [6, 2, 2, 12, 1, False, 'static'], [7, 2, 1, 1, 2, False, 'kinematic'], [8, 2, 4, 6, 0, True, 'static']], [[3, 8], [2, 1], [4, 7]]], [[1, 2]]], [[[[1, 4, 2, 1, -2, False, 'dynamic'], [2, 4, 4, 15, -2, False, 'dynamic'], [3, 1, 8, 15, -1, False, 'dynamic'], [4, 4, 2, 6, -1, False, 'dynamic'], [5, 4, 2, 12, 0, False, 'static'], [6, 2, 2, 6, 0, False, 'dynamic']], [[4, 2], [3, 2], [2, 4], [6, 3], [6, 2]]], [[2, 3], [2, 6]]], [[[[1, 1, 4, 1, 0, False, 'kinematic'], [2, 3, 4, 7, -2, False, 'dynamic'], [3, 1, 4, 12, 0, True, 'dynamic']], [[1, 3], [3, 2], [3, 1], [3, 1], [2, 1], [3, 2], [2, 3], [1, 2], [1, 3]]], [[2, 3]]], [[[[1, 1, 4, 6, 2, False, 'kinematic'], [2, 2, 2, 7, -2, False, 'static'], [3, 4, 8, 7, -2, False, 'dynamic'], [4, 3, 4, 6, 0, False, 'dynamic'], [5, 1, 2, 15, 2, False, 'dynamic'], [6, 1, 2, 3, -2, False, 'dynamic'], [7, 1, 8, 15, 1, False, 'dynamic'], [8, 4, 1, 3, 1, False, 'static'], [9, 3, 1, 12, 0, False, 'kinematic']], [[4, 8], [9, 2], [7, 9], [6, 5], [3, 4], [1, 4]]], [[1, 4], [7, 9]]], [[[[1, 3, 1, 15, 1, False, 'dynamic'], [2, 4, 4, 1, 1, False, 'dynamic'], [3, 4, 8, 15, 0, False, 'dynamic'], [4, 4, 8, 1, 2, True, 'dynamic'], [5, 2, 4, 1, 0, False, 'dynamic'], [6, 3, 2, 15, -1, False, 'kinematic'], [7, 2, 1, 6, 1, True, 'kinematic'], [8, 3, 2, 3, 1, True, 'kinematic']], [[1, 7], [2, 5], [3, 4]]], [[1, 7]]], [[[[1, 3, 8, 1, 0, False, 'dynamic'], [2, 1, 4, 6, 2, False, 'dynamic'], [3, 3, 1, 3, 2, True, 'dynamic'], [4, 1, 4, 12, -2, True, 'dynamic']], [[3, 4], [1, 4], [1, 2], [4, 1], [2, 1], [3, 4], [2, 3], [4, 1], [3, 1], [3, 4]]], [[2, 3]]], [[[[1, 4, 2, 15, 0, False, 'static'], [2, 3, 4, 7, -1, False, 'dynamic'], [3, 1, 8, 15, 2, False, 'kinematic'], [4, 4, 2, 6, 2, False, 'dynamic'], [5, 1, 2, 7, 1, True, 'kinematic'], [6, 3, 1, 12, -1, False, 'dynamic'], [7, 1, 2, 12, -1, False, 'dynamic'], [8, 2, 2, 12, -1, False, 'kinematic']], [[8, 5], [3, 1], [4, 7]]], []]], [[[[[1, 4, 8, 15, -1, False, 'kinematic'], [2, 1, 8, 3, 2, True, 'static'], [3, 1, 2, 6, -1, True, 'dynamic'], [4, 2, 4, 15, 0, True, 'static'], [5, 2, 4, 1, 2, True, 'dynamic'], [6, 3, 4, 15, 0, False, 'dynamic'], [7, 3, 4, 1, -1, True, 'kinematic'], [8, 4, 2, 15, 0, False, 'dynamic'], [9, 3, 1, 7, -2, False, 'dynamic'], [10, 1, 4, 3, 0, True, 'static']], [[5, 1], [9, 6], [7, 2], [5, 2], [6, 1]]], [[1, 6]]], [[[[1, 4, 1, 3, 0, False, 'kinematic'], [2, 4, 1, 6, -1, False, 'dynamic']], [[1, 2], [2, 1], [1, 2], [1, 2], [2, 1], [2, 1], [1, 2], [1, 2]]], []], [[[[1, 1, 2, 1, 0, False, 'static'], [2, 3, 8, 6, 2, False, 'dynamic'], [3, 2, 1, 15, 1, False, 'dynamic'], [4, 2, 2, 1, 0, True, 'static'], [5, 2, 1, 6, 2, False, 'dynamic'], [6, 1, 2, 6, -2, False, 'kinematic'], [7, 4, 1, 3, 0, False, 'static'], [8, 2, 1, 15, 0, True, 'dynamic'], [9, 2, 2, 3, 2, False, 'dynamic']], [[2, 8], [9, 7], [2, 1]]], [[7, 9]]], [[[[1, 3, 4, 15, 2, False, 'dynamic'], [2, 4, 8, 15, -1, False, 'static'], [3, 1, 4, 12, -1, False, 'dynamic'], [4, 3, 2, 1, 0, True, 'static'], [5, 1, 8, 7, -2, False, 'static']], [[3, 2], [3, 4], [3, 1], [5, 3], [1, 5]]], [[1, 3], [1, 5]]], [[[[1, 1, 2, 7, 2, False, 'dynamic'], [2, 2, 4, 15, 0, False, 'kinematic'], [3, 4, 8, 15, -1, False, 'static'], [4, 4, 1, 7, -1, False, 'static'], [5, 1, 2, 1, -2, False, 'dynamic'], [6, 4, 1, 15, 1, False, 'dynamic'], [7, 4, 4, 1, -1, False, 'dynamic'], [8, 4, 1, 15, 0, False, 'static'], [9, 3, 1, 15, 0, False, 'dynamic'], [10, 3, 2, 3, 1, False, 'dynamic']], [[2, 6], [9, 6], [7, 9], [9, 6], [7, 3]]], [[2, 6], [6, 9], [7, 9]]], [[[[1, 2, 1, 1, -2, False, 'kinematic'], [2, 1, 1, 12, -2, False, 'kinematic'], [3, 2, 2, 7, 2, False, 'dynamic'], [4, 4, 4, 1, -1, True, 'dynamic'], [5, 2, 4, 6, 0, False, 'dynamic'], [6, 2, 8, 6, 0, False, 'dynamic'], [7, 1, 1, 15, 0, True, 'kinematic'], [8, 1, 1, 1, 1, False, 'static'], [9, 2, 8, 3, -2, False, 'dynamic']], [[8, 3], [3, 5], [7, 1]]], []], [[[[1, 3, 4, 1, 0, False, 'kinematic'], [2, 1, 1, 7, -1, False, 'static'], [3, 3, 1, 15, -2, False, 'static'], [4, 3, 4, 12, 1, True, 'dynamic'], [5, 3, 1, 15, 1, False, 'dynamic'], [6, 4, 8, 1, 0, False, 'kinematic'], [7, 3, 2, 1, 2, False, 'dynamic'], [8, 2, 8, 15, 0, False, 'static'], [9, 4, 8, 3, 1, True, 'static']], [[7, 9], [5, 4], [6, 2], [6, 3], [9, 7]]], []], [[[[1, 1, 2, 15, -1, False, 'dynamic'], [2, 2, 2, 12, 0, False, 'dynamic'], [3, 4, 4, 6, 0, False, 'dynamic'], [4, 2, 2, 6, 1, False, 'dynamic'], [5, 4, 4, 12, 0, False, 'dynamic'], [6, 2, 8, 15, -2, False, 'dynamic'], [7, 1, 8, 3, 2, False, 'kinematic'], [8, 4, 1, 1, 0, False, 'kinematic'], [9, 1, 1, 15, 0, True, 'kinematic']], [[1, 5], [2, 3], [9, 1], [1, 4], [6, 7], [2, 9]]], [[1, 4], [2, 3]]]]]
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, 2], [1, 3]] | [[1, 2], [1, 3]] | Passed |
| case 1 | [] | [] | Passed |
| case 2 | [[3, 4]] | [[3, 4]] | Passed |
| case 3 | [] | [] | Passed |
| case 4 | [[2, 6]] | [[2, 6]] | Passed |
| case 5 | [] | [] | Passed |
| case 6 | [[1, 3], [1, 4], [1, 6]] | [[1, 3], [1, 4], [1, 6]] | Passed |
| case 7 | [] | [] | Passed |
SHA-256 / e873df182b47fae002edd4e4ff69fcf0764d71f4db2113dec31efae7f204c8aa
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.606110+00:00.
Case digest / a0eecf11578903bb79b7e3c2a3d325e87d7744dcc9ffe138ee8920870cc8a71b