FAILURE MAP
← Case archive

FA-87576 / Collision detection broadphase / Open access

x is normalized against the y maximum · case 01

Scenes that are not square produce skewed codes.

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

ROOT CAUSE

quant(x) uses bounds[3] as hi.

VERIFIED REPAIR

Normalize x with bounds[0]..bounds[2].

Unsuccessful approach: Using bounds[1] as the x minimum is the mirrored mix-up.

Case contract

solve(pts, bounds): LBVH ordering. Each centroid [id,x,y] is quantized per axis to min(1023, max(0, floor((c-lo)/(hi-lo)*1024))) (0 for a flat axis), and the 10-bit values are interleaved with x in even bits and y in odd bits. Return [[id, code]] sorted by (code, numeric id).

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(pts, bounds):
    def part(v):
        v &= 0x3FF
        v = (v | (v << 8)) & 0x00FF00FF
        v = (v | (v << 4)) & 0x0F0F0F0F
        v = (v | (v << 2)) & 0x33333333
        v = (v | (v << 1)) & 0x55555555
        return v
    def quant(c, lo, hi):
        if hi <= lo:
            return 0
        return min(1023, max(0, math.floor((c - lo) / (hi - lo) * 1024)))
    out = []
    for i, x, y in pts:
        code = part(quant(x, bounds[0], bounds[3])) | (part(quant(y, bounds[1], bounds[3])) << 1)
        out.append([i, code])
    out.sort(key=lambda r: (r[1], r[0]))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[8, -5.94, 9.17], [2, -5.94, 9.17], [16, -3.93, 32.0], [4, 6.0, 5.06], [17, 6.0, 21.16], [15, -10.0, 32.0], [12, -10.0, 32.0]], [-10.0, 0.0, 6.0, 32.0]], [[2, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]]], [[[[15, -10.0, 30.56], [2, -10.0, 32.0], [1, -10.0, 32.0], [27, -10.51, 15.54]], [-10.0, 0.0, 0.0, 32.0]], [[27, 174594], [15, 696834], [1, 699050], [2, 699050]]], [[[[15, -9.79, -4.0], [23, -8.97, 28.0], [4, 1.83, -4.0], [3, -10.0, 28.0]], [-10.0, -4.0, 6.0, 28.0]], [[15, 81], [4, 283921], [3, 699050], [23, 703147]]], [[[[29, 15.14, -4.07], [13, 0.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[29, 16709], [13, 699050]]], [[[[29, 4.43, 23.54], [11, 5.0, 0.0], [22, 4.99, 0.0], [14, 5.01, 0.0], [10, 5.0, 14.42], [21, 5.0, 0.0]], [5.0, 0.0, 5.0, 32.0]], [[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]]], [[[[1, -10.0, -4.0], [21, -10.0, -4.0], [12, -10.0, -0.83], [4, -10.0, 1.95], [8, -10.0, -4.0]], [-10.0, -4.0, -10.0, 4.0]], [[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]]], [[[[5, 55.38, -0.83], [8, 0.0, 4.0], [17, 0.0, 4.0], [21, 0.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[5, 427831], [8, 699050], [17, 699050], [21, 699050]]], [[[[22, 5.0, 0.0], [12, 6.63, 0.0], [14, 105.0, 6.32]], [5.0, 0.0, 105.0, 8.0]], [[22, 0], [12, 256], [14, 1007061]]]], [[[[[21, -3.54, 0.0], [6, -9.58, 0.0], [2, -10.0, 0.0], [10, -9.51, 13.6], [8, -10.0, 14.86], [14, -10.0, 32.0]], [-10.0, 0.0, 0.0, 32.0]], [[2, 0], [6, 1093], [10, 167694], [8, 172682], [21, 278801], [14, 699050]]], [[[[4, 15.0, 8.0], [27, 5.0, 8.3]], [5.0, 0.0, 15.0, 8.0]], [[27, 699050], [4, 1048575]]], [[[[16, 0.0, 0.51], [14, 0.0, 0.51], [27, 0.0, -4.83]], [0.0, -4.0, 10.0, 4.0]], [[27, 0], [14, 532482], [16, 532482]]], [[[[22, 5.0, 1.76], [26, 5.0, 1.76], [25, 5.7, -1.04], [6, 5.0, -0.73]], [5.0, -4.0, 21.0, 4.0]], [[25, 143064], [6, 165896], [22, 567298], [26, 567298]]], [[[[27, 5.0, 4.0], [21, 5.0, 4.0], [22, 105.0, -3.16], [3, 42.29, 4.0], [17, 5.0, 2.25], [12, 25.35, -0.08], [8, 70.41, 2.16]], [5.0, -4.0, 105.0, 4.0]], [[12, 195362], [22, 359903], [17, 657408], [21, 699050], [27, 699050], [3, 770043], [8, 934769]]], [[[[21, -7.77, 4.37], [10, -10.0, -4.0], [20, -9.43, -3.81], [22, 1.31, -2.46], [25, 5.87, -4.0], [19, -6.46, 4.0], [8, -8.2, 4.29], [27, 6.0, 2.44]], [-10.0, -4.0, 6.0, 4.0]], [[10, 0], [20, 1680], [22, 323879], [25, 349461], [8, 704431], [21, 715518], [19, 720558], [27, 1007573]]], [[[[29, -10.0, -0.25], [3, -10.57, 28.0], [19, -10.0, -4.0], [9, -10.0, -4.0], [20, -10.0, -4.0]], [-10.0, -4.0, -10.0, 28.0]], [[9, 0], [19, 0], [20, 0], [29, 10880], [3, 699050]]], [[[[7, 61.89, 26.8], [4, 65.14, 0.0], [10, 37.56, 2.32], [12, 46.76, 27.2], [13, 105.0, 16.99]], [5.0, 0.0, 105.0, 32.0]], [[10, 78041], [4, 267285], [12, 748653], [13, 874495], [7, 930454]]]], [[[[[6, 70.15, -4.0], [11, 0.0, 2.08], [18, 100.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[6, 282708], [11, 655496], [18, 1048575]]], [[[[14, -10.0, 8.0], [26, -10.0, 8.0], [8, -10.0, 3.45], [16, -10.97, 8.0], [25, -10.0, 5.04], [22, -10.0, 0.0], [7, -10.0, 2.57], [15, -9.53, 3.51], [12, -10.46, 2.24]], [-10.0, 0.0, -10.0, 8.0]], [[22, 0], [12, 131752], [7, 139392], [8, 166530], [15, 172034], [25, 557090], [14, 699050], [16, 699050], [26, 699050]]], [[[[7, 5.0, 5.02], [22, 5.0, 5.02], [6, 105.0, 6.44]], [5.0, 0.0, 105.0, 8.0]], [[7, 557064], [22, 557064], [6, 1007573]]], [[[[2, -2.74, 0.0], [24, -0.25, 19.26], [28, 0.0, 23.93], [17, -9.92, 0.0], [10, 0.0, 10.99], [18, -4.08, 0.0]], [-10.0, 0.0, 0.0, 32.0]], [[17, 64], [18, 266580], [2, 283669], [10, 489471], [24, 883860], [28, 917495]]], [[[[8, 0.0, -4.0], [28, 0.0, 28.0], [26, 0.0, 28.0], [21, 0.0, 2.42], [4, 0.0, -4.0]], [0.0, -4.0, 0.0, 28.0]], [[4, 0], [8, 0], [21, 41122], [26, 699050], [28, 699050]]], [[[[22, 90.0, 0.0], [18, 10.62, 0.0], [27, 13.28, 0.0]], [-10.0, 0.0, 90.0, 32.0]], [[18, 20741], [27, 21588], [22, 349525]]], [[[[26, 17.49, 0.0], [3, 17.49, 0.0], [25, 21.17, 0.0], [20, 16.02, 8.23], [7, 21.0, 5.26], [2, 16.42, 1.66], [24, 21.0, 7.24], [18, 9.22, 8.0], [28, 21.0, 0.0]], [5.0, 0.0, 21.0, 8.0]], [[2, 324452], [3, 328021], [26, 328021], [25, 349525], [28, 349525], [18, 764670], [7, 908631], [20, 981675], [24, 1038333]]], [[[[2, 5.42, -3.91], [24, 5.0, -4.0], [8, 5.0, 4.0], [7, 5.0, 4.0], [12, 5.0, 4.0]], [5.0, -4.0, 5.0, 4.0]], [[24, 0], [2, 138], [7, 699050], [8, 699050], [12, 699050]]]], [[[[[12, 5.0, -1.65], [13, 5.0, -4.0], [10, 85.95, 0.41], [24, 5.0, -4.0]], [5.0, -4.0, 105.0, 4.0]], [[13, 0], [24, 0], [12, 133280], [10, 855920]]], [[[[23, 0.0, 32.0], [27, 0.0, 2.02], [16, 0.0, 27.42], [20, 34.39, 32.0]], [0.0, 0.0, 100.0, 32.0]], [[27, 8192], [16, 665762], [23, 699050], [20, 769706]]], [[[[29, 0.0, 32.0], [10, -0.21, 0.0], [23, -0.32, 0.0], [26, 0.0, 30.2]], [0.0, 0.0, 0.0, 32.0]], [[10, 0], [23, 0], [26, 696360], [29, 699050]]], [[[[18, 5.0, -3.45], [26, 5.0, 4.0]], [5.0, -4.0, 5.0, 4.0]], [[18, 8232], [26, 699050]]], [[[[5, 21.0, 2.38], [20, 5.0, 0.8], [9, 6.41, 8.0], [1, 21.0, 0.0], [29, 21.0, 8.0], [7, 14.94, 6.94], [14, 21.0, 5.79], [18, 21.0, 0.0]], [5.0, 0.0, 21.0, 8.0]], [[20, 10280], [1, 349525], [18, 349525], [5, 483157], [9, 703470], [14, 916855], [7, 933840], [29, 1048575]]], [[[[7, 21.0, 4.88], [19, 21.0, 4.88], [18, 21.0, 0.0], [29, 6.08, 0.37], [21, 21.0, 12.27], [1, 5.0, 9.09]], [5.0, 0.0, 21.0, 32.0]], [[29, 4251], [1, 133128], [18, 349525], [7, 382965], [19, 382965], [21, 513493]]], [[[[18, 15.0, 0.0], [6, 15.0, 0.0], [20, 5.0, 0.0]], [5.0, 0.0, 15.0, 8.0]], [[20, 0], [6, 349525], [18, 349525]]], [[[[28, 89.65, 8.0], [20, 89.65, 8.0], [15, 90.0, 0.0], [25, -7.44, 3.45], [3, -10.0, 0.0], [29, 39.43, 0.0]], [-10.0, 0.0, 90.0, 8.0]], [[3, 0], [29, 87364], [25, 166854], [15, 349525], [20, 1048570], [28, 1048570]]]], [[[[[13, 64.33, 3.22], [26, 64.33, 3.22], [28, 12.16, 8.0], [3, 35.2, 0.0], [9, 41.6, 0.96], [2, 27.88, 4.16]], [5.0, 0.0, 105.0, 8.0]], [[3, 66833], [9, 81820], [13, 431093], [26, 431093], [2, 546404], [28, 703211]]], [[[[17, 5.0, 2.07], [10, 5.0, 2.07], [28, 5.0, 0.0]], [5.0, 0.0, 21.0, 32.0]], [[28, 0], [10, 8200], [17, 8200]]], [[[[17, 0.0, -4.0], [21, 0.0, -4.0], [4, 0.0, -2.2], [29, 0.0, 4.0], [5, 0.0, 0.07], [24, 0.0, -3.58], [18, 0.0, 0.36], [7, 0.0, 4.0], [3, 0.0, -4.0], [11, 0.0, -1.93]], [0.0, -4.0, 0.0, 4.0]], [[3, 0], [17, 0], [21, 0], [24, 2594], [4, 43048], [11, 131200], [5, 524416], [18, 526504], [7, 699050], [29, 699050]]], [[[[16, 100.0, 8.0], [29, 33.02, 3.99], [28, 68.28, 2.75], [27, 0.0, 5.89], [6, 100.0, 5.44], [19, 100.0, 8.0], [9, 90.65, 0.0]], [0.0, 0.0, 100.0, 8.0]], [[29, 244652], [9, 345088], [28, 421189], [27, 567810], [6, 909269], [16, 1048575], [19, 1048575]]], [[[[19, 5.0, -3.05], [25, 5.0, -3.05], [2, 5.0, -4.0], [7, 5.0, -0.21], [4, 5.0, -0.44]], [5.0, -4.0, 5.0, 28.0]], [[2, 0], [19, 680], [25, 680], [4, 10754], [7, 10882]]], [[[[15, 94.67, 0.0], [16, 100.0, 0.0], [12, 0.0, 10.42], [20, 59.05, 23.9], [7, 100.0, 32.0], [2, 0.91, 12.9]], [0.0, 0.0, 100.0, 32.0]], [[12, 139426], [2, 164577], [15, 348225], [16, 349525], [20, 834544], [7, 1048575]]], [[[[9, 21.0, -4.0], [7, 21.0, -4.0], [15, 19.51, 4.95], [10, 5.0, -4.0], [25, 21.0, -4.0], [12, 17.72, 4.0], [26, 21.0, -4.0], [8, 6.03, -4.0]], [5.0, -4.0, 21.0, 4.0]], [[10, 0], [8, 4097], [7, 349525], [9, 349525], [25, 349525], [26, 349525], [12, 1027838], [15, 1044138]]], [[[[28, -10.0, -4.0], [15, 0.0, -0.33], [13, 0.0, 4.0], [19, -10.0, -3.44], [16, -10.0, 4.0], [17, 0.0, 3.07], [21, -9.69, -1.77], [29, -10.0, -2.27]], [-10.0, -4.0, 0.0, 4.0]], [[28, 0], [19, 8234], [29, 41634], [21, 132087], [15, 522103], [16, 699050], [17, 1037781], [13, 1048575]]]]]
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, 116758], [2, 138278], [8, 138278], [17, 641078], [12, 699050], [15, 699050], [16, 715695]][[2, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]]Failed
case 1[[27, 174594], [15, 696834], [1, 699050], [2, 699050]][[27, 174594], [15, 696834], [1, 699050], [2, 699050]]Passed
case 2[[15, 17], [4, 66900], [3, 699050], [23, 699375]][[15, 81], [4, 283921], [3, 699050], [23, 703147]]Failed
case 3[[29, 349525], [13, 699050]][[29, 16709], [13, 699050]]Failed
case 4[[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]][[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]]Passed
case 5[[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]][[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]]Passed
case 6[[5, 513911], [8, 699050], [17, 699050], [21, 699050]][[5, 427831], [8, 699050], [17, 699050], [21, 699050]]Failed
case 7[[22, 0], [12, 263248], [14, 1007061]][[22, 0], [12, 256], [14, 1007061]]Failed

SHA-256 / c9ffb5401a65ca5e60c422b1f45890ccfcdf149a0135440f528b41bef10d76d1

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(pts, bounds):
    def part(v):
        v &= 0x3FF
        v = (v | (v << 8)) & 0x00FF00FF
        v = (v | (v << 4)) & 0x0F0F0F0F
        v = (v | (v << 2)) & 0x33333333
        v = (v | (v << 1)) & 0x55555555
        return v
    def quant(c, lo, hi):
        if hi <= lo:
            return 0
        return min(1023, max(0, math.floor((c - lo) / (hi - lo) * 1024)))
    out = []
    for i, x, y in pts:
        code = part(quant(x, bounds[1], bounds[2])) | (part(quant(y, bounds[1], bounds[3])) << 1)
        out.append([i, code])
    out.sort(key=lambda r: (r[1], r[0]))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[8, -5.94, 9.17], [2, -5.94, 9.17], [16, -3.93, 32.0], [4, 6.0, 5.06], [17, 6.0, 21.16], [15, -10.0, 32.0], [12, -10.0, 32.0]], [-10.0, 0.0, 6.0, 32.0]], [[2, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]]], [[[[15, -10.0, 30.56], [2, -10.0, 32.0], [1, -10.0, 32.0], [27, -10.51, 15.54]], [-10.0, 0.0, 0.0, 32.0]], [[27, 174594], [15, 696834], [1, 699050], [2, 699050]]], [[[[15, -9.79, -4.0], [23, -8.97, 28.0], [4, 1.83, -4.0], [3, -10.0, 28.0]], [-10.0, -4.0, 6.0, 28.0]], [[15, 81], [4, 283921], [3, 699050], [23, 703147]]], [[[[29, 15.14, -4.07], [13, 0.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[29, 16709], [13, 699050]]], [[[[29, 4.43, 23.54], [11, 5.0, 0.0], [22, 4.99, 0.0], [14, 5.01, 0.0], [10, 5.0, 14.42], [21, 5.0, 0.0]], [5.0, 0.0, 5.0, 32.0]], [[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]]], [[[[1, -10.0, -4.0], [21, -10.0, -4.0], [12, -10.0, -0.83], [4, -10.0, 1.95], [8, -10.0, -4.0]], [-10.0, -4.0, -10.0, 4.0]], [[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]]], [[[[5, 55.38, -0.83], [8, 0.0, 4.0], [17, 0.0, 4.0], [21, 0.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[5, 427831], [8, 699050], [17, 699050], [21, 699050]]], [[[[22, 5.0, 0.0], [12, 6.63, 0.0], [14, 105.0, 6.32]], [5.0, 0.0, 105.0, 8.0]], [[22, 0], [12, 256], [14, 1007061]]]], [[[[[21, -3.54, 0.0], [6, -9.58, 0.0], [2, -10.0, 0.0], [10, -9.51, 13.6], [8, -10.0, 14.86], [14, -10.0, 32.0]], [-10.0, 0.0, 0.0, 32.0]], [[2, 0], [6, 1093], [10, 167694], [8, 172682], [21, 278801], [14, 699050]]], [[[[4, 15.0, 8.0], [27, 5.0, 8.3]], [5.0, 0.0, 15.0, 8.0]], [[27, 699050], [4, 1048575]]], [[[[16, 0.0, 0.51], [14, 0.0, 0.51], [27, 0.0, -4.83]], [0.0, -4.0, 10.0, 4.0]], [[27, 0], [14, 532482], [16, 532482]]], [[[[22, 5.0, 1.76], [26, 5.0, 1.76], [25, 5.7, -1.04], [6, 5.0, -0.73]], [5.0, -4.0, 21.0, 4.0]], [[25, 143064], [6, 165896], [22, 567298], [26, 567298]]], [[[[27, 5.0, 4.0], [21, 5.0, 4.0], [22, 105.0, -3.16], [3, 42.29, 4.0], [17, 5.0, 2.25], [12, 25.35, -0.08], [8, 70.41, 2.16]], [5.0, -4.0, 105.0, 4.0]], [[12, 195362], [22, 359903], [17, 657408], [21, 699050], [27, 699050], [3, 770043], [8, 934769]]], [[[[21, -7.77, 4.37], [10, -10.0, -4.0], [20, -9.43, -3.81], [22, 1.31, -2.46], [25, 5.87, -4.0], [19, -6.46, 4.0], [8, -8.2, 4.29], [27, 6.0, 2.44]], [-10.0, -4.0, 6.0, 4.0]], [[10, 0], [20, 1680], [22, 323879], [25, 349461], [8, 704431], [21, 715518], [19, 720558], [27, 1007573]]], [[[[29, -10.0, -0.25], [3, -10.57, 28.0], [19, -10.0, -4.0], [9, -10.0, -4.0], [20, -10.0, -4.0]], [-10.0, -4.0, -10.0, 28.0]], [[9, 0], [19, 0], [20, 0], [29, 10880], [3, 699050]]], [[[[7, 61.89, 26.8], [4, 65.14, 0.0], [10, 37.56, 2.32], [12, 46.76, 27.2], [13, 105.0, 16.99]], [5.0, 0.0, 105.0, 32.0]], [[10, 78041], [4, 267285], [12, 748653], [13, 874495], [7, 930454]]]], [[[[[6, 70.15, -4.0], [11, 0.0, 2.08], [18, 100.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[6, 282708], [11, 655496], [18, 1048575]]], [[[[14, -10.0, 8.0], [26, -10.0, 8.0], [8, -10.0, 3.45], [16, -10.97, 8.0], [25, -10.0, 5.04], [22, -10.0, 0.0], [7, -10.0, 2.57], [15, -9.53, 3.51], [12, -10.46, 2.24]], [-10.0, 0.0, -10.0, 8.0]], [[22, 0], [12, 131752], [7, 139392], [8, 166530], [15, 172034], [25, 557090], [14, 699050], [16, 699050], [26, 699050]]], [[[[7, 5.0, 5.02], [22, 5.0, 5.02], [6, 105.0, 6.44]], [5.0, 0.0, 105.0, 8.0]], [[7, 557064], [22, 557064], [6, 1007573]]], [[[[2, -2.74, 0.0], [24, -0.25, 19.26], [28, 0.0, 23.93], [17, -9.92, 0.0], [10, 0.0, 10.99], [18, -4.08, 0.0]], [-10.0, 0.0, 0.0, 32.0]], [[17, 64], [18, 266580], [2, 283669], [10, 489471], [24, 883860], [28, 917495]]], [[[[8, 0.0, -4.0], [28, 0.0, 28.0], [26, 0.0, 28.0], [21, 0.0, 2.42], [4, 0.0, -4.0]], [0.0, -4.0, 0.0, 28.0]], [[4, 0], [8, 0], [21, 41122], [26, 699050], [28, 699050]]], [[[[22, 90.0, 0.0], [18, 10.62, 0.0], [27, 13.28, 0.0]], [-10.0, 0.0, 90.0, 32.0]], [[18, 20741], [27, 21588], [22, 349525]]], [[[[26, 17.49, 0.0], [3, 17.49, 0.0], [25, 21.17, 0.0], [20, 16.02, 8.23], [7, 21.0, 5.26], [2, 16.42, 1.66], [24, 21.0, 7.24], [18, 9.22, 8.0], [28, 21.0, 0.0]], [5.0, 0.0, 21.0, 8.0]], [[2, 324452], [3, 328021], [26, 328021], [25, 349525], [28, 349525], [18, 764670], [7, 908631], [20, 981675], [24, 1038333]]], [[[[2, 5.42, -3.91], [24, 5.0, -4.0], [8, 5.0, 4.0], [7, 5.0, 4.0], [12, 5.0, 4.0]], [5.0, -4.0, 5.0, 4.0]], [[24, 0], [2, 138], [7, 699050], [8, 699050], [12, 699050]]]], [[[[[12, 5.0, -1.65], [13, 5.0, -4.0], [10, 85.95, 0.41], [24, 5.0, -4.0]], [5.0, -4.0, 105.0, 4.0]], [[13, 0], [24, 0], [12, 133280], [10, 855920]]], [[[[23, 0.0, 32.0], [27, 0.0, 2.02], [16, 0.0, 27.42], [20, 34.39, 32.0]], [0.0, 0.0, 100.0, 32.0]], [[27, 8192], [16, 665762], [23, 699050], [20, 769706]]], [[[[29, 0.0, 32.0], [10, -0.21, 0.0], [23, -0.32, 0.0], [26, 0.0, 30.2]], [0.0, 0.0, 0.0, 32.0]], [[10, 0], [23, 0], [26, 696360], [29, 699050]]], [[[[18, 5.0, -3.45], [26, 5.0, 4.0]], [5.0, -4.0, 5.0, 4.0]], [[18, 8232], [26, 699050]]], [[[[5, 21.0, 2.38], [20, 5.0, 0.8], [9, 6.41, 8.0], [1, 21.0, 0.0], [29, 21.0, 8.0], [7, 14.94, 6.94], [14, 21.0, 5.79], [18, 21.0, 0.0]], [5.0, 0.0, 21.0, 8.0]], [[20, 10280], [1, 349525], [18, 349525], [5, 483157], [9, 703470], [14, 916855], [7, 933840], [29, 1048575]]], [[[[7, 21.0, 4.88], [19, 21.0, 4.88], [18, 21.0, 0.0], [29, 6.08, 0.37], [21, 21.0, 12.27], [1, 5.0, 9.09]], [5.0, 0.0, 21.0, 32.0]], [[29, 4251], [1, 133128], [18, 349525], [7, 382965], [19, 382965], [21, 513493]]], [[[[18, 15.0, 0.0], [6, 15.0, 0.0], [20, 5.0, 0.0]], [5.0, 0.0, 15.0, 8.0]], [[20, 0], [6, 349525], [18, 349525]]], [[[[28, 89.65, 8.0], [20, 89.65, 8.0], [15, 90.0, 0.0], [25, -7.44, 3.45], [3, -10.0, 0.0], [29, 39.43, 0.0]], [-10.0, 0.0, 90.0, 8.0]], [[3, 0], [29, 87364], [25, 166854], [15, 349525], [20, 1048570], [28, 1048570]]]], [[[[[13, 64.33, 3.22], [26, 64.33, 3.22], [28, 12.16, 8.0], [3, 35.2, 0.0], [9, 41.6, 0.96], [2, 27.88, 4.16]], [5.0, 0.0, 105.0, 8.0]], [[3, 66833], [9, 81820], [13, 431093], [26, 431093], [2, 546404], [28, 703211]]], [[[[17, 5.0, 2.07], [10, 5.0, 2.07], [28, 5.0, 0.0]], [5.0, 0.0, 21.0, 32.0]], [[28, 0], [10, 8200], [17, 8200]]], [[[[17, 0.0, -4.0], [21, 0.0, -4.0], [4, 0.0, -2.2], [29, 0.0, 4.0], [5, 0.0, 0.07], [24, 0.0, -3.58], [18, 0.0, 0.36], [7, 0.0, 4.0], [3, 0.0, -4.0], [11, 0.0, -1.93]], [0.0, -4.0, 0.0, 4.0]], [[3, 0], [17, 0], [21, 0], [24, 2594], [4, 43048], [11, 131200], [5, 524416], [18, 526504], [7, 699050], [29, 699050]]], [[[[16, 100.0, 8.0], [29, 33.02, 3.99], [28, 68.28, 2.75], [27, 0.0, 5.89], [6, 100.0, 5.44], [19, 100.0, 8.0], [9, 90.65, 0.0]], [0.0, 0.0, 100.0, 8.0]], [[29, 244652], [9, 345088], [28, 421189], [27, 567810], [6, 909269], [16, 1048575], [19, 1048575]]], [[[[19, 5.0, -3.05], [25, 5.0, -3.05], [2, 5.0, -4.0], [7, 5.0, -0.21], [4, 5.0, -0.44]], [5.0, -4.0, 5.0, 28.0]], [[2, 0], [19, 680], [25, 680], [4, 10754], [7, 10882]]], [[[[15, 94.67, 0.0], [16, 100.0, 0.0], [12, 0.0, 10.42], [20, 59.05, 23.9], [7, 100.0, 32.0], [2, 0.91, 12.9]], [0.0, 0.0, 100.0, 32.0]], [[12, 139426], [2, 164577], [15, 348225], [16, 349525], [20, 834544], [7, 1048575]]], [[[[9, 21.0, -4.0], [7, 21.0, -4.0], [15, 19.51, 4.95], [10, 5.0, -4.0], [25, 21.0, -4.0], [12, 17.72, 4.0], [26, 21.0, -4.0], [8, 6.03, -4.0]], [5.0, -4.0, 21.0, 4.0]], [[10, 0], [8, 4097], [7, 349525], [9, 349525], [25, 349525], [26, 349525], [12, 1027838], [15, 1044138]]], [[[[28, -10.0, -4.0], [15, 0.0, -0.33], [13, 0.0, 4.0], [19, -10.0, -3.44], [16, -10.0, 4.0], [17, 0.0, 3.07], [21, -9.69, -1.77], [29, -10.0, -2.27]], [-10.0, -4.0, 0.0, 4.0]], [[28, 0], [19, 8234], [29, 41634], [21, 132087], [15, 522103], [16, 699050], [17, 1037781], [13, 1048575]]]]]
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, 133154], [8, 133154], [4, 384343], [12, 699050], [15, 699050], [16, 699050], [17, 908663]][[2, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]]Failed
case 1[[27, 174594], [15, 696834], [1, 699050], [2, 699050]][[27, 174594], [15, 696834], [1, 699050], [2, 699050]]Passed
case 2[[15, 0], [4, 266512], [3, 699050], [23, 699050]][[15, 81], [4, 283921], [3, 699050], [23, 703147]]Failed
case 3[[29, 17744], [13, 700095]][[29, 16709], [13, 699050]]Failed
case 4[[22, 349521], [11, 349525], [14, 349525], [21, 349525], [10, 521719], [29, 911943]][[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]]Failed
case 5[[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]][[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]]Passed
case 6[[5, 430690], [8, 700095], [17, 700095], [21, 700095]][[5, 427831], [8, 699050], [17, 699050], [21, 699050]]Failed
case 7[[22, 1280], [12, 4096], [14, 1007061]][[22, 0], [12, 256], [14, 1007061]]Failed

SHA-256 / fc4a78a3d914c9e11732cc04addfb6bb4d38ff72e99a09068670074fc7580abd

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(pts, bounds):
    def part(v):
        v &= 0x3FF
        v = (v | (v << 8)) & 0x00FF00FF
        v = (v | (v << 4)) & 0x0F0F0F0F
        v = (v | (v << 2)) & 0x33333333
        v = (v | (v << 1)) & 0x55555555
        return v
    def quant(c, lo, hi):
        if hi <= lo:
            return 0
        return min(1023, max(0, math.floor((c - lo) / (hi - lo) * 1024)))
    out = []
    for i, x, y in pts:
        code = part(quant(x, bounds[0], bounds[2])) | (part(quant(y, bounds[1], bounds[3])) << 1)
        out.append([i, code])
    out.sort(key=lambda r: (r[1], r[0]))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[8, -5.94, 9.17], [2, -5.94, 9.17], [16, -3.93, 32.0], [4, 6.0, 5.06], [17, 6.0, 21.16], [15, -10.0, 32.0], [12, -10.0, 32.0]], [-10.0, 0.0, 6.0, 32.0]], [[2, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]]], [[[[15, -10.0, 30.56], [2, -10.0, 32.0], [1, -10.0, 32.0], [27, -10.51, 15.54]], [-10.0, 0.0, 0.0, 32.0]], [[27, 174594], [15, 696834], [1, 699050], [2, 699050]]], [[[[15, -9.79, -4.0], [23, -8.97, 28.0], [4, 1.83, -4.0], [3, -10.0, 28.0]], [-10.0, -4.0, 6.0, 28.0]], [[15, 81], [4, 283921], [3, 699050], [23, 703147]]], [[[[29, 15.14, -4.07], [13, 0.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[29, 16709], [13, 699050]]], [[[[29, 4.43, 23.54], [11, 5.0, 0.0], [22, 4.99, 0.0], [14, 5.01, 0.0], [10, 5.0, 14.42], [21, 5.0, 0.0]], [5.0, 0.0, 5.0, 32.0]], [[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]]], [[[[1, -10.0, -4.0], [21, -10.0, -4.0], [12, -10.0, -0.83], [4, -10.0, 1.95], [8, -10.0, -4.0]], [-10.0, -4.0, -10.0, 4.0]], [[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]]], [[[[5, 55.38, -0.83], [8, 0.0, 4.0], [17, 0.0, 4.0], [21, 0.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[5, 427831], [8, 699050], [17, 699050], [21, 699050]]], [[[[22, 5.0, 0.0], [12, 6.63, 0.0], [14, 105.0, 6.32]], [5.0, 0.0, 105.0, 8.0]], [[22, 0], [12, 256], [14, 1007061]]]], [[[[[21, -3.54, 0.0], [6, -9.58, 0.0], [2, -10.0, 0.0], [10, -9.51, 13.6], [8, -10.0, 14.86], [14, -10.0, 32.0]], [-10.0, 0.0, 0.0, 32.0]], [[2, 0], [6, 1093], [10, 167694], [8, 172682], [21, 278801], [14, 699050]]], [[[[4, 15.0, 8.0], [27, 5.0, 8.3]], [5.0, 0.0, 15.0, 8.0]], [[27, 699050], [4, 1048575]]], [[[[16, 0.0, 0.51], [14, 0.0, 0.51], [27, 0.0, -4.83]], [0.0, -4.0, 10.0, 4.0]], [[27, 0], [14, 532482], [16, 532482]]], [[[[22, 5.0, 1.76], [26, 5.0, 1.76], [25, 5.7, -1.04], [6, 5.0, -0.73]], [5.0, -4.0, 21.0, 4.0]], [[25, 143064], [6, 165896], [22, 567298], [26, 567298]]], [[[[27, 5.0, 4.0], [21, 5.0, 4.0], [22, 105.0, -3.16], [3, 42.29, 4.0], [17, 5.0, 2.25], [12, 25.35, -0.08], [8, 70.41, 2.16]], [5.0, -4.0, 105.0, 4.0]], [[12, 195362], [22, 359903], [17, 657408], [21, 699050], [27, 699050], [3, 770043], [8, 934769]]], [[[[21, -7.77, 4.37], [10, -10.0, -4.0], [20, -9.43, -3.81], [22, 1.31, -2.46], [25, 5.87, -4.0], [19, -6.46, 4.0], [8, -8.2, 4.29], [27, 6.0, 2.44]], [-10.0, -4.0, 6.0, 4.0]], [[10, 0], [20, 1680], [22, 323879], [25, 349461], [8, 704431], [21, 715518], [19, 720558], [27, 1007573]]], [[[[29, -10.0, -0.25], [3, -10.57, 28.0], [19, -10.0, -4.0], [9, -10.0, -4.0], [20, -10.0, -4.0]], [-10.0, -4.0, -10.0, 28.0]], [[9, 0], [19, 0], [20, 0], [29, 10880], [3, 699050]]], [[[[7, 61.89, 26.8], [4, 65.14, 0.0], [10, 37.56, 2.32], [12, 46.76, 27.2], [13, 105.0, 16.99]], [5.0, 0.0, 105.0, 32.0]], [[10, 78041], [4, 267285], [12, 748653], [13, 874495], [7, 930454]]]], [[[[[6, 70.15, -4.0], [11, 0.0, 2.08], [18, 100.0, 4.0]], [0.0, -4.0, 100.0, 4.0]], [[6, 282708], [11, 655496], [18, 1048575]]], [[[[14, -10.0, 8.0], [26, -10.0, 8.0], [8, -10.0, 3.45], [16, -10.97, 8.0], [25, -10.0, 5.04], [22, -10.0, 0.0], [7, -10.0, 2.57], [15, -9.53, 3.51], [12, -10.46, 2.24]], [-10.0, 0.0, -10.0, 8.0]], [[22, 0], [12, 131752], [7, 139392], [8, 166530], [15, 172034], [25, 557090], [14, 699050], [16, 699050], [26, 699050]]], [[[[7, 5.0, 5.02], [22, 5.0, 5.02], [6, 105.0, 6.44]], [5.0, 0.0, 105.0, 8.0]], [[7, 557064], [22, 557064], [6, 1007573]]], [[[[2, -2.74, 0.0], [24, -0.25, 19.26], [28, 0.0, 23.93], [17, -9.92, 0.0], [10, 0.0, 10.99], [18, -4.08, 0.0]], [-10.0, 0.0, 0.0, 32.0]], [[17, 64], [18, 266580], [2, 283669], [10, 489471], [24, 883860], [28, 917495]]], [[[[8, 0.0, -4.0], [28, 0.0, 28.0], [26, 0.0, 28.0], [21, 0.0, 2.42], [4, 0.0, -4.0]], [0.0, -4.0, 0.0, 28.0]], [[4, 0], [8, 0], [21, 41122], [26, 699050], [28, 699050]]], [[[[22, 90.0, 0.0], [18, 10.62, 0.0], [27, 13.28, 0.0]], [-10.0, 0.0, 90.0, 32.0]], [[18, 20741], [27, 21588], [22, 349525]]], [[[[26, 17.49, 0.0], [3, 17.49, 0.0], [25, 21.17, 0.0], [20, 16.02, 8.23], [7, 21.0, 5.26], [2, 16.42, 1.66], [24, 21.0, 7.24], [18, 9.22, 8.0], [28, 21.0, 0.0]], [5.0, 0.0, 21.0, 8.0]], [[2, 324452], [3, 328021], [26, 328021], [25, 349525], [28, 349525], [18, 764670], [7, 908631], [20, 981675], [24, 1038333]]], [[[[2, 5.42, -3.91], [24, 5.0, -4.0], [8, 5.0, 4.0], [7, 5.0, 4.0], [12, 5.0, 4.0]], [5.0, -4.0, 5.0, 4.0]], [[24, 0], [2, 138], [7, 699050], [8, 699050], [12, 699050]]]], [[[[[12, 5.0, -1.65], [13, 5.0, -4.0], [10, 85.95, 0.41], [24, 5.0, -4.0]], [5.0, -4.0, 105.0, 4.0]], [[13, 0], [24, 0], [12, 133280], [10, 855920]]], [[[[23, 0.0, 32.0], [27, 0.0, 2.02], [16, 0.0, 27.42], [20, 34.39, 32.0]], [0.0, 0.0, 100.0, 32.0]], [[27, 8192], [16, 665762], [23, 699050], [20, 769706]]], [[[[29, 0.0, 32.0], [10, -0.21, 0.0], [23, -0.32, 0.0], [26, 0.0, 30.2]], [0.0, 0.0, 0.0, 32.0]], [[10, 0], [23, 0], [26, 696360], [29, 699050]]], [[[[18, 5.0, -3.45], [26, 5.0, 4.0]], [5.0, -4.0, 5.0, 4.0]], [[18, 8232], [26, 699050]]], [[[[5, 21.0, 2.38], [20, 5.0, 0.8], [9, 6.41, 8.0], [1, 21.0, 0.0], [29, 21.0, 8.0], [7, 14.94, 6.94], [14, 21.0, 5.79], [18, 21.0, 0.0]], [5.0, 0.0, 21.0, 8.0]], [[20, 10280], [1, 349525], [18, 349525], [5, 483157], [9, 703470], [14, 916855], [7, 933840], [29, 1048575]]], [[[[7, 21.0, 4.88], [19, 21.0, 4.88], [18, 21.0, 0.0], [29, 6.08, 0.37], [21, 21.0, 12.27], [1, 5.0, 9.09]], [5.0, 0.0, 21.0, 32.0]], [[29, 4251], [1, 133128], [18, 349525], [7, 382965], [19, 382965], [21, 513493]]], [[[[18, 15.0, 0.0], [6, 15.0, 0.0], [20, 5.0, 0.0]], [5.0, 0.0, 15.0, 8.0]], [[20, 0], [6, 349525], [18, 349525]]], [[[[28, 89.65, 8.0], [20, 89.65, 8.0], [15, 90.0, 0.0], [25, -7.44, 3.45], [3, -10.0, 0.0], [29, 39.43, 0.0]], [-10.0, 0.0, 90.0, 8.0]], [[3, 0], [29, 87364], [25, 166854], [15, 349525], [20, 1048570], [28, 1048570]]]], [[[[[13, 64.33, 3.22], [26, 64.33, 3.22], [28, 12.16, 8.0], [3, 35.2, 0.0], [9, 41.6, 0.96], [2, 27.88, 4.16]], [5.0, 0.0, 105.0, 8.0]], [[3, 66833], [9, 81820], [13, 431093], [26, 431093], [2, 546404], [28, 703211]]], [[[[17, 5.0, 2.07], [10, 5.0, 2.07], [28, 5.0, 0.0]], [5.0, 0.0, 21.0, 32.0]], [[28, 0], [10, 8200], [17, 8200]]], [[[[17, 0.0, -4.0], [21, 0.0, -4.0], [4, 0.0, -2.2], [29, 0.0, 4.0], [5, 0.0, 0.07], [24, 0.0, -3.58], [18, 0.0, 0.36], [7, 0.0, 4.0], [3, 0.0, -4.0], [11, 0.0, -1.93]], [0.0, -4.0, 0.0, 4.0]], [[3, 0], [17, 0], [21, 0], [24, 2594], [4, 43048], [11, 131200], [5, 524416], [18, 526504], [7, 699050], [29, 699050]]], [[[[16, 100.0, 8.0], [29, 33.02, 3.99], [28, 68.28, 2.75], [27, 0.0, 5.89], [6, 100.0, 5.44], [19, 100.0, 8.0], [9, 90.65, 0.0]], [0.0, 0.0, 100.0, 8.0]], [[29, 244652], [9, 345088], [28, 421189], [27, 567810], [6, 909269], [16, 1048575], [19, 1048575]]], [[[[19, 5.0, -3.05], [25, 5.0, -3.05], [2, 5.0, -4.0], [7, 5.0, -0.21], [4, 5.0, -0.44]], [5.0, -4.0, 5.0, 28.0]], [[2, 0], [19, 680], [25, 680], [4, 10754], [7, 10882]]], [[[[15, 94.67, 0.0], [16, 100.0, 0.0], [12, 0.0, 10.42], [20, 59.05, 23.9], [7, 100.0, 32.0], [2, 0.91, 12.9]], [0.0, 0.0, 100.0, 32.0]], [[12, 139426], [2, 164577], [15, 348225], [16, 349525], [20, 834544], [7, 1048575]]], [[[[9, 21.0, -4.0], [7, 21.0, -4.0], [15, 19.51, 4.95], [10, 5.0, -4.0], [25, 21.0, -4.0], [12, 17.72, 4.0], [26, 21.0, -4.0], [8, 6.03, -4.0]], [5.0, -4.0, 21.0, 4.0]], [[10, 0], [8, 4097], [7, 349525], [9, 349525], [25, 349525], [26, 349525], [12, 1027838], [15, 1044138]]], [[[[28, -10.0, -4.0], [15, 0.0, -0.33], [13, 0.0, 4.0], [19, -10.0, -3.44], [16, -10.0, 4.0], [17, 0.0, 3.07], [21, -9.69, -1.77], [29, -10.0, -2.27]], [-10.0, -4.0, 0.0, 4.0]], [[28, 0], [19, 8234], [29, 41634], [21, 132087], [15, 522103], [16, 699050], [17, 1037781], [13, 1048575]]]]]
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, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]][[2, 198695], [8, 198695], [4, 384343], [12, 699050], [15, 699050], [16, 780986], [17, 908663]]Passed
case 1[[27, 174594], [15, 696834], [1, 699050], [2, 699050]][[27, 174594], [15, 696834], [1, 699050], [2, 699050]]Passed
case 2[[15, 81], [4, 283921], [3, 699050], [23, 703147]][[15, 81], [4, 283921], [3, 699050], [23, 703147]]Passed
case 3[[29, 16709], [13, 699050]][[29, 16709], [13, 699050]]Passed
case 4[[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]][[11, 0], [14, 0], [21, 0], [22, 0], [10, 172194], [29, 567810]]Passed
case 5[[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]][[1, 0], [8, 0], [21, 0], [12, 164386], [4, 567938]]Passed
case 6[[5, 427831], [8, 699050], [17, 699050], [21, 699050]][[5, 427831], [8, 699050], [17, 699050], [21, 699050]]Passed
case 7[[22, 0], [12, 256], [14, 1007061]][[22, 0], [12, 256], [14, 1007061]]Passed

SHA-256 / 80f1acc6ea749bfda2c577ded7cec5e4e734bfdf6ad2ceaaa042cbd9c8ed8d83

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

Case digest / cac8d6bf0c998b2d6312406265e0f79ed0b73aa23c6e9f8fce42a78d78dbfc76