FAILURE MAP
← Case archive

FA-87351 / Collision detection broadphase / Open access

Sweep reports pairs in active-list order · case 01

The pair cache sees (b,a) one frame and (a,b) the next, restarting contacts.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Pairs are appended as [active, new] without canonical ordering.

VERIFIED REPAIR

Emit [min id, max id].

Unsuccessful approach: Emitting [new, active] is still event-order dependent.

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[4] and bj[2] <= bi[4]:
                    pairs.append([j, i])
            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 = [[[[[[22, -2.0, 2.0, 2.0, 3.0], [29, -5.0, 1.0, -4.0, 2.0], [4, -5.0, -2.0, -2.0, 1.0]]], [[4, 29]]], [[[[5, 0.0, 3.0, 2.0, 5.0], [15, -2.0, 3.0, -1.0, 6.0], [34, -3.0, 6.0, -2.0, 6.0], [20, -2.0, 1.0, 2.0, 4.0], [23, -2.0, -1.0, -2.0, -1.0], [1, 4.0, -5.0, 6.0, -2.0], [25, 0.0, 5.0, 1.0, 9.0]]], [[5, 20], [5, 25], [15, 20], [15, 34]]], [[[[20, 4.0, -5.0, 6.0, -3.0], [38, 0.0, 4.0, 1.0, 4.0], [22, 3.0, -6.0, 5.0, -5.0], [3, -1.0, -5.0, 0.0, -4.0], [35, -6.0, 3.0, -2.0, 7.0], [7, 2.0, -6.0, 5.0, -6.0], [28, -2.0, 1.0, 2.0, 3.0]]], [[7, 22], [20, 22], [28, 35]]], [[[[39, 5.0, 0.0, 9.0, 3.0], [27, 3.0, -1.0, 3.0, 0.0], [37, -6.0, 5.0, -2.0, 5.0], [22, -5.0, 1.0, -2.0, 1.0], [26, 6.0, 1.0, 8.0, 3.0], [24, 2.0, -3.0, 6.0, -1.0]]], [[24, 27], [26, 39]]], [[[[14, 0.0, -1.0, 3.0, -1.0], [30, -4.0, -3.0, -4.0, 0.0], [15, -3.0, 1.0, 0.0, 4.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]]], [[[[17, 1.0, 6.0, 2.0, 7.0], [20, 6.0, 2.0, 6.0, 6.0], [4, 6.0, -6.0, 10.0, -4.0], [38, -6.0, -6.0, -3.0, -2.0], [19, 6.0, 1.0, 8.0, 5.0], [35, 4.0, -1.0, 8.0, -1.0]]], [[19, 20]]], [[[[14, 1.0, -4.0, 4.0, -1.0], [6, 0.0, -1.0, 4.0, 3.0], [32, -2.0, -3.0, 2.0, -1.0], [15, -4.0, 0.0, -4.0, 4.0], [7, -4.0, -2.0, -1.0, -2.0]]], [[6, 14], [6, 32], [7, 32], [14, 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]]], [[[[4, -5.0, 2.0, -4.0, 6.0], [14, 0.0, -3.0, 4.0, -3.0], [5, 5.0, -1.0, 6.0, 1.0], [32, 3.0, 0.0, 6.0, 2.0], [27, 0.0, 4.0, 2.0, 5.0], [30, 5.0, -1.0, 5.0, 1.0], [35, 2.0, 3.0, 6.0, 3.0]]], [[5, 30], [5, 32], [30, 32]]], [[[[9, -6.0, 0.0, -3.0, 4.0], [11, -5.0, 0.0, -5.0, 3.0], [31, 0.0, -3.0, 4.0, -2.0], [5, -4.0, 3.0, 0.0, 3.0], [12, 5.0, 3.0, 9.0, 4.0], [26, 5.0, -2.0, 7.0, 1.0], [33, -3.0, -4.0, -2.0, -4.0]]], [[5, 9], [9, 11]]], [[[[6, 6.0, -1.0, 8.0, 0.0], [35, -2.0, 2.0, -1.0, 3.0], [24, 1.0, 0.0, 4.0, 0.0]]], []], [[[[16, 2.0, 6.0, 2.0, 10.0], [6, 2.0, -4.0, 4.0, -2.0], [22, 0.0, 2.0, 1.0, 4.0], [3, 2.0, -4.0, 2.0, -1.0], [17, -2.0, -4.0, -1.0, -3.0], [30, -6.0, -6.0, -2.0, -6.0], [34, 4.0, -5.0, 5.0, -1.0], [14, -1.0, 3.0, -1.0, 7.0]]], [[3, 6], [6, 34]]], [[[[15, 3.0, -5.0, 7.0, -2.0], [21, 0.0, 4.0, 3.0, 6.0], [29, 3.0, -6.0, 4.0, -5.0], [7, 0.0, 5.0, 4.0, 6.0], [34, 1.0, 4.0, 5.0, 8.0]]], [[7, 21], [7, 34], [15, 29], [21, 34]]], [[[[5, 3.0, 4.0, 4.0, 8.0], [37, 2.0, 1.0, 6.0, 4.0]]], [[5, 37]]], [[[[39, -6.0, 3.0, -3.0, 4.0], [4, 4.0, 0.0, 4.0, 1.0], [5, 4.0, 2.0, 6.0, 6.0], [24, -6.0, 1.0, -3.0, 5.0], [7, 5.0, 6.0, 9.0, 6.0]]], [[5, 7], [24, 39]]]], [[[[[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]]], [[[[3, 3.0, 6.0, 3.0, 8.0], [1, 0.0, 5.0, 1.0, 7.0], [14, 0.0, 0.0, 1.0, 2.0], [5, 4.0, -2.0, 8.0, 2.0], [31, -5.0, -1.0, -5.0, 1.0], [21, 6.0, 0.0, 7.0, 4.0], [25, 5.0, 2.0, 9.0, 2.0]]], [[5, 21], [5, 25], [21, 25]]], [[[[34, 6.0, 0.0, 9.0, 1.0], [24, -2.0, -3.0, 2.0, -3.0]]], []], [[[[38, 0.0, 6.0, 1.0, 7.0], [33, -2.0, 5.0, 2.0, 6.0], [3, -6.0, -1.0, -6.0, 0.0], [24, 0.0, -1.0, 3.0, 2.0], [19, -2.0, 3.0, 2.0, 3.0], [29, -4.0, 2.0, 0.0, 2.0]]], [[24, 29], [33, 38]]], [[[[20, -2.0, -6.0, -1.0, -4.0], [28, 0.0, -2.0, 4.0, 0.0], [16, -6.0, 1.0, -2.0, 4.0], [29, 0.0, 5.0, 4.0, 7.0], [27, -5.0, 2.0, -5.0, 4.0], [15, 2.0, 5.0, 4.0, 6.0]]], [[15, 29], [16, 27]]], [[[[5, -6.0, 5.0, -6.0, 6.0], [36, -2.0, -3.0, -2.0, -2.0], [27, 2.0, 5.0, 5.0, 6.0], [13, 6.0, 1.0, 7.0, 5.0], [14, 6.0, 5.0, 8.0, 9.0], [16, -6.0, -4.0, -5.0, 0.0], [12, 5.0, 6.0, 7.0, 8.0]]], [[12, 14], [12, 27], [13, 14]]], [[[[24, 1.0, -4.0, 4.0, -1.0], [32, -2.0, 4.0, 2.0, 6.0], [18, -5.0, -5.0, -2.0, -2.0]]], []], [[[[10, -2.0, 1.0, -1.0, 4.0], [13, -1.0, -4.0, 3.0, -1.0], [24, -3.0, 3.0, 1.0, 7.0]]], [[10, 24]]]], [[[[[27, -5.0, -4.0, -5.0, -2.0], [34, 4.0, 0.0, 6.0, 2.0], [14, 1.0, -5.0, 1.0, -5.0]]], []], [[[[11, -2.0, 0.0, -2.0, 1.0], [27, -4.0, 0.0, -2.0, 3.0]]], [[11, 27]]], [[[[18, -5.0, -4.0, -4.0, -1.0], [32, -1.0, -5.0, 2.0, -3.0], [22, -6.0, 2.0, -2.0, 6.0], [28, 6.0, 5.0, 7.0, 8.0], [12, -5.0, 4.0, -5.0, 7.0], [33, 5.0, 5.0, 9.0, 7.0], [39, -3.0, 3.0, -2.0, 4.0], [11, -5.0, -4.0, -4.0, 0.0]]], [[11, 18], [12, 22], [22, 39], [28, 33]]], [[[[34, -2.0, -6.0, -1.0, -6.0], [39, 5.0, -4.0, 7.0, -3.0], [9, 1.0, -3.0, 2.0, -2.0], [38, 2.0, 5.0, 4.0, 6.0], [8, -5.0, 1.0, -3.0, 4.0], [26, -2.0, -2.0, 2.0, 0.0], [4, 5.0, -5.0, 6.0, -3.0], [35, 3.0, 1.0, 6.0, 2.0], [10, -4.0, 6.0, -2.0, 6.0], [31, 2.0, 1.0, 5.0, 3.0]]], [[4, 39], [9, 26], [31, 35]]], [[[[1, -4.0, -5.0, -3.0, -1.0], [7, -2.0, 5.0, 1.0, 9.0], [9, -4.0, -6.0, -4.0, -6.0]]], []], [[[[1, -5.0, 6.0, -1.0, 6.0], [7, 5.0, -2.0, 9.0, -1.0], [28, -4.0, 0.0, -2.0, 2.0], [2, -1.0, -5.0, -1.0, -2.0], [3, 6.0, -1.0, 7.0, 2.0], [13, -4.0, 5.0, -2.0, 5.0], [14, 3.0, 6.0, 4.0, 6.0], [15, -4.0, 6.0, -1.0, 10.0], [35, -5.0, 1.0, -4.0, 4.0]]], [[1, 15], [3, 7], [28, 35]]], [[[[35, 3.0, -6.0, 4.0, -2.0], [13, 0.0, -2.0, 1.0, 2.0], [20, -3.0, 0.0, -1.0, 4.0], [23, -3.0, 6.0, -1.0, 10.0], [33, 2.0, -3.0, 5.0, -2.0], [38, 5.0, -2.0, 8.0, 2.0], [26, -2.0, 5.0, -2.0, 6.0]]], [[23, 26], [33, 35], [33, 38]]], [[[[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]]]], [[[[[17, 6.0, -4.0, 7.0, -3.0], [1, 6.0, -3.0, 9.0, 1.0], [34, 6.0, -3.0, 10.0, 1.0], [15, 4.0, 2.0, 7.0, 6.0], [13, 0.0, -5.0, 0.0, -3.0], [14, 4.0, -6.0, 4.0, -5.0], [32, -5.0, -5.0, -3.0, -3.0], [20, -2.0, -4.0, 1.0, -4.0], [8, -6.0, 1.0, -2.0, 2.0], [11, 3.0, 6.0, 5.0, 8.0]]], [[1, 17], [1, 34], [11, 15], [13, 20], [17, 34]]], [[[[14, -6.0, -5.0, -2.0, -3.0], [29, -2.0, -1.0, -2.0, 0.0]]], []], [[[[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]]], [[[[26, -2.0, 2.0, -2.0, 4.0], [32, 1.0, -6.0, 4.0, -5.0], [5, -3.0, -4.0, 1.0, -1.0], [39, -2.0, 3.0, -1.0, 3.0]]], [[26, 39]]], [[[[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]]], [[[[36, -5.0, -4.0, -2.0, -2.0], [2, 6.0, 3.0, 9.0, 5.0], [7, 4.0, -2.0, 8.0, 1.0], [28, 1.0, -4.0, 3.0, -1.0], [25, 1.0, -6.0, 1.0, -2.0], [3, 0.0, 2.0, 0.0, 2.0], [38, 2.0, 6.0, 4.0, 6.0], [5, 6.0, 0.0, 10.0, 3.0], [14, -5.0, -5.0, -3.0, -2.0], [39, -3.0, 5.0, 0.0, 8.0]]], [[2, 5], [5, 7], [14, 36], [25, 28]]], [[[[35, -2.0, -1.0, 1.0, 2.0], [7, 6.0, 3.0, 10.0, 7.0], [18, 1.0, -2.0, 1.0, 1.0], [13, 3.0, -1.0, 3.0, 0.0], [12, -3.0, -1.0, -1.0, 2.0], [24, 2.0, 2.0, 2.0, 6.0], [36, 4.0, -4.0, 8.0, -3.0]]], [[12, 35], [18, 35]]], [[[[11, -1.0, -5.0, -1.0, -4.0], [25, -3.0, 2.0, -1.0, 3.0], [15, -5.0, -3.0, -3.0, 1.0], [27, -5.0, -6.0, -4.0, -4.0], [20, 0.0, -3.0, 0.0, -2.0], [39, 5.0, 3.0, 7.0, 5.0], [33, -3.0, -6.0, 0.0, -6.0], [28, -4.0, 6.0, -1.0, 6.0], [13, 1.0, -2.0, 1.0, 0.0]]], []]]]
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 fixtureActualExpectedOutcome
case 0[[4, 29]][[4, 29]]Passed
case 1[[5, 25], [15, 20], [20, 5], [34, 15]][[5, 20], [5, 25], [15, 20], [15, 34]]Failed
case 2[[7, 22], [22, 20], [35, 28]][[7, 22], [20, 22], [28, 35]]Failed
case 3[[24, 27], [39, 26]][[24, 27], [26, 39]]Failed
case 4[][]Passed
case 5[[9, 28], [9, 32], [28, 32]][[9, 28], [9, 32], [28, 32]]Passed
case 6[[19, 20]][[19, 20]]Passed
case 7[[6, 14], [7, 32], [32, 6], [32, 14]][[6, 14], [6, 32], [7, 32], [14, 32]]Failed

SHA-256 / 24d5f280b18268c4ff43bc37f8e11abb44cc370ef3fbcea8651cb2e7d7d8cac4

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[2] <= bj[4] and bj[2] <= bi[4]:
                    pairs.append([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 = [[[[[[22, -2.0, 2.0, 2.0, 3.0], [29, -5.0, 1.0, -4.0, 2.0], [4, -5.0, -2.0, -2.0, 1.0]]], [[4, 29]]], [[[[5, 0.0, 3.0, 2.0, 5.0], [15, -2.0, 3.0, -1.0, 6.0], [34, -3.0, 6.0, -2.0, 6.0], [20, -2.0, 1.0, 2.0, 4.0], [23, -2.0, -1.0, -2.0, -1.0], [1, 4.0, -5.0, 6.0, -2.0], [25, 0.0, 5.0, 1.0, 9.0]]], [[5, 20], [5, 25], [15, 20], [15, 34]]], [[[[20, 4.0, -5.0, 6.0, -3.0], [38, 0.0, 4.0, 1.0, 4.0], [22, 3.0, -6.0, 5.0, -5.0], [3, -1.0, -5.0, 0.0, -4.0], [35, -6.0, 3.0, -2.0, 7.0], [7, 2.0, -6.0, 5.0, -6.0], [28, -2.0, 1.0, 2.0, 3.0]]], [[7, 22], [20, 22], [28, 35]]], [[[[39, 5.0, 0.0, 9.0, 3.0], [27, 3.0, -1.0, 3.0, 0.0], [37, -6.0, 5.0, -2.0, 5.0], [22, -5.0, 1.0, -2.0, 1.0], [26, 6.0, 1.0, 8.0, 3.0], [24, 2.0, -3.0, 6.0, -1.0]]], [[24, 27], [26, 39]]], [[[[14, 0.0, -1.0, 3.0, -1.0], [30, -4.0, -3.0, -4.0, 0.0], [15, -3.0, 1.0, 0.0, 4.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]]], [[[[17, 1.0, 6.0, 2.0, 7.0], [20, 6.0, 2.0, 6.0, 6.0], [4, 6.0, -6.0, 10.0, -4.0], [38, -6.0, -6.0, -3.0, -2.0], [19, 6.0, 1.0, 8.0, 5.0], [35, 4.0, -1.0, 8.0, -1.0]]], [[19, 20]]], [[[[14, 1.0, -4.0, 4.0, -1.0], [6, 0.0, -1.0, 4.0, 3.0], [32, -2.0, -3.0, 2.0, -1.0], [15, -4.0, 0.0, -4.0, 4.0], [7, -4.0, -2.0, -1.0, -2.0]]], [[6, 14], [6, 32], [7, 32], [14, 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]]], [[[[4, -5.0, 2.0, -4.0, 6.0], [14, 0.0, -3.0, 4.0, -3.0], [5, 5.0, -1.0, 6.0, 1.0], [32, 3.0, 0.0, 6.0, 2.0], [27, 0.0, 4.0, 2.0, 5.0], [30, 5.0, -1.0, 5.0, 1.0], [35, 2.0, 3.0, 6.0, 3.0]]], [[5, 30], [5, 32], [30, 32]]], [[[[9, -6.0, 0.0, -3.0, 4.0], [11, -5.0, 0.0, -5.0, 3.0], [31, 0.0, -3.0, 4.0, -2.0], [5, -4.0, 3.0, 0.0, 3.0], [12, 5.0, 3.0, 9.0, 4.0], [26, 5.0, -2.0, 7.0, 1.0], [33, -3.0, -4.0, -2.0, -4.0]]], [[5, 9], [9, 11]]], [[[[6, 6.0, -1.0, 8.0, 0.0], [35, -2.0, 2.0, -1.0, 3.0], [24, 1.0, 0.0, 4.0, 0.0]]], []], [[[[16, 2.0, 6.0, 2.0, 10.0], [6, 2.0, -4.0, 4.0, -2.0], [22, 0.0, 2.0, 1.0, 4.0], [3, 2.0, -4.0, 2.0, -1.0], [17, -2.0, -4.0, -1.0, -3.0], [30, -6.0, -6.0, -2.0, -6.0], [34, 4.0, -5.0, 5.0, -1.0], [14, -1.0, 3.0, -1.0, 7.0]]], [[3, 6], [6, 34]]], [[[[15, 3.0, -5.0, 7.0, -2.0], [21, 0.0, 4.0, 3.0, 6.0], [29, 3.0, -6.0, 4.0, -5.0], [7, 0.0, 5.0, 4.0, 6.0], [34, 1.0, 4.0, 5.0, 8.0]]], [[7, 21], [7, 34], [15, 29], [21, 34]]], [[[[5, 3.0, 4.0, 4.0, 8.0], [37, 2.0, 1.0, 6.0, 4.0]]], [[5, 37]]], [[[[39, -6.0, 3.0, -3.0, 4.0], [4, 4.0, 0.0, 4.0, 1.0], [5, 4.0, 2.0, 6.0, 6.0], [24, -6.0, 1.0, -3.0, 5.0], [7, 5.0, 6.0, 9.0, 6.0]]], [[5, 7], [24, 39]]]], [[[[[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]]], [[[[3, 3.0, 6.0, 3.0, 8.0], [1, 0.0, 5.0, 1.0, 7.0], [14, 0.0, 0.0, 1.0, 2.0], [5, 4.0, -2.0, 8.0, 2.0], [31, -5.0, -1.0, -5.0, 1.0], [21, 6.0, 0.0, 7.0, 4.0], [25, 5.0, 2.0, 9.0, 2.0]]], [[5, 21], [5, 25], [21, 25]]], [[[[34, 6.0, 0.0, 9.0, 1.0], [24, -2.0, -3.0, 2.0, -3.0]]], []], [[[[38, 0.0, 6.0, 1.0, 7.0], [33, -2.0, 5.0, 2.0, 6.0], [3, -6.0, -1.0, -6.0, 0.0], [24, 0.0, -1.0, 3.0, 2.0], [19, -2.0, 3.0, 2.0, 3.0], [29, -4.0, 2.0, 0.0, 2.0]]], [[24, 29], [33, 38]]], [[[[20, -2.0, -6.0, -1.0, -4.0], [28, 0.0, -2.0, 4.0, 0.0], [16, -6.0, 1.0, -2.0, 4.0], [29, 0.0, 5.0, 4.0, 7.0], [27, -5.0, 2.0, -5.0, 4.0], [15, 2.0, 5.0, 4.0, 6.0]]], [[15, 29], [16, 27]]], [[[[5, -6.0, 5.0, -6.0, 6.0], [36, -2.0, -3.0, -2.0, -2.0], [27, 2.0, 5.0, 5.0, 6.0], [13, 6.0, 1.0, 7.0, 5.0], [14, 6.0, 5.0, 8.0, 9.0], [16, -6.0, -4.0, -5.0, 0.0], [12, 5.0, 6.0, 7.0, 8.0]]], [[12, 14], [12, 27], [13, 14]]], [[[[24, 1.0, -4.0, 4.0, -1.0], [32, -2.0, 4.0, 2.0, 6.0], [18, -5.0, -5.0, -2.0, -2.0]]], []], [[[[10, -2.0, 1.0, -1.0, 4.0], [13, -1.0, -4.0, 3.0, -1.0], [24, -3.0, 3.0, 1.0, 7.0]]], [[10, 24]]]], [[[[[27, -5.0, -4.0, -5.0, -2.0], [34, 4.0, 0.0, 6.0, 2.0], [14, 1.0, -5.0, 1.0, -5.0]]], []], [[[[11, -2.0, 0.0, -2.0, 1.0], [27, -4.0, 0.0, -2.0, 3.0]]], [[11, 27]]], [[[[18, -5.0, -4.0, -4.0, -1.0], [32, -1.0, -5.0, 2.0, -3.0], [22, -6.0, 2.0, -2.0, 6.0], [28, 6.0, 5.0, 7.0, 8.0], [12, -5.0, 4.0, -5.0, 7.0], [33, 5.0, 5.0, 9.0, 7.0], [39, -3.0, 3.0, -2.0, 4.0], [11, -5.0, -4.0, -4.0, 0.0]]], [[11, 18], [12, 22], [22, 39], [28, 33]]], [[[[34, -2.0, -6.0, -1.0, -6.0], [39, 5.0, -4.0, 7.0, -3.0], [9, 1.0, -3.0, 2.0, -2.0], [38, 2.0, 5.0, 4.0, 6.0], [8, -5.0, 1.0, -3.0, 4.0], [26, -2.0, -2.0, 2.0, 0.0], [4, 5.0, -5.0, 6.0, -3.0], [35, 3.0, 1.0, 6.0, 2.0], [10, -4.0, 6.0, -2.0, 6.0], [31, 2.0, 1.0, 5.0, 3.0]]], [[4, 39], [9, 26], [31, 35]]], [[[[1, -4.0, -5.0, -3.0, -1.0], [7, -2.0, 5.0, 1.0, 9.0], [9, -4.0, -6.0, -4.0, -6.0]]], []], [[[[1, -5.0, 6.0, -1.0, 6.0], [7, 5.0, -2.0, 9.0, -1.0], [28, -4.0, 0.0, -2.0, 2.0], [2, -1.0, -5.0, -1.0, -2.0], [3, 6.0, -1.0, 7.0, 2.0], [13, -4.0, 5.0, -2.0, 5.0], [14, 3.0, 6.0, 4.0, 6.0], [15, -4.0, 6.0, -1.0, 10.0], [35, -5.0, 1.0, -4.0, 4.0]]], [[1, 15], [3, 7], [28, 35]]], [[[[35, 3.0, -6.0, 4.0, -2.0], [13, 0.0, -2.0, 1.0, 2.0], [20, -3.0, 0.0, -1.0, 4.0], [23, -3.0, 6.0, -1.0, 10.0], [33, 2.0, -3.0, 5.0, -2.0], [38, 5.0, -2.0, 8.0, 2.0], [26, -2.0, 5.0, -2.0, 6.0]]], [[23, 26], [33, 35], [33, 38]]], [[[[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]]]], [[[[[17, 6.0, -4.0, 7.0, -3.0], [1, 6.0, -3.0, 9.0, 1.0], [34, 6.0, -3.0, 10.0, 1.0], [15, 4.0, 2.0, 7.0, 6.0], [13, 0.0, -5.0, 0.0, -3.0], [14, 4.0, -6.0, 4.0, -5.0], [32, -5.0, -5.0, -3.0, -3.0], [20, -2.0, -4.0, 1.0, -4.0], [8, -6.0, 1.0, -2.0, 2.0], [11, 3.0, 6.0, 5.0, 8.0]]], [[1, 17], [1, 34], [11, 15], [13, 20], [17, 34]]], [[[[14, -6.0, -5.0, -2.0, -3.0], [29, -2.0, -1.0, -2.0, 0.0]]], []], [[[[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]]], [[[[26, -2.0, 2.0, -2.0, 4.0], [32, 1.0, -6.0, 4.0, -5.0], [5, -3.0, -4.0, 1.0, -1.0], [39, -2.0, 3.0, -1.0, 3.0]]], [[26, 39]]], [[[[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]]], [[[[36, -5.0, -4.0, -2.0, -2.0], [2, 6.0, 3.0, 9.0, 5.0], [7, 4.0, -2.0, 8.0, 1.0], [28, 1.0, -4.0, 3.0, -1.0], [25, 1.0, -6.0, 1.0, -2.0], [3, 0.0, 2.0, 0.0, 2.0], [38, 2.0, 6.0, 4.0, 6.0], [5, 6.0, 0.0, 10.0, 3.0], [14, -5.0, -5.0, -3.0, -2.0], [39, -3.0, 5.0, 0.0, 8.0]]], [[2, 5], [5, 7], [14, 36], [25, 28]]], [[[[35, -2.0, -1.0, 1.0, 2.0], [7, 6.0, 3.0, 10.0, 7.0], [18, 1.0, -2.0, 1.0, 1.0], [13, 3.0, -1.0, 3.0, 0.0], [12, -3.0, -1.0, -1.0, 2.0], [24, 2.0, 2.0, 2.0, 6.0], [36, 4.0, -4.0, 8.0, -3.0]]], [[12, 35], [18, 35]]], [[[[11, -1.0, -5.0, -1.0, -4.0], [25, -3.0, 2.0, -1.0, 3.0], [15, -5.0, -3.0, -3.0, 1.0], [27, -5.0, -6.0, -4.0, -4.0], [20, 0.0, -3.0, 0.0, -2.0], [39, 5.0, 3.0, 7.0, 5.0], [33, -3.0, -6.0, 0.0, -6.0], [28, -4.0, 6.0, -1.0, 6.0], [13, 1.0, -2.0, 1.0, 0.0]]], []]]]
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 fixtureActualExpectedOutcome
case 0[[29, 4]][[4, 29]]Failed
case 1[[5, 20], [15, 34], [20, 15], [25, 5]][[5, 20], [5, 25], [15, 20], [15, 34]]Failed
case 2[[20, 22], [22, 7], [28, 35]][[7, 22], [20, 22], [28, 35]]Failed
case 3[[26, 39], [27, 24]][[24, 27], [26, 39]]Failed
case 4[][]Passed
case 5[[28, 9], [32, 9], [32, 28]][[9, 28], [9, 32], [28, 32]]Failed
case 6[[20, 19]][[19, 20]]Failed
case 7[[6, 32], [14, 6], [14, 32], [32, 7]][[6, 14], [6, 32], [7, 32], [14, 32]]Failed

SHA-256 / a4918e0165081825b7c645fa4461231d1a93970edb2fa1a19b450763c0ecfc41

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 = [[[[[[22, -2.0, 2.0, 2.0, 3.0], [29, -5.0, 1.0, -4.0, 2.0], [4, -5.0, -2.0, -2.0, 1.0]]], [[4, 29]]], [[[[5, 0.0, 3.0, 2.0, 5.0], [15, -2.0, 3.0, -1.0, 6.0], [34, -3.0, 6.0, -2.0, 6.0], [20, -2.0, 1.0, 2.0, 4.0], [23, -2.0, -1.0, -2.0, -1.0], [1, 4.0, -5.0, 6.0, -2.0], [25, 0.0, 5.0, 1.0, 9.0]]], [[5, 20], [5, 25], [15, 20], [15, 34]]], [[[[20, 4.0, -5.0, 6.0, -3.0], [38, 0.0, 4.0, 1.0, 4.0], [22, 3.0, -6.0, 5.0, -5.0], [3, -1.0, -5.0, 0.0, -4.0], [35, -6.0, 3.0, -2.0, 7.0], [7, 2.0, -6.0, 5.0, -6.0], [28, -2.0, 1.0, 2.0, 3.0]]], [[7, 22], [20, 22], [28, 35]]], [[[[39, 5.0, 0.0, 9.0, 3.0], [27, 3.0, -1.0, 3.0, 0.0], [37, -6.0, 5.0, -2.0, 5.0], [22, -5.0, 1.0, -2.0, 1.0], [26, 6.0, 1.0, 8.0, 3.0], [24, 2.0, -3.0, 6.0, -1.0]]], [[24, 27], [26, 39]]], [[[[14, 0.0, -1.0, 3.0, -1.0], [30, -4.0, -3.0, -4.0, 0.0], [15, -3.0, 1.0, 0.0, 4.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]]], [[[[17, 1.0, 6.0, 2.0, 7.0], [20, 6.0, 2.0, 6.0, 6.0], [4, 6.0, -6.0, 10.0, -4.0], [38, -6.0, -6.0, -3.0, -2.0], [19, 6.0, 1.0, 8.0, 5.0], [35, 4.0, -1.0, 8.0, -1.0]]], [[19, 20]]], [[[[14, 1.0, -4.0, 4.0, -1.0], [6, 0.0, -1.0, 4.0, 3.0], [32, -2.0, -3.0, 2.0, -1.0], [15, -4.0, 0.0, -4.0, 4.0], [7, -4.0, -2.0, -1.0, -2.0]]], [[6, 14], [6, 32], [7, 32], [14, 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]]], [[[[4, -5.0, 2.0, -4.0, 6.0], [14, 0.0, -3.0, 4.0, -3.0], [5, 5.0, -1.0, 6.0, 1.0], [32, 3.0, 0.0, 6.0, 2.0], [27, 0.0, 4.0, 2.0, 5.0], [30, 5.0, -1.0, 5.0, 1.0], [35, 2.0, 3.0, 6.0, 3.0]]], [[5, 30], [5, 32], [30, 32]]], [[[[9, -6.0, 0.0, -3.0, 4.0], [11, -5.0, 0.0, -5.0, 3.0], [31, 0.0, -3.0, 4.0, -2.0], [5, -4.0, 3.0, 0.0, 3.0], [12, 5.0, 3.0, 9.0, 4.0], [26, 5.0, -2.0, 7.0, 1.0], [33, -3.0, -4.0, -2.0, -4.0]]], [[5, 9], [9, 11]]], [[[[6, 6.0, -1.0, 8.0, 0.0], [35, -2.0, 2.0, -1.0, 3.0], [24, 1.0, 0.0, 4.0, 0.0]]], []], [[[[16, 2.0, 6.0, 2.0, 10.0], [6, 2.0, -4.0, 4.0, -2.0], [22, 0.0, 2.0, 1.0, 4.0], [3, 2.0, -4.0, 2.0, -1.0], [17, -2.0, -4.0, -1.0, -3.0], [30, -6.0, -6.0, -2.0, -6.0], [34, 4.0, -5.0, 5.0, -1.0], [14, -1.0, 3.0, -1.0, 7.0]]], [[3, 6], [6, 34]]], [[[[15, 3.0, -5.0, 7.0, -2.0], [21, 0.0, 4.0, 3.0, 6.0], [29, 3.0, -6.0, 4.0, -5.0], [7, 0.0, 5.0, 4.0, 6.0], [34, 1.0, 4.0, 5.0, 8.0]]], [[7, 21], [7, 34], [15, 29], [21, 34]]], [[[[5, 3.0, 4.0, 4.0, 8.0], [37, 2.0, 1.0, 6.0, 4.0]]], [[5, 37]]], [[[[39, -6.0, 3.0, -3.0, 4.0], [4, 4.0, 0.0, 4.0, 1.0], [5, 4.0, 2.0, 6.0, 6.0], [24, -6.0, 1.0, -3.0, 5.0], [7, 5.0, 6.0, 9.0, 6.0]]], [[5, 7], [24, 39]]]], [[[[[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]]], [[[[3, 3.0, 6.0, 3.0, 8.0], [1, 0.0, 5.0, 1.0, 7.0], [14, 0.0, 0.0, 1.0, 2.0], [5, 4.0, -2.0, 8.0, 2.0], [31, -5.0, -1.0, -5.0, 1.0], [21, 6.0, 0.0, 7.0, 4.0], [25, 5.0, 2.0, 9.0, 2.0]]], [[5, 21], [5, 25], [21, 25]]], [[[[34, 6.0, 0.0, 9.0, 1.0], [24, -2.0, -3.0, 2.0, -3.0]]], []], [[[[38, 0.0, 6.0, 1.0, 7.0], [33, -2.0, 5.0, 2.0, 6.0], [3, -6.0, -1.0, -6.0, 0.0], [24, 0.0, -1.0, 3.0, 2.0], [19, -2.0, 3.0, 2.0, 3.0], [29, -4.0, 2.0, 0.0, 2.0]]], [[24, 29], [33, 38]]], [[[[20, -2.0, -6.0, -1.0, -4.0], [28, 0.0, -2.0, 4.0, 0.0], [16, -6.0, 1.0, -2.0, 4.0], [29, 0.0, 5.0, 4.0, 7.0], [27, -5.0, 2.0, -5.0, 4.0], [15, 2.0, 5.0, 4.0, 6.0]]], [[15, 29], [16, 27]]], [[[[5, -6.0, 5.0, -6.0, 6.0], [36, -2.0, -3.0, -2.0, -2.0], [27, 2.0, 5.0, 5.0, 6.0], [13, 6.0, 1.0, 7.0, 5.0], [14, 6.0, 5.0, 8.0, 9.0], [16, -6.0, -4.0, -5.0, 0.0], [12, 5.0, 6.0, 7.0, 8.0]]], [[12, 14], [12, 27], [13, 14]]], [[[[24, 1.0, -4.0, 4.0, -1.0], [32, -2.0, 4.0, 2.0, 6.0], [18, -5.0, -5.0, -2.0, -2.0]]], []], [[[[10, -2.0, 1.0, -1.0, 4.0], [13, -1.0, -4.0, 3.0, -1.0], [24, -3.0, 3.0, 1.0, 7.0]]], [[10, 24]]]], [[[[[27, -5.0, -4.0, -5.0, -2.0], [34, 4.0, 0.0, 6.0, 2.0], [14, 1.0, -5.0, 1.0, -5.0]]], []], [[[[11, -2.0, 0.0, -2.0, 1.0], [27, -4.0, 0.0, -2.0, 3.0]]], [[11, 27]]], [[[[18, -5.0, -4.0, -4.0, -1.0], [32, -1.0, -5.0, 2.0, -3.0], [22, -6.0, 2.0, -2.0, 6.0], [28, 6.0, 5.0, 7.0, 8.0], [12, -5.0, 4.0, -5.0, 7.0], [33, 5.0, 5.0, 9.0, 7.0], [39, -3.0, 3.0, -2.0, 4.0], [11, -5.0, -4.0, -4.0, 0.0]]], [[11, 18], [12, 22], [22, 39], [28, 33]]], [[[[34, -2.0, -6.0, -1.0, -6.0], [39, 5.0, -4.0, 7.0, -3.0], [9, 1.0, -3.0, 2.0, -2.0], [38, 2.0, 5.0, 4.0, 6.0], [8, -5.0, 1.0, -3.0, 4.0], [26, -2.0, -2.0, 2.0, 0.0], [4, 5.0, -5.0, 6.0, -3.0], [35, 3.0, 1.0, 6.0, 2.0], [10, -4.0, 6.0, -2.0, 6.0], [31, 2.0, 1.0, 5.0, 3.0]]], [[4, 39], [9, 26], [31, 35]]], [[[[1, -4.0, -5.0, -3.0, -1.0], [7, -2.0, 5.0, 1.0, 9.0], [9, -4.0, -6.0, -4.0, -6.0]]], []], [[[[1, -5.0, 6.0, -1.0, 6.0], [7, 5.0, -2.0, 9.0, -1.0], [28, -4.0, 0.0, -2.0, 2.0], [2, -1.0, -5.0, -1.0, -2.0], [3, 6.0, -1.0, 7.0, 2.0], [13, -4.0, 5.0, -2.0, 5.0], [14, 3.0, 6.0, 4.0, 6.0], [15, -4.0, 6.0, -1.0, 10.0], [35, -5.0, 1.0, -4.0, 4.0]]], [[1, 15], [3, 7], [28, 35]]], [[[[35, 3.0, -6.0, 4.0, -2.0], [13, 0.0, -2.0, 1.0, 2.0], [20, -3.0, 0.0, -1.0, 4.0], [23, -3.0, 6.0, -1.0, 10.0], [33, 2.0, -3.0, 5.0, -2.0], [38, 5.0, -2.0, 8.0, 2.0], [26, -2.0, 5.0, -2.0, 6.0]]], [[23, 26], [33, 35], [33, 38]]], [[[[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]]]], [[[[[17, 6.0, -4.0, 7.0, -3.0], [1, 6.0, -3.0, 9.0, 1.0], [34, 6.0, -3.0, 10.0, 1.0], [15, 4.0, 2.0, 7.0, 6.0], [13, 0.0, -5.0, 0.0, -3.0], [14, 4.0, -6.0, 4.0, -5.0], [32, -5.0, -5.0, -3.0, -3.0], [20, -2.0, -4.0, 1.0, -4.0], [8, -6.0, 1.0, -2.0, 2.0], [11, 3.0, 6.0, 5.0, 8.0]]], [[1, 17], [1, 34], [11, 15], [13, 20], [17, 34]]], [[[[14, -6.0, -5.0, -2.0, -3.0], [29, -2.0, -1.0, -2.0, 0.0]]], []], [[[[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]]], [[[[26, -2.0, 2.0, -2.0, 4.0], [32, 1.0, -6.0, 4.0, -5.0], [5, -3.0, -4.0, 1.0, -1.0], [39, -2.0, 3.0, -1.0, 3.0]]], [[26, 39]]], [[[[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]]], [[[[36, -5.0, -4.0, -2.0, -2.0], [2, 6.0, 3.0, 9.0, 5.0], [7, 4.0, -2.0, 8.0, 1.0], [28, 1.0, -4.0, 3.0, -1.0], [25, 1.0, -6.0, 1.0, -2.0], [3, 0.0, 2.0, 0.0, 2.0], [38, 2.0, 6.0, 4.0, 6.0], [5, 6.0, 0.0, 10.0, 3.0], [14, -5.0, -5.0, -3.0, -2.0], [39, -3.0, 5.0, 0.0, 8.0]]], [[2, 5], [5, 7], [14, 36], [25, 28]]], [[[[35, -2.0, -1.0, 1.0, 2.0], [7, 6.0, 3.0, 10.0, 7.0], [18, 1.0, -2.0, 1.0, 1.0], [13, 3.0, -1.0, 3.0, 0.0], [12, -3.0, -1.0, -1.0, 2.0], [24, 2.0, 2.0, 2.0, 6.0], [36, 4.0, -4.0, 8.0, -3.0]]], [[12, 35], [18, 35]]], [[[[11, -1.0, -5.0, -1.0, -4.0], [25, -3.0, 2.0, -1.0, 3.0], [15, -5.0, -3.0, -3.0, 1.0], [27, -5.0, -6.0, -4.0, -4.0], [20, 0.0, -3.0, 0.0, -2.0], [39, 5.0, 3.0, 7.0, 5.0], [33, -3.0, -6.0, 0.0, -6.0], [28, -4.0, 6.0, -1.0, 6.0], [13, 1.0, -2.0, 1.0, 0.0]]], []]]]
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 fixtureActualExpectedOutcome
case 0[[4, 29]][[4, 29]]Passed
case 1[[5, 20], [5, 25], [15, 20], [15, 34]][[5, 20], [5, 25], [15, 20], [15, 34]]Passed
case 2[[7, 22], [20, 22], [28, 35]][[7, 22], [20, 22], [28, 35]]Passed
case 3[[24, 27], [26, 39]][[24, 27], [26, 39]]Passed
case 4[][]Passed
case 5[[9, 28], [9, 32], [28, 32]][[9, 28], [9, 32], [28, 32]]Passed
case 6[[19, 20]][[19, 20]]Passed
case 7[[6, 14], [6, 32], [7, 32], [14, 32]][[6, 14], [6, 32], [7, 32], [14, 32]]Passed

SHA-256 / 767882f0f1ac51627f4c5fbdc66b4e935012f0bb7c579c036ecd01ba37ccd162

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.964683+00:00.

Case digest / 3e6b52295d345fa27f56590a50f71bdc12d3663ab221b607a8b3ba5d2a7e85b6