FAILURE MAP
← Case archive

FA-87436 / Collision detection broadphase / Open access

SAH weights each child area by the other child count · case 01

Unbalanced splits are costed backwards.

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

ROOT CAUSE

Left perimeter is multiplied by n-k and right by k.

VERIFIED REPAIR

Weight each child by its own primitive count.

Unsuccessful approach: Using n/2 for both children ignores imbalance entirely.

Case contract

solve(prims): top-down BVH build step. Split axis = larger centroid extent (x on ties). Primitives sorted by centroid on that axis (index tiebreak). Cost of split k = 1 + (P(L)*k + P(R)*(n-k))/P(parent) with P the box perimeter of the primitives' bounds; leaf cost n. Return [best k or 0 for leaf, axis, cost rounded to 6, sorted left indices].

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(prims):
    n = len(prims)
    cent = [((p[0] + p[2]) / 2, (p[1] + p[3]) / 2) for p in prims]
    ex = max(c[0] for c in cent) - min(c[0] for c in cent)
    ey = max(c[1] for c in cent) - min(c[1] for c in cent)
    axis = 0 if ex >= ey else 1
    order = sorted(range(n), key=lambda i: (cent[i][axis], i))
    def box(ids):
        return [min(prims[i][0] for i in ids), min(prims[i][1] for i in ids), max(prims[i][2] for i in ids), max(prims[i][3] for i in ids)]
    def perim(b):
        return 2 * ((b[2] - b[0]) + (b[3] - b[1]))
    pa = perim(box(order))
    best_k, best = 0, float(n)
    for k in range(1, n):
        cost = 1 + (perim(box(order[:k])) * (n - k) + perim(box(order[k:])) * k) / pa
        if cost < best:
            best_k, best = k, cost
    return [best_k, axis, round(best, 6), sorted(order[:best_k])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, 0, 7, 5], [3, 9, 6, 12]]], [1, 1, 1.8125, [0]]], [[[[0, 5, 6, 9], [5, 8, 7, 14], [6, 3, 8, 4], [6, 2, 11, 5], [8, 0, 14, 1], [7, 8, 11, 9]]], [3, 1, 4.535714, [2, 3, 4]]], [[[[7, 6, 12, 8], [6, 7, 13, 10], [3, 6, 8, 10], [1, 2, 2, 4]]], [1, 0, 3.25, [3]]], [[[[5, 0, 10, 4], [0, 1, 5, 7]]], [0, 0, 2.0, []]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.0, []]], [[[[6, 4, 9, 9], [1, 3, 5, 10], [3, 6, 5, 12], [4, 2, 9, 6]]], [2, 1, 3.777778, [0, 3]]], [[[[8, 5, 12, 12], [6, 5, 11, 12], [2, 7, 9, 8], [4, 6, 11, 13], [5, 0, 11, 2], [4, 8, 5, 14]]], [2, 1, 5.25, [2, 4]]], [[[[4, 4, 11, 5], [6, 0, 10, 5], [10, 6, 16, 11], [2, 2, 4, 9], [7, 8, 11, 15], [6, 10, 13, 11], [7, 7, 8, 12]]], [4, 0, 5.862069, [0, 1, 3, 6]]]], [[[[[8, 7, 10, 13], [3, 3, 8, 6], [2, 2, 7, 4], [9, 10, 12, 14]]], [2, 1, 2.909091, [1, 2]]], [[[[2, 5, 9, 9], [9, 2, 10, 7], [2, 0, 7, 7], [4, 5, 6, 12]]], [0, 0, 4.0, []]], [[[[2, 3, 8, 7], [9, 4, 13, 5]]], [0, 0, 2.0, []]], [[[[6, 3, 10, 8], [10, 9, 12, 15], [7, 7, 13, 14], [2, 3, 8, 4], [7, 7, 8, 12], [2, 2, 8, 8], [5, 6, 6, 9]]], [4, 1, 5.25, [0, 3, 5, 6]]], [[[[3, 10, 10, 11], [8, 0, 11, 5], [0, 9, 1, 11], [6, 9, 7, 12], [9, 1, 11, 4], [0, 8, 6, 15], [7, 4, 12, 10]]], [4, 0, 5.185185, [0, 2, 3, 5]]], [[[[1, 2, 7, 5], [9, 5, 11, 6]]], [1, 0, 1.857143, [0]]], [[[[9, 3, 16, 10], [5, 8, 11, 13]]], [0, 0, 2.0, []]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]]], [[[[[4, 1, 5, 3], [1, 6, 4, 11]]], [1, 1, 1.785714, [0]]], [[[[10, 3, 14, 10], [0, 1, 3, 3]]], [1, 0, 1.695652, [1]]], [[[[9, 7, 13, 11], [6, 3, 8, 5]]], [1, 1, 1.8, [1]]], [[[[8, 10, 9, 15], [7, 1, 11, 7]]], [1, 1, 1.888889, [1]]], [[[[7, 6, 8, 8], [5, 0, 10, 7], [7, 8, 12, 14], [1, 6, 8, 8], [3, 0, 7, 3]]], [4, 1, 4.16, [0, 1, 3, 4]]], [[[[5, 4, 9, 11], [2, 3, 6, 8], [1, 0, 5, 5], [5, 10, 11, 14], [5, 8, 7, 13], [7, 9, 10, 11], [2, 2, 7, 9]]], [3, 1, 5.541667, [1, 2, 6]]], [[[[10, 1, 12, 4], [7, 0, 8, 1], [2, 1, 7, 8], [6, 3, 13, 5], [8, 9, 9, 11], [4, 10, 9, 17], [9, 8, 12, 15]]], [4, 1, 5.535714, [0, 1, 2, 3]]], [[[[1, 3, 5, 10], [3, 0, 7, 7], [10, 4, 17, 6], [2, 2, 6, 9]]], [3, 0, 3.192308, [0, 1, 3]]]], [[[[[3, 3, 9, 10], [3, 4, 6, 9], [8, 3, 12, 4], [4, 1, 6, 2], [9, 2, 12, 8], [3, 9, 6, 10], [5, 9, 12, 14]]], [5, 1, 6.363636, [0, 1, 2, 3, 4]]], [[[[6, 2, 10, 6], [2, 4, 8, 9], [8, 3, 13, 6]]], [1, 0, 2.833333, [1]]], [[[[10, 0, 16, 1], [1, 7, 8, 10], [3, 5, 5, 10], [6, 8, 13, 9], [5, 9, 10, 10]]], [4, 0, 4.0, [1, 2, 3, 4]]], [[[[4, 10, 8, 13], [0, 9, 1, 14]]], [0, 0, 2.0, []]], [[[[3, 6, 5, 8], [10, 0, 11, 1], [5, 1, 11, 8]]], [0, 0, 3.0, []]], [[[[8, 5, 13, 7], [10, 10, 17, 14], [8, 3, 15, 4]]], [2, 1, 2.65, [0, 2]]], [[[[8, 10, 15, 15], [4, 2, 8, 7]]], [1, 1, 1.875, [1]]], [[[[4, 0, 7, 3], [5, 8, 12, 12], [2, 1, 5, 4], [8, 0, 14, 7], [2, 10, 9, 11]]], [3, 1, 4.541667, [0, 2, 3]]]], [[[[[3, 9, 8, 12], [5, 8, 6, 13]]], [0, 0, 2.0, []]], [[[[2, 0, 8, 4], [10, 6, 14, 8], [9, 6, 15, 8], [7, 7, 10, 12], [9, 6, 15, 8], [8, 6, 9, 13]]], [1, 1, 4.269231, [0]]], [[[[0, 9, 1, 12], [0, 9, 2, 15]]], [0, 1, 2.0, []]], [[[[5, 7, 10, 10], [9, 0, 13, 4], [9, 4, 16, 11], [7, 6, 8, 13]]], [2, 1, 3.5, [1, 2]]], [[[[5, 1, 8, 5], [8, 9, 15, 12]]], [1, 1, 1.809524, [0]]], [[[[1, 8, 4, 13], [1, 7, 4, 14], [0, 0, 1, 5], [1, 7, 5, 8], [8, 0, 10, 7], [1, 8, 6, 14], [6, 8, 13, 11]]], [5, 0, 6.037037, [0, 1, 2, 3, 5]]], [[[[10, 2, 16, 7], [4, 2, 5, 5], [9, 8, 10, 9], [7, 4, 11, 9], [8, 9, 12, 10], [0, 3, 2, 9], [0, 7, 7, 8]]], [3, 0, 5.583333, [1, 5, 6]]], [[[[10, 1, 16, 6], [2, 10, 4, 14], [7, 3, 14, 9], [6, 7, 11, 13], [0, 7, 2, 12]]], [2, 0, 4.034483, [1, 4]]]]]
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[1, 1, 1.8125, [0]][1, 1, 1.8125, [0]]Passed
case 1[1, 1, 3.071429, [4]][3, 1, 4.535714, [2, 3, 4]]Failed
case 2[1, 0, 2.15, [3]][1, 0, 3.25, [3]]Failed
case 3[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 4[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 5[3, 1, 3.222222, [0, 1, 3]][2, 1, 3.777778, [0, 3]]Failed
case 6[5, 1, 3.416667, [0, 1, 2, 3, 4]][2, 1, 5.25, [2, 4]]Failed
case 7[1, 0, 3.793103, [3]][4, 0, 5.862069, [0, 1, 3, 6]]Failed

SHA-256 / 6fb31d5c672b90504738b1cb71a20ed6bba7f7092719dec131aee0e5bbb58950

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(prims):
    n = len(prims)
    cent = [((p[0] + p[2]) / 2, (p[1] + p[3]) / 2) for p in prims]
    ex = max(c[0] for c in cent) - min(c[0] for c in cent)
    ey = max(c[1] for c in cent) - min(c[1] for c in cent)
    axis = 0 if ex >= ey else 1
    order = sorted(range(n), key=lambda i: (cent[i][axis], i))
    def box(ids):
        return [min(prims[i][0] for i in ids), min(prims[i][1] for i in ids), max(prims[i][2] for i in ids), max(prims[i][3] for i in ids)]
    def perim(b):
        return 2 * ((b[2] - b[0]) + (b[3] - b[1]))
    pa = perim(box(order))
    best_k, best = 0, float(n)
    for k in range(1, n):
        cost = 1 + ((perim(box(order[:k])) + perim(box(order[k:]))) * n / 2) / pa
        if cost < best:
            best_k, best = k, cost
    return [best_k, axis, round(best, 6), sorted(order[:best_k])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, 0, 7, 5], [3, 9, 6, 12]]], [1, 1, 1.8125, [0]]], [[[[0, 5, 6, 9], [5, 8, 7, 14], [6, 3, 8, 4], [6, 2, 11, 5], [8, 0, 14, 1], [7, 8, 11, 9]]], [3, 1, 4.535714, [2, 3, 4]]], [[[[7, 6, 12, 8], [6, 7, 13, 10], [3, 6, 8, 10], [1, 2, 2, 4]]], [1, 0, 3.25, [3]]], [[[[5, 0, 10, 4], [0, 1, 5, 7]]], [0, 0, 2.0, []]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.0, []]], [[[[6, 4, 9, 9], [1, 3, 5, 10], [3, 6, 5, 12], [4, 2, 9, 6]]], [2, 1, 3.777778, [0, 3]]], [[[[8, 5, 12, 12], [6, 5, 11, 12], [2, 7, 9, 8], [4, 6, 11, 13], [5, 0, 11, 2], [4, 8, 5, 14]]], [2, 1, 5.25, [2, 4]]], [[[[4, 4, 11, 5], [6, 0, 10, 5], [10, 6, 16, 11], [2, 2, 4, 9], [7, 8, 11, 15], [6, 10, 13, 11], [7, 7, 8, 12]]], [4, 0, 5.862069, [0, 1, 3, 6]]]], [[[[[8, 7, 10, 13], [3, 3, 8, 6], [2, 2, 7, 4], [9, 10, 12, 14]]], [2, 1, 2.909091, [1, 2]]], [[[[2, 5, 9, 9], [9, 2, 10, 7], [2, 0, 7, 7], [4, 5, 6, 12]]], [0, 0, 4.0, []]], [[[[2, 3, 8, 7], [9, 4, 13, 5]]], [0, 0, 2.0, []]], [[[[6, 3, 10, 8], [10, 9, 12, 15], [7, 7, 13, 14], [2, 3, 8, 4], [7, 7, 8, 12], [2, 2, 8, 8], [5, 6, 6, 9]]], [4, 1, 5.25, [0, 3, 5, 6]]], [[[[3, 10, 10, 11], [8, 0, 11, 5], [0, 9, 1, 11], [6, 9, 7, 12], [9, 1, 11, 4], [0, 8, 6, 15], [7, 4, 12, 10]]], [4, 0, 5.185185, [0, 2, 3, 5]]], [[[[1, 2, 7, 5], [9, 5, 11, 6]]], [1, 0, 1.857143, [0]]], [[[[9, 3, 16, 10], [5, 8, 11, 13]]], [0, 0, 2.0, []]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]]], [[[[[4, 1, 5, 3], [1, 6, 4, 11]]], [1, 1, 1.785714, [0]]], [[[[10, 3, 14, 10], [0, 1, 3, 3]]], [1, 0, 1.695652, [1]]], [[[[9, 7, 13, 11], [6, 3, 8, 5]]], [1, 1, 1.8, [1]]], [[[[8, 10, 9, 15], [7, 1, 11, 7]]], [1, 1, 1.888889, [1]]], [[[[7, 6, 8, 8], [5, 0, 10, 7], [7, 8, 12, 14], [1, 6, 8, 8], [3, 0, 7, 3]]], [4, 1, 4.16, [0, 1, 3, 4]]], [[[[5, 4, 9, 11], [2, 3, 6, 8], [1, 0, 5, 5], [5, 10, 11, 14], [5, 8, 7, 13], [7, 9, 10, 11], [2, 2, 7, 9]]], [3, 1, 5.541667, [1, 2, 6]]], [[[[10, 1, 12, 4], [7, 0, 8, 1], [2, 1, 7, 8], [6, 3, 13, 5], [8, 9, 9, 11], [4, 10, 9, 17], [9, 8, 12, 15]]], [4, 1, 5.535714, [0, 1, 2, 3]]], [[[[1, 3, 5, 10], [3, 0, 7, 7], [10, 4, 17, 6], [2, 2, 6, 9]]], [3, 0, 3.192308, [0, 1, 3]]]], [[[[[3, 3, 9, 10], [3, 4, 6, 9], [8, 3, 12, 4], [4, 1, 6, 2], [9, 2, 12, 8], [3, 9, 6, 10], [5, 9, 12, 14]]], [5, 1, 6.363636, [0, 1, 2, 3, 4]]], [[[[6, 2, 10, 6], [2, 4, 8, 9], [8, 3, 13, 6]]], [1, 0, 2.833333, [1]]], [[[[10, 0, 16, 1], [1, 7, 8, 10], [3, 5, 5, 10], [6, 8, 13, 9], [5, 9, 10, 10]]], [4, 0, 4.0, [1, 2, 3, 4]]], [[[[4, 10, 8, 13], [0, 9, 1, 14]]], [0, 0, 2.0, []]], [[[[3, 6, 5, 8], [10, 0, 11, 1], [5, 1, 11, 8]]], [0, 0, 3.0, []]], [[[[8, 5, 13, 7], [10, 10, 17, 14], [8, 3, 15, 4]]], [2, 1, 2.65, [0, 2]]], [[[[8, 10, 15, 15], [4, 2, 8, 7]]], [1, 1, 1.875, [1]]], [[[[4, 0, 7, 3], [5, 8, 12, 12], [2, 1, 5, 4], [8, 0, 14, 7], [2, 10, 9, 11]]], [3, 1, 4.541667, [0, 2, 3]]]], [[[[[3, 9, 8, 12], [5, 8, 6, 13]]], [0, 0, 2.0, []]], [[[[2, 0, 8, 4], [10, 6, 14, 8], [9, 6, 15, 8], [7, 7, 10, 12], [9, 6, 15, 8], [8, 6, 9, 13]]], [1, 1, 4.269231, [0]]], [[[[0, 9, 1, 12], [0, 9, 2, 15]]], [0, 1, 2.0, []]], [[[[5, 7, 10, 10], [9, 0, 13, 4], [9, 4, 16, 11], [7, 6, 8, 13]]], [2, 1, 3.5, [1, 2]]], [[[[5, 1, 8, 5], [8, 9, 15, 12]]], [1, 1, 1.809524, [0]]], [[[[1, 8, 4, 13], [1, 7, 4, 14], [0, 0, 1, 5], [1, 7, 5, 8], [8, 0, 10, 7], [1, 8, 6, 14], [6, 8, 13, 11]]], [5, 0, 6.037037, [0, 1, 2, 3, 5]]], [[[[10, 2, 16, 7], [4, 2, 5, 5], [9, 8, 10, 9], [7, 4, 11, 9], [8, 9, 12, 10], [0, 3, 2, 9], [0, 7, 7, 8]]], [3, 0, 5.583333, [1, 5, 6]]], [[[[10, 1, 16, 6], [2, 10, 4, 14], [7, 3, 14, 9], [6, 7, 11, 13], [0, 7, 2, 12]]], [2, 0, 4.034483, [1, 4]]]]]
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[1, 1, 1.8125, [0]][1, 1, 1.8125, [0]]Passed
case 1[1, 1, 4.214286, [4]][3, 1, 4.535714, [2, 3, 4]]Failed
case 2[1, 0, 2.7, [3]][1, 0, 3.25, [3]]Failed
case 3[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 4[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 5[3, 1, 3.666667, [0, 1, 3]][2, 1, 3.777778, [0, 3]]Failed
case 6[1, 1, 4.375, [4]][2, 1, 5.25, [2, 4]]Failed
case 7[1, 0, 5.344828, [3]][4, 0, 5.862069, [0, 1, 3, 6]]Failed

SHA-256 / 2710ff323c3740a7606c690d6b4d32d6c765f2da89a9d27c83e9922703d83c8a

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(prims):
    n = len(prims)
    cent = [((p[0] + p[2]) / 2, (p[1] + p[3]) / 2) for p in prims]
    ex = max(c[0] for c in cent) - min(c[0] for c in cent)
    ey = max(c[1] for c in cent) - min(c[1] for c in cent)
    axis = 0 if ex >= ey else 1
    order = sorted(range(n), key=lambda i: (cent[i][axis], i))
    def box(ids):
        return [min(prims[i][0] for i in ids), min(prims[i][1] for i in ids), max(prims[i][2] for i in ids), max(prims[i][3] for i in ids)]
    def perim(b):
        return 2 * ((b[2] - b[0]) + (b[3] - b[1]))
    pa = perim(box(order))
    best_k, best = 0, float(n)
    for k in range(1, n):
        cost = 1 + (perim(box(order[:k])) * k + perim(box(order[k:])) * (n - k)) / pa
        if cost < best:
            best_k, best = k, cost
    return [best_k, axis, round(best, 6), sorted(order[:best_k])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, 0, 7, 5], [3, 9, 6, 12]]], [1, 1, 1.8125, [0]]], [[[[0, 5, 6, 9], [5, 8, 7, 14], [6, 3, 8, 4], [6, 2, 11, 5], [8, 0, 14, 1], [7, 8, 11, 9]]], [3, 1, 4.535714, [2, 3, 4]]], [[[[7, 6, 12, 8], [6, 7, 13, 10], [3, 6, 8, 10], [1, 2, 2, 4]]], [1, 0, 3.25, [3]]], [[[[5, 0, 10, 4], [0, 1, 5, 7]]], [0, 0, 2.0, []]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.0, []]], [[[[6, 4, 9, 9], [1, 3, 5, 10], [3, 6, 5, 12], [4, 2, 9, 6]]], [2, 1, 3.777778, [0, 3]]], [[[[8, 5, 12, 12], [6, 5, 11, 12], [2, 7, 9, 8], [4, 6, 11, 13], [5, 0, 11, 2], [4, 8, 5, 14]]], [2, 1, 5.25, [2, 4]]], [[[[4, 4, 11, 5], [6, 0, 10, 5], [10, 6, 16, 11], [2, 2, 4, 9], [7, 8, 11, 15], [6, 10, 13, 11], [7, 7, 8, 12]]], [4, 0, 5.862069, [0, 1, 3, 6]]]], [[[[[8, 7, 10, 13], [3, 3, 8, 6], [2, 2, 7, 4], [9, 10, 12, 14]]], [2, 1, 2.909091, [1, 2]]], [[[[2, 5, 9, 9], [9, 2, 10, 7], [2, 0, 7, 7], [4, 5, 6, 12]]], [0, 0, 4.0, []]], [[[[2, 3, 8, 7], [9, 4, 13, 5]]], [0, 0, 2.0, []]], [[[[6, 3, 10, 8], [10, 9, 12, 15], [7, 7, 13, 14], [2, 3, 8, 4], [7, 7, 8, 12], [2, 2, 8, 8], [5, 6, 6, 9]]], [4, 1, 5.25, [0, 3, 5, 6]]], [[[[3, 10, 10, 11], [8, 0, 11, 5], [0, 9, 1, 11], [6, 9, 7, 12], [9, 1, 11, 4], [0, 8, 6, 15], [7, 4, 12, 10]]], [4, 0, 5.185185, [0, 2, 3, 5]]], [[[[1, 2, 7, 5], [9, 5, 11, 6]]], [1, 0, 1.857143, [0]]], [[[[9, 3, 16, 10], [5, 8, 11, 13]]], [0, 0, 2.0, []]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]]], [[[[[4, 1, 5, 3], [1, 6, 4, 11]]], [1, 1, 1.785714, [0]]], [[[[10, 3, 14, 10], [0, 1, 3, 3]]], [1, 0, 1.695652, [1]]], [[[[9, 7, 13, 11], [6, 3, 8, 5]]], [1, 1, 1.8, [1]]], [[[[8, 10, 9, 15], [7, 1, 11, 7]]], [1, 1, 1.888889, [1]]], [[[[7, 6, 8, 8], [5, 0, 10, 7], [7, 8, 12, 14], [1, 6, 8, 8], [3, 0, 7, 3]]], [4, 1, 4.16, [0, 1, 3, 4]]], [[[[5, 4, 9, 11], [2, 3, 6, 8], [1, 0, 5, 5], [5, 10, 11, 14], [5, 8, 7, 13], [7, 9, 10, 11], [2, 2, 7, 9]]], [3, 1, 5.541667, [1, 2, 6]]], [[[[10, 1, 12, 4], [7, 0, 8, 1], [2, 1, 7, 8], [6, 3, 13, 5], [8, 9, 9, 11], [4, 10, 9, 17], [9, 8, 12, 15]]], [4, 1, 5.535714, [0, 1, 2, 3]]], [[[[1, 3, 5, 10], [3, 0, 7, 7], [10, 4, 17, 6], [2, 2, 6, 9]]], [3, 0, 3.192308, [0, 1, 3]]]], [[[[[3, 3, 9, 10], [3, 4, 6, 9], [8, 3, 12, 4], [4, 1, 6, 2], [9, 2, 12, 8], [3, 9, 6, 10], [5, 9, 12, 14]]], [5, 1, 6.363636, [0, 1, 2, 3, 4]]], [[[[6, 2, 10, 6], [2, 4, 8, 9], [8, 3, 13, 6]]], [1, 0, 2.833333, [1]]], [[[[10, 0, 16, 1], [1, 7, 8, 10], [3, 5, 5, 10], [6, 8, 13, 9], [5, 9, 10, 10]]], [4, 0, 4.0, [1, 2, 3, 4]]], [[[[4, 10, 8, 13], [0, 9, 1, 14]]], [0, 0, 2.0, []]], [[[[3, 6, 5, 8], [10, 0, 11, 1], [5, 1, 11, 8]]], [0, 0, 3.0, []]], [[[[8, 5, 13, 7], [10, 10, 17, 14], [8, 3, 15, 4]]], [2, 1, 2.65, [0, 2]]], [[[[8, 10, 15, 15], [4, 2, 8, 7]]], [1, 1, 1.875, [1]]], [[[[4, 0, 7, 3], [5, 8, 12, 12], [2, 1, 5, 4], [8, 0, 14, 7], [2, 10, 9, 11]]], [3, 1, 4.541667, [0, 2, 3]]]], [[[[[3, 9, 8, 12], [5, 8, 6, 13]]], [0, 0, 2.0, []]], [[[[2, 0, 8, 4], [10, 6, 14, 8], [9, 6, 15, 8], [7, 7, 10, 12], [9, 6, 15, 8], [8, 6, 9, 13]]], [1, 1, 4.269231, [0]]], [[[[0, 9, 1, 12], [0, 9, 2, 15]]], [0, 1, 2.0, []]], [[[[5, 7, 10, 10], [9, 0, 13, 4], [9, 4, 16, 11], [7, 6, 8, 13]]], [2, 1, 3.5, [1, 2]]], [[[[5, 1, 8, 5], [8, 9, 15, 12]]], [1, 1, 1.809524, [0]]], [[[[1, 8, 4, 13], [1, 7, 4, 14], [0, 0, 1, 5], [1, 7, 5, 8], [8, 0, 10, 7], [1, 8, 6, 14], [6, 8, 13, 11]]], [5, 0, 6.037037, [0, 1, 2, 3, 5]]], [[[[10, 2, 16, 7], [4, 2, 5, 5], [9, 8, 10, 9], [7, 4, 11, 9], [8, 9, 12, 10], [0, 3, 2, 9], [0, 7, 7, 8]]], [3, 0, 5.583333, [1, 5, 6]]], [[[[10, 1, 16, 6], [2, 10, 4, 14], [7, 3, 14, 9], [6, 7, 11, 13], [0, 7, 2, 12]]], [2, 0, 4.034483, [1, 4]]]]]
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[1, 1, 1.8125, [0]][1, 1, 1.8125, [0]]Passed
case 1[3, 1, 4.535714, [2, 3, 4]][3, 1, 4.535714, [2, 3, 4]]Passed
case 2[1, 0, 3.25, [3]][1, 0, 3.25, [3]]Passed
case 3[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 4[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 5[2, 1, 3.777778, [0, 3]][2, 1, 3.777778, [0, 3]]Passed
case 6[2, 1, 5.25, [2, 4]][2, 1, 5.25, [2, 4]]Passed
case 7[4, 0, 5.862069, [0, 1, 3, 6]][4, 0, 5.862069, [0, 1, 3, 6]]Passed

SHA-256 / 373214e4f0626dbdb15d8ab5054289c9793d67c28e470d5285dd3ef4bf604fb5

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

Case digest / 67f676e70c7ce486f16e695a1a20ba5851bef50b34cd843085c8de51a80a8d73