FAILURE MAP
← Case archive

FA-87676 / Collision detection broadphase / Open access

Variance is measured around the midrange · case 01

Skewed distributions report the wrong spread.

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

ROOT CAUSE

mean = (max+min)/2.

VERIFIED REPAIR

Use the arithmetic mean.

Unsuccessful approach: Using the first centre as the mean biases the result.

Case contract

solve(boxes): 3D sweep-and-prune axis selection. Boxes [id,minx,miny,minz,maxx,maxy,maxz]. Pick the axis with the largest population variance of box centres (first axis on ties), then order ids by (min on that axis, id). Return [axis, variance rounded to 6, ordered ids].

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):
    n = len(boxes)
    best_axis, best_var = 0, -1.0
    for ax in (0, 1, 2):
        cs_ = [(b[1 + ax] + b[4 + ax]) / 2 for b in boxes]
        mean = (max(cs_) + min(cs_)) / 2
        var = sum((c - mean) ** 2 for c in cs_) / n
        if var > best_var:
            best_axis, best_var = ax, var
    order = [b[0] for b in sorted(boxes, key=lambda b: (b[1 + best_axis], b[0]))]
    return [best_axis, round(best_var, 6), order]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[33, 11, 21, 19, 23, 23, 28], [4, 14, 15, 2, 19, 19, 9], [30, 13, 29, 13, 22, 31, 17], [26, 17, 18, 3, 23, 21, 8], [15, 10, 25, 4, 18, 33, 11]]], [2, 48.84, [4, 26, 15, 30, 33]]], [[[[38, 0, 1, 1, 2, 3, 6], [11, 0, 5, 2, 12, 14, 3]]], [1, 14.0625, [38, 11]]], [[[[9, 2, 28, 6, 5, 32, 11], [11, 1, 26, 2, 1, 34, 9], [14, 0, 0, 8, 10, 11, 9]]], [1, 133.388889, [14, 11, 9]]], [[[[3, 0, 20, 0, 4, 30, 3], [32, 3, 28, 14, 8, 34, 24], [6, 3, 8, 2, 14, 9, 12], [34, 10, 9, 20, 19, 20, 20]]], [1, 77.0625, [6, 34, 3, 32]]], [[[[28, 6, 3, 23, 6, 7, 29], [18, 0, 0, 7, 12, 5, 18], [19, 8, 2, 24, 9, 9, 31], [38, 1, 3, 20, 8, 5, 27], [12, 0, 9, 21, 11, 14, 30], [32, 4, 2, 3, 4, 5, 7]]], [2, 69.333333, [32, 18, 38, 12, 28, 19]]], [[[[35, 2, 22, 0, 4, 32, 0], [31, 1, 3, 1, 7, 9, 2], [13, 0, 12, 1, 3, 13, 1], [37, 2, 19, 2, 5, 20, 14], [19, 2, 3, 2, 5, 15, 5], [7, 1, 29, 2, 12, 36, 14]]], [1, 91.395833, [19, 31, 13, 37, 35, 7]]], [[[[23, 2, 9, 0, 11, 12, 8], [35, 2, 3, 7, 2, 13, 17]]], [2, 16.0, [23, 35]]], [[[[28, 22, 23, 27, 29, 29, 38], [32, 7, 10, 19, 11, 17, 19], [4, 15, 6, 0, 26, 7, 7], [22, 10, 4, 16, 19, 16, 22], [15, 9, 9, 9, 16, 19, 14], [23, 15, 3, 6, 19, 4, 6]]], [2, 93.895833, [4, 23, 15, 22, 32, 28]]]], [[[[[9, 19, 4, 25, 28, 7, 30], [12, 1, 21, 25, 6, 31, 25]]], [1, 105.0625, [9, 12]]], [[[[10, 0, 1, 5, 9, 1, 5], [35, 1, 0, 0, 6, 2, 3], [12, 10, 1, 4, 11, 2, 14], [9, 2, 2, 3, 6, 14, 4]]], [1, 8.796875, [35, 10, 12, 9]]], [[[[26, 6, 1, 2, 14, 9, 9], [3, 2, 1, 0, 5, 7, 1], [1, 0, 0, 2, 7, 9, 9], [28, 6, 1, 0, 9, 4, 6], [31, 10, 1, 2, 17, 13, 9], [24, 9, 0, 0, 15, 11, 9], [2, 3, 0, 2, 9, 4, 7]]], [0, 13.571429, [1, 3, 2, 26, 28, 24, 31]]], [[[[9, 10, 2, 1, 18, 9, 3], [39, 1, 1, 2, 8, 9, 8]]], [0, 22.5625, [39, 9]]], [[[[8, 5, 21, 8, 5, 30, 20], [21, 3, 7, 1, 12, 16, 9]]], [1, 49.0, [21, 8]]], [[[[19, 8, 10, 4, 14, 22, 7], [12, 2, 10, 9, 11, 21, 20]]], [2, 20.25, [19, 12]]], [[[[22, 2, 0, 1, 4, 7, 7], [23, 1, 15, 0, 11, 20, 9], [12, 1, 22, 2, 4, 29, 7], [15, 0, 3, 1, 7, 11, 10]]], [1, 75.546875, [22, 15, 23, 12]]], [[[[27, 9, 12, 8, 17, 16, 13], [28, 9, 19, 6, 15, 29, 14], [18, 0, 20, 4, 10, 25, 15], [5, 7, 3, 5, 9, 15, 14]]], [1, 37.921875, [5, 27, 28, 18]]]], [[[[[11, 6, 15, 1, 17, 21, 6], [38, 5, 22, 1, 17, 29, 9], [32, 4, 19, 1, 12, 29, 9], [1, 0, 14, 1, 11, 14, 10], [23, 5, 10, 1, 5, 16, 9], [7, 2, 18, 1, 2, 29, 4]]], [1, 24.472222, [23, 1, 11, 7, 32, 38]]], [[[[26, 9, 1, 0, 13, 5, 12], [3, 20, 1, 0, 23, 12, 5], [21, 18, 1, 1, 24, 12, 3], [28, 11, 0, 1, 15, 12, 6], [38, 12, 0, 0, 23, 8, 6]]], [0, 17.66, [26, 28, 38, 21, 3]]], [[[[5, 1, 2, 0, 2, 7, 8], [27, 1, 2, 2, 3, 8, 10], [18, 0, 1, 1, 1, 13, 2], [22, 0, 2, 1, 7, 6, 6], [3, 0, 2, 0, 6, 4, 12], [33, 2, 0, 1, 3, 6, 10], [36, 2, 1, 1, 11, 10, 13]]], [0, 3.132653, [3, 18, 22, 5, 27, 33, 36]]], [[[[11, 2, 0, 5, 11, 3, 8], [34, 2, 1, 4, 8, 3, 10]]], [0, 0.5625, [11, 34]]], [[[[20, 3, 1, 7, 15, 6, 15], [2, 4, 2, 9, 14, 5, 11]]], [2, 0.25, [20, 2]]], [[[[10, 2, 2, 27, 9, 12, 34], [13, 2, 10, 11, 8, 17, 18]]], [2, 64.0, [13, 10]]], [[[[23, 1, 1, 9, 3, 6, 14], [39, 2, 1, 19, 4, 6, 29], [21, 0, 0, 23, 3, 8, 28], [36, 0, 1, 1, 0, 6, 3], [29, 0, 0, 15, 8, 10, 26], [16, 2, 0, 21, 2, 1, 33], [33, 2, 1, 19, 13, 3, 24], [7, 2, 0, 12, 5, 2, 24]]], [2, 60.6875, [36, 23, 7, 29, 33, 39, 16, 21]]], [[[[4, 1, 3, 8, 5, 5, 13], [27, 0, 4, 3, 10, 13, 14], [29, 1, 5, 1, 11, 14, 11], [24, 2, 1, 0, 8, 3, 10], [12, 0, 6, 2, 7, 7, 10], [20, 0, 8, 0, 6, 14, 9], [5, 1, 6, 9, 13, 18, 11]]], [1, 11.55102, [24, 4, 27, 29, 5, 12, 20]]]], [[[[[35, 3, 30, 2, 12, 38, 11], [19, 0, 1, 2, 7, 10, 9], [21, 6, 3, 0, 8, 12, 4]]], [1, 168.722222, [19, 21, 35]]], [[[[22, 0, 9, 2, 12, 13, 9], [8, 3, 24, 2, 8, 26, 7]]], [1, 49.0, [22, 8]]], [[[[5, 2, 11, 13, 6, 22, 19], [6, 1, 5, 2, 5, 14, 6], [39, 6, 11, 29, 13, 22, 34], [25, 10, 6, 9, 11, 15, 16], [16, 3, 25, 11, 6, 27, 13], [13, 1, 10, 22, 8, 20, 29]]], [2, 82.951389, [6, 25, 16, 5, 13, 39]]], [[[[17, 1, 16, 9, 3, 28, 15], [18, 1, 24, 1, 12, 33, 11]]], [1, 10.5625, [17, 18]]], [[[[24, 4, 16, 2, 9, 20, 10], [2, 28, 4, 2, 28, 15, 11]]], [0, 115.5625, [24, 2]]], [[[[2, 10, 25, 2, 11, 27, 7], [19, 2, 27, 0, 7, 29, 8], [22, 29, 24, 0, 40, 28, 7], [17, 22, 8, 2, 25, 20, 12], [24, 25, 13, 0, 29, 24, 11], [36, 16, 26, 0, 24, 38, 5], [35, 20, 1, 1, 28, 11, 12], [27, 2, 15, 2, 4, 27, 8]]], [0, 110.734375, [19, 27, 2, 36, 35, 17, 24, 22]]], [[[[4, 0, 2, 3, 7, 2, 12], [1, 0, 1, 9, 12, 1, 13], [28, 0, 0, 6, 11, 9, 13]]], [1, 2.166667, [28, 1, 4]]], [[[[22, 5, 17, 20, 14, 24, 32], [38, 6, 1, 28, 7, 2, 28], [33, 8, 8, 3, 13, 14, 11], [14, 0, 1, 26, 8, 11, 31], [19, 7, 1, 0, 11, 1, 11]]], [2, 109.3, [19, 33, 22, 14, 38]]]], [[[[[21, 3, 16, 3, 3, 16, 5], [12, 29, 11, 3, 29, 23, 9], [31, 16, 30, 10, 18, 33, 14], [28, 24, 25, 1, 34, 26, 9], [6, 20, 8, 4, 25, 10, 7], [15, 16, 0, 3, 19, 5, 12], [10, 25, 25, 7, 32, 31, 14]]], [1, 94.714286, [15, 6, 12, 21, 10, 28, 31]]], [[[[39, 0, 22, 3, 10, 22, 3], [13, 1, 14, 0, 8, 25, 5], [38, 2, 27, 7, 7, 37, 14], [21, 2, 7, 9, 10, 14, 17], [12, 1, 1, 1, 13, 11, 6], [17, 2, 30, 10, 7, 41, 10], [9, 0, 24, 5, 1, 24, 16]]], [1, 96.836735, [12, 21, 13, 39, 9, 38, 17]]], [[[[8, 2, 4, 0, 13, 10, 3], [25, 0, 0, 0, 2, 4, 8]]], [0, 10.5625, [25, 8]]], [[[[18, 10, 16, 29, 15, 22, 33], [39, 25, 21, 17, 30, 31, 25], [38, 5, 18, 14, 11, 25, 23], [15, 26, 28, 13, 38, 35, 21]]], [0, 100.125, [38, 18, 39, 15]]], [[[[32, 5, 1, 7, 9, 6, 16], [22, 9, 1, 0, 21, 11, 0], [29, 4, 0, 9, 15, 3, 12]]], [2, 27.055556, [22, 32, 29]]], [[[[5, 1, 5, 2, 11, 8, 6], [29, 2, 3, 6, 2, 13, 7]]], [0, 4.0, [5, 29]]], [[[[29, 3, 5, 2, 15, 5, 5], [8, 4, 6, 6, 7, 15, 11], [36, 7, 9, 4, 10, 19, 4]]], [1, 13.722222, [29, 8, 36]]], [[[[7, 2, 3, 2, 8, 11, 13], [2, 2, 18, 1, 12, 25, 11], [35, 1, 8, 0, 3, 17, 6], [10, 1, 23, 0, 11, 30, 6]]], [1, 57.671875, [7, 35, 2, 10]]]]]
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, 58.45, [4, 26, 15, 30, 33]][2, 48.84, [4, 26, 15, 30, 33]]Failed
case 1[1, 14.0625, [38, 11]][1, 14.0625, [38, 11]]Passed
case 2[1, 150.0625, [14, 11, 9]][1, 133.388889, [14, 11, 9]]Failed
case 3[1, 77.0625, [6, 34, 3, 32]][1, 77.0625, [6, 34, 3, 32]]Passed
case 4[2, 83.395833, [32, 18, 38, 12, 28, 19]][2, 69.333333, [32, 18, 38, 12, 28, 19]]Failed
case 5[1, 93.645833, [19, 31, 13, 37, 35, 7]][1, 91.395833, [19, 31, 13, 37, 35, 7]]Failed
case 6[2, 16.0, [23, 35]][2, 16.0, [23, 35]]Passed
case 7[2, 101.458333, [4, 23, 15, 22, 32, 28]][2, 93.895833, [4, 23, 15, 22, 32, 28]]Failed

SHA-256 / 4849c9f1785b5201488e35e6dd3ff6d790d5b789ec15ebe2404ca1ad087d99a3

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(boxes):
    n = len(boxes)
    best_axis, best_var = 0, -1.0
    for ax in (0, 1, 2):
        cs_ = [(b[1 + ax] + b[4 + ax]) / 2 for b in boxes]
        mean = cs_[0]
        var = sum((c - mean) ** 2 for c in cs_) / n
        if var > best_var:
            best_axis, best_var = ax, var
    order = [b[0] for b in sorted(boxes, key=lambda b: (b[1 + best_axis], b[0]))]
    return [best_axis, round(best_var, 6), order]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[33, 11, 21, 19, 23, 23, 28], [4, 14, 15, 2, 19, 19, 9], [30, 13, 29, 13, 22, 31, 17], [26, 17, 18, 3, 23, 21, 8], [15, 10, 25, 4, 18, 33, 11]]], [2, 48.84, [4, 26, 15, 30, 33]]], [[[[38, 0, 1, 1, 2, 3, 6], [11, 0, 5, 2, 12, 14, 3]]], [1, 14.0625, [38, 11]]], [[[[9, 2, 28, 6, 5, 32, 11], [11, 1, 26, 2, 1, 34, 9], [14, 0, 0, 8, 10, 11, 9]]], [1, 133.388889, [14, 11, 9]]], [[[[3, 0, 20, 0, 4, 30, 3], [32, 3, 28, 14, 8, 34, 24], [6, 3, 8, 2, 14, 9, 12], [34, 10, 9, 20, 19, 20, 20]]], [1, 77.0625, [6, 34, 3, 32]]], [[[[28, 6, 3, 23, 6, 7, 29], [18, 0, 0, 7, 12, 5, 18], [19, 8, 2, 24, 9, 9, 31], [38, 1, 3, 20, 8, 5, 27], [12, 0, 9, 21, 11, 14, 30], [32, 4, 2, 3, 4, 5, 7]]], [2, 69.333333, [32, 18, 38, 12, 28, 19]]], [[[[35, 2, 22, 0, 4, 32, 0], [31, 1, 3, 1, 7, 9, 2], [13, 0, 12, 1, 3, 13, 1], [37, 2, 19, 2, 5, 20, 14], [19, 2, 3, 2, 5, 15, 5], [7, 1, 29, 2, 12, 36, 14]]], [1, 91.395833, [19, 31, 13, 37, 35, 7]]], [[[[23, 2, 9, 0, 11, 12, 8], [35, 2, 3, 7, 2, 13, 17]]], [2, 16.0, [23, 35]]], [[[[28, 22, 23, 27, 29, 29, 38], [32, 7, 10, 19, 11, 17, 19], [4, 15, 6, 0, 26, 7, 7], [22, 10, 4, 16, 19, 16, 22], [15, 9, 9, 9, 16, 19, 14], [23, 15, 3, 6, 19, 4, 6]]], [2, 93.895833, [4, 23, 15, 22, 32, 28]]]], [[[[[9, 19, 4, 25, 28, 7, 30], [12, 1, 21, 25, 6, 31, 25]]], [1, 105.0625, [9, 12]]], [[[[10, 0, 1, 5, 9, 1, 5], [35, 1, 0, 0, 6, 2, 3], [12, 10, 1, 4, 11, 2, 14], [9, 2, 2, 3, 6, 14, 4]]], [1, 8.796875, [35, 10, 12, 9]]], [[[[26, 6, 1, 2, 14, 9, 9], [3, 2, 1, 0, 5, 7, 1], [1, 0, 0, 2, 7, 9, 9], [28, 6, 1, 0, 9, 4, 6], [31, 10, 1, 2, 17, 13, 9], [24, 9, 0, 0, 15, 11, 9], [2, 3, 0, 2, 9, 4, 7]]], [0, 13.571429, [1, 3, 2, 26, 28, 24, 31]]], [[[[9, 10, 2, 1, 18, 9, 3], [39, 1, 1, 2, 8, 9, 8]]], [0, 22.5625, [39, 9]]], [[[[8, 5, 21, 8, 5, 30, 20], [21, 3, 7, 1, 12, 16, 9]]], [1, 49.0, [21, 8]]], [[[[19, 8, 10, 4, 14, 22, 7], [12, 2, 10, 9, 11, 21, 20]]], [2, 20.25, [19, 12]]], [[[[22, 2, 0, 1, 4, 7, 7], [23, 1, 15, 0, 11, 20, 9], [12, 1, 22, 2, 4, 29, 7], [15, 0, 3, 1, 7, 11, 10]]], [1, 75.546875, [22, 15, 23, 12]]], [[[[27, 9, 12, 8, 17, 16, 13], [28, 9, 19, 6, 15, 29, 14], [18, 0, 20, 4, 10, 25, 15], [5, 7, 3, 5, 9, 15, 14]]], [1, 37.921875, [5, 27, 28, 18]]]], [[[[[11, 6, 15, 1, 17, 21, 6], [38, 5, 22, 1, 17, 29, 9], [32, 4, 19, 1, 12, 29, 9], [1, 0, 14, 1, 11, 14, 10], [23, 5, 10, 1, 5, 16, 9], [7, 2, 18, 1, 2, 29, 4]]], [1, 24.472222, [23, 1, 11, 7, 32, 38]]], [[[[26, 9, 1, 0, 13, 5, 12], [3, 20, 1, 0, 23, 12, 5], [21, 18, 1, 1, 24, 12, 3], [28, 11, 0, 1, 15, 12, 6], [38, 12, 0, 0, 23, 8, 6]]], [0, 17.66, [26, 28, 38, 21, 3]]], [[[[5, 1, 2, 0, 2, 7, 8], [27, 1, 2, 2, 3, 8, 10], [18, 0, 1, 1, 1, 13, 2], [22, 0, 2, 1, 7, 6, 6], [3, 0, 2, 0, 6, 4, 12], [33, 2, 0, 1, 3, 6, 10], [36, 2, 1, 1, 11, 10, 13]]], [0, 3.132653, [3, 18, 22, 5, 27, 33, 36]]], [[[[11, 2, 0, 5, 11, 3, 8], [34, 2, 1, 4, 8, 3, 10]]], [0, 0.5625, [11, 34]]], [[[[20, 3, 1, 7, 15, 6, 15], [2, 4, 2, 9, 14, 5, 11]]], [2, 0.25, [20, 2]]], [[[[10, 2, 2, 27, 9, 12, 34], [13, 2, 10, 11, 8, 17, 18]]], [2, 64.0, [13, 10]]], [[[[23, 1, 1, 9, 3, 6, 14], [39, 2, 1, 19, 4, 6, 29], [21, 0, 0, 23, 3, 8, 28], [36, 0, 1, 1, 0, 6, 3], [29, 0, 0, 15, 8, 10, 26], [16, 2, 0, 21, 2, 1, 33], [33, 2, 1, 19, 13, 3, 24], [7, 2, 0, 12, 5, 2, 24]]], [2, 60.6875, [36, 23, 7, 29, 33, 39, 16, 21]]], [[[[4, 1, 3, 8, 5, 5, 13], [27, 0, 4, 3, 10, 13, 14], [29, 1, 5, 1, 11, 14, 11], [24, 2, 1, 0, 8, 3, 10], [12, 0, 6, 2, 7, 7, 10], [20, 0, 8, 0, 6, 14, 9], [5, 1, 6, 9, 13, 18, 11]]], [1, 11.55102, [24, 4, 27, 29, 5, 12, 20]]]], [[[[[35, 3, 30, 2, 12, 38, 11], [19, 0, 1, 2, 7, 10, 9], [21, 6, 3, 0, 8, 12, 4]]], [1, 168.722222, [19, 21, 35]]], [[[[22, 0, 9, 2, 12, 13, 9], [8, 3, 24, 2, 8, 26, 7]]], [1, 49.0, [22, 8]]], [[[[5, 2, 11, 13, 6, 22, 19], [6, 1, 5, 2, 5, 14, 6], [39, 6, 11, 29, 13, 22, 34], [25, 10, 6, 9, 11, 15, 16], [16, 3, 25, 11, 6, 27, 13], [13, 1, 10, 22, 8, 20, 29]]], [2, 82.951389, [6, 25, 16, 5, 13, 39]]], [[[[17, 1, 16, 9, 3, 28, 15], [18, 1, 24, 1, 12, 33, 11]]], [1, 10.5625, [17, 18]]], [[[[24, 4, 16, 2, 9, 20, 10], [2, 28, 4, 2, 28, 15, 11]]], [0, 115.5625, [24, 2]]], [[[[2, 10, 25, 2, 11, 27, 7], [19, 2, 27, 0, 7, 29, 8], [22, 29, 24, 0, 40, 28, 7], [17, 22, 8, 2, 25, 20, 12], [24, 25, 13, 0, 29, 24, 11], [36, 16, 26, 0, 24, 38, 5], [35, 20, 1, 1, 28, 11, 12], [27, 2, 15, 2, 4, 27, 8]]], [0, 110.734375, [19, 27, 2, 36, 35, 17, 24, 22]]], [[[[4, 0, 2, 3, 7, 2, 12], [1, 0, 1, 9, 12, 1, 13], [28, 0, 0, 6, 11, 9, 13]]], [1, 2.166667, [28, 1, 4]]], [[[[22, 5, 17, 20, 14, 24, 32], [38, 6, 1, 28, 7, 2, 28], [33, 8, 8, 3, 13, 14, 11], [14, 0, 1, 26, 8, 11, 31], [19, 7, 1, 0, 11, 1, 11]]], [2, 109.3, [19, 33, 22, 14, 38]]]], [[[[[21, 3, 16, 3, 3, 16, 5], [12, 29, 11, 3, 29, 23, 9], [31, 16, 30, 10, 18, 33, 14], [28, 24, 25, 1, 34, 26, 9], [6, 20, 8, 4, 25, 10, 7], [15, 16, 0, 3, 19, 5, 12], [10, 25, 25, 7, 32, 31, 14]]], [1, 94.714286, [15, 6, 12, 21, 10, 28, 31]]], [[[[39, 0, 22, 3, 10, 22, 3], [13, 1, 14, 0, 8, 25, 5], [38, 2, 27, 7, 7, 37, 14], [21, 2, 7, 9, 10, 14, 17], [12, 1, 1, 1, 13, 11, 6], [17, 2, 30, 10, 7, 41, 10], [9, 0, 24, 5, 1, 24, 16]]], [1, 96.836735, [12, 21, 13, 39, 9, 38, 17]]], [[[[8, 2, 4, 0, 13, 10, 3], [25, 0, 0, 0, 2, 4, 8]]], [0, 10.5625, [25, 8]]], [[[[18, 10, 16, 29, 15, 22, 33], [39, 25, 21, 17, 30, 31, 25], [38, 5, 18, 14, 11, 25, 23], [15, 26, 28, 13, 38, 35, 21]]], [0, 100.125, [38, 18, 39, 15]]], [[[[32, 5, 1, 7, 9, 6, 16], [22, 9, 1, 0, 21, 11, 0], [29, 4, 0, 9, 15, 3, 12]]], [2, 27.055556, [22, 32, 29]]], [[[[5, 1, 5, 2, 11, 8, 6], [29, 2, 3, 6, 2, 13, 7]]], [0, 4.0, [5, 29]]], [[[[29, 3, 5, 2, 15, 5, 5], [8, 4, 6, 6, 7, 15, 11], [36, 7, 9, 4, 10, 19, 4]]], [1, 13.722222, [29, 8, 36]]], [[[[7, 2, 3, 2, 8, 11, 13], [2, 2, 18, 1, 12, 25, 11], [35, 1, 8, 0, 3, 17, 6], [10, 1, 23, 0, 11, 30, 6]]], [1, 57.671875, [7, 35, 2, 10]]]]]
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, 195.25, [4, 26, 15, 30, 33]][2, 48.84, [4, 26, 15, 30, 33]]Failed
case 1[1, 28.125, [38, 11]][1, 14.0625, [38, 11]]Failed
case 2[1, 200.083333, [14, 11, 9]][1, 133.388889, [14, 11, 9]]Failed
case 3[2, 169.6875, [3, 6, 32, 34]][1, 77.0625, [6, 34, 3, 32]]Failed
case 4[2, 105.333333, [32, 18, 38, 12, 28, 19]][2, 69.333333, [32, 18, 38, 12, 28, 19]]Failed
case 5[1, 176.958333, [19, 31, 13, 37, 35, 7]][1, 91.395833, [19, 31, 13, 37, 35, 7]]Failed
case 6[2, 32.0, [23, 35]][2, 16.0, [23, 35]]Failed
case 7[2, 391.458333, [4, 23, 15, 22, 32, 28]][2, 93.895833, [4, 23, 15, 22, 32, 28]]Failed

SHA-256 / f0a9d8751780bb2979d72d1070a18a82be8d2b8567fdf5402517a0399334cbc8

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(boxes):
    n = len(boxes)
    best_axis, best_var = 0, -1.0
    for ax in (0, 1, 2):
        cs_ = [(b[1 + ax] + b[4 + ax]) / 2 for b in boxes]
        mean = sum(cs_) / n
        var = sum((c - mean) ** 2 for c in cs_) / n
        if var > best_var:
            best_axis, best_var = ax, var
    order = [b[0] for b in sorted(boxes, key=lambda b: (b[1 + best_axis], b[0]))]
    return [best_axis, round(best_var, 6), order]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[33, 11, 21, 19, 23, 23, 28], [4, 14, 15, 2, 19, 19, 9], [30, 13, 29, 13, 22, 31, 17], [26, 17, 18, 3, 23, 21, 8], [15, 10, 25, 4, 18, 33, 11]]], [2, 48.84, [4, 26, 15, 30, 33]]], [[[[38, 0, 1, 1, 2, 3, 6], [11, 0, 5, 2, 12, 14, 3]]], [1, 14.0625, [38, 11]]], [[[[9, 2, 28, 6, 5, 32, 11], [11, 1, 26, 2, 1, 34, 9], [14, 0, 0, 8, 10, 11, 9]]], [1, 133.388889, [14, 11, 9]]], [[[[3, 0, 20, 0, 4, 30, 3], [32, 3, 28, 14, 8, 34, 24], [6, 3, 8, 2, 14, 9, 12], [34, 10, 9, 20, 19, 20, 20]]], [1, 77.0625, [6, 34, 3, 32]]], [[[[28, 6, 3, 23, 6, 7, 29], [18, 0, 0, 7, 12, 5, 18], [19, 8, 2, 24, 9, 9, 31], [38, 1, 3, 20, 8, 5, 27], [12, 0, 9, 21, 11, 14, 30], [32, 4, 2, 3, 4, 5, 7]]], [2, 69.333333, [32, 18, 38, 12, 28, 19]]], [[[[35, 2, 22, 0, 4, 32, 0], [31, 1, 3, 1, 7, 9, 2], [13, 0, 12, 1, 3, 13, 1], [37, 2, 19, 2, 5, 20, 14], [19, 2, 3, 2, 5, 15, 5], [7, 1, 29, 2, 12, 36, 14]]], [1, 91.395833, [19, 31, 13, 37, 35, 7]]], [[[[23, 2, 9, 0, 11, 12, 8], [35, 2, 3, 7, 2, 13, 17]]], [2, 16.0, [23, 35]]], [[[[28, 22, 23, 27, 29, 29, 38], [32, 7, 10, 19, 11, 17, 19], [4, 15, 6, 0, 26, 7, 7], [22, 10, 4, 16, 19, 16, 22], [15, 9, 9, 9, 16, 19, 14], [23, 15, 3, 6, 19, 4, 6]]], [2, 93.895833, [4, 23, 15, 22, 32, 28]]]], [[[[[9, 19, 4, 25, 28, 7, 30], [12, 1, 21, 25, 6, 31, 25]]], [1, 105.0625, [9, 12]]], [[[[10, 0, 1, 5, 9, 1, 5], [35, 1, 0, 0, 6, 2, 3], [12, 10, 1, 4, 11, 2, 14], [9, 2, 2, 3, 6, 14, 4]]], [1, 8.796875, [35, 10, 12, 9]]], [[[[26, 6, 1, 2, 14, 9, 9], [3, 2, 1, 0, 5, 7, 1], [1, 0, 0, 2, 7, 9, 9], [28, 6, 1, 0, 9, 4, 6], [31, 10, 1, 2, 17, 13, 9], [24, 9, 0, 0, 15, 11, 9], [2, 3, 0, 2, 9, 4, 7]]], [0, 13.571429, [1, 3, 2, 26, 28, 24, 31]]], [[[[9, 10, 2, 1, 18, 9, 3], [39, 1, 1, 2, 8, 9, 8]]], [0, 22.5625, [39, 9]]], [[[[8, 5, 21, 8, 5, 30, 20], [21, 3, 7, 1, 12, 16, 9]]], [1, 49.0, [21, 8]]], [[[[19, 8, 10, 4, 14, 22, 7], [12, 2, 10, 9, 11, 21, 20]]], [2, 20.25, [19, 12]]], [[[[22, 2, 0, 1, 4, 7, 7], [23, 1, 15, 0, 11, 20, 9], [12, 1, 22, 2, 4, 29, 7], [15, 0, 3, 1, 7, 11, 10]]], [1, 75.546875, [22, 15, 23, 12]]], [[[[27, 9, 12, 8, 17, 16, 13], [28, 9, 19, 6, 15, 29, 14], [18, 0, 20, 4, 10, 25, 15], [5, 7, 3, 5, 9, 15, 14]]], [1, 37.921875, [5, 27, 28, 18]]]], [[[[[11, 6, 15, 1, 17, 21, 6], [38, 5, 22, 1, 17, 29, 9], [32, 4, 19, 1, 12, 29, 9], [1, 0, 14, 1, 11, 14, 10], [23, 5, 10, 1, 5, 16, 9], [7, 2, 18, 1, 2, 29, 4]]], [1, 24.472222, [23, 1, 11, 7, 32, 38]]], [[[[26, 9, 1, 0, 13, 5, 12], [3, 20, 1, 0, 23, 12, 5], [21, 18, 1, 1, 24, 12, 3], [28, 11, 0, 1, 15, 12, 6], [38, 12, 0, 0, 23, 8, 6]]], [0, 17.66, [26, 28, 38, 21, 3]]], [[[[5, 1, 2, 0, 2, 7, 8], [27, 1, 2, 2, 3, 8, 10], [18, 0, 1, 1, 1, 13, 2], [22, 0, 2, 1, 7, 6, 6], [3, 0, 2, 0, 6, 4, 12], [33, 2, 0, 1, 3, 6, 10], [36, 2, 1, 1, 11, 10, 13]]], [0, 3.132653, [3, 18, 22, 5, 27, 33, 36]]], [[[[11, 2, 0, 5, 11, 3, 8], [34, 2, 1, 4, 8, 3, 10]]], [0, 0.5625, [11, 34]]], [[[[20, 3, 1, 7, 15, 6, 15], [2, 4, 2, 9, 14, 5, 11]]], [2, 0.25, [20, 2]]], [[[[10, 2, 2, 27, 9, 12, 34], [13, 2, 10, 11, 8, 17, 18]]], [2, 64.0, [13, 10]]], [[[[23, 1, 1, 9, 3, 6, 14], [39, 2, 1, 19, 4, 6, 29], [21, 0, 0, 23, 3, 8, 28], [36, 0, 1, 1, 0, 6, 3], [29, 0, 0, 15, 8, 10, 26], [16, 2, 0, 21, 2, 1, 33], [33, 2, 1, 19, 13, 3, 24], [7, 2, 0, 12, 5, 2, 24]]], [2, 60.6875, [36, 23, 7, 29, 33, 39, 16, 21]]], [[[[4, 1, 3, 8, 5, 5, 13], [27, 0, 4, 3, 10, 13, 14], [29, 1, 5, 1, 11, 14, 11], [24, 2, 1, 0, 8, 3, 10], [12, 0, 6, 2, 7, 7, 10], [20, 0, 8, 0, 6, 14, 9], [5, 1, 6, 9, 13, 18, 11]]], [1, 11.55102, [24, 4, 27, 29, 5, 12, 20]]]], [[[[[35, 3, 30, 2, 12, 38, 11], [19, 0, 1, 2, 7, 10, 9], [21, 6, 3, 0, 8, 12, 4]]], [1, 168.722222, [19, 21, 35]]], [[[[22, 0, 9, 2, 12, 13, 9], [8, 3, 24, 2, 8, 26, 7]]], [1, 49.0, [22, 8]]], [[[[5, 2, 11, 13, 6, 22, 19], [6, 1, 5, 2, 5, 14, 6], [39, 6, 11, 29, 13, 22, 34], [25, 10, 6, 9, 11, 15, 16], [16, 3, 25, 11, 6, 27, 13], [13, 1, 10, 22, 8, 20, 29]]], [2, 82.951389, [6, 25, 16, 5, 13, 39]]], [[[[17, 1, 16, 9, 3, 28, 15], [18, 1, 24, 1, 12, 33, 11]]], [1, 10.5625, [17, 18]]], [[[[24, 4, 16, 2, 9, 20, 10], [2, 28, 4, 2, 28, 15, 11]]], [0, 115.5625, [24, 2]]], [[[[2, 10, 25, 2, 11, 27, 7], [19, 2, 27, 0, 7, 29, 8], [22, 29, 24, 0, 40, 28, 7], [17, 22, 8, 2, 25, 20, 12], [24, 25, 13, 0, 29, 24, 11], [36, 16, 26, 0, 24, 38, 5], [35, 20, 1, 1, 28, 11, 12], [27, 2, 15, 2, 4, 27, 8]]], [0, 110.734375, [19, 27, 2, 36, 35, 17, 24, 22]]], [[[[4, 0, 2, 3, 7, 2, 12], [1, 0, 1, 9, 12, 1, 13], [28, 0, 0, 6, 11, 9, 13]]], [1, 2.166667, [28, 1, 4]]], [[[[22, 5, 17, 20, 14, 24, 32], [38, 6, 1, 28, 7, 2, 28], [33, 8, 8, 3, 13, 14, 11], [14, 0, 1, 26, 8, 11, 31], [19, 7, 1, 0, 11, 1, 11]]], [2, 109.3, [19, 33, 22, 14, 38]]]], [[[[[21, 3, 16, 3, 3, 16, 5], [12, 29, 11, 3, 29, 23, 9], [31, 16, 30, 10, 18, 33, 14], [28, 24, 25, 1, 34, 26, 9], [6, 20, 8, 4, 25, 10, 7], [15, 16, 0, 3, 19, 5, 12], [10, 25, 25, 7, 32, 31, 14]]], [1, 94.714286, [15, 6, 12, 21, 10, 28, 31]]], [[[[39, 0, 22, 3, 10, 22, 3], [13, 1, 14, 0, 8, 25, 5], [38, 2, 27, 7, 7, 37, 14], [21, 2, 7, 9, 10, 14, 17], [12, 1, 1, 1, 13, 11, 6], [17, 2, 30, 10, 7, 41, 10], [9, 0, 24, 5, 1, 24, 16]]], [1, 96.836735, [12, 21, 13, 39, 9, 38, 17]]], [[[[8, 2, 4, 0, 13, 10, 3], [25, 0, 0, 0, 2, 4, 8]]], [0, 10.5625, [25, 8]]], [[[[18, 10, 16, 29, 15, 22, 33], [39, 25, 21, 17, 30, 31, 25], [38, 5, 18, 14, 11, 25, 23], [15, 26, 28, 13, 38, 35, 21]]], [0, 100.125, [38, 18, 39, 15]]], [[[[32, 5, 1, 7, 9, 6, 16], [22, 9, 1, 0, 21, 11, 0], [29, 4, 0, 9, 15, 3, 12]]], [2, 27.055556, [22, 32, 29]]], [[[[5, 1, 5, 2, 11, 8, 6], [29, 2, 3, 6, 2, 13, 7]]], [0, 4.0, [5, 29]]], [[[[29, 3, 5, 2, 15, 5, 5], [8, 4, 6, 6, 7, 15, 11], [36, 7, 9, 4, 10, 19, 4]]], [1, 13.722222, [29, 8, 36]]], [[[[7, 2, 3, 2, 8, 11, 13], [2, 2, 18, 1, 12, 25, 11], [35, 1, 8, 0, 3, 17, 6], [10, 1, 23, 0, 11, 30, 6]]], [1, 57.671875, [7, 35, 2, 10]]]]]
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, 48.84, [4, 26, 15, 30, 33]][2, 48.84, [4, 26, 15, 30, 33]]Passed
case 1[1, 14.0625, [38, 11]][1, 14.0625, [38, 11]]Passed
case 2[1, 133.388889, [14, 11, 9]][1, 133.388889, [14, 11, 9]]Passed
case 3[1, 77.0625, [6, 34, 3, 32]][1, 77.0625, [6, 34, 3, 32]]Passed
case 4[2, 69.333333, [32, 18, 38, 12, 28, 19]][2, 69.333333, [32, 18, 38, 12, 28, 19]]Passed
case 5[1, 91.395833, [19, 31, 13, 37, 35, 7]][1, 91.395833, [19, 31, 13, 37, 35, 7]]Passed
case 6[2, 16.0, [23, 35]][2, 16.0, [23, 35]]Passed
case 7[2, 93.895833, [4, 23, 15, 22, 32, 28]][2, 93.895833, [4, 23, 15, 22, 32, 28]]Passed

SHA-256 / 36b5470aef3934a9ee709f7825c5cd36f2bc53a98e88bd19c70e8156a5f0f6a6

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

Case digest / 989ccde25321c451b9cd10db9d7b71241b936295c9d80abaadfcd398e62868eb