FA-87361 / Collision detection broadphase / Open access
Secondary test reads max x as max y · case 01
Tall thin boxes miss pairs and wide flat boxes gain false ones.
ROOT CAUSE
The y test compares against column 3 (maxx) instead of 4 (maxy).
VERIFIED REPAIR
Use columns 2 and 4 for the y interval.
Unsuccessful approach: Using column 1 for min y compares x against y.
Case contract
solve(boxes): boxes [id,minx,miny,maxx,maxy] with closed intervals (touching overlaps). Sweep x endpoints sorted by (coord, begin-before-end); on each begin, test y against every active box. Return sorted [min id, max id] pairs overlapping on both axes.
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(boxes):
ev = []
for b in boxes:
ev.append((b[1], 0, b[0]))
ev.append((b[3], 1, b[0]))
ev.sort()
byid = {b[0]: b for b in boxes}
active = []
pairs = []
for x, kind, i in ev:
if kind == 0:
bi = byid[i]
for j in active:
bj = byid[j]
if bi[2] <= bj[3] and bj[2] <= bi[3]:
pairs.append([min(i, j), max(i, j)])
active.append(i)
else:
active.remove(i)
pairs.sort()
return pairs
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, -5.0, -4.0, -4.0, -2.0], [37, -5.0, -1.0, -1.0, -1.0], [26, 0.0, 1.0, 3.0, 2.0]]], []], [[[[33, -4.0, -3.0, -4.0, -3.0], [32, 3.0, -6.0, 6.0, -4.0]]], []], [[[[36, 2.0, -2.0, 6.0, 2.0], [33, 4.0, 1.0, 7.0, 5.0], [17, 6.0, -3.0, 8.0, 1.0], [30, -2.0, 0.0, -1.0, 3.0], [14, 3.0, 1.0, 6.0, 4.0], [18, 2.0, -5.0, 2.0, -5.0]]], [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]]], [[[[36, 4.0, 1.0, 5.0, 4.0], [29, 5.0, -1.0, 5.0, 0.0], [19, -2.0, -4.0, 2.0, -2.0], [23, 5.0, -2.0, 7.0, 0.0]]], [[23, 29]]], [[[[12, 0.0, -1.0, 4.0, 2.0], [32, 2.0, 3.0, 4.0, 6.0]]], []], [[[[23, 5.0, 6.0, 5.0, 7.0], [39, 0.0, 3.0, 4.0, 3.0], [27, -5.0, -4.0, -4.0, -4.0]]], []], [[[[13, 0.0, -4.0, 4.0, -1.0], [28, -6.0, 3.0, -5.0, 4.0], [4, -1.0, 1.0, -1.0, 2.0], [7, 5.0, -2.0, 5.0, -2.0], [9, -5.0, -6.0, -4.0, -6.0]]], []], [[[[28, 6.0, -4.0, 7.0, -3.0], [32, 6.0, -4.0, 9.0, -1.0], [8, 1.0, 4.0, 3.0, 7.0], [9, 3.0, -6.0, 7.0, -4.0], [37, -6.0, 3.0, -2.0, 6.0]]], [[9, 28], [9, 32], [28, 32]]]], [[[[[13, 5.0, -3.0, 6.0, -2.0], [34, 3.0, 3.0, 5.0, 4.0], [8, -4.0, 5.0, -3.0, 6.0], [10, 0.0, 1.0, 3.0, 4.0], [27, 2.0, 3.0, 2.0, 5.0], [4, -5.0, -2.0, -5.0, 2.0], [22, -6.0, 0.0, -5.0, 1.0]]], [[4, 22], [10, 27], [10, 34]]], [[[[7, 2.0, -3.0, 3.0, -1.0], [35, -4.0, 2.0, 0.0, 3.0], [1, 2.0, 4.0, 6.0, 4.0], [22, 3.0, 2.0, 5.0, 4.0]]], [[1, 22]]], [[[[37, -2.0, 2.0, 2.0, 2.0], [38, -3.0, 6.0, -2.0, 10.0], [32, -2.0, 4.0, -1.0, 4.0], [33, 4.0, 3.0, 4.0, 5.0], [14, 0.0, 6.0, 4.0, 7.0], [26, -4.0, -4.0, -2.0, -2.0]]], []], [[[[32, -4.0, 2.0, -2.0, 3.0], [28, -1.0, 6.0, 0.0, 7.0], [18, 1.0, -4.0, 3.0, -3.0], [26, -5.0, -4.0, -2.0, -2.0], [24, 1.0, -3.0, 4.0, -1.0]]], [[18, 24]]], [[[[27, 3.0, 2.0, 5.0, 6.0], [19, -3.0, -4.0, -3.0, -1.0], [1, 2.0, 1.0, 4.0, 1.0], [3, 5.0, 0.0, 6.0, 4.0], [24, -1.0, -2.0, -1.0, 0.0], [33, 0.0, -5.0, 4.0, -1.0]]], [[3, 27]]], [[[[7, -1.0, 2.0, 1.0, 2.0], [29, 4.0, -5.0, 4.0, -4.0], [34, -6.0, -4.0, -3.0, -1.0], [3, -6.0, -2.0, -5.0, -1.0], [28, -6.0, 2.0, -2.0, 2.0], [30, -3.0, 1.0, -2.0, 5.0], [5, 0.0, -6.0, 0.0, -4.0], [32, -1.0, 6.0, 3.0, 10.0]]], [[3, 34], [28, 30]]], [[[[1, -2.0, 3.0, 2.0, 5.0], [3, 2.0, 0.0, 2.0, 0.0], [15, 4.0, 2.0, 7.0, 4.0], [31, 5.0, 0.0, 7.0, 3.0], [21, 6.0, -1.0, 8.0, 3.0], [7, -5.0, -4.0, -5.0, -2.0]]], [[15, 21], [15, 31], [21, 31]]], [[[[19, -1.0, 4.0, 0.0, 4.0], [32, 5.0, -1.0, 8.0, 0.0]]], []]], [[[[[2, 0.0, 6.0, 1.0, 7.0], [8, 2.0, 4.0, 4.0, 6.0], [10, 2.0, 2.0, 5.0, 5.0], [6, -5.0, -6.0, -1.0, -2.0], [24, -1.0, 3.0, 0.0, 3.0]]], [[8, 10]]], [[[[2, -3.0, -4.0, 1.0, -2.0], [37, -2.0, 6.0, 2.0, 10.0]]], []], [[[[30, 1.0, -3.0, 5.0, -2.0], [12, 6.0, 0.0, 10.0, 1.0], [4, -6.0, -5.0, -4.0, -1.0], [23, -3.0, 6.0, -3.0, 9.0], [17, -2.0, 1.0, -2.0, 4.0], [5, -4.0, -5.0, -4.0, -2.0], [8, -1.0, -2.0, 3.0, -2.0], [37, 6.0, -2.0, 6.0, -2.0]]], [[4, 5], [8, 30]]], [[[[18, -6.0, -3.0, -5.0, -2.0], [29, 4.0, 1.0, 7.0, 4.0], [13, -6.0, -6.0, -2.0, -3.0], [25, 4.0, 2.0, 8.0, 6.0], [9, 2.0, -6.0, 6.0, -3.0], [2, -5.0, -6.0, -5.0, -3.0], [27, 6.0, -6.0, 6.0, -4.0]]], [[2, 13], [2, 18], [9, 27], [13, 18], [25, 29]]], [[[[29, 1.0, 3.0, 1.0, 5.0], [19, -2.0, 4.0, 2.0, 5.0], [21, -4.0, 4.0, -4.0, 6.0], [6, -6.0, -3.0, -4.0, 0.0], [11, 5.0, 2.0, 8.0, 2.0], [24, -3.0, 5.0, -3.0, 5.0], [15, -1.0, 5.0, 3.0, 9.0], [35, -5.0, 0.0, -5.0, 4.0]]], [[6, 35], [15, 19], [15, 29], [19, 29]]], [[[[19, -4.0, -4.0, -3.0, -4.0], [28, -1.0, 6.0, 2.0, 6.0]]], []], [[[[38, -1.0, 2.0, 1.0, 6.0], [11, 5.0, -3.0, 8.0, -3.0], [21, 1.0, -5.0, 2.0, -4.0]]], []], [[[[34, -1.0, 0.0, 3.0, 3.0], [39, 4.0, 3.0, 7.0, 3.0], [4, -6.0, -6.0, -5.0, -3.0]]], []]], [[[[[25, -6.0, -6.0, -3.0, -5.0], [23, 5.0, -2.0, 7.0, -1.0], [3, 1.0, -3.0, 5.0, 1.0]]], [[3, 23]]], [[[[39, 4.0, -4.0, 8.0, -2.0], [4, -2.0, -1.0, 1.0, 0.0], [20, 0.0, -4.0, 2.0, -1.0], [17, 3.0, -5.0, 4.0, -4.0]]], [[4, 20], [17, 39]]], [[[[12, -6.0, 0.0, -3.0, 0.0], [11, -3.0, 2.0, -3.0, 2.0], [30, 2.0, 6.0, 2.0, 7.0], [17, 2.0, -5.0, 5.0, -4.0], [18, -2.0, 6.0, -1.0, 8.0], [13, 6.0, 0.0, 7.0, 1.0], [22, -4.0, -3.0, -3.0, -2.0], [37, 3.0, -1.0, 6.0, 0.0], [20, 4.0, -1.0, 8.0, 3.0]]], [[13, 20], [13, 37], [20, 37]]], [[[[14, 1.0, 6.0, 3.0, 6.0], [36, -5.0, 4.0, -4.0, 5.0], [7, 2.0, -1.0, 2.0, 2.0], [38, -5.0, 4.0, -4.0, 4.0], [6, 0.0, 0.0, 3.0, 0.0], [21, -3.0, 2.0, -3.0, 3.0], [27, -2.0, 6.0, 2.0, 7.0], [25, -4.0, 0.0, -4.0, 4.0], [30, -5.0, -1.0, -1.0, -1.0]]], [[6, 7], [14, 27], [25, 36], [25, 38], [36, 38]]], [[[[22, -4.0, 1.0, -4.0, 4.0], [23, -4.0, -4.0, -3.0, -2.0], [24, 5.0, 0.0, 6.0, 2.0], [9, -1.0, -4.0, 1.0, -2.0]]], []], [[[[15, 0.0, -2.0, 3.0, 1.0], [4, -6.0, -6.0, -2.0, -4.0], [13, -6.0, 6.0, -6.0, 10.0], [16, 6.0, -6.0, 6.0, -5.0], [11, -2.0, -1.0, 2.0, 2.0], [20, 0.0, 4.0, 2.0, 5.0]]], [[11, 15]]], [[[[26, 2.0, 4.0, 6.0, 6.0], [9, -3.0, 0.0, -3.0, 3.0], [27, 3.0, -4.0, 7.0, -4.0], [34, -6.0, 0.0, -5.0, 2.0], [5, 2.0, -2.0, 2.0, -1.0], [38, 1.0, 5.0, 4.0, 5.0], [7, 1.0, -5.0, 3.0, -4.0], [15, 2.0, -5.0, 3.0, -5.0], [2, 5.0, 5.0, 9.0, 7.0]]], [[2, 26], [7, 15], [7, 27], [26, 38]]], [[[[39, -6.0, 1.0, -6.0, 5.0], [6, -5.0, -4.0, -2.0, 0.0], [17, 0.0, 4.0, 2.0, 7.0], [35, -6.0, 5.0, -6.0, 7.0]]], [[35, 39]]]], [[[[[2, 6.0, -4.0, 10.0, -1.0], [30, -1.0, -4.0, 2.0, -4.0], [3, -3.0, -1.0, -1.0, -1.0], [16, 3.0, -2.0, 7.0, -2.0]]], [[2, 16]]], [[[[15, 5.0, 2.0, 8.0, 4.0], [17, -5.0, -5.0, -1.0, -5.0]]], []], [[[[23, 1.0, -4.0, 2.0, -1.0], [14, 3.0, -3.0, 5.0, -2.0], [39, 4.0, 6.0, 4.0, 9.0], [20, -5.0, -1.0, -5.0, 1.0], [5, 4.0, 4.0, 7.0, 6.0], [7, -5.0, 5.0, -4.0, 5.0], [33, -5.0, -4.0, -1.0, -3.0], [26, -2.0, 3.0, 2.0, 5.0], [19, 5.0, 1.0, 7.0, 4.0]]], [[5, 19], [5, 39]]], [[[[19, 4.0, 1.0, 4.0, 2.0], [1, 2.0, -6.0, 3.0, -2.0], [35, -6.0, -4.0, -2.0, -3.0], [32, -6.0, 3.0, -3.0, 3.0], [22, -1.0, -5.0, 1.0, -1.0], [34, -1.0, 3.0, 1.0, 3.0], [24, -4.0, -5.0, -4.0, -5.0], [20, 6.0, 3.0, 8.0, 3.0], [7, -2.0, 6.0, -1.0, 6.0], [30, 3.0, -4.0, 7.0, -1.0], [15, 1.0, -5.0, 5.0, -4.0]]], [[1, 15], [1, 30], [15, 22], [15, 30]]], [[[[16, -3.0, 2.0, -3.0, 4.0], [38, 6.0, -4.0, 8.0, -3.0], [8, -1.0, 4.0, 2.0, 4.0]]], []], [[[[20, -4.0, 0.0, -4.0, 2.0], [33, 0.0, -6.0, 1.0, -5.0]]], []], [[[[10, -4.0, 0.0, -3.0, 1.0], [1, 4.0, -2.0, 4.0, 0.0], [19, 0.0, 2.0, 0.0, 5.0], [13, 4.0, -6.0, 7.0, -2.0], [16, -2.0, 0.0, -2.0, 3.0], [20, -3.0, 0.0, -2.0, 4.0], [34, -2.0, -6.0, -2.0, -3.0], [27, 2.0, 4.0, 5.0, 6.0]]], [[1, 13], [10, 20], [16, 20]]], [[[[5, 2.0, 6.0, 5.0, 6.0], [12, -3.0, 3.0, -2.0, 4.0], [35, -2.0, -4.0, -1.0, -4.0], [22, 6.0, 6.0, 9.0, 6.0], [28, 1.0, -6.0, 1.0, -2.0], [3, -2.0, -2.0, -2.0, 2.0], [16, 6.0, 5.0, 6.0, 5.0], [11, -3.0, 4.0, -3.0, 6.0], [37, -4.0, 3.0, -1.0, 7.0], [32, -5.0, -2.0, -1.0, -2.0], [18, 0.0, -5.0, 0.0, -2.0]]], [[3, 32], [11, 12], [11, 37], [12, 37]]]]]
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 | [] | [] | Passed |
| case 1 | [] | [] | Passed |
| case 2 | [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [18, 36], [33, 36]] | [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]] | Failed |
| case 3 | [[23, 29], [23, 36], [29, 36]] | [[23, 29]] | Failed |
| case 4 | [[12, 32]] | [] | Failed |
| case 5 | [] | [] | Passed |
| case 6 | [] | [] | Passed |
| case 7 | [[8, 9], [9, 28], [9, 32], [28, 32]] | [[9, 28], [9, 32], [28, 32]] | Failed |
SHA-256 / 9d3259886ed07ee94f5c458abad46d029f1c0eb1678dd14fcfda2474ac322e57
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(boxes):
ev = []
for b in boxes:
ev.append((b[1], 0, b[0]))
ev.append((b[3], 1, b[0]))
ev.sort()
byid = {b[0]: b for b in boxes}
active = []
pairs = []
for x, kind, i in ev:
if kind == 0:
bi = byid[i]
for j in active:
bj = byid[j]
if bi[1] <= bj[4] and bj[1] <= bi[4]:
pairs.append([min(i, j), max(i, j)])
active.append(i)
else:
active.remove(i)
pairs.sort()
return pairs
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, -5.0, -4.0, -4.0, -2.0], [37, -5.0, -1.0, -1.0, -1.0], [26, 0.0, 1.0, 3.0, 2.0]]], []], [[[[33, -4.0, -3.0, -4.0, -3.0], [32, 3.0, -6.0, 6.0, -4.0]]], []], [[[[36, 2.0, -2.0, 6.0, 2.0], [33, 4.0, 1.0, 7.0, 5.0], [17, 6.0, -3.0, 8.0, 1.0], [30, -2.0, 0.0, -1.0, 3.0], [14, 3.0, 1.0, 6.0, 4.0], [18, 2.0, -5.0, 2.0, -5.0]]], [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]]], [[[[36, 4.0, 1.0, 5.0, 4.0], [29, 5.0, -1.0, 5.0, 0.0], [19, -2.0, -4.0, 2.0, -2.0], [23, 5.0, -2.0, 7.0, 0.0]]], [[23, 29]]], [[[[12, 0.0, -1.0, 4.0, 2.0], [32, 2.0, 3.0, 4.0, 6.0]]], []], [[[[23, 5.0, 6.0, 5.0, 7.0], [39, 0.0, 3.0, 4.0, 3.0], [27, -5.0, -4.0, -4.0, -4.0]]], []], [[[[13, 0.0, -4.0, 4.0, -1.0], [28, -6.0, 3.0, -5.0, 4.0], [4, -1.0, 1.0, -1.0, 2.0], [7, 5.0, -2.0, 5.0, -2.0], [9, -5.0, -6.0, -4.0, -6.0]]], []], [[[[28, 6.0, -4.0, 7.0, -3.0], [32, 6.0, -4.0, 9.0, -1.0], [8, 1.0, 4.0, 3.0, 7.0], [9, 3.0, -6.0, 7.0, -4.0], [37, -6.0, 3.0, -2.0, 6.0]]], [[9, 28], [9, 32], [28, 32]]]], [[[[[13, 5.0, -3.0, 6.0, -2.0], [34, 3.0, 3.0, 5.0, 4.0], [8, -4.0, 5.0, -3.0, 6.0], [10, 0.0, 1.0, 3.0, 4.0], [27, 2.0, 3.0, 2.0, 5.0], [4, -5.0, -2.0, -5.0, 2.0], [22, -6.0, 0.0, -5.0, 1.0]]], [[4, 22], [10, 27], [10, 34]]], [[[[7, 2.0, -3.0, 3.0, -1.0], [35, -4.0, 2.0, 0.0, 3.0], [1, 2.0, 4.0, 6.0, 4.0], [22, 3.0, 2.0, 5.0, 4.0]]], [[1, 22]]], [[[[37, -2.0, 2.0, 2.0, 2.0], [38, -3.0, 6.0, -2.0, 10.0], [32, -2.0, 4.0, -1.0, 4.0], [33, 4.0, 3.0, 4.0, 5.0], [14, 0.0, 6.0, 4.0, 7.0], [26, -4.0, -4.0, -2.0, -2.0]]], []], [[[[32, -4.0, 2.0, -2.0, 3.0], [28, -1.0, 6.0, 0.0, 7.0], [18, 1.0, -4.0, 3.0, -3.0], [26, -5.0, -4.0, -2.0, -2.0], [24, 1.0, -3.0, 4.0, -1.0]]], [[18, 24]]], [[[[27, 3.0, 2.0, 5.0, 6.0], [19, -3.0, -4.0, -3.0, -1.0], [1, 2.0, 1.0, 4.0, 1.0], [3, 5.0, 0.0, 6.0, 4.0], [24, -1.0, -2.0, -1.0, 0.0], [33, 0.0, -5.0, 4.0, -1.0]]], [[3, 27]]], [[[[7, -1.0, 2.0, 1.0, 2.0], [29, 4.0, -5.0, 4.0, -4.0], [34, -6.0, -4.0, -3.0, -1.0], [3, -6.0, -2.0, -5.0, -1.0], [28, -6.0, 2.0, -2.0, 2.0], [30, -3.0, 1.0, -2.0, 5.0], [5, 0.0, -6.0, 0.0, -4.0], [32, -1.0, 6.0, 3.0, 10.0]]], [[3, 34], [28, 30]]], [[[[1, -2.0, 3.0, 2.0, 5.0], [3, 2.0, 0.0, 2.0, 0.0], [15, 4.0, 2.0, 7.0, 4.0], [31, 5.0, 0.0, 7.0, 3.0], [21, 6.0, -1.0, 8.0, 3.0], [7, -5.0, -4.0, -5.0, -2.0]]], [[15, 21], [15, 31], [21, 31]]], [[[[19, -1.0, 4.0, 0.0, 4.0], [32, 5.0, -1.0, 8.0, 0.0]]], []]], [[[[[2, 0.0, 6.0, 1.0, 7.0], [8, 2.0, 4.0, 4.0, 6.0], [10, 2.0, 2.0, 5.0, 5.0], [6, -5.0, -6.0, -1.0, -2.0], [24, -1.0, 3.0, 0.0, 3.0]]], [[8, 10]]], [[[[2, -3.0, -4.0, 1.0, -2.0], [37, -2.0, 6.0, 2.0, 10.0]]], []], [[[[30, 1.0, -3.0, 5.0, -2.0], [12, 6.0, 0.0, 10.0, 1.0], [4, -6.0, -5.0, -4.0, -1.0], [23, -3.0, 6.0, -3.0, 9.0], [17, -2.0, 1.0, -2.0, 4.0], [5, -4.0, -5.0, -4.0, -2.0], [8, -1.0, -2.0, 3.0, -2.0], [37, 6.0, -2.0, 6.0, -2.0]]], [[4, 5], [8, 30]]], [[[[18, -6.0, -3.0, -5.0, -2.0], [29, 4.0, 1.0, 7.0, 4.0], [13, -6.0, -6.0, -2.0, -3.0], [25, 4.0, 2.0, 8.0, 6.0], [9, 2.0, -6.0, 6.0, -3.0], [2, -5.0, -6.0, -5.0, -3.0], [27, 6.0, -6.0, 6.0, -4.0]]], [[2, 13], [2, 18], [9, 27], [13, 18], [25, 29]]], [[[[29, 1.0, 3.0, 1.0, 5.0], [19, -2.0, 4.0, 2.0, 5.0], [21, -4.0, 4.0, -4.0, 6.0], [6, -6.0, -3.0, -4.0, 0.0], [11, 5.0, 2.0, 8.0, 2.0], [24, -3.0, 5.0, -3.0, 5.0], [15, -1.0, 5.0, 3.0, 9.0], [35, -5.0, 0.0, -5.0, 4.0]]], [[6, 35], [15, 19], [15, 29], [19, 29]]], [[[[19, -4.0, -4.0, -3.0, -4.0], [28, -1.0, 6.0, 2.0, 6.0]]], []], [[[[38, -1.0, 2.0, 1.0, 6.0], [11, 5.0, -3.0, 8.0, -3.0], [21, 1.0, -5.0, 2.0, -4.0]]], []], [[[[34, -1.0, 0.0, 3.0, 3.0], [39, 4.0, 3.0, 7.0, 3.0], [4, -6.0, -6.0, -5.0, -3.0]]], []]], [[[[[25, -6.0, -6.0, -3.0, -5.0], [23, 5.0, -2.0, 7.0, -1.0], [3, 1.0, -3.0, 5.0, 1.0]]], [[3, 23]]], [[[[39, 4.0, -4.0, 8.0, -2.0], [4, -2.0, -1.0, 1.0, 0.0], [20, 0.0, -4.0, 2.0, -1.0], [17, 3.0, -5.0, 4.0, -4.0]]], [[4, 20], [17, 39]]], [[[[12, -6.0, 0.0, -3.0, 0.0], [11, -3.0, 2.0, -3.0, 2.0], [30, 2.0, 6.0, 2.0, 7.0], [17, 2.0, -5.0, 5.0, -4.0], [18, -2.0, 6.0, -1.0, 8.0], [13, 6.0, 0.0, 7.0, 1.0], [22, -4.0, -3.0, -3.0, -2.0], [37, 3.0, -1.0, 6.0, 0.0], [20, 4.0, -1.0, 8.0, 3.0]]], [[13, 20], [13, 37], [20, 37]]], [[[[14, 1.0, 6.0, 3.0, 6.0], [36, -5.0, 4.0, -4.0, 5.0], [7, 2.0, -1.0, 2.0, 2.0], [38, -5.0, 4.0, -4.0, 4.0], [6, 0.0, 0.0, 3.0, 0.0], [21, -3.0, 2.0, -3.0, 3.0], [27, -2.0, 6.0, 2.0, 7.0], [25, -4.0, 0.0, -4.0, 4.0], [30, -5.0, -1.0, -1.0, -1.0]]], [[6, 7], [14, 27], [25, 36], [25, 38], [36, 38]]], [[[[22, -4.0, 1.0, -4.0, 4.0], [23, -4.0, -4.0, -3.0, -2.0], [24, 5.0, 0.0, 6.0, 2.0], [9, -1.0, -4.0, 1.0, -2.0]]], []], [[[[15, 0.0, -2.0, 3.0, 1.0], [4, -6.0, -6.0, -2.0, -4.0], [13, -6.0, 6.0, -6.0, 10.0], [16, 6.0, -6.0, 6.0, -5.0], [11, -2.0, -1.0, 2.0, 2.0], [20, 0.0, 4.0, 2.0, 5.0]]], [[11, 15]]], [[[[26, 2.0, 4.0, 6.0, 6.0], [9, -3.0, 0.0, -3.0, 3.0], [27, 3.0, -4.0, 7.0, -4.0], [34, -6.0, 0.0, -5.0, 2.0], [5, 2.0, -2.0, 2.0, -1.0], [38, 1.0, 5.0, 4.0, 5.0], [7, 1.0, -5.0, 3.0, -4.0], [15, 2.0, -5.0, 3.0, -5.0], [2, 5.0, 5.0, 9.0, 7.0]]], [[2, 26], [7, 15], [7, 27], [26, 38]]], [[[[39, -6.0, 1.0, -6.0, 5.0], [6, -5.0, -4.0, -2.0, 0.0], [17, 0.0, 4.0, 2.0, 7.0], [35, -6.0, 5.0, -6.0, 7.0]]], [[35, 39]]]], [[[[[2, 6.0, -4.0, 10.0, -1.0], [30, -1.0, -4.0, 2.0, -4.0], [3, -3.0, -1.0, -1.0, -1.0], [16, 3.0, -2.0, 7.0, -2.0]]], [[2, 16]]], [[[[15, 5.0, 2.0, 8.0, 4.0], [17, -5.0, -5.0, -1.0, -5.0]]], []], [[[[23, 1.0, -4.0, 2.0, -1.0], [14, 3.0, -3.0, 5.0, -2.0], [39, 4.0, 6.0, 4.0, 9.0], [20, -5.0, -1.0, -5.0, 1.0], [5, 4.0, 4.0, 7.0, 6.0], [7, -5.0, 5.0, -4.0, 5.0], [33, -5.0, -4.0, -1.0, -3.0], [26, -2.0, 3.0, 2.0, 5.0], [19, 5.0, 1.0, 7.0, 4.0]]], [[5, 19], [5, 39]]], [[[[19, 4.0, 1.0, 4.0, 2.0], [1, 2.0, -6.0, 3.0, -2.0], [35, -6.0, -4.0, -2.0, -3.0], [32, -6.0, 3.0, -3.0, 3.0], [22, -1.0, -5.0, 1.0, -1.0], [34, -1.0, 3.0, 1.0, 3.0], [24, -4.0, -5.0, -4.0, -5.0], [20, 6.0, 3.0, 8.0, 3.0], [7, -2.0, 6.0, -1.0, 6.0], [30, 3.0, -4.0, 7.0, -1.0], [15, 1.0, -5.0, 5.0, -4.0]]], [[1, 15], [1, 30], [15, 22], [15, 30]]], [[[[16, -3.0, 2.0, -3.0, 4.0], [38, 6.0, -4.0, 8.0, -3.0], [8, -1.0, 4.0, 2.0, 4.0]]], []], [[[[20, -4.0, 0.0, -4.0, 2.0], [33, 0.0, -6.0, 1.0, -5.0]]], []], [[[[10, -4.0, 0.0, -3.0, 1.0], [1, 4.0, -2.0, 4.0, 0.0], [19, 0.0, 2.0, 0.0, 5.0], [13, 4.0, -6.0, 7.0, -2.0], [16, -2.0, 0.0, -2.0, 3.0], [20, -3.0, 0.0, -2.0, 4.0], [34, -2.0, -6.0, -2.0, -3.0], [27, 2.0, 4.0, 5.0, 6.0]]], [[1, 13], [10, 20], [16, 20]]], [[[[5, 2.0, 6.0, 5.0, 6.0], [12, -3.0, 3.0, -2.0, 4.0], [35, -2.0, -4.0, -1.0, -4.0], [22, 6.0, 6.0, 9.0, 6.0], [28, 1.0, -6.0, 1.0, -2.0], [3, -2.0, -2.0, -2.0, 2.0], [16, 6.0, 5.0, 6.0, 5.0], [11, -3.0, 4.0, -3.0, 6.0], [37, -4.0, 3.0, -1.0, 7.0], [32, -5.0, -2.0, -1.0, -2.0], [18, 0.0, -5.0, 0.0, -2.0]]], [[3, 32], [11, 12], [11, 37], [12, 37]]]]]
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 | [[5, 37]] | [] | Failed |
| case 1 | [] | [] | Passed |
| case 2 | [[14, 33]] | [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]] | Failed |
| case 3 | [] | [[23, 29]] | Failed |
| case 4 | [[12, 32]] | [] | Failed |
| case 5 | [] | [] | Passed |
| case 6 | [[9, 28]] | [] | Failed |
| case 7 | [] | [[9, 28], [9, 32], [28, 32]] | Failed |
SHA-256 / 667c7dc08ec607cf64225914d2d63655b126135aed267d0e75cf69589341a93e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(boxes):
ev = []
for b in boxes:
ev.append((b[1], 0, b[0]))
ev.append((b[3], 1, b[0]))
ev.sort()
byid = {b[0]: b for b in boxes}
active = []
pairs = []
for x, kind, i in ev:
if kind == 0:
bi = byid[i]
for j in active:
bj = byid[j]
if bi[2] <= bj[4] and bj[2] <= bi[4]:
pairs.append([min(i, j), max(i, j)])
active.append(i)
else:
active.remove(i)
pairs.sort()
return pairs
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, -5.0, -4.0, -4.0, -2.0], [37, -5.0, -1.0, -1.0, -1.0], [26, 0.0, 1.0, 3.0, 2.0]]], []], [[[[33, -4.0, -3.0, -4.0, -3.0], [32, 3.0, -6.0, 6.0, -4.0]]], []], [[[[36, 2.0, -2.0, 6.0, 2.0], [33, 4.0, 1.0, 7.0, 5.0], [17, 6.0, -3.0, 8.0, 1.0], [30, -2.0, 0.0, -1.0, 3.0], [14, 3.0, 1.0, 6.0, 4.0], [18, 2.0, -5.0, 2.0, -5.0]]], [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]]], [[[[36, 4.0, 1.0, 5.0, 4.0], [29, 5.0, -1.0, 5.0, 0.0], [19, -2.0, -4.0, 2.0, -2.0], [23, 5.0, -2.0, 7.0, 0.0]]], [[23, 29]]], [[[[12, 0.0, -1.0, 4.0, 2.0], [32, 2.0, 3.0, 4.0, 6.0]]], []], [[[[23, 5.0, 6.0, 5.0, 7.0], [39, 0.0, 3.0, 4.0, 3.0], [27, -5.0, -4.0, -4.0, -4.0]]], []], [[[[13, 0.0, -4.0, 4.0, -1.0], [28, -6.0, 3.0, -5.0, 4.0], [4, -1.0, 1.0, -1.0, 2.0], [7, 5.0, -2.0, 5.0, -2.0], [9, -5.0, -6.0, -4.0, -6.0]]], []], [[[[28, 6.0, -4.0, 7.0, -3.0], [32, 6.0, -4.0, 9.0, -1.0], [8, 1.0, 4.0, 3.0, 7.0], [9, 3.0, -6.0, 7.0, -4.0], [37, -6.0, 3.0, -2.0, 6.0]]], [[9, 28], [9, 32], [28, 32]]]], [[[[[13, 5.0, -3.0, 6.0, -2.0], [34, 3.0, 3.0, 5.0, 4.0], [8, -4.0, 5.0, -3.0, 6.0], [10, 0.0, 1.0, 3.0, 4.0], [27, 2.0, 3.0, 2.0, 5.0], [4, -5.0, -2.0, -5.0, 2.0], [22, -6.0, 0.0, -5.0, 1.0]]], [[4, 22], [10, 27], [10, 34]]], [[[[7, 2.0, -3.0, 3.0, -1.0], [35, -4.0, 2.0, 0.0, 3.0], [1, 2.0, 4.0, 6.0, 4.0], [22, 3.0, 2.0, 5.0, 4.0]]], [[1, 22]]], [[[[37, -2.0, 2.0, 2.0, 2.0], [38, -3.0, 6.0, -2.0, 10.0], [32, -2.0, 4.0, -1.0, 4.0], [33, 4.0, 3.0, 4.0, 5.0], [14, 0.0, 6.0, 4.0, 7.0], [26, -4.0, -4.0, -2.0, -2.0]]], []], [[[[32, -4.0, 2.0, -2.0, 3.0], [28, -1.0, 6.0, 0.0, 7.0], [18, 1.0, -4.0, 3.0, -3.0], [26, -5.0, -4.0, -2.0, -2.0], [24, 1.0, -3.0, 4.0, -1.0]]], [[18, 24]]], [[[[27, 3.0, 2.0, 5.0, 6.0], [19, -3.0, -4.0, -3.0, -1.0], [1, 2.0, 1.0, 4.0, 1.0], [3, 5.0, 0.0, 6.0, 4.0], [24, -1.0, -2.0, -1.0, 0.0], [33, 0.0, -5.0, 4.0, -1.0]]], [[3, 27]]], [[[[7, -1.0, 2.0, 1.0, 2.0], [29, 4.0, -5.0, 4.0, -4.0], [34, -6.0, -4.0, -3.0, -1.0], [3, -6.0, -2.0, -5.0, -1.0], [28, -6.0, 2.0, -2.0, 2.0], [30, -3.0, 1.0, -2.0, 5.0], [5, 0.0, -6.0, 0.0, -4.0], [32, -1.0, 6.0, 3.0, 10.0]]], [[3, 34], [28, 30]]], [[[[1, -2.0, 3.0, 2.0, 5.0], [3, 2.0, 0.0, 2.0, 0.0], [15, 4.0, 2.0, 7.0, 4.0], [31, 5.0, 0.0, 7.0, 3.0], [21, 6.0, -1.0, 8.0, 3.0], [7, -5.0, -4.0, -5.0, -2.0]]], [[15, 21], [15, 31], [21, 31]]], [[[[19, -1.0, 4.0, 0.0, 4.0], [32, 5.0, -1.0, 8.0, 0.0]]], []]], [[[[[2, 0.0, 6.0, 1.0, 7.0], [8, 2.0, 4.0, 4.0, 6.0], [10, 2.0, 2.0, 5.0, 5.0], [6, -5.0, -6.0, -1.0, -2.0], [24, -1.0, 3.0, 0.0, 3.0]]], [[8, 10]]], [[[[2, -3.0, -4.0, 1.0, -2.0], [37, -2.0, 6.0, 2.0, 10.0]]], []], [[[[30, 1.0, -3.0, 5.0, -2.0], [12, 6.0, 0.0, 10.0, 1.0], [4, -6.0, -5.0, -4.0, -1.0], [23, -3.0, 6.0, -3.0, 9.0], [17, -2.0, 1.0, -2.0, 4.0], [5, -4.0, -5.0, -4.0, -2.0], [8, -1.0, -2.0, 3.0, -2.0], [37, 6.0, -2.0, 6.0, -2.0]]], [[4, 5], [8, 30]]], [[[[18, -6.0, -3.0, -5.0, -2.0], [29, 4.0, 1.0, 7.0, 4.0], [13, -6.0, -6.0, -2.0, -3.0], [25, 4.0, 2.0, 8.0, 6.0], [9, 2.0, -6.0, 6.0, -3.0], [2, -5.0, -6.0, -5.0, -3.0], [27, 6.0, -6.0, 6.0, -4.0]]], [[2, 13], [2, 18], [9, 27], [13, 18], [25, 29]]], [[[[29, 1.0, 3.0, 1.0, 5.0], [19, -2.0, 4.0, 2.0, 5.0], [21, -4.0, 4.0, -4.0, 6.0], [6, -6.0, -3.0, -4.0, 0.0], [11, 5.0, 2.0, 8.0, 2.0], [24, -3.0, 5.0, -3.0, 5.0], [15, -1.0, 5.0, 3.0, 9.0], [35, -5.0, 0.0, -5.0, 4.0]]], [[6, 35], [15, 19], [15, 29], [19, 29]]], [[[[19, -4.0, -4.0, -3.0, -4.0], [28, -1.0, 6.0, 2.0, 6.0]]], []], [[[[38, -1.0, 2.0, 1.0, 6.0], [11, 5.0, -3.0, 8.0, -3.0], [21, 1.0, -5.0, 2.0, -4.0]]], []], [[[[34, -1.0, 0.0, 3.0, 3.0], [39, 4.0, 3.0, 7.0, 3.0], [4, -6.0, -6.0, -5.0, -3.0]]], []]], [[[[[25, -6.0, -6.0, -3.0, -5.0], [23, 5.0, -2.0, 7.0, -1.0], [3, 1.0, -3.0, 5.0, 1.0]]], [[3, 23]]], [[[[39, 4.0, -4.0, 8.0, -2.0], [4, -2.0, -1.0, 1.0, 0.0], [20, 0.0, -4.0, 2.0, -1.0], [17, 3.0, -5.0, 4.0, -4.0]]], [[4, 20], [17, 39]]], [[[[12, -6.0, 0.0, -3.0, 0.0], [11, -3.0, 2.0, -3.0, 2.0], [30, 2.0, 6.0, 2.0, 7.0], [17, 2.0, -5.0, 5.0, -4.0], [18, -2.0, 6.0, -1.0, 8.0], [13, 6.0, 0.0, 7.0, 1.0], [22, -4.0, -3.0, -3.0, -2.0], [37, 3.0, -1.0, 6.0, 0.0], [20, 4.0, -1.0, 8.0, 3.0]]], [[13, 20], [13, 37], [20, 37]]], [[[[14, 1.0, 6.0, 3.0, 6.0], [36, -5.0, 4.0, -4.0, 5.0], [7, 2.0, -1.0, 2.0, 2.0], [38, -5.0, 4.0, -4.0, 4.0], [6, 0.0, 0.0, 3.0, 0.0], [21, -3.0, 2.0, -3.0, 3.0], [27, -2.0, 6.0, 2.0, 7.0], [25, -4.0, 0.0, -4.0, 4.0], [30, -5.0, -1.0, -1.0, -1.0]]], [[6, 7], [14, 27], [25, 36], [25, 38], [36, 38]]], [[[[22, -4.0, 1.0, -4.0, 4.0], [23, -4.0, -4.0, -3.0, -2.0], [24, 5.0, 0.0, 6.0, 2.0], [9, -1.0, -4.0, 1.0, -2.0]]], []], [[[[15, 0.0, -2.0, 3.0, 1.0], [4, -6.0, -6.0, -2.0, -4.0], [13, -6.0, 6.0, -6.0, 10.0], [16, 6.0, -6.0, 6.0, -5.0], [11, -2.0, -1.0, 2.0, 2.0], [20, 0.0, 4.0, 2.0, 5.0]]], [[11, 15]]], [[[[26, 2.0, 4.0, 6.0, 6.0], [9, -3.0, 0.0, -3.0, 3.0], [27, 3.0, -4.0, 7.0, -4.0], [34, -6.0, 0.0, -5.0, 2.0], [5, 2.0, -2.0, 2.0, -1.0], [38, 1.0, 5.0, 4.0, 5.0], [7, 1.0, -5.0, 3.0, -4.0], [15, 2.0, -5.0, 3.0, -5.0], [2, 5.0, 5.0, 9.0, 7.0]]], [[2, 26], [7, 15], [7, 27], [26, 38]]], [[[[39, -6.0, 1.0, -6.0, 5.0], [6, -5.0, -4.0, -2.0, 0.0], [17, 0.0, 4.0, 2.0, 7.0], [35, -6.0, 5.0, -6.0, 7.0]]], [[35, 39]]]], [[[[[2, 6.0, -4.0, 10.0, -1.0], [30, -1.0, -4.0, 2.0, -4.0], [3, -3.0, -1.0, -1.0, -1.0], [16, 3.0, -2.0, 7.0, -2.0]]], [[2, 16]]], [[[[15, 5.0, 2.0, 8.0, 4.0], [17, -5.0, -5.0, -1.0, -5.0]]], []], [[[[23, 1.0, -4.0, 2.0, -1.0], [14, 3.0, -3.0, 5.0, -2.0], [39, 4.0, 6.0, 4.0, 9.0], [20, -5.0, -1.0, -5.0, 1.0], [5, 4.0, 4.0, 7.0, 6.0], [7, -5.0, 5.0, -4.0, 5.0], [33, -5.0, -4.0, -1.0, -3.0], [26, -2.0, 3.0, 2.0, 5.0], [19, 5.0, 1.0, 7.0, 4.0]]], [[5, 19], [5, 39]]], [[[[19, 4.0, 1.0, 4.0, 2.0], [1, 2.0, -6.0, 3.0, -2.0], [35, -6.0, -4.0, -2.0, -3.0], [32, -6.0, 3.0, -3.0, 3.0], [22, -1.0, -5.0, 1.0, -1.0], [34, -1.0, 3.0, 1.0, 3.0], [24, -4.0, -5.0, -4.0, -5.0], [20, 6.0, 3.0, 8.0, 3.0], [7, -2.0, 6.0, -1.0, 6.0], [30, 3.0, -4.0, 7.0, -1.0], [15, 1.0, -5.0, 5.0, -4.0]]], [[1, 15], [1, 30], [15, 22], [15, 30]]], [[[[16, -3.0, 2.0, -3.0, 4.0], [38, 6.0, -4.0, 8.0, -3.0], [8, -1.0, 4.0, 2.0, 4.0]]], []], [[[[20, -4.0, 0.0, -4.0, 2.0], [33, 0.0, -6.0, 1.0, -5.0]]], []], [[[[10, -4.0, 0.0, -3.0, 1.0], [1, 4.0, -2.0, 4.0, 0.0], [19, 0.0, 2.0, 0.0, 5.0], [13, 4.0, -6.0, 7.0, -2.0], [16, -2.0, 0.0, -2.0, 3.0], [20, -3.0, 0.0, -2.0, 4.0], [34, -2.0, -6.0, -2.0, -3.0], [27, 2.0, 4.0, 5.0, 6.0]]], [[1, 13], [10, 20], [16, 20]]], [[[[5, 2.0, 6.0, 5.0, 6.0], [12, -3.0, 3.0, -2.0, 4.0], [35, -2.0, -4.0, -1.0, -4.0], [22, 6.0, 6.0, 9.0, 6.0], [28, 1.0, -6.0, 1.0, -2.0], [3, -2.0, -2.0, -2.0, 2.0], [16, 6.0, 5.0, 6.0, 5.0], [11, -3.0, 4.0, -3.0, 6.0], [37, -4.0, 3.0, -1.0, 7.0], [32, -5.0, -2.0, -1.0, -2.0], [18, 0.0, -5.0, 0.0, -2.0]]], [[3, 32], [11, 12], [11, 37], [12, 37]]]]]
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 | [] | [] | Passed |
| case 1 | [] | [] | Passed |
| case 2 | [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]] | [[14, 17], [14, 33], [14, 36], [17, 33], [17, 36], [33, 36]] | Passed |
| case 3 | [[23, 29]] | [[23, 29]] | Passed |
| case 4 | [] | [] | Passed |
| case 5 | [] | [] | Passed |
| case 6 | [] | [] | Passed |
| case 7 | [[9, 28], [9, 32], [28, 32]] | [[9, 28], [9, 32], [28, 32]] | Passed |
SHA-256 / b4b1115afefab9725b3b7d4028187412872bcb3861fca7a3d4e913cad08d6f30
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:57.975846+00:00.
Case digest / fe0ef0f0ceb22485d16e6c3bb4e5c94948c7d3dacd9d5eac4fb6bf6baa60eddb