FAILURE MAP
← Case archive

FA-87441 / Collision detection broadphase / Open access

SAH always splits because the leaf cost is ignored · case 01

Tiny nodes are split although a leaf is cheaper, deepening the tree.

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

ROOT CAUSE

The best cost starts at a huge sentinel instead of the leaf cost n.

VERIFIED REPAIR

Start from the leaf cost n and split only when cheaper.

Unsuccessful approach: Starting at n-1 still misjudges when a leaf is preferable.

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 * 1000)
    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 = [[[[[[1, 10, 6, 11], [1, 0, 5, 2], [2, 8, 5, 15], [8, 2, 15, 7]]], [2, 1, 3.275862, [1, 3]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[9, 0, 13, 3], [6, 7, 13, 13], [9, 7, 13, 10]]], [1, 1, 2.65, [0]]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.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, 3, 13, 5], [4, 3, 9, 7]]], [0, 0, 2.0, []]], [[[[3, 6, 9, 9], [1, 4, 7, 5]]], [0, 1, 2.0, []]], [[[[4, 6, 10, 13], [2, 0, 6, 6]]], [0, 1, 2.0, []]]], [[[[[10, 6, 14, 10], [6, 6, 8, 8], [5, 0, 8, 5], [7, 7, 8, 11]]], [2, 1, 3.3, [1, 2]]], [[[[0, 4, 4, 11], [9, 4, 13, 10]]], [0, 0, 2.0, []]], [[[[8, 1, 13, 2], [3, 8, 9, 15], [3, 1, 8, 2], [10, 0, 12, 2]]], [3, 1, 2.96, [0, 2, 3]]], [[[[6, 4, 9, 11], [0, 6, 2, 13], [8, 8, 10, 13], [3, 8, 10, 14], [6, 7, 9, 12], [8, 0, 14, 2], [10, 0, 17, 1]]], [5, 0, 4.935484, [0, 1, 2, 3, 4]]], [[[[4, 3, 6, 8], [0, 6, 1, 13], [0, 7, 1, 11], [0, 2, 5, 4], [4, 1, 7, 2]]], [3, 1, 4.052632, [0, 3, 4]]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[7, 9, 12, 14], [6, 1, 12, 4], [7, 9, 13, 12]]], [1, 1, 2.55, [1]]]], [[[[[6, 3, 13, 8], [8, 5, 14, 10], [0, 0, 7, 1], [7, 10, 9, 17]]], [1, 1, 3.387097, [2]]], [[[[10, 5, 16, 9], [8, 3, 11, 7]]], [0, 0, 2.0, []]], [[[[8, 7, 13, 8], [8, 5, 10, 7], [4, 1, 5, 5], [7, 1, 9, 5]]], [2, 0, 3.125, [2, 3]]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[9, 7, 16, 12], [8, 0, 10, 3]]], [1, 1, 1.85, [1]]], [[[[8, 8, 13, 9], [6, 8, 11, 12]]], [0, 0, 2.0, []]], [[[[1, 2, 8, 6], [8, 3, 9, 6]]], [0, 0, 2.0, []]], [[[[1, 7, 8, 13], [8, 5, 9, 10], [6, 7, 10, 11]]], [1, 0, 2.941176, [0]]]], [[[[[3, 5, 4, 12], [0, 6, 3, 13], [2, 2, 8, 4], [8, 6, 12, 7], [8, 8, 14, 13], [5, 6, 10, 8], [3, 6, 8, 13]]], [4, 0, 5.96, [0, 1, 2, 6]]], [[[[3, 4, 5, 6], [9, 10, 15, 13]]], [1, 0, 1.619048, [0]]], [[[[4, 4, 6, 7], [7, 4, 14, 6], [9, 0, 11, 7], [1, 0, 3, 1], [1, 3, 4, 8], [10, 2, 14, 8]]], [3, 0, 5.0, [0, 3, 4]]], [[[[10, 4, 11, 7], [3, 6, 10, 10], [4, 8, 7, 14], [1, 3, 8, 9]]], [0, 0, 4.0, []]], [[[[3, 1, 8, 2], [5, 2, 11, 7]]], [0, 1, 2.0, []]], [[[[1, 3, 3, 9], [3, 9, 10, 14], [9, 7, 15, 9], [10, 10, 11, 12], [0, 5, 4, 12], [10, 3, 13, 5]]], [3, 0, 5.153846, [0, 1, 4]]], [[[[4, 8, 7, 15], [10, 7, 17, 13], [5, 2, 11, 9]]], [0, 0, 3.0, []]], [[[[2, 0, 9, 3], [7, 1, 13, 7], [8, 3, 15, 4], [4, 3, 11, 10], [8, 10, 13, 13], [8, 9, 12, 11], [4, 7, 7, 13]]], [3, 1, 6.230769, [0, 1, 2]]]], [[[[[8, 5, 9, 7], [2, 5, 8, 8], [5, 7, 10, 10]]], [0, 0, 3.0, []]], [[[[5, 10, 9, 16], [7, 10, 14, 11], [8, 2, 11, 4], [10, 3, 15, 6], [2, 7, 7, 10]]], [2, 1, 4.148148, [2, 3]]], [[[[5, 8, 7, 13], [6, 8, 12, 14], [5, 1, 10, 7], [2, 0, 9, 7], [0, 7, 1, 14], [6, 10, 10, 15], [5, 0, 11, 2]]], [3, 1, 5.740741, [2, 3, 6]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 8], [4, 4, 6, 6], [10, 10, 16, 17]]], [2, 1, 2.24, [0, 1]]], [[[[6, 3, 10, 4], [6, 6, 13, 13]]], [0, 1, 2.0, []]], [[[[9, 1, 12, 4], [0, 9, 7, 11], [8, 3, 11, 5]]], [2, 1, 2.136364, [0, 2]]], [[[[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]]]]]
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[2, 1, 3.275862, [1, 3]][2, 1, 3.275862, [1, 3]]Passed
case 1[2, 0, 2.619048, [0, 2]][2, 0, 2.619048, [0, 2]]Passed
case 2[1, 1, 2.65, [0]][1, 1, 2.65, [0]]Passed
case 3[1, 0, 2.727273, [0]][0, 0, 2.0, []]Failed
case 4[3, 1, 4.535714, [2, 3, 4]][3, 1, 4.535714, [2, 3, 4]]Passed
case 5[1, 0, 2.307692, [1]][0, 0, 2.0, []]Failed
case 6[1, 1, 2.230769, [1]][0, 1, 2.0, []]Failed
case 7[1, 1, 2.095238, [1]][0, 1, 2.0, []]Failed

SHA-256 / ca8be1bf077650cccab1ebea2a8cc76662fad3ef6f7057045e250f1612d2631a

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 - 1)
    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 = [[[[[[1, 10, 6, 11], [1, 0, 5, 2], [2, 8, 5, 15], [8, 2, 15, 7]]], [2, 1, 3.275862, [1, 3]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[9, 0, 13, 3], [6, 7, 13, 13], [9, 7, 13, 10]]], [1, 1, 2.65, [0]]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.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, 3, 13, 5], [4, 3, 9, 7]]], [0, 0, 2.0, []]], [[[[3, 6, 9, 9], [1, 4, 7, 5]]], [0, 1, 2.0, []]], [[[[4, 6, 10, 13], [2, 0, 6, 6]]], [0, 1, 2.0, []]]], [[[[[10, 6, 14, 10], [6, 6, 8, 8], [5, 0, 8, 5], [7, 7, 8, 11]]], [2, 1, 3.3, [1, 2]]], [[[[0, 4, 4, 11], [9, 4, 13, 10]]], [0, 0, 2.0, []]], [[[[8, 1, 13, 2], [3, 8, 9, 15], [3, 1, 8, 2], [10, 0, 12, 2]]], [3, 1, 2.96, [0, 2, 3]]], [[[[6, 4, 9, 11], [0, 6, 2, 13], [8, 8, 10, 13], [3, 8, 10, 14], [6, 7, 9, 12], [8, 0, 14, 2], [10, 0, 17, 1]]], [5, 0, 4.935484, [0, 1, 2, 3, 4]]], [[[[4, 3, 6, 8], [0, 6, 1, 13], [0, 7, 1, 11], [0, 2, 5, 4], [4, 1, 7, 2]]], [3, 1, 4.052632, [0, 3, 4]]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[7, 9, 12, 14], [6, 1, 12, 4], [7, 9, 13, 12]]], [1, 1, 2.55, [1]]]], [[[[[6, 3, 13, 8], [8, 5, 14, 10], [0, 0, 7, 1], [7, 10, 9, 17]]], [1, 1, 3.387097, [2]]], [[[[10, 5, 16, 9], [8, 3, 11, 7]]], [0, 0, 2.0, []]], [[[[8, 7, 13, 8], [8, 5, 10, 7], [4, 1, 5, 5], [7, 1, 9, 5]]], [2, 0, 3.125, [2, 3]]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[9, 7, 16, 12], [8, 0, 10, 3]]], [1, 1, 1.85, [1]]], [[[[8, 8, 13, 9], [6, 8, 11, 12]]], [0, 0, 2.0, []]], [[[[1, 2, 8, 6], [8, 3, 9, 6]]], [0, 0, 2.0, []]], [[[[1, 7, 8, 13], [8, 5, 9, 10], [6, 7, 10, 11]]], [1, 0, 2.941176, [0]]]], [[[[[3, 5, 4, 12], [0, 6, 3, 13], [2, 2, 8, 4], [8, 6, 12, 7], [8, 8, 14, 13], [5, 6, 10, 8], [3, 6, 8, 13]]], [4, 0, 5.96, [0, 1, 2, 6]]], [[[[3, 4, 5, 6], [9, 10, 15, 13]]], [1, 0, 1.619048, [0]]], [[[[4, 4, 6, 7], [7, 4, 14, 6], [9, 0, 11, 7], [1, 0, 3, 1], [1, 3, 4, 8], [10, 2, 14, 8]]], [3, 0, 5.0, [0, 3, 4]]], [[[[10, 4, 11, 7], [3, 6, 10, 10], [4, 8, 7, 14], [1, 3, 8, 9]]], [0, 0, 4.0, []]], [[[[3, 1, 8, 2], [5, 2, 11, 7]]], [0, 1, 2.0, []]], [[[[1, 3, 3, 9], [3, 9, 10, 14], [9, 7, 15, 9], [10, 10, 11, 12], [0, 5, 4, 12], [10, 3, 13, 5]]], [3, 0, 5.153846, [0, 1, 4]]], [[[[4, 8, 7, 15], [10, 7, 17, 13], [5, 2, 11, 9]]], [0, 0, 3.0, []]], [[[[2, 0, 9, 3], [7, 1, 13, 7], [8, 3, 15, 4], [4, 3, 11, 10], [8, 10, 13, 13], [8, 9, 12, 11], [4, 7, 7, 13]]], [3, 1, 6.230769, [0, 1, 2]]]], [[[[[8, 5, 9, 7], [2, 5, 8, 8], [5, 7, 10, 10]]], [0, 0, 3.0, []]], [[[[5, 10, 9, 16], [7, 10, 14, 11], [8, 2, 11, 4], [10, 3, 15, 6], [2, 7, 7, 10]]], [2, 1, 4.148148, [2, 3]]], [[[[5, 8, 7, 13], [6, 8, 12, 14], [5, 1, 10, 7], [2, 0, 9, 7], [0, 7, 1, 14], [6, 10, 10, 15], [5, 0, 11, 2]]], [3, 1, 5.740741, [2, 3, 6]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 8], [4, 4, 6, 6], [10, 10, 16, 17]]], [2, 1, 2.24, [0, 1]]], [[[[6, 3, 10, 4], [6, 6, 13, 13]]], [0, 1, 2.0, []]], [[[[9, 1, 12, 4], [0, 9, 7, 11], [8, 3, 11, 5]]], [2, 1, 2.136364, [0, 2]]], [[[[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]]]]]
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[0, 1, 3.0, []][2, 1, 3.275862, [1, 3]]Failed
case 1[0, 0, 2.0, []][2, 0, 2.619048, [0, 2]]Failed
case 2[0, 1, 2.0, []][1, 1, 2.65, [0]]Failed
case 3[0, 0, 1.0, []][0, 0, 2.0, []]Failed
case 4[3, 1, 4.535714, [2, 3, 4]][3, 1, 4.535714, [2, 3, 4]]Passed
case 5[0, 0, 1.0, []][0, 0, 2.0, []]Failed
case 6[0, 1, 1.0, []][0, 1, 2.0, []]Failed
case 7[0, 1, 1.0, []][0, 1, 2.0, []]Failed

SHA-256 / f435062914d4434e0365e539cc31664f6f6b61cd4c69ee7e30e2c9c46faef1b8

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 = [[[[[[1, 10, 6, 11], [1, 0, 5, 2], [2, 8, 5, 15], [8, 2, 15, 7]]], [2, 1, 3.275862, [1, 3]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[9, 0, 13, 3], [6, 7, 13, 13], [9, 7, 13, 10]]], [1, 1, 2.65, [0]]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.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, 3, 13, 5], [4, 3, 9, 7]]], [0, 0, 2.0, []]], [[[[3, 6, 9, 9], [1, 4, 7, 5]]], [0, 1, 2.0, []]], [[[[4, 6, 10, 13], [2, 0, 6, 6]]], [0, 1, 2.0, []]]], [[[[[10, 6, 14, 10], [6, 6, 8, 8], [5, 0, 8, 5], [7, 7, 8, 11]]], [2, 1, 3.3, [1, 2]]], [[[[0, 4, 4, 11], [9, 4, 13, 10]]], [0, 0, 2.0, []]], [[[[8, 1, 13, 2], [3, 8, 9, 15], [3, 1, 8, 2], [10, 0, 12, 2]]], [3, 1, 2.96, [0, 2, 3]]], [[[[6, 4, 9, 11], [0, 6, 2, 13], [8, 8, 10, 13], [3, 8, 10, 14], [6, 7, 9, 12], [8, 0, 14, 2], [10, 0, 17, 1]]], [5, 0, 4.935484, [0, 1, 2, 3, 4]]], [[[[4, 3, 6, 8], [0, 6, 1, 13], [0, 7, 1, 11], [0, 2, 5, 4], [4, 1, 7, 2]]], [3, 1, 4.052632, [0, 3, 4]]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[7, 9, 12, 14], [6, 1, 12, 4], [7, 9, 13, 12]]], [1, 1, 2.55, [1]]]], [[[[[6, 3, 13, 8], [8, 5, 14, 10], [0, 0, 7, 1], [7, 10, 9, 17]]], [1, 1, 3.387097, [2]]], [[[[10, 5, 16, 9], [8, 3, 11, 7]]], [0, 0, 2.0, []]], [[[[8, 7, 13, 8], [8, 5, 10, 7], [4, 1, 5, 5], [7, 1, 9, 5]]], [2, 0, 3.125, [2, 3]]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[9, 7, 16, 12], [8, 0, 10, 3]]], [1, 1, 1.85, [1]]], [[[[8, 8, 13, 9], [6, 8, 11, 12]]], [0, 0, 2.0, []]], [[[[1, 2, 8, 6], [8, 3, 9, 6]]], [0, 0, 2.0, []]], [[[[1, 7, 8, 13], [8, 5, 9, 10], [6, 7, 10, 11]]], [1, 0, 2.941176, [0]]]], [[[[[3, 5, 4, 12], [0, 6, 3, 13], [2, 2, 8, 4], [8, 6, 12, 7], [8, 8, 14, 13], [5, 6, 10, 8], [3, 6, 8, 13]]], [4, 0, 5.96, [0, 1, 2, 6]]], [[[[3, 4, 5, 6], [9, 10, 15, 13]]], [1, 0, 1.619048, [0]]], [[[[4, 4, 6, 7], [7, 4, 14, 6], [9, 0, 11, 7], [1, 0, 3, 1], [1, 3, 4, 8], [10, 2, 14, 8]]], [3, 0, 5.0, [0, 3, 4]]], [[[[10, 4, 11, 7], [3, 6, 10, 10], [4, 8, 7, 14], [1, 3, 8, 9]]], [0, 0, 4.0, []]], [[[[3, 1, 8, 2], [5, 2, 11, 7]]], [0, 1, 2.0, []]], [[[[1, 3, 3, 9], [3, 9, 10, 14], [9, 7, 15, 9], [10, 10, 11, 12], [0, 5, 4, 12], [10, 3, 13, 5]]], [3, 0, 5.153846, [0, 1, 4]]], [[[[4, 8, 7, 15], [10, 7, 17, 13], [5, 2, 11, 9]]], [0, 0, 3.0, []]], [[[[2, 0, 9, 3], [7, 1, 13, 7], [8, 3, 15, 4], [4, 3, 11, 10], [8, 10, 13, 13], [8, 9, 12, 11], [4, 7, 7, 13]]], [3, 1, 6.230769, [0, 1, 2]]]], [[[[[8, 5, 9, 7], [2, 5, 8, 8], [5, 7, 10, 10]]], [0, 0, 3.0, []]], [[[[5, 10, 9, 16], [7, 10, 14, 11], [8, 2, 11, 4], [10, 3, 15, 6], [2, 7, 7, 10]]], [2, 1, 4.148148, [2, 3]]], [[[[5, 8, 7, 13], [6, 8, 12, 14], [5, 1, 10, 7], [2, 0, 9, 7], [0, 7, 1, 14], [6, 10, 10, 15], [5, 0, 11, 2]]], [3, 1, 5.740741, [2, 3, 6]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 8], [4, 4, 6, 6], [10, 10, 16, 17]]], [2, 1, 2.24, [0, 1]]], [[[[6, 3, 10, 4], [6, 6, 13, 13]]], [0, 1, 2.0, []]], [[[[9, 1, 12, 4], [0, 9, 7, 11], [8, 3, 11, 5]]], [2, 1, 2.136364, [0, 2]]], [[[[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]]]]]
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[2, 1, 3.275862, [1, 3]][2, 1, 3.275862, [1, 3]]Passed
case 1[2, 0, 2.619048, [0, 2]][2, 0, 2.619048, [0, 2]]Passed
case 2[1, 1, 2.65, [0]][1, 1, 2.65, [0]]Passed
case 3[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 4[3, 1, 4.535714, [2, 3, 4]][3, 1, 4.535714, [2, 3, 4]]Passed
case 5[0, 0, 2.0, []][0, 0, 2.0, []]Passed
case 6[0, 1, 2.0, []][0, 1, 2.0, []]Passed
case 7[0, 1, 2.0, []][0, 1, 2.0, []]Passed

SHA-256 / 9b63dd5c4b6d3d4a4730c87452ddcb5965d3ee20894448389a31f58fe3e88708

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

Case digest / c5f56d0e670da4e39c501a475d0fc325715c201dd7bba2dcc49f7ed2685e764a