FA-87386 / Collision detection broadphase / Open access
Largest bucket statistic reports the number of occupied cells · case 01
Grid tuning picks cell sizes from a meaningless load metric.
ROOT CAUSE
len(grid) is returned instead of the maximum bucket size.
VERIFIED REPAIR
Report the largest per-cell list length.
Unsuccessful approach: Reporting the mean load hides hot cells.
Case contract
solve(boxes, cs): insert each box [id,minx,miny,maxx,maxy] into every grid cell floor(min/cs)..floor(max/cs) inclusive on both axes. Return [sorted unique canonical candidate pairs sharing a cell, total cell insertions, largest bucket size].
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, cs):
grid = {}
inserts = 0
for b in boxes:
i0, i1 = math.floor(b[1] / cs), math.floor(b[3] / cs)
j0, j1 = math.floor(b[2] / cs), math.floor(b[4] / cs)
for i in range(i0, i1 + 1):
for j in range(j0, j1 + 1):
grid.setdefault((i, j), []).append(b[0])
inserts += 1
pairs = set()
for cell in grid.values():
for p in range(len(cell)):
for q in range(p + 1, len(cell)):
a, c = cell[p], cell[q]
pairs.add((min(a, c), max(a, c)))
return [sorted([list(p) for p in pairs]), inserts, len(grid)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[8, -4.0, 5.0, -3.0, 6.0], [20, -4.0, 6.0, 1.0, 9.0]], 2.5], [[[8, 20]], 7, 2]], [[[[6, -1.5, 2.5, -1.5, 3.5], [4, 2.0, -3.0, 2.5, -2.0]], 2.5], [[], 5, 1]], [[[[14, -2.5, 0.5, -2.5, 3.0], [38, 0.0, 2.0, 1.0, 3.0]], 1.0], [[], 8, 1]], [[[[12, -3.0, 1.0, 0.0, 3.0], [34, -4.0, -5.0, -4.0, 0.0], [33, -6.0, 5.0, -1.0, 10.0], [10, -3.0, -4.0, 2.0, 1.0], [29, 4.0, 4.0, 9.0, 5.0], [18, 2.0, -1.0, 5.0, 1.0]], 3.0], [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3]], [[[[28, 3.0, -0.5, 5.0, -0.5], [8, 0.5, 0.5, 2.5, 1.5], [17, -3.0, 1.0, -1.0, 1.5]], 2.5], [[], 6, 1]], [[[[31, -1.5, 0.0, 0.5, 0.0], [39, -2.5, 1.5, 0.0, 3.5]], 3.0], [[[31, 39]], 6, 2]], [[[[22, -1.0, 0.5, -0.5, 2.5], [36, 3.0, 1.5, 4.5, 3.5], [6, 0.5, 0.0, 3.0, 1.0], [30, -2.0, 1.5, -1.5, 3.0], [27, 0.5, 2.0, 0.5, 2.5], [8, -1.0, -0.5, 0.5, -0.5]], 3.0], [[[6, 27], [6, 36], [22, 30]], 10, 2]], [[[[38, -2.0, 4.0, 1.0, 4.0], [6, 3.0, -1.0, 4.0, 4.0], [13, -4.0, 1.0, -3.0, 6.0], [17, -1.0, 2.0, 4.0, 6.0], [24, 6.0, -6.0, 6.0, -2.0]], 3.0], [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3]]], [[[[[26, 1.0, -1.5, 3.0, -1.0], [11, -2.0, -1.5, -1.0, 1.0]], 2.5], [[], 4, 1]], [[[[1, -2.0, 2.0, -1.5, 4.5], [38, -3.0, 3.0, -1.0, 5.0], [39, -1.5, -3.0, 0.5, -1.5], [25, 1.5, -0.5, 3.5, 2.0], [9, -2.0, 1.0, -1.0, 3.0]], 3.0], [[[1, 9], [1, 38], [9, 38], [25, 39]], 11, 3]], [[[[30, 1.5, -2.5, 1.5, -2.0], [17, 1.5, 1.0, 2.5, 1.0], [23, -0.5, 0.5, 1.0, 0.5], [11, 1.5, -1.5, 3.5, -0.5], [35, -2.5, -3.0, 0.0, -2.5]], 2.0], [[[11, 30], [17, 23], [30, 35]], 11, 2]], [[[[32, -3.0, 3.0, 1.0, 5.0], [16, 5.0, 2.0, 7.0, 2.0], [6, 6.0, 1.0, 10.0, 4.0], [26, 2.0, 0.0, 6.0, 3.0], [5, 3.0, -3.0, 4.0, 2.0]], 1.0], [[[5, 26], [6, 16], [6, 26], [16, 26]], 70, 3]], [[[[8, 3.0, 1.0, 5.0, 3.0], [17, 0.0, 4.0, 1.0, 6.0], [23, -5.0, -3.0, -1.0, -1.0], [20, -3.0, -6.0, 1.0, -1.0], [33, 6.0, 5.0, 8.0, 9.0]], 3.0], [[[20, 23]], 13, 2]], [[[[25, -6.0, 5.0, -6.0, 9.0], [28, 4.0, 3.0, 8.0, 3.0], [36, -2.0, 3.0, 2.0, 8.0], [29, 2.0, -5.0, 5.0, -1.0], [20, -2.0, 4.0, 3.0, 9.0], [12, -2.0, -3.0, 1.0, -3.0]], 1.0], [[[20, 36]], 100, 2]], [[[[38, 0.5, 2.0, 1.0, 2.5], [25, -2.5, -1.5, -1.0, 0.5], [34, 0.0, 3.0, 0.5, 4.0], [4, 1.0, -1.0, 3.0, -0.5]], 2.5], [[[34, 38]], 7, 2]], [[[[13, -1.0, 6.0, 2.0, 9.0], [17, 5.0, -1.0, 10.0, 1.0], [8, 4.0, -4.0, 6.0, -2.0], [14, 3.0, 2.0, 6.0, 3.0], [18, 2.0, -1.0, 3.0, 2.0]], 2.5], [[[8, 17], [8, 18], [14, 17], [14, 18]], 22, 2]]], [[[[[13, 5.0, -1.0, 7.0, 4.0], [17, 4.0, -6.0, 8.0, -3.0]], 1.0], [[], 38, 1]], [[[[30, -1.0, 0.0, 1.0, 2.0], [17, 1.0, -3.0, 1.0, -3.0], [28, 2.0, 2.0, 2.0, 4.0], [11, -5.0, -3.0, -1.0, -2.0], [21, -5.0, -1.0, -2.0, 4.0]], 3.0], [[[11, 21], [21, 30], [28, 30]], 13, 2]], [[[[12, 0.5, -1.5, 2.0, 1.0], [25, -3.0, 0.5, -2.5, 1.0], [11, -2.5, -2.0, 0.0, -1.0], [3, -1.5, 0.0, -1.0, 0.5]], 2.0], [[[11, 12]], 9, 2]], [[[[29, 4.0, 4.0, 9.0, 6.0], [15, 3.0, 5.0, 4.0, 7.0]], 2.0], [[[15, 29]], 10, 2]], [[[[18, -6.0, 6.0, -2.0, 9.0], [12, -2.0, 3.0, -1.0, 5.0], [21, 4.0, -1.0, 4.0, 2.0], [24, 6.0, -3.0, 10.0, -2.0], [22, -5.0, -1.0, -2.0, -1.0], [27, 1.0, -4.0, 3.0, 0.0], [30, 6.0, 3.0, 8.0, 4.0]], 2.5], [[[12, 18], [21, 27]], 26, 2]], [[[[1, 4.0, -2.0, 8.0, 3.0], [19, -6.0, 3.0, -4.0, 6.0]], 3.0], [[], 8, 1]], [[[[7, 0.0, 1.0, 5.0, 2.0], [2, -4.0, -1.0, -1.0, 2.0]], 3.0], [[], 6, 1]], [[[[20, -5.0, 6.0, -4.0, 6.0], [9, -6.0, -3.0, -6.0, 2.0], [19, -2.0, -5.0, 0.0, -2.0], [22, 0.0, 2.0, 4.0, 3.0], [16, 1.0, -3.0, 6.0, -3.0], [3, -6.0, -2.0, -2.0, -1.0]], 2.5], [[[3, 9], [3, 19], [16, 19]], 18, 2]]], [[[[[35, 2.5, 2.5, 4.5, 4.0], [13, 1.5, -3.0, 4.0, -2.5]], 3.0], [[], 6, 1]], [[[[5, -5.0, -3.0, 0.0, 0.0], [27, -2.0, 4.0, -1.0, 7.0], [31, 0.0, 3.0, 5.0, 6.0], [20, 3.0, 0.0, 3.0, 3.0]], 1.0], [[[20, 31]], 60, 2]], [[[[4, 1.0, -1.0, 4.0, -1.0], [19, 6.0, -5.0, 8.0, -2.0], [26, -2.0, 5.0, -1.0, 5.0], [14, 4.0, -3.0, 6.0, 0.0], [2, -6.0, 6.0, -3.0, 8.0], [36, 6.0, -1.0, 6.0, -1.0], [16, 2.0, -1.0, 2.0, 2.0], [29, -4.0, 4.0, -3.0, 9.0], [27, 0.0, 4.0, 4.0, 7.0]], 1.0], [[[2, 29], [4, 14], [4, 16], [14, 19], [14, 36]], 79, 2]], [[[[5, -2.5, 2.5, -1.0, 5.0], [25, 0.5, 0.0, 1.0, 2.5], [22, 1.5, -2.0, 2.0, -1.0], [10, -1.5, -1.0, -1.0, 0.0]], 2.0], [[], 10, 1]], [[[[32, -0.5, 0.0, 2.0, 1.5], [13, -1.0, 0.0, -0.5, 0.5], [3, 0.0, 0.5, 2.5, 1.0], [20, 1.0, 1.5, 3.5, 3.5], [14, 2.0, 0.0, 4.5, 0.0], [2, -1.5, 0.0, -1.5, 0.5], [1, -2.0, 2.0, -0.5, 4.5], [4, -2.0, -2.0, 0.5, -0.5], [36, -0.5, 2.0, 0.5, 3.0]], 2.5], [[[1, 2], [1, 13], [1, 32], [1, 36], [2, 13], [2, 32], [2, 36], [3, 14], [3, 20], [3, 32], [3, 36], [13, 32], [13, 36], [14, 20], [14, 32], [14, 36], [20, 32], [20, 36], [32, 36]], 20, 5]], [[[[27, 5.0, -3.0, 6.0, 0.0], [1, 4.0, -4.0, 5.0, 0.0], [38, 6.0, 4.0, 10.0, 9.0], [34, -2.0, -2.0, -1.0, 1.0], [23, -1.0, -3.0, 0.0, -3.0], [10, -1.0, 6.0, 4.0, 11.0], [3, -4.0, 4.0, 0.0, 7.0], [20, 1.0, 0.0, 1.0, 3.0], [21, -6.0, -1.0, -4.0, -1.0]], 2.5], [[[1, 27], [3, 10], [3, 20]], 41, 2]], [[[[22, -2.0, -5.0, 0.0, -3.0], [28, 5.0, 5.0, 5.0, 10.0], [7, -3.0, -6.0, -3.0, -3.0], [38, 6.0, 1.0, 6.0, 1.0]], 2.0], [[], 11, 1]], [[[[22, -0.5, -2.5, 1.0, -1.0], [14, 2.0, -2.0, 2.0, -2.0], [24, 2.5, 0.5, 3.0, 1.5], [5, -1.5, 3.0, 1.0, 5.0], [19, -1.0, -1.5, 1.0, -1.0], [17, -0.5, -2.5, 1.5, -0.5], [33, 3.0, 3.0, 5.5, 5.5]], 1.0], [[[17, 19], [17, 22], [19, 22]], 50, 3]]], [[[[[2, 0.0, -3.0, 1.0, -2.5], [6, -3.0, 2.5, -1.0, 4.5], [25, -3.0, -3.0, -1.0, -2.5], [19, -0.5, -2.5, 1.5, -2.5], [29, 1.5, -1.0, 2.0, -1.0], [10, -1.0, 2.0, -0.5, 3.5]], 2.5], [[[2, 19], [2, 29], [6, 10], [19, 25], [19, 29]], 13, 3]], [[[[30, -5.0, -5.0, 0.0, -2.0], [37, 6.0, -2.0, 10.0, 3.0], [3, -3.0, 4.0, 2.0, 5.0], [7, 0.0, -5.0, 4.0, 0.0], [20, -2.0, 1.0, 2.0, 4.0], [16, -3.0, -4.0, 0.0, 0.0], [24, 0.0, 6.0, 0.0, 9.0]], 2.0], [[[3, 20], [7, 16], [7, 20], [7, 30], [16, 20], [16, 30]], 57, 3]], [[[[4, -1.0, -2.0, 0.5, -0.5], [34, -3.0, -2.0, -1.5, 0.0], [26, 2.0, 2.5, 2.5, 3.0], [5, 1.5, -0.5, 3.5, 1.5]], 3.0], [[[4, 5], [4, 34], [5, 26]], 10, 2]], [[[[37, -1.5, 0.0, 0.0, 1.0], [20, 0.0, 0.0, 0.5, 2.5], [8, -2.0, 0.0, 0.5, 0.0]], 2.5], [[[8, 20], [8, 37], [20, 37]], 6, 3]], [[[[25, -1.0, -1.0, 1.0, 3.0], [30, 3.0, -4.0, 5.0, 1.0], [16, -4.0, 5.0, -4.0, 5.0], [20, -6.0, 3.0, -1.0, 3.0], [9, -1.0, 2.0, 0.0, 3.0], [35, 3.0, -6.0, 6.0, -3.0], [27, 6.0, -5.0, 11.0, -3.0]], 2.0], [[[9, 20], [9, 25], [20, 25], [27, 35], [30, 35]], 30, 3]], [[[[35, 0.0, 0.0, 0.0, 4.0], [18, -1.0, -6.0, 3.0, -6.0], [6, 3.0, 4.0, 5.0, 8.0], [25, 4.0, -4.0, 6.0, -2.0], [36, 2.0, -6.0, 7.0, -5.0], [21, 0.0, 4.0, 4.0, 6.0], [29, 4.0, -2.0, 9.0, 3.0], [34, 3.0, -2.0, 7.0, 0.0], [33, 5.0, -4.0, 5.0, -3.0], [15, 4.0, 0.0, 4.0, 5.0]], 2.5], [[[6, 15], [6, 21], [6, 29], [15, 21], [15, 29], [15, 34], [18, 36], [21, 29], [21, 35], [25, 29], [25, 33], [25, 34], [25, 36], [29, 34], [33, 36]], 42, 4]], [[[[17, 5.0, 0.0, 6.0, 5.0], [34, -4.0, 5.0, -2.0, 9.0], [19, 1.0, -4.0, 1.0, 0.0], [27, -4.0, -1.0, 0.0, -1.0], [22, -1.0, 2.0, 3.0, 5.0], [26, 1.0, -5.0, 1.0, -2.0], [25, 1.0, -4.0, 4.0, -4.0]], 1.0], [[[19, 25], [19, 26], [25, 26]], 65, 3]], [[[[27, 3.0, -6.0, 6.0, -1.0], [29, 1.0, 3.0, 4.0, 3.0], [10, -3.0, 1.0, 0.0, 1.0]], 2.0], [[], 15, 1]]]]
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 | [[[8, 20]], 7, 6] | [[[8, 20]], 7, 2] | Failed |
| case 1 | [[], 5, 5] | [[], 5, 1] | Failed |
| case 2 | [[], 8, 8] | [[], 8, 1] | Failed |
| case 3 | [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 21] | [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3] | Failed |
| case 4 | [[], 6, 6] | [[], 6, 1] | Failed |
| case 5 | [[[31, 39]], 6, 4] | [[[31, 39]], 6, 2] | Failed |
| case 6 | [[[6, 27], [6, 36], [22, 30]], 10, 7] | [[[6, 27], [6, 36], [22, 30]], 10, 2] | Failed |
| case 7 | [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 15] | [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3] | Failed |
SHA-256 / 91500ff341fd1d861d4dd4ba1c05b00dba5729d207cd4467a4e70aab292c6bc0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(boxes, cs):
grid = {}
inserts = 0
for b in boxes:
i0, i1 = math.floor(b[1] / cs), math.floor(b[3] / cs)
j0, j1 = math.floor(b[2] / cs), math.floor(b[4] / cs)
for i in range(i0, i1 + 1):
for j in range(j0, j1 + 1):
grid.setdefault((i, j), []).append(b[0])
inserts += 1
pairs = set()
for cell in grid.values():
for p in range(len(cell)):
for q in range(p + 1, len(cell)):
a, c = cell[p], cell[q]
pairs.add((min(a, c), max(a, c)))
return [sorted([list(p) for p in pairs]), inserts, inserts // max(len(grid), 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[8, -4.0, 5.0, -3.0, 6.0], [20, -4.0, 6.0, 1.0, 9.0]], 2.5], [[[8, 20]], 7, 2]], [[[[6, -1.5, 2.5, -1.5, 3.5], [4, 2.0, -3.0, 2.5, -2.0]], 2.5], [[], 5, 1]], [[[[14, -2.5, 0.5, -2.5, 3.0], [38, 0.0, 2.0, 1.0, 3.0]], 1.0], [[], 8, 1]], [[[[12, -3.0, 1.0, 0.0, 3.0], [34, -4.0, -5.0, -4.0, 0.0], [33, -6.0, 5.0, -1.0, 10.0], [10, -3.0, -4.0, 2.0, 1.0], [29, 4.0, 4.0, 9.0, 5.0], [18, 2.0, -1.0, 5.0, 1.0]], 3.0], [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3]], [[[[28, 3.0, -0.5, 5.0, -0.5], [8, 0.5, 0.5, 2.5, 1.5], [17, -3.0, 1.0, -1.0, 1.5]], 2.5], [[], 6, 1]], [[[[31, -1.5, 0.0, 0.5, 0.0], [39, -2.5, 1.5, 0.0, 3.5]], 3.0], [[[31, 39]], 6, 2]], [[[[22, -1.0, 0.5, -0.5, 2.5], [36, 3.0, 1.5, 4.5, 3.5], [6, 0.5, 0.0, 3.0, 1.0], [30, -2.0, 1.5, -1.5, 3.0], [27, 0.5, 2.0, 0.5, 2.5], [8, -1.0, -0.5, 0.5, -0.5]], 3.0], [[[6, 27], [6, 36], [22, 30]], 10, 2]], [[[[38, -2.0, 4.0, 1.0, 4.0], [6, 3.0, -1.0, 4.0, 4.0], [13, -4.0, 1.0, -3.0, 6.0], [17, -1.0, 2.0, 4.0, 6.0], [24, 6.0, -6.0, 6.0, -2.0]], 3.0], [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3]]], [[[[[26, 1.0, -1.5, 3.0, -1.0], [11, -2.0, -1.5, -1.0, 1.0]], 2.5], [[], 4, 1]], [[[[1, -2.0, 2.0, -1.5, 4.5], [38, -3.0, 3.0, -1.0, 5.0], [39, -1.5, -3.0, 0.5, -1.5], [25, 1.5, -0.5, 3.5, 2.0], [9, -2.0, 1.0, -1.0, 3.0]], 3.0], [[[1, 9], [1, 38], [9, 38], [25, 39]], 11, 3]], [[[[30, 1.5, -2.5, 1.5, -2.0], [17, 1.5, 1.0, 2.5, 1.0], [23, -0.5, 0.5, 1.0, 0.5], [11, 1.5, -1.5, 3.5, -0.5], [35, -2.5, -3.0, 0.0, -2.5]], 2.0], [[[11, 30], [17, 23], [30, 35]], 11, 2]], [[[[32, -3.0, 3.0, 1.0, 5.0], [16, 5.0, 2.0, 7.0, 2.0], [6, 6.0, 1.0, 10.0, 4.0], [26, 2.0, 0.0, 6.0, 3.0], [5, 3.0, -3.0, 4.0, 2.0]], 1.0], [[[5, 26], [6, 16], [6, 26], [16, 26]], 70, 3]], [[[[8, 3.0, 1.0, 5.0, 3.0], [17, 0.0, 4.0, 1.0, 6.0], [23, -5.0, -3.0, -1.0, -1.0], [20, -3.0, -6.0, 1.0, -1.0], [33, 6.0, 5.0, 8.0, 9.0]], 3.0], [[[20, 23]], 13, 2]], [[[[25, -6.0, 5.0, -6.0, 9.0], [28, 4.0, 3.0, 8.0, 3.0], [36, -2.0, 3.0, 2.0, 8.0], [29, 2.0, -5.0, 5.0, -1.0], [20, -2.0, 4.0, 3.0, 9.0], [12, -2.0, -3.0, 1.0, -3.0]], 1.0], [[[20, 36]], 100, 2]], [[[[38, 0.5, 2.0, 1.0, 2.5], [25, -2.5, -1.5, -1.0, 0.5], [34, 0.0, 3.0, 0.5, 4.0], [4, 1.0, -1.0, 3.0, -0.5]], 2.5], [[[34, 38]], 7, 2]], [[[[13, -1.0, 6.0, 2.0, 9.0], [17, 5.0, -1.0, 10.0, 1.0], [8, 4.0, -4.0, 6.0, -2.0], [14, 3.0, 2.0, 6.0, 3.0], [18, 2.0, -1.0, 3.0, 2.0]], 2.5], [[[8, 17], [8, 18], [14, 17], [14, 18]], 22, 2]]], [[[[[13, 5.0, -1.0, 7.0, 4.0], [17, 4.0, -6.0, 8.0, -3.0]], 1.0], [[], 38, 1]], [[[[30, -1.0, 0.0, 1.0, 2.0], [17, 1.0, -3.0, 1.0, -3.0], [28, 2.0, 2.0, 2.0, 4.0], [11, -5.0, -3.0, -1.0, -2.0], [21, -5.0, -1.0, -2.0, 4.0]], 3.0], [[[11, 21], [21, 30], [28, 30]], 13, 2]], [[[[12, 0.5, -1.5, 2.0, 1.0], [25, -3.0, 0.5, -2.5, 1.0], [11, -2.5, -2.0, 0.0, -1.0], [3, -1.5, 0.0, -1.0, 0.5]], 2.0], [[[11, 12]], 9, 2]], [[[[29, 4.0, 4.0, 9.0, 6.0], [15, 3.0, 5.0, 4.0, 7.0]], 2.0], [[[15, 29]], 10, 2]], [[[[18, -6.0, 6.0, -2.0, 9.0], [12, -2.0, 3.0, -1.0, 5.0], [21, 4.0, -1.0, 4.0, 2.0], [24, 6.0, -3.0, 10.0, -2.0], [22, -5.0, -1.0, -2.0, -1.0], [27, 1.0, -4.0, 3.0, 0.0], [30, 6.0, 3.0, 8.0, 4.0]], 2.5], [[[12, 18], [21, 27]], 26, 2]], [[[[1, 4.0, -2.0, 8.0, 3.0], [19, -6.0, 3.0, -4.0, 6.0]], 3.0], [[], 8, 1]], [[[[7, 0.0, 1.0, 5.0, 2.0], [2, -4.0, -1.0, -1.0, 2.0]], 3.0], [[], 6, 1]], [[[[20, -5.0, 6.0, -4.0, 6.0], [9, -6.0, -3.0, -6.0, 2.0], [19, -2.0, -5.0, 0.0, -2.0], [22, 0.0, 2.0, 4.0, 3.0], [16, 1.0, -3.0, 6.0, -3.0], [3, -6.0, -2.0, -2.0, -1.0]], 2.5], [[[3, 9], [3, 19], [16, 19]], 18, 2]]], [[[[[35, 2.5, 2.5, 4.5, 4.0], [13, 1.5, -3.0, 4.0, -2.5]], 3.0], [[], 6, 1]], [[[[5, -5.0, -3.0, 0.0, 0.0], [27, -2.0, 4.0, -1.0, 7.0], [31, 0.0, 3.0, 5.0, 6.0], [20, 3.0, 0.0, 3.0, 3.0]], 1.0], [[[20, 31]], 60, 2]], [[[[4, 1.0, -1.0, 4.0, -1.0], [19, 6.0, -5.0, 8.0, -2.0], [26, -2.0, 5.0, -1.0, 5.0], [14, 4.0, -3.0, 6.0, 0.0], [2, -6.0, 6.0, -3.0, 8.0], [36, 6.0, -1.0, 6.0, -1.0], [16, 2.0, -1.0, 2.0, 2.0], [29, -4.0, 4.0, -3.0, 9.0], [27, 0.0, 4.0, 4.0, 7.0]], 1.0], [[[2, 29], [4, 14], [4, 16], [14, 19], [14, 36]], 79, 2]], [[[[5, -2.5, 2.5, -1.0, 5.0], [25, 0.5, 0.0, 1.0, 2.5], [22, 1.5, -2.0, 2.0, -1.0], [10, -1.5, -1.0, -1.0, 0.0]], 2.0], [[], 10, 1]], [[[[32, -0.5, 0.0, 2.0, 1.5], [13, -1.0, 0.0, -0.5, 0.5], [3, 0.0, 0.5, 2.5, 1.0], [20, 1.0, 1.5, 3.5, 3.5], [14, 2.0, 0.0, 4.5, 0.0], [2, -1.5, 0.0, -1.5, 0.5], [1, -2.0, 2.0, -0.5, 4.5], [4, -2.0, -2.0, 0.5, -0.5], [36, -0.5, 2.0, 0.5, 3.0]], 2.5], [[[1, 2], [1, 13], [1, 32], [1, 36], [2, 13], [2, 32], [2, 36], [3, 14], [3, 20], [3, 32], [3, 36], [13, 32], [13, 36], [14, 20], [14, 32], [14, 36], [20, 32], [20, 36], [32, 36]], 20, 5]], [[[[27, 5.0, -3.0, 6.0, 0.0], [1, 4.0, -4.0, 5.0, 0.0], [38, 6.0, 4.0, 10.0, 9.0], [34, -2.0, -2.0, -1.0, 1.0], [23, -1.0, -3.0, 0.0, -3.0], [10, -1.0, 6.0, 4.0, 11.0], [3, -4.0, 4.0, 0.0, 7.0], [20, 1.0, 0.0, 1.0, 3.0], [21, -6.0, -1.0, -4.0, -1.0]], 2.5], [[[1, 27], [3, 10], [3, 20]], 41, 2]], [[[[22, -2.0, -5.0, 0.0, -3.0], [28, 5.0, 5.0, 5.0, 10.0], [7, -3.0, -6.0, -3.0, -3.0], [38, 6.0, 1.0, 6.0, 1.0]], 2.0], [[], 11, 1]], [[[[22, -0.5, -2.5, 1.0, -1.0], [14, 2.0, -2.0, 2.0, -2.0], [24, 2.5, 0.5, 3.0, 1.5], [5, -1.5, 3.0, 1.0, 5.0], [19, -1.0, -1.5, 1.0, -1.0], [17, -0.5, -2.5, 1.5, -0.5], [33, 3.0, 3.0, 5.5, 5.5]], 1.0], [[[17, 19], [17, 22], [19, 22]], 50, 3]]], [[[[[2, 0.0, -3.0, 1.0, -2.5], [6, -3.0, 2.5, -1.0, 4.5], [25, -3.0, -3.0, -1.0, -2.5], [19, -0.5, -2.5, 1.5, -2.5], [29, 1.5, -1.0, 2.0, -1.0], [10, -1.0, 2.0, -0.5, 3.5]], 2.5], [[[2, 19], [2, 29], [6, 10], [19, 25], [19, 29]], 13, 3]], [[[[30, -5.0, -5.0, 0.0, -2.0], [37, 6.0, -2.0, 10.0, 3.0], [3, -3.0, 4.0, 2.0, 5.0], [7, 0.0, -5.0, 4.0, 0.0], [20, -2.0, 1.0, 2.0, 4.0], [16, -3.0, -4.0, 0.0, 0.0], [24, 0.0, 6.0, 0.0, 9.0]], 2.0], [[[3, 20], [7, 16], [7, 20], [7, 30], [16, 20], [16, 30]], 57, 3]], [[[[4, -1.0, -2.0, 0.5, -0.5], [34, -3.0, -2.0, -1.5, 0.0], [26, 2.0, 2.5, 2.5, 3.0], [5, 1.5, -0.5, 3.5, 1.5]], 3.0], [[[4, 5], [4, 34], [5, 26]], 10, 2]], [[[[37, -1.5, 0.0, 0.0, 1.0], [20, 0.0, 0.0, 0.5, 2.5], [8, -2.0, 0.0, 0.5, 0.0]], 2.5], [[[8, 20], [8, 37], [20, 37]], 6, 3]], [[[[25, -1.0, -1.0, 1.0, 3.0], [30, 3.0, -4.0, 5.0, 1.0], [16, -4.0, 5.0, -4.0, 5.0], [20, -6.0, 3.0, -1.0, 3.0], [9, -1.0, 2.0, 0.0, 3.0], [35, 3.0, -6.0, 6.0, -3.0], [27, 6.0, -5.0, 11.0, -3.0]], 2.0], [[[9, 20], [9, 25], [20, 25], [27, 35], [30, 35]], 30, 3]], [[[[35, 0.0, 0.0, 0.0, 4.0], [18, -1.0, -6.0, 3.0, -6.0], [6, 3.0, 4.0, 5.0, 8.0], [25, 4.0, -4.0, 6.0, -2.0], [36, 2.0, -6.0, 7.0, -5.0], [21, 0.0, 4.0, 4.0, 6.0], [29, 4.0, -2.0, 9.0, 3.0], [34, 3.0, -2.0, 7.0, 0.0], [33, 5.0, -4.0, 5.0, -3.0], [15, 4.0, 0.0, 4.0, 5.0]], 2.5], [[[6, 15], [6, 21], [6, 29], [15, 21], [15, 29], [15, 34], [18, 36], [21, 29], [21, 35], [25, 29], [25, 33], [25, 34], [25, 36], [29, 34], [33, 36]], 42, 4]], [[[[17, 5.0, 0.0, 6.0, 5.0], [34, -4.0, 5.0, -2.0, 9.0], [19, 1.0, -4.0, 1.0, 0.0], [27, -4.0, -1.0, 0.0, -1.0], [22, -1.0, 2.0, 3.0, 5.0], [26, 1.0, -5.0, 1.0, -2.0], [25, 1.0, -4.0, 4.0, -4.0]], 1.0], [[[19, 25], [19, 26], [25, 26]], 65, 3]], [[[[27, 3.0, -6.0, 6.0, -1.0], [29, 1.0, 3.0, 4.0, 3.0], [10, -3.0, 1.0, 0.0, 1.0]], 2.0], [[], 15, 1]]]]
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 | [[[8, 20]], 7, 1] | [[[8, 20]], 7, 2] | Failed |
| case 1 | [[], 5, 1] | [[], 5, 1] | Passed |
| case 2 | [[], 8, 1] | [[], 8, 1] | Passed |
| case 3 | [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 1] | [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3] | Failed |
| case 4 | [[], 6, 1] | [[], 6, 1] | Passed |
| case 5 | [[[31, 39]], 6, 1] | [[[31, 39]], 6, 2] | Failed |
| case 6 | [[[6, 27], [6, 36], [22, 30]], 10, 1] | [[[6, 27], [6, 36], [22, 30]], 10, 2] | Failed |
| case 7 | [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 1] | [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3] | Failed |
SHA-256 / 06e857be7da4068ce2d0a65d7a83da7e595b7e8d5b55679fe057f72b2b7b30fa
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(boxes, cs):
grid = {}
inserts = 0
for b in boxes:
i0, i1 = math.floor(b[1] / cs), math.floor(b[3] / cs)
j0, j1 = math.floor(b[2] / cs), math.floor(b[4] / cs)
for i in range(i0, i1 + 1):
for j in range(j0, j1 + 1):
grid.setdefault((i, j), []).append(b[0])
inserts += 1
pairs = set()
for cell in grid.values():
for p in range(len(cell)):
for q in range(p + 1, len(cell)):
a, c = cell[p], cell[q]
pairs.add((min(a, c), max(a, c)))
return [sorted([list(p) for p in pairs]), inserts, max((len(v) for v in grid.values()), default=0)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[8, -4.0, 5.0, -3.0, 6.0], [20, -4.0, 6.0, 1.0, 9.0]], 2.5], [[[8, 20]], 7, 2]], [[[[6, -1.5, 2.5, -1.5, 3.5], [4, 2.0, -3.0, 2.5, -2.0]], 2.5], [[], 5, 1]], [[[[14, -2.5, 0.5, -2.5, 3.0], [38, 0.0, 2.0, 1.0, 3.0]], 1.0], [[], 8, 1]], [[[[12, -3.0, 1.0, 0.0, 3.0], [34, -4.0, -5.0, -4.0, 0.0], [33, -6.0, 5.0, -1.0, 10.0], [10, -3.0, -4.0, 2.0, 1.0], [29, 4.0, 4.0, 9.0, 5.0], [18, 2.0, -1.0, 5.0, 1.0]], 3.0], [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3]], [[[[28, 3.0, -0.5, 5.0, -0.5], [8, 0.5, 0.5, 2.5, 1.5], [17, -3.0, 1.0, -1.0, 1.5]], 2.5], [[], 6, 1]], [[[[31, -1.5, 0.0, 0.5, 0.0], [39, -2.5, 1.5, 0.0, 3.5]], 3.0], [[[31, 39]], 6, 2]], [[[[22, -1.0, 0.5, -0.5, 2.5], [36, 3.0, 1.5, 4.5, 3.5], [6, 0.5, 0.0, 3.0, 1.0], [30, -2.0, 1.5, -1.5, 3.0], [27, 0.5, 2.0, 0.5, 2.5], [8, -1.0, -0.5, 0.5, -0.5]], 3.0], [[[6, 27], [6, 36], [22, 30]], 10, 2]], [[[[38, -2.0, 4.0, 1.0, 4.0], [6, 3.0, -1.0, 4.0, 4.0], [13, -4.0, 1.0, -3.0, 6.0], [17, -1.0, 2.0, 4.0, 6.0], [24, 6.0, -6.0, 6.0, -2.0]], 3.0], [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3]]], [[[[[26, 1.0, -1.5, 3.0, -1.0], [11, -2.0, -1.5, -1.0, 1.0]], 2.5], [[], 4, 1]], [[[[1, -2.0, 2.0, -1.5, 4.5], [38, -3.0, 3.0, -1.0, 5.0], [39, -1.5, -3.0, 0.5, -1.5], [25, 1.5, -0.5, 3.5, 2.0], [9, -2.0, 1.0, -1.0, 3.0]], 3.0], [[[1, 9], [1, 38], [9, 38], [25, 39]], 11, 3]], [[[[30, 1.5, -2.5, 1.5, -2.0], [17, 1.5, 1.0, 2.5, 1.0], [23, -0.5, 0.5, 1.0, 0.5], [11, 1.5, -1.5, 3.5, -0.5], [35, -2.5, -3.0, 0.0, -2.5]], 2.0], [[[11, 30], [17, 23], [30, 35]], 11, 2]], [[[[32, -3.0, 3.0, 1.0, 5.0], [16, 5.0, 2.0, 7.0, 2.0], [6, 6.0, 1.0, 10.0, 4.0], [26, 2.0, 0.0, 6.0, 3.0], [5, 3.0, -3.0, 4.0, 2.0]], 1.0], [[[5, 26], [6, 16], [6, 26], [16, 26]], 70, 3]], [[[[8, 3.0, 1.0, 5.0, 3.0], [17, 0.0, 4.0, 1.0, 6.0], [23, -5.0, -3.0, -1.0, -1.0], [20, -3.0, -6.0, 1.0, -1.0], [33, 6.0, 5.0, 8.0, 9.0]], 3.0], [[[20, 23]], 13, 2]], [[[[25, -6.0, 5.0, -6.0, 9.0], [28, 4.0, 3.0, 8.0, 3.0], [36, -2.0, 3.0, 2.0, 8.0], [29, 2.0, -5.0, 5.0, -1.0], [20, -2.0, 4.0, 3.0, 9.0], [12, -2.0, -3.0, 1.0, -3.0]], 1.0], [[[20, 36]], 100, 2]], [[[[38, 0.5, 2.0, 1.0, 2.5], [25, -2.5, -1.5, -1.0, 0.5], [34, 0.0, 3.0, 0.5, 4.0], [4, 1.0, -1.0, 3.0, -0.5]], 2.5], [[[34, 38]], 7, 2]], [[[[13, -1.0, 6.0, 2.0, 9.0], [17, 5.0, -1.0, 10.0, 1.0], [8, 4.0, -4.0, 6.0, -2.0], [14, 3.0, 2.0, 6.0, 3.0], [18, 2.0, -1.0, 3.0, 2.0]], 2.5], [[[8, 17], [8, 18], [14, 17], [14, 18]], 22, 2]]], [[[[[13, 5.0, -1.0, 7.0, 4.0], [17, 4.0, -6.0, 8.0, -3.0]], 1.0], [[], 38, 1]], [[[[30, -1.0, 0.0, 1.0, 2.0], [17, 1.0, -3.0, 1.0, -3.0], [28, 2.0, 2.0, 2.0, 4.0], [11, -5.0, -3.0, -1.0, -2.0], [21, -5.0, -1.0, -2.0, 4.0]], 3.0], [[[11, 21], [21, 30], [28, 30]], 13, 2]], [[[[12, 0.5, -1.5, 2.0, 1.0], [25, -3.0, 0.5, -2.5, 1.0], [11, -2.5, -2.0, 0.0, -1.0], [3, -1.5, 0.0, -1.0, 0.5]], 2.0], [[[11, 12]], 9, 2]], [[[[29, 4.0, 4.0, 9.0, 6.0], [15, 3.0, 5.0, 4.0, 7.0]], 2.0], [[[15, 29]], 10, 2]], [[[[18, -6.0, 6.0, -2.0, 9.0], [12, -2.0, 3.0, -1.0, 5.0], [21, 4.0, -1.0, 4.0, 2.0], [24, 6.0, -3.0, 10.0, -2.0], [22, -5.0, -1.0, -2.0, -1.0], [27, 1.0, -4.0, 3.0, 0.0], [30, 6.0, 3.0, 8.0, 4.0]], 2.5], [[[12, 18], [21, 27]], 26, 2]], [[[[1, 4.0, -2.0, 8.0, 3.0], [19, -6.0, 3.0, -4.0, 6.0]], 3.0], [[], 8, 1]], [[[[7, 0.0, 1.0, 5.0, 2.0], [2, -4.0, -1.0, -1.0, 2.0]], 3.0], [[], 6, 1]], [[[[20, -5.0, 6.0, -4.0, 6.0], [9, -6.0, -3.0, -6.0, 2.0], [19, -2.0, -5.0, 0.0, -2.0], [22, 0.0, 2.0, 4.0, 3.0], [16, 1.0, -3.0, 6.0, -3.0], [3, -6.0, -2.0, -2.0, -1.0]], 2.5], [[[3, 9], [3, 19], [16, 19]], 18, 2]]], [[[[[35, 2.5, 2.5, 4.5, 4.0], [13, 1.5, -3.0, 4.0, -2.5]], 3.0], [[], 6, 1]], [[[[5, -5.0, -3.0, 0.0, 0.0], [27, -2.0, 4.0, -1.0, 7.0], [31, 0.0, 3.0, 5.0, 6.0], [20, 3.0, 0.0, 3.0, 3.0]], 1.0], [[[20, 31]], 60, 2]], [[[[4, 1.0, -1.0, 4.0, -1.0], [19, 6.0, -5.0, 8.0, -2.0], [26, -2.0, 5.0, -1.0, 5.0], [14, 4.0, -3.0, 6.0, 0.0], [2, -6.0, 6.0, -3.0, 8.0], [36, 6.0, -1.0, 6.0, -1.0], [16, 2.0, -1.0, 2.0, 2.0], [29, -4.0, 4.0, -3.0, 9.0], [27, 0.0, 4.0, 4.0, 7.0]], 1.0], [[[2, 29], [4, 14], [4, 16], [14, 19], [14, 36]], 79, 2]], [[[[5, -2.5, 2.5, -1.0, 5.0], [25, 0.5, 0.0, 1.0, 2.5], [22, 1.5, -2.0, 2.0, -1.0], [10, -1.5, -1.0, -1.0, 0.0]], 2.0], [[], 10, 1]], [[[[32, -0.5, 0.0, 2.0, 1.5], [13, -1.0, 0.0, -0.5, 0.5], [3, 0.0, 0.5, 2.5, 1.0], [20, 1.0, 1.5, 3.5, 3.5], [14, 2.0, 0.0, 4.5, 0.0], [2, -1.5, 0.0, -1.5, 0.5], [1, -2.0, 2.0, -0.5, 4.5], [4, -2.0, -2.0, 0.5, -0.5], [36, -0.5, 2.0, 0.5, 3.0]], 2.5], [[[1, 2], [1, 13], [1, 32], [1, 36], [2, 13], [2, 32], [2, 36], [3, 14], [3, 20], [3, 32], [3, 36], [13, 32], [13, 36], [14, 20], [14, 32], [14, 36], [20, 32], [20, 36], [32, 36]], 20, 5]], [[[[27, 5.0, -3.0, 6.0, 0.0], [1, 4.0, -4.0, 5.0, 0.0], [38, 6.0, 4.0, 10.0, 9.0], [34, -2.0, -2.0, -1.0, 1.0], [23, -1.0, -3.0, 0.0, -3.0], [10, -1.0, 6.0, 4.0, 11.0], [3, -4.0, 4.0, 0.0, 7.0], [20, 1.0, 0.0, 1.0, 3.0], [21, -6.0, -1.0, -4.0, -1.0]], 2.5], [[[1, 27], [3, 10], [3, 20]], 41, 2]], [[[[22, -2.0, -5.0, 0.0, -3.0], [28, 5.0, 5.0, 5.0, 10.0], [7, -3.0, -6.0, -3.0, -3.0], [38, 6.0, 1.0, 6.0, 1.0]], 2.0], [[], 11, 1]], [[[[22, -0.5, -2.5, 1.0, -1.0], [14, 2.0, -2.0, 2.0, -2.0], [24, 2.5, 0.5, 3.0, 1.5], [5, -1.5, 3.0, 1.0, 5.0], [19, -1.0, -1.5, 1.0, -1.0], [17, -0.5, -2.5, 1.5, -0.5], [33, 3.0, 3.0, 5.5, 5.5]], 1.0], [[[17, 19], [17, 22], [19, 22]], 50, 3]]], [[[[[2, 0.0, -3.0, 1.0, -2.5], [6, -3.0, 2.5, -1.0, 4.5], [25, -3.0, -3.0, -1.0, -2.5], [19, -0.5, -2.5, 1.5, -2.5], [29, 1.5, -1.0, 2.0, -1.0], [10, -1.0, 2.0, -0.5, 3.5]], 2.5], [[[2, 19], [2, 29], [6, 10], [19, 25], [19, 29]], 13, 3]], [[[[30, -5.0, -5.0, 0.0, -2.0], [37, 6.0, -2.0, 10.0, 3.0], [3, -3.0, 4.0, 2.0, 5.0], [7, 0.0, -5.0, 4.0, 0.0], [20, -2.0, 1.0, 2.0, 4.0], [16, -3.0, -4.0, 0.0, 0.0], [24, 0.0, 6.0, 0.0, 9.0]], 2.0], [[[3, 20], [7, 16], [7, 20], [7, 30], [16, 20], [16, 30]], 57, 3]], [[[[4, -1.0, -2.0, 0.5, -0.5], [34, -3.0, -2.0, -1.5, 0.0], [26, 2.0, 2.5, 2.5, 3.0], [5, 1.5, -0.5, 3.5, 1.5]], 3.0], [[[4, 5], [4, 34], [5, 26]], 10, 2]], [[[[37, -1.5, 0.0, 0.0, 1.0], [20, 0.0, 0.0, 0.5, 2.5], [8, -2.0, 0.0, 0.5, 0.0]], 2.5], [[[8, 20], [8, 37], [20, 37]], 6, 3]], [[[[25, -1.0, -1.0, 1.0, 3.0], [30, 3.0, -4.0, 5.0, 1.0], [16, -4.0, 5.0, -4.0, 5.0], [20, -6.0, 3.0, -1.0, 3.0], [9, -1.0, 2.0, 0.0, 3.0], [35, 3.0, -6.0, 6.0, -3.0], [27, 6.0, -5.0, 11.0, -3.0]], 2.0], [[[9, 20], [9, 25], [20, 25], [27, 35], [30, 35]], 30, 3]], [[[[35, 0.0, 0.0, 0.0, 4.0], [18, -1.0, -6.0, 3.0, -6.0], [6, 3.0, 4.0, 5.0, 8.0], [25, 4.0, -4.0, 6.0, -2.0], [36, 2.0, -6.0, 7.0, -5.0], [21, 0.0, 4.0, 4.0, 6.0], [29, 4.0, -2.0, 9.0, 3.0], [34, 3.0, -2.0, 7.0, 0.0], [33, 5.0, -4.0, 5.0, -3.0], [15, 4.0, 0.0, 4.0, 5.0]], 2.5], [[[6, 15], [6, 21], [6, 29], [15, 21], [15, 29], [15, 34], [18, 36], [21, 29], [21, 35], [25, 29], [25, 33], [25, 34], [25, 36], [29, 34], [33, 36]], 42, 4]], [[[[17, 5.0, 0.0, 6.0, 5.0], [34, -4.0, 5.0, -2.0, 9.0], [19, 1.0, -4.0, 1.0, 0.0], [27, -4.0, -1.0, 0.0, -1.0], [22, -1.0, 2.0, 3.0, 5.0], [26, 1.0, -5.0, 1.0, -2.0], [25, 1.0, -4.0, 4.0, -4.0]], 1.0], [[[19, 25], [19, 26], [25, 26]], 65, 3]], [[[[27, 3.0, -6.0, 6.0, -1.0], [29, 1.0, 3.0, 4.0, 3.0], [10, -3.0, 1.0, 0.0, 1.0]], 2.0], [[], 15, 1]]]]
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 | [[[8, 20]], 7, 2] | [[[8, 20]], 7, 2] | Passed |
| case 1 | [[], 5, 1] | [[], 5, 1] | Passed |
| case 2 | [[], 8, 1] | [[], 8, 1] | Passed |
| case 3 | [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3] | [[[10, 12], [10, 18], [12, 18], [12, 33]], 26, 3] | Passed |
| case 4 | [[], 6, 1] | [[], 6, 1] | Passed |
| case 5 | [[[31, 39]], 6, 2] | [[[31, 39]], 6, 2] | Passed |
| case 6 | [[[6, 27], [6, 36], [22, 30]], 10, 2] | [[[6, 27], [6, 36], [22, 30]], 10, 2] | Passed |
| case 7 | [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3] | [[[6, 17], [13, 17], [13, 38], [17, 38]], 22, 3] | Passed |
SHA-256 / bcc568536cf5c47760bc9288976fdb1c91e49e0f18399c127de986ed8a34db34
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:58.342620+00:00.
Case digest / a506d3aba85760a5886ca63dd68ab0cd9d3cb40798e81e54e8b4589145082530