FA-87711 / Collision detection broadphase / Open access
Pairs between two moved proxies are never created · case 01
Two bodies moving into each other never collide.
ROOT CAUSE
Any hit that is itself in the move buffer is skipped.
VERIFIED REPAIR
Skip only when the other moved proxy has the larger id.
Unsuccessful approach: Skipping every larger id drops pairs with static proxies too.
Case contract
solve(proxies, moved): dynamic-tree pair update. For each distinct moved proxy q (first occurrence order) test every other proxy p; skip p when p also moved and p>q (that pair is found from p). Count every overlap test performed; closed intervals. Return [sorted unique [min,max] pairs, test count].
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(proxies, moved):
box = {p[0]: p for p in proxies}
mv = set(moved)
seen = set()
raw = []
tests = 0
for q in moved:
if q in seen:
continue
seen.add(q)
a = box[q]
for p in proxies:
if p[0] == q:
continue
if p[0] in mv:
continue
tests += 1
if a[1] <= p[3] and p[1] <= a[3] and a[2] <= p[4] and p[2] <= a[4]:
raw.append((min(q, p[0]), max(q, p[0])))
pairs = sorted(set(raw))
return [[list(x) for x in pairs], tests]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[39, 5.0, -4.0, 5.0, -1.0], [9, 1.0, -1.0, 2.0, 1.0], [34, -4.0, -3.0, -2.0, -2.0], [20, 2.0, 4.0, 3.0, 5.0], [31, 2.0, 5.0, 5.0, 5.0], [23, 4.0, 5.0, 6.0, 6.0], [4, -5.0, 4.0, -5.0, 6.0]], [39]], [[], 6]], [[[[18, 3.0, 5.0, 3.0, 6.0], [29, 3.0, -2.0, 5.0, -1.0], [13, 1.0, -5.0, 1.0, -5.0], [31, 0.0, -5.0, 0.0, -2.0], [22, 4.0, 4.0, 6.0, 4.0], [12, 2.0, 3.0, 2.0, 5.0], [6, -4.0, -5.0, -4.0, -4.0]], [6, 6, 31, 18, 18]], [[], 15]], [[[[30, 3.0, -3.0, 6.0, -2.0], [19, -1.0, 1.0, 2.0, 2.0], [12, -1.0, 1.0, 2.0, 4.0]], [19, 19, 19, 30, 30]], [[[12, 19]], 3]], [[[[32, 3.0, -4.0, 5.0, -3.0], [4, 0.0, 2.0, 1.0, 4.0], [26, 1.0, -2.0, 2.0, 1.0], [27, 4.0, 4.0, 5.0, 6.0], [36, 2.0, 4.0, 5.0, 7.0], [9, -4.0, 2.0, -1.0, 5.0], [38, -3.0, 0.0, -3.0, 3.0]], [9, 32]], [[[9, 38]], 11]], [[[[30, 1.0, 1.0, 2.0, 3.0], [36, -4.0, -2.0, -3.0, 1.0]], [36, 30, 30, 30]], [[], 1]], [[[[7, 1.0, -5.0, 2.0, -5.0], [35, -2.0, -5.0, -2.0, -3.0]], [7, 7, 7, 7]], [[], 1]], [[[[20, 1.0, 1.0, 4.0, 3.0], [6, -4.0, -1.0, -3.0, -1.0], [23, -1.0, -4.0, 1.0, -1.0]], [20, 6, 6]], [[], 3]], [[[[35, 2.0, -2.0, 3.0, 0.0], [37, 0.0, 2.0, 2.0, 4.0], [26, 5.0, 2.0, 7.0, 3.0], [5, 2.0, 2.0, 4.0, 3.0]], [26]], [[], 3]]], [[[[[37, -4.0, -1.0, -3.0, 1.0], [8, 4.0, 5.0, 5.0, 7.0], [24, 3.0, -2.0, 4.0, 0.0], [3, -4.0, 0.0, -1.0, 0.0], [7, 2.0, -1.0, 4.0, 1.0]], [7, 3]], [[[3, 37], [7, 24]], 7]], [[[[23, -5.0, -4.0, -3.0, -4.0], [7, 1.0, 4.0, 3.0, 4.0], [20, 2.0, -1.0, 3.0, 2.0], [6, -4.0, 5.0, -2.0, 5.0], [26, 0.0, -1.0, 3.0, 2.0]], [23, 7]], [[], 7]], [[[[23, -2.0, 5.0, 0.0, 5.0], [39, -1.0, -3.0, -1.0, -2.0], [30, -2.0, 2.0, 1.0, 3.0], [31, 0.0, 1.0, 2.0, 3.0], [4, 5.0, 2.0, 5.0, 4.0], [8, 1.0, 2.0, 1.0, 2.0]], [4]], [[], 5]], [[[[24, -1.0, 5.0, 1.0, 5.0], [19, -4.0, 2.0, -2.0, 5.0], [7, -3.0, 4.0, 0.0, 7.0], [16, -5.0, 2.0, -4.0, 5.0], [28, 3.0, 0.0, 5.0, 0.0]], [28]], [[], 4]], [[[[6, -5.0, 3.0, -3.0, 6.0], [31, 2.0, -1.0, 3.0, 2.0], [26, 1.0, 3.0, 4.0, 4.0]], [31, 6, 26]], [[], 3]], [[[[9, -3.0, 2.0, 0.0, 5.0], [28, -1.0, -4.0, 2.0, -3.0], [1, 0.0, 0.0, 2.0, 2.0], [12, 0.0, 2.0, 3.0, 2.0], [32, -3.0, -4.0, -3.0, -2.0]], [1, 28, 12, 32]], [[[1, 9], [1, 12], [9, 12]], 10]], [[[[23, 1.0, -1.0, 1.0, 0.0], [33, 3.0, -4.0, 4.0, -2.0], [28, 4.0, 0.0, 5.0, 0.0], [34, 0.0, 0.0, 1.0, 2.0], [8, -5.0, 1.0, -3.0, 3.0]], [28, 8, 34]], [[[23, 34]], 9]], [[[[3, 2.0, -2.0, 4.0, 1.0], [14, 0.0, 0.0, 3.0, 1.0], [15, 0.0, 2.0, 3.0, 4.0], [30, 5.0, -5.0, 5.0, -2.0], [26, 4.0, -4.0, 6.0, -3.0], [10, -2.0, 5.0, -1.0, 6.0], [13, -3.0, -1.0, 0.0, 2.0]], [26]], [[[26, 30]], 6]]], [[[[[31, -1.0, -4.0, 2.0, -1.0], [7, 5.0, 2.0, 7.0, 2.0], [36, 5.0, -1.0, 8.0, 2.0], [12, 5.0, 2.0, 8.0, 2.0], [29, 3.0, 3.0, 6.0, 4.0], [18, -4.0, 5.0, -2.0, 7.0], [14, -3.0, 3.0, 0.0, 5.0]], [7, 18, 14, 14, 29]], [[[7, 12], [7, 36], [14, 18]], 18]], [[[[29, 3.0, -1.0, 4.0, 2.0], [15, -4.0, -2.0, -3.0, -1.0]], [15]], [[], 1]], [[[[19, -5.0, 1.0, -4.0, 2.0], [31, -2.0, 0.0, -1.0, 3.0], [36, 3.0, 3.0, 4.0, 6.0], [24, -5.0, 5.0, -2.0, 5.0], [22, 1.0, -4.0, 1.0, -2.0], [13, 3.0, -3.0, 4.0, -2.0], [28, -2.0, 0.0, -1.0, 1.0]], [22, 22]], [[], 6]], [[[[30, 5.0, -1.0, 8.0, 2.0], [35, -4.0, 0.0, -1.0, 3.0], [17, -2.0, -3.0, -2.0, -3.0], [6, 3.0, 4.0, 5.0, 5.0], [23, -4.0, -3.0, -2.0, -1.0]], [17, 35, 35, 6, 30]], [[[17, 23]], 10]], [[[[33, 5.0, 0.0, 7.0, 2.0], [1, -3.0, 5.0, -2.0, 7.0], [18, 0.0, 3.0, 0.0, 3.0], [14, -1.0, -4.0, -1.0, -3.0], [12, -1.0, 1.0, 1.0, 4.0]], [33, 14]], [[], 7]], [[[[26, -4.0, 0.0, -4.0, 1.0], [11, -4.0, 1.0, -4.0, 2.0], [15, -2.0, 1.0, 1.0, 1.0], [39, -5.0, -1.0, -4.0, -1.0], [34, -5.0, 2.0, -4.0, 4.0]], [26, 39, 26, 15]], [[[11, 26]], 9]], [[[[20, 1.0, 5.0, 1.0, 8.0], [34, 3.0, 2.0, 3.0, 5.0], [9, 4.0, -1.0, 5.0, 1.0], [13, 1.0, -2.0, 4.0, -2.0], [14, 4.0, 0.0, 4.0, 3.0], [3, 3.0, -3.0, 5.0, -2.0], [23, 3.0, 4.0, 4.0, 4.0]], [14]], [[[9, 14]], 6]], [[[[22, 0.0, 4.0, 0.0, 5.0], [16, 3.0, -2.0, 6.0, -1.0], [25, -4.0, -1.0, -1.0, 1.0], [36, -3.0, 5.0, -2.0, 5.0], [29, -5.0, 0.0, -5.0, 0.0], [12, -4.0, 5.0, -2.0, 5.0], [11, 4.0, 2.0, 6.0, 3.0], [13, -2.0, -5.0, 0.0, -3.0], [6, -5.0, 1.0, -2.0, 3.0]], [11, 13, 25]], [[[6, 25]], 21]]], [[[[[36, -3.0, 1.0, -2.0, 2.0], [9, 3.0, 2.0, 4.0, 4.0], [3, -2.0, -2.0, -1.0, 1.0], [39, 4.0, -3.0, 4.0, -2.0], [6, -1.0, -1.0, 2.0, 0.0], [28, -3.0, -3.0, -2.0, -2.0], [38, 2.0, 4.0, 3.0, 5.0]], [38]], [[[9, 38]], 6]], [[[[32, -5.0, -1.0, -3.0, 2.0], [26, 1.0, 5.0, 2.0, 7.0], [18, -4.0, 2.0, -3.0, 4.0], [5, 1.0, 1.0, 2.0, 1.0], [11, -2.0, 4.0, 1.0, 5.0], [4, 3.0, -4.0, 4.0, -4.0], [37, -4.0, 5.0, -1.0, 7.0]], [18]], [[[18, 32]], 6]], [[[[4, 3.0, -3.0, 3.0, -1.0], [19, -1.0, -2.0, 2.0, 0.0], [38, -2.0, 1.0, 1.0, 1.0], [32, -4.0, 1.0, -3.0, 2.0]], [4, 19, 4, 32]], [[], 6]], [[[[4, 4.0, -4.0, 5.0, -4.0], [28, 0.0, -1.0, 3.0, 0.0], [2, 2.0, -5.0, 3.0, -5.0], [1, -4.0, 3.0, -3.0, 5.0], [34, -2.0, 1.0, -2.0, 2.0], [24, -3.0, 0.0, -3.0, 1.0], [16, -4.0, -4.0, -1.0, -2.0], [5, -3.0, 0.0, -1.0, 1.0], [20, -3.0, 0.0, -2.0, 0.0], [13, 5.0, -5.0, 6.0, -4.0]], [2, 2, 13]], [[[4, 13]], 17]], [[[[27, 3.0, 4.0, 4.0, 7.0], [32, 2.0, -3.0, 4.0, -3.0], [20, -5.0, -5.0, -3.0, -2.0], [19, -4.0, -3.0, -2.0, -2.0], [10, 1.0, 0.0, 3.0, 3.0]], [20, 10, 32, 19, 10]], [[[19, 20]], 10]], [[[[18, -4.0, 2.0, -4.0, 4.0], [30, 5.0, 5.0, 5.0, 6.0], [7, -5.0, 5.0, -3.0, 7.0], [32, -4.0, 2.0, -2.0, 4.0], [12, -2.0, 3.0, -2.0, 3.0]], [30, 18, 12, 32, 18]], [[[12, 32], [18, 32]], 10]], [[[[27, 0.0, 2.0, 0.0, 2.0], [36, 5.0, -1.0, 6.0, 0.0], [20, 0.0, -2.0, 3.0, -2.0], [21, 2.0, 1.0, 2.0, 4.0], [25, -3.0, -4.0, -3.0, -3.0], [32, -5.0, -5.0, -3.0, -2.0]], [27]], [[], 5]], [[[[23, -2.0, -4.0, 1.0, -1.0], [16, -3.0, -4.0, -2.0, -2.0], [25, 5.0, 1.0, 8.0, 2.0], [3, 3.0, 4.0, 4.0, 5.0], [8, 0.0, 0.0, 0.0, 2.0], [13, -1.0, -3.0, 1.0, 0.0], [19, -1.0, -3.0, 2.0, -3.0], [28, -2.0, 2.0, -2.0, 4.0], [29, -5.0, 2.0, -3.0, 2.0]], [8]], [[[8, 13]], 8]]], [[[[[2, 1.0, 1.0, 4.0, 3.0], [4, -3.0, -2.0, -1.0, -2.0], [15, 5.0, -3.0, 7.0, 0.0], [27, -2.0, 3.0, -1.0, 6.0]], [15]], [[], 3]], [[[[19, -2.0, 0.0, -1.0, 0.0], [27, -3.0, 1.0, -2.0, 4.0], [10, -4.0, -3.0, -4.0, -3.0], [29, -5.0, -4.0, -3.0, -4.0], [9, -5.0, 3.0, -2.0, 6.0]], [27, 19, 9, 10]], [[[9, 27]], 10]], [[[[8, 3.0, 1.0, 5.0, 4.0], [17, 1.0, 4.0, 4.0, 4.0], [31, 0.0, 5.0, 0.0, 7.0], [27, -3.0, 3.0, -3.0, 4.0], [26, 5.0, 1.0, 8.0, 2.0], [22, 4.0, -3.0, 5.0, 0.0], [38, 4.0, 2.0, 4.0, 5.0], [29, -2.0, 0.0, 0.0, 3.0]], [8]], [[[8, 17], [8, 26], [8, 38]], 7]], [[[[18, -3.0, -1.0, -2.0, -1.0], [23, 2.0, -3.0, 2.0, -1.0], [3, -2.0, -2.0, -2.0, 0.0], [21, 5.0, -5.0, 7.0, -5.0], [15, -3.0, -4.0, -2.0, -1.0], [12, -3.0, 3.0, -3.0, 4.0], [29, -4.0, -2.0, -1.0, 1.0], [11, -4.0, 5.0, -4.0, 8.0], [16, 0.0, -3.0, 2.0, 0.0]], [12]], [[], 8]], [[[[12, 4.0, -2.0, 4.0, 1.0], [23, 5.0, 3.0, 8.0, 6.0], [21, 3.0, 3.0, 6.0, 3.0], [16, -2.0, -3.0, -1.0, -2.0], [19, -1.0, 5.0, 0.0, 6.0]], [19, 16]], [[], 7]], [[[[24, 4.0, -1.0, 7.0, 0.0], [22, 2.0, -2.0, 4.0, -2.0], [15, 5.0, -1.0, 5.0, 1.0], [38, 2.0, 1.0, 4.0, 4.0], [19, 0.0, -3.0, 1.0, -3.0], [17, 1.0, -3.0, 3.0, -3.0], [27, 3.0, 2.0, 3.0, 2.0]], [22]], [[], 6]], [[[[14, 3.0, 3.0, 4.0, 3.0], [12, 4.0, -1.0, 7.0, -1.0], [16, -4.0, 3.0, -2.0, 5.0], [19, 3.0, -5.0, 3.0, -5.0], [9, 1.0, -1.0, 3.0, 0.0]], [16, 12, 16, 19, 12]], [[], 9]], [[[[11, -3.0, -3.0, 0.0, -1.0], [1, 3.0, -3.0, 5.0, 0.0], [27, 1.0, -5.0, 4.0, -5.0], [23, -3.0, 2.0, -3.0, 4.0], [9, -1.0, -4.0, 1.0, -3.0], [13, 4.0, 1.0, 5.0, 2.0], [18, 0.0, 5.0, 1.0, 6.0]], [1, 13, 9]], [[[9, 11]], 15]]]]
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 | [[], 6] | [[], 6] | Passed |
| case 1 | [[], 12] | [[], 15] | Failed |
| case 2 | [[[12, 19]], 2] | [[[12, 19]], 3] | Failed |
| case 3 | [[[9, 38]], 10] | [[[9, 38]], 11] | Failed |
| case 4 | [[], 0] | [[], 1] | Failed |
| case 5 | [[], 1] | [[], 1] | Passed |
| case 6 | [[], 2] | [[], 3] | Failed |
| case 7 | [[], 3] | [[], 3] | Passed |
SHA-256 / 7a889bb9fdb48ff0271cba2d209d5aaff511ca777fb713cf9e8990cc98023d5f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(proxies, moved):
box = {p[0]: p for p in proxies}
mv = set(moved)
seen = set()
raw = []
tests = 0
for q in moved:
if q in seen:
continue
seen.add(q)
a = box[q]
for p in proxies:
if p[0] == q:
continue
if p[0] > q:
continue
tests += 1
if a[1] <= p[3] and p[1] <= a[3] and a[2] <= p[4] and p[2] <= a[4]:
raw.append((min(q, p[0]), max(q, p[0])))
pairs = sorted(set(raw))
return [[list(x) for x in pairs], tests]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[39, 5.0, -4.0, 5.0, -1.0], [9, 1.0, -1.0, 2.0, 1.0], [34, -4.0, -3.0, -2.0, -2.0], [20, 2.0, 4.0, 3.0, 5.0], [31, 2.0, 5.0, 5.0, 5.0], [23, 4.0, 5.0, 6.0, 6.0], [4, -5.0, 4.0, -5.0, 6.0]], [39]], [[], 6]], [[[[18, 3.0, 5.0, 3.0, 6.0], [29, 3.0, -2.0, 5.0, -1.0], [13, 1.0, -5.0, 1.0, -5.0], [31, 0.0, -5.0, 0.0, -2.0], [22, 4.0, 4.0, 6.0, 4.0], [12, 2.0, 3.0, 2.0, 5.0], [6, -4.0, -5.0, -4.0, -4.0]], [6, 6, 31, 18, 18]], [[], 15]], [[[[30, 3.0, -3.0, 6.0, -2.0], [19, -1.0, 1.0, 2.0, 2.0], [12, -1.0, 1.0, 2.0, 4.0]], [19, 19, 19, 30, 30]], [[[12, 19]], 3]], [[[[32, 3.0, -4.0, 5.0, -3.0], [4, 0.0, 2.0, 1.0, 4.0], [26, 1.0, -2.0, 2.0, 1.0], [27, 4.0, 4.0, 5.0, 6.0], [36, 2.0, 4.0, 5.0, 7.0], [9, -4.0, 2.0, -1.0, 5.0], [38, -3.0, 0.0, -3.0, 3.0]], [9, 32]], [[[9, 38]], 11]], [[[[30, 1.0, 1.0, 2.0, 3.0], [36, -4.0, -2.0, -3.0, 1.0]], [36, 30, 30, 30]], [[], 1]], [[[[7, 1.0, -5.0, 2.0, -5.0], [35, -2.0, -5.0, -2.0, -3.0]], [7, 7, 7, 7]], [[], 1]], [[[[20, 1.0, 1.0, 4.0, 3.0], [6, -4.0, -1.0, -3.0, -1.0], [23, -1.0, -4.0, 1.0, -1.0]], [20, 6, 6]], [[], 3]], [[[[35, 2.0, -2.0, 3.0, 0.0], [37, 0.0, 2.0, 2.0, 4.0], [26, 5.0, 2.0, 7.0, 3.0], [5, 2.0, 2.0, 4.0, 3.0]], [26]], [[], 3]]], [[[[[37, -4.0, -1.0, -3.0, 1.0], [8, 4.0, 5.0, 5.0, 7.0], [24, 3.0, -2.0, 4.0, 0.0], [3, -4.0, 0.0, -1.0, 0.0], [7, 2.0, -1.0, 4.0, 1.0]], [7, 3]], [[[3, 37], [7, 24]], 7]], [[[[23, -5.0, -4.0, -3.0, -4.0], [7, 1.0, 4.0, 3.0, 4.0], [20, 2.0, -1.0, 3.0, 2.0], [6, -4.0, 5.0, -2.0, 5.0], [26, 0.0, -1.0, 3.0, 2.0]], [23, 7]], [[], 7]], [[[[23, -2.0, 5.0, 0.0, 5.0], [39, -1.0, -3.0, -1.0, -2.0], [30, -2.0, 2.0, 1.0, 3.0], [31, 0.0, 1.0, 2.0, 3.0], [4, 5.0, 2.0, 5.0, 4.0], [8, 1.0, 2.0, 1.0, 2.0]], [4]], [[], 5]], [[[[24, -1.0, 5.0, 1.0, 5.0], [19, -4.0, 2.0, -2.0, 5.0], [7, -3.0, 4.0, 0.0, 7.0], [16, -5.0, 2.0, -4.0, 5.0], [28, 3.0, 0.0, 5.0, 0.0]], [28]], [[], 4]], [[[[6, -5.0, 3.0, -3.0, 6.0], [31, 2.0, -1.0, 3.0, 2.0], [26, 1.0, 3.0, 4.0, 4.0]], [31, 6, 26]], [[], 3]], [[[[9, -3.0, 2.0, 0.0, 5.0], [28, -1.0, -4.0, 2.0, -3.0], [1, 0.0, 0.0, 2.0, 2.0], [12, 0.0, 2.0, 3.0, 2.0], [32, -3.0, -4.0, -3.0, -2.0]], [1, 28, 12, 32]], [[[1, 9], [1, 12], [9, 12]], 10]], [[[[23, 1.0, -1.0, 1.0, 0.0], [33, 3.0, -4.0, 4.0, -2.0], [28, 4.0, 0.0, 5.0, 0.0], [34, 0.0, 0.0, 1.0, 2.0], [8, -5.0, 1.0, -3.0, 3.0]], [28, 8, 34]], [[[23, 34]], 9]], [[[[3, 2.0, -2.0, 4.0, 1.0], [14, 0.0, 0.0, 3.0, 1.0], [15, 0.0, 2.0, 3.0, 4.0], [30, 5.0, -5.0, 5.0, -2.0], [26, 4.0, -4.0, 6.0, -3.0], [10, -2.0, 5.0, -1.0, 6.0], [13, -3.0, -1.0, 0.0, 2.0]], [26]], [[[26, 30]], 6]]], [[[[[31, -1.0, -4.0, 2.0, -1.0], [7, 5.0, 2.0, 7.0, 2.0], [36, 5.0, -1.0, 8.0, 2.0], [12, 5.0, 2.0, 8.0, 2.0], [29, 3.0, 3.0, 6.0, 4.0], [18, -4.0, 5.0, -2.0, 7.0], [14, -3.0, 3.0, 0.0, 5.0]], [7, 18, 14, 14, 29]], [[[7, 12], [7, 36], [14, 18]], 18]], [[[[29, 3.0, -1.0, 4.0, 2.0], [15, -4.0, -2.0, -3.0, -1.0]], [15]], [[], 1]], [[[[19, -5.0, 1.0, -4.0, 2.0], [31, -2.0, 0.0, -1.0, 3.0], [36, 3.0, 3.0, 4.0, 6.0], [24, -5.0, 5.0, -2.0, 5.0], [22, 1.0, -4.0, 1.0, -2.0], [13, 3.0, -3.0, 4.0, -2.0], [28, -2.0, 0.0, -1.0, 1.0]], [22, 22]], [[], 6]], [[[[30, 5.0, -1.0, 8.0, 2.0], [35, -4.0, 0.0, -1.0, 3.0], [17, -2.0, -3.0, -2.0, -3.0], [6, 3.0, 4.0, 5.0, 5.0], [23, -4.0, -3.0, -2.0, -1.0]], [17, 35, 35, 6, 30]], [[[17, 23]], 10]], [[[[33, 5.0, 0.0, 7.0, 2.0], [1, -3.0, 5.0, -2.0, 7.0], [18, 0.0, 3.0, 0.0, 3.0], [14, -1.0, -4.0, -1.0, -3.0], [12, -1.0, 1.0, 1.0, 4.0]], [33, 14]], [[], 7]], [[[[26, -4.0, 0.0, -4.0, 1.0], [11, -4.0, 1.0, -4.0, 2.0], [15, -2.0, 1.0, 1.0, 1.0], [39, -5.0, -1.0, -4.0, -1.0], [34, -5.0, 2.0, -4.0, 4.0]], [26, 39, 26, 15]], [[[11, 26]], 9]], [[[[20, 1.0, 5.0, 1.0, 8.0], [34, 3.0, 2.0, 3.0, 5.0], [9, 4.0, -1.0, 5.0, 1.0], [13, 1.0, -2.0, 4.0, -2.0], [14, 4.0, 0.0, 4.0, 3.0], [3, 3.0, -3.0, 5.0, -2.0], [23, 3.0, 4.0, 4.0, 4.0]], [14]], [[[9, 14]], 6]], [[[[22, 0.0, 4.0, 0.0, 5.0], [16, 3.0, -2.0, 6.0, -1.0], [25, -4.0, -1.0, -1.0, 1.0], [36, -3.0, 5.0, -2.0, 5.0], [29, -5.0, 0.0, -5.0, 0.0], [12, -4.0, 5.0, -2.0, 5.0], [11, 4.0, 2.0, 6.0, 3.0], [13, -2.0, -5.0, 0.0, -3.0], [6, -5.0, 1.0, -2.0, 3.0]], [11, 13, 25]], [[[6, 25]], 21]]], [[[[[36, -3.0, 1.0, -2.0, 2.0], [9, 3.0, 2.0, 4.0, 4.0], [3, -2.0, -2.0, -1.0, 1.0], [39, 4.0, -3.0, 4.0, -2.0], [6, -1.0, -1.0, 2.0, 0.0], [28, -3.0, -3.0, -2.0, -2.0], [38, 2.0, 4.0, 3.0, 5.0]], [38]], [[[9, 38]], 6]], [[[[32, -5.0, -1.0, -3.0, 2.0], [26, 1.0, 5.0, 2.0, 7.0], [18, -4.0, 2.0, -3.0, 4.0], [5, 1.0, 1.0, 2.0, 1.0], [11, -2.0, 4.0, 1.0, 5.0], [4, 3.0, -4.0, 4.0, -4.0], [37, -4.0, 5.0, -1.0, 7.0]], [18]], [[[18, 32]], 6]], [[[[4, 3.0, -3.0, 3.0, -1.0], [19, -1.0, -2.0, 2.0, 0.0], [38, -2.0, 1.0, 1.0, 1.0], [32, -4.0, 1.0, -3.0, 2.0]], [4, 19, 4, 32]], [[], 6]], [[[[4, 4.0, -4.0, 5.0, -4.0], [28, 0.0, -1.0, 3.0, 0.0], [2, 2.0, -5.0, 3.0, -5.0], [1, -4.0, 3.0, -3.0, 5.0], [34, -2.0, 1.0, -2.0, 2.0], [24, -3.0, 0.0, -3.0, 1.0], [16, -4.0, -4.0, -1.0, -2.0], [5, -3.0, 0.0, -1.0, 1.0], [20, -3.0, 0.0, -2.0, 0.0], [13, 5.0, -5.0, 6.0, -4.0]], [2, 2, 13]], [[[4, 13]], 17]], [[[[27, 3.0, 4.0, 4.0, 7.0], [32, 2.0, -3.0, 4.0, -3.0], [20, -5.0, -5.0, -3.0, -2.0], [19, -4.0, -3.0, -2.0, -2.0], [10, 1.0, 0.0, 3.0, 3.0]], [20, 10, 32, 19, 10]], [[[19, 20]], 10]], [[[[18, -4.0, 2.0, -4.0, 4.0], [30, 5.0, 5.0, 5.0, 6.0], [7, -5.0, 5.0, -3.0, 7.0], [32, -4.0, 2.0, -2.0, 4.0], [12, -2.0, 3.0, -2.0, 3.0]], [30, 18, 12, 32, 18]], [[[12, 32], [18, 32]], 10]], [[[[27, 0.0, 2.0, 0.0, 2.0], [36, 5.0, -1.0, 6.0, 0.0], [20, 0.0, -2.0, 3.0, -2.0], [21, 2.0, 1.0, 2.0, 4.0], [25, -3.0, -4.0, -3.0, -3.0], [32, -5.0, -5.0, -3.0, -2.0]], [27]], [[], 5]], [[[[23, -2.0, -4.0, 1.0, -1.0], [16, -3.0, -4.0, -2.0, -2.0], [25, 5.0, 1.0, 8.0, 2.0], [3, 3.0, 4.0, 4.0, 5.0], [8, 0.0, 0.0, 0.0, 2.0], [13, -1.0, -3.0, 1.0, 0.0], [19, -1.0, -3.0, 2.0, -3.0], [28, -2.0, 2.0, -2.0, 4.0], [29, -5.0, 2.0, -3.0, 2.0]], [8]], [[[8, 13]], 8]]], [[[[[2, 1.0, 1.0, 4.0, 3.0], [4, -3.0, -2.0, -1.0, -2.0], [15, 5.0, -3.0, 7.0, 0.0], [27, -2.0, 3.0, -1.0, 6.0]], [15]], [[], 3]], [[[[19, -2.0, 0.0, -1.0, 0.0], [27, -3.0, 1.0, -2.0, 4.0], [10, -4.0, -3.0, -4.0, -3.0], [29, -5.0, -4.0, -3.0, -4.0], [9, -5.0, 3.0, -2.0, 6.0]], [27, 19, 9, 10]], [[[9, 27]], 10]], [[[[8, 3.0, 1.0, 5.0, 4.0], [17, 1.0, 4.0, 4.0, 4.0], [31, 0.0, 5.0, 0.0, 7.0], [27, -3.0, 3.0, -3.0, 4.0], [26, 5.0, 1.0, 8.0, 2.0], [22, 4.0, -3.0, 5.0, 0.0], [38, 4.0, 2.0, 4.0, 5.0], [29, -2.0, 0.0, 0.0, 3.0]], [8]], [[[8, 17], [8, 26], [8, 38]], 7]], [[[[18, -3.0, -1.0, -2.0, -1.0], [23, 2.0, -3.0, 2.0, -1.0], [3, -2.0, -2.0, -2.0, 0.0], [21, 5.0, -5.0, 7.0, -5.0], [15, -3.0, -4.0, -2.0, -1.0], [12, -3.0, 3.0, -3.0, 4.0], [29, -4.0, -2.0, -1.0, 1.0], [11, -4.0, 5.0, -4.0, 8.0], [16, 0.0, -3.0, 2.0, 0.0]], [12]], [[], 8]], [[[[12, 4.0, -2.0, 4.0, 1.0], [23, 5.0, 3.0, 8.0, 6.0], [21, 3.0, 3.0, 6.0, 3.0], [16, -2.0, -3.0, -1.0, -2.0], [19, -1.0, 5.0, 0.0, 6.0]], [19, 16]], [[], 7]], [[[[24, 4.0, -1.0, 7.0, 0.0], [22, 2.0, -2.0, 4.0, -2.0], [15, 5.0, -1.0, 5.0, 1.0], [38, 2.0, 1.0, 4.0, 4.0], [19, 0.0, -3.0, 1.0, -3.0], [17, 1.0, -3.0, 3.0, -3.0], [27, 3.0, 2.0, 3.0, 2.0]], [22]], [[], 6]], [[[[14, 3.0, 3.0, 4.0, 3.0], [12, 4.0, -1.0, 7.0, -1.0], [16, -4.0, 3.0, -2.0, 5.0], [19, 3.0, -5.0, 3.0, -5.0], [9, 1.0, -1.0, 3.0, 0.0]], [16, 12, 16, 19, 12]], [[], 9]], [[[[11, -3.0, -3.0, 0.0, -1.0], [1, 3.0, -3.0, 5.0, 0.0], [27, 1.0, -5.0, 4.0, -5.0], [23, -3.0, 2.0, -3.0, 4.0], [9, -1.0, -4.0, 1.0, -3.0], [13, 4.0, 1.0, 5.0, 2.0], [18, 0.0, 5.0, 1.0, 6.0]], [1, 13, 9]], [[[9, 11]], 15]]]]
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 | [[], 6] | [[], 6] | Passed |
| case 1 | [[], 9] | [[], 15] | Failed |
| case 2 | [[[12, 19]], 3] | [[[12, 19]], 3] | Passed |
| case 3 | [[], 5] | [[[9, 38]], 11] | Failed |
| case 4 | [[], 1] | [[], 1] | Passed |
| case 5 | [[], 0] | [[], 1] | Failed |
| case 6 | [[], 1] | [[], 3] | Failed |
| case 7 | [[], 1] | [[], 3] | Failed |
SHA-256 / 106b81b0814b607fbcac7fab39879d3b6208e5fc2438ab5ba358154cf2efb163
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(proxies, moved):
box = {p[0]: p for p in proxies}
mv = set(moved)
seen = set()
raw = []
tests = 0
for q in moved:
if q in seen:
continue
seen.add(q)
a = box[q]
for p in proxies:
if p[0] == q:
continue
if p[0] in mv and p[0] > q:
continue
tests += 1
if a[1] <= p[3] and p[1] <= a[3] and a[2] <= p[4] and p[2] <= a[4]:
raw.append((min(q, p[0]), max(q, p[0])))
pairs = sorted(set(raw))
return [[list(x) for x in pairs], tests]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[39, 5.0, -4.0, 5.0, -1.0], [9, 1.0, -1.0, 2.0, 1.0], [34, -4.0, -3.0, -2.0, -2.0], [20, 2.0, 4.0, 3.0, 5.0], [31, 2.0, 5.0, 5.0, 5.0], [23, 4.0, 5.0, 6.0, 6.0], [4, -5.0, 4.0, -5.0, 6.0]], [39]], [[], 6]], [[[[18, 3.0, 5.0, 3.0, 6.0], [29, 3.0, -2.0, 5.0, -1.0], [13, 1.0, -5.0, 1.0, -5.0], [31, 0.0, -5.0, 0.0, -2.0], [22, 4.0, 4.0, 6.0, 4.0], [12, 2.0, 3.0, 2.0, 5.0], [6, -4.0, -5.0, -4.0, -4.0]], [6, 6, 31, 18, 18]], [[], 15]], [[[[30, 3.0, -3.0, 6.0, -2.0], [19, -1.0, 1.0, 2.0, 2.0], [12, -1.0, 1.0, 2.0, 4.0]], [19, 19, 19, 30, 30]], [[[12, 19]], 3]], [[[[32, 3.0, -4.0, 5.0, -3.0], [4, 0.0, 2.0, 1.0, 4.0], [26, 1.0, -2.0, 2.0, 1.0], [27, 4.0, 4.0, 5.0, 6.0], [36, 2.0, 4.0, 5.0, 7.0], [9, -4.0, 2.0, -1.0, 5.0], [38, -3.0, 0.0, -3.0, 3.0]], [9, 32]], [[[9, 38]], 11]], [[[[30, 1.0, 1.0, 2.0, 3.0], [36, -4.0, -2.0, -3.0, 1.0]], [36, 30, 30, 30]], [[], 1]], [[[[7, 1.0, -5.0, 2.0, -5.0], [35, -2.0, -5.0, -2.0, -3.0]], [7, 7, 7, 7]], [[], 1]], [[[[20, 1.0, 1.0, 4.0, 3.0], [6, -4.0, -1.0, -3.0, -1.0], [23, -1.0, -4.0, 1.0, -1.0]], [20, 6, 6]], [[], 3]], [[[[35, 2.0, -2.0, 3.0, 0.0], [37, 0.0, 2.0, 2.0, 4.0], [26, 5.0, 2.0, 7.0, 3.0], [5, 2.0, 2.0, 4.0, 3.0]], [26]], [[], 3]]], [[[[[37, -4.0, -1.0, -3.0, 1.0], [8, 4.0, 5.0, 5.0, 7.0], [24, 3.0, -2.0, 4.0, 0.0], [3, -4.0, 0.0, -1.0, 0.0], [7, 2.0, -1.0, 4.0, 1.0]], [7, 3]], [[[3, 37], [7, 24]], 7]], [[[[23, -5.0, -4.0, -3.0, -4.0], [7, 1.0, 4.0, 3.0, 4.0], [20, 2.0, -1.0, 3.0, 2.0], [6, -4.0, 5.0, -2.0, 5.0], [26, 0.0, -1.0, 3.0, 2.0]], [23, 7]], [[], 7]], [[[[23, -2.0, 5.0, 0.0, 5.0], [39, -1.0, -3.0, -1.0, -2.0], [30, -2.0, 2.0, 1.0, 3.0], [31, 0.0, 1.0, 2.0, 3.0], [4, 5.0, 2.0, 5.0, 4.0], [8, 1.0, 2.0, 1.0, 2.0]], [4]], [[], 5]], [[[[24, -1.0, 5.0, 1.0, 5.0], [19, -4.0, 2.0, -2.0, 5.0], [7, -3.0, 4.0, 0.0, 7.0], [16, -5.0, 2.0, -4.0, 5.0], [28, 3.0, 0.0, 5.0, 0.0]], [28]], [[], 4]], [[[[6, -5.0, 3.0, -3.0, 6.0], [31, 2.0, -1.0, 3.0, 2.0], [26, 1.0, 3.0, 4.0, 4.0]], [31, 6, 26]], [[], 3]], [[[[9, -3.0, 2.0, 0.0, 5.0], [28, -1.0, -4.0, 2.0, -3.0], [1, 0.0, 0.0, 2.0, 2.0], [12, 0.0, 2.0, 3.0, 2.0], [32, -3.0, -4.0, -3.0, -2.0]], [1, 28, 12, 32]], [[[1, 9], [1, 12], [9, 12]], 10]], [[[[23, 1.0, -1.0, 1.0, 0.0], [33, 3.0, -4.0, 4.0, -2.0], [28, 4.0, 0.0, 5.0, 0.0], [34, 0.0, 0.0, 1.0, 2.0], [8, -5.0, 1.0, -3.0, 3.0]], [28, 8, 34]], [[[23, 34]], 9]], [[[[3, 2.0, -2.0, 4.0, 1.0], [14, 0.0, 0.0, 3.0, 1.0], [15, 0.0, 2.0, 3.0, 4.0], [30, 5.0, -5.0, 5.0, -2.0], [26, 4.0, -4.0, 6.0, -3.0], [10, -2.0, 5.0, -1.0, 6.0], [13, -3.0, -1.0, 0.0, 2.0]], [26]], [[[26, 30]], 6]]], [[[[[31, -1.0, -4.0, 2.0, -1.0], [7, 5.0, 2.0, 7.0, 2.0], [36, 5.0, -1.0, 8.0, 2.0], [12, 5.0, 2.0, 8.0, 2.0], [29, 3.0, 3.0, 6.0, 4.0], [18, -4.0, 5.0, -2.0, 7.0], [14, -3.0, 3.0, 0.0, 5.0]], [7, 18, 14, 14, 29]], [[[7, 12], [7, 36], [14, 18]], 18]], [[[[29, 3.0, -1.0, 4.0, 2.0], [15, -4.0, -2.0, -3.0, -1.0]], [15]], [[], 1]], [[[[19, -5.0, 1.0, -4.0, 2.0], [31, -2.0, 0.0, -1.0, 3.0], [36, 3.0, 3.0, 4.0, 6.0], [24, -5.0, 5.0, -2.0, 5.0], [22, 1.0, -4.0, 1.0, -2.0], [13, 3.0, -3.0, 4.0, -2.0], [28, -2.0, 0.0, -1.0, 1.0]], [22, 22]], [[], 6]], [[[[30, 5.0, -1.0, 8.0, 2.0], [35, -4.0, 0.0, -1.0, 3.0], [17, -2.0, -3.0, -2.0, -3.0], [6, 3.0, 4.0, 5.0, 5.0], [23, -4.0, -3.0, -2.0, -1.0]], [17, 35, 35, 6, 30]], [[[17, 23]], 10]], [[[[33, 5.0, 0.0, 7.0, 2.0], [1, -3.0, 5.0, -2.0, 7.0], [18, 0.0, 3.0, 0.0, 3.0], [14, -1.0, -4.0, -1.0, -3.0], [12, -1.0, 1.0, 1.0, 4.0]], [33, 14]], [[], 7]], [[[[26, -4.0, 0.0, -4.0, 1.0], [11, -4.0, 1.0, -4.0, 2.0], [15, -2.0, 1.0, 1.0, 1.0], [39, -5.0, -1.0, -4.0, -1.0], [34, -5.0, 2.0, -4.0, 4.0]], [26, 39, 26, 15]], [[[11, 26]], 9]], [[[[20, 1.0, 5.0, 1.0, 8.0], [34, 3.0, 2.0, 3.0, 5.0], [9, 4.0, -1.0, 5.0, 1.0], [13, 1.0, -2.0, 4.0, -2.0], [14, 4.0, 0.0, 4.0, 3.0], [3, 3.0, -3.0, 5.0, -2.0], [23, 3.0, 4.0, 4.0, 4.0]], [14]], [[[9, 14]], 6]], [[[[22, 0.0, 4.0, 0.0, 5.0], [16, 3.0, -2.0, 6.0, -1.0], [25, -4.0, -1.0, -1.0, 1.0], [36, -3.0, 5.0, -2.0, 5.0], [29, -5.0, 0.0, -5.0, 0.0], [12, -4.0, 5.0, -2.0, 5.0], [11, 4.0, 2.0, 6.0, 3.0], [13, -2.0, -5.0, 0.0, -3.0], [6, -5.0, 1.0, -2.0, 3.0]], [11, 13, 25]], [[[6, 25]], 21]]], [[[[[36, -3.0, 1.0, -2.0, 2.0], [9, 3.0, 2.0, 4.0, 4.0], [3, -2.0, -2.0, -1.0, 1.0], [39, 4.0, -3.0, 4.0, -2.0], [6, -1.0, -1.0, 2.0, 0.0], [28, -3.0, -3.0, -2.0, -2.0], [38, 2.0, 4.0, 3.0, 5.0]], [38]], [[[9, 38]], 6]], [[[[32, -5.0, -1.0, -3.0, 2.0], [26, 1.0, 5.0, 2.0, 7.0], [18, -4.0, 2.0, -3.0, 4.0], [5, 1.0, 1.0, 2.0, 1.0], [11, -2.0, 4.0, 1.0, 5.0], [4, 3.0, -4.0, 4.0, -4.0], [37, -4.0, 5.0, -1.0, 7.0]], [18]], [[[18, 32]], 6]], [[[[4, 3.0, -3.0, 3.0, -1.0], [19, -1.0, -2.0, 2.0, 0.0], [38, -2.0, 1.0, 1.0, 1.0], [32, -4.0, 1.0, -3.0, 2.0]], [4, 19, 4, 32]], [[], 6]], [[[[4, 4.0, -4.0, 5.0, -4.0], [28, 0.0, -1.0, 3.0, 0.0], [2, 2.0, -5.0, 3.0, -5.0], [1, -4.0, 3.0, -3.0, 5.0], [34, -2.0, 1.0, -2.0, 2.0], [24, -3.0, 0.0, -3.0, 1.0], [16, -4.0, -4.0, -1.0, -2.0], [5, -3.0, 0.0, -1.0, 1.0], [20, -3.0, 0.0, -2.0, 0.0], [13, 5.0, -5.0, 6.0, -4.0]], [2, 2, 13]], [[[4, 13]], 17]], [[[[27, 3.0, 4.0, 4.0, 7.0], [32, 2.0, -3.0, 4.0, -3.0], [20, -5.0, -5.0, -3.0, -2.0], [19, -4.0, -3.0, -2.0, -2.0], [10, 1.0, 0.0, 3.0, 3.0]], [20, 10, 32, 19, 10]], [[[19, 20]], 10]], [[[[18, -4.0, 2.0, -4.0, 4.0], [30, 5.0, 5.0, 5.0, 6.0], [7, -5.0, 5.0, -3.0, 7.0], [32, -4.0, 2.0, -2.0, 4.0], [12, -2.0, 3.0, -2.0, 3.0]], [30, 18, 12, 32, 18]], [[[12, 32], [18, 32]], 10]], [[[[27, 0.0, 2.0, 0.0, 2.0], [36, 5.0, -1.0, 6.0, 0.0], [20, 0.0, -2.0, 3.0, -2.0], [21, 2.0, 1.0, 2.0, 4.0], [25, -3.0, -4.0, -3.0, -3.0], [32, -5.0, -5.0, -3.0, -2.0]], [27]], [[], 5]], [[[[23, -2.0, -4.0, 1.0, -1.0], [16, -3.0, -4.0, -2.0, -2.0], [25, 5.0, 1.0, 8.0, 2.0], [3, 3.0, 4.0, 4.0, 5.0], [8, 0.0, 0.0, 0.0, 2.0], [13, -1.0, -3.0, 1.0, 0.0], [19, -1.0, -3.0, 2.0, -3.0], [28, -2.0, 2.0, -2.0, 4.0], [29, -5.0, 2.0, -3.0, 2.0]], [8]], [[[8, 13]], 8]]], [[[[[2, 1.0, 1.0, 4.0, 3.0], [4, -3.0, -2.0, -1.0, -2.0], [15, 5.0, -3.0, 7.0, 0.0], [27, -2.0, 3.0, -1.0, 6.0]], [15]], [[], 3]], [[[[19, -2.0, 0.0, -1.0, 0.0], [27, -3.0, 1.0, -2.0, 4.0], [10, -4.0, -3.0, -4.0, -3.0], [29, -5.0, -4.0, -3.0, -4.0], [9, -5.0, 3.0, -2.0, 6.0]], [27, 19, 9, 10]], [[[9, 27]], 10]], [[[[8, 3.0, 1.0, 5.0, 4.0], [17, 1.0, 4.0, 4.0, 4.0], [31, 0.0, 5.0, 0.0, 7.0], [27, -3.0, 3.0, -3.0, 4.0], [26, 5.0, 1.0, 8.0, 2.0], [22, 4.0, -3.0, 5.0, 0.0], [38, 4.0, 2.0, 4.0, 5.0], [29, -2.0, 0.0, 0.0, 3.0]], [8]], [[[8, 17], [8, 26], [8, 38]], 7]], [[[[18, -3.0, -1.0, -2.0, -1.0], [23, 2.0, -3.0, 2.0, -1.0], [3, -2.0, -2.0, -2.0, 0.0], [21, 5.0, -5.0, 7.0, -5.0], [15, -3.0, -4.0, -2.0, -1.0], [12, -3.0, 3.0, -3.0, 4.0], [29, -4.0, -2.0, -1.0, 1.0], [11, -4.0, 5.0, -4.0, 8.0], [16, 0.0, -3.0, 2.0, 0.0]], [12]], [[], 8]], [[[[12, 4.0, -2.0, 4.0, 1.0], [23, 5.0, 3.0, 8.0, 6.0], [21, 3.0, 3.0, 6.0, 3.0], [16, -2.0, -3.0, -1.0, -2.0], [19, -1.0, 5.0, 0.0, 6.0]], [19, 16]], [[], 7]], [[[[24, 4.0, -1.0, 7.0, 0.0], [22, 2.0, -2.0, 4.0, -2.0], [15, 5.0, -1.0, 5.0, 1.0], [38, 2.0, 1.0, 4.0, 4.0], [19, 0.0, -3.0, 1.0, -3.0], [17, 1.0, -3.0, 3.0, -3.0], [27, 3.0, 2.0, 3.0, 2.0]], [22]], [[], 6]], [[[[14, 3.0, 3.0, 4.0, 3.0], [12, 4.0, -1.0, 7.0, -1.0], [16, -4.0, 3.0, -2.0, 5.0], [19, 3.0, -5.0, 3.0, -5.0], [9, 1.0, -1.0, 3.0, 0.0]], [16, 12, 16, 19, 12]], [[], 9]], [[[[11, -3.0, -3.0, 0.0, -1.0], [1, 3.0, -3.0, 5.0, 0.0], [27, 1.0, -5.0, 4.0, -5.0], [23, -3.0, 2.0, -3.0, 4.0], [9, -1.0, -4.0, 1.0, -3.0], [13, 4.0, 1.0, 5.0, 2.0], [18, 0.0, 5.0, 1.0, 6.0]], [1, 13, 9]], [[[9, 11]], 15]]]]
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 | [[], 6] | [[], 6] | Passed |
| case 1 | [[], 15] | [[], 15] | Passed |
| case 2 | [[[12, 19]], 3] | [[[12, 19]], 3] | Passed |
| case 3 | [[[9, 38]], 11] | [[[9, 38]], 11] | Passed |
| case 4 | [[], 1] | [[], 1] | Passed |
| case 5 | [[], 1] | [[], 1] | Passed |
| case 6 | [[], 3] | [[], 3] | Passed |
| case 7 | [[], 3] | [[], 3] | Passed |
SHA-256 / a7ada5ddf061f11c716f687d03c8b612d8c3486de2ba32da8d49a76777495399
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:51:01.274295+00:00.
Case digest / 93190348645a97a24f650b4589adaaa2c18747edac80dc5ed7929dd9b51ea915