FA-87591 / Collision detection broadphase / Open access
Centroids below the scene bound wrap to high codes · case 01
Slightly out-of-bounds objects land at the far end of the order.
ROOT CAUSE
The max(0, ...) clamp is missing, so negative values are masked to large ones.
VERIFIED REPAIR
Clamp negative quantized coordinates to 0.
Unsuccessful approach: Taking the absolute value mirrors them into the scene instead of clamping.
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, 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 = [[[[[[29, 0.0, 10.76], [26, 0.0, 10.76], [13, 81.68, 0.0], [4, 0.0, 32.0], [10, 100.0, 0.3], [2, 71.74, 6.32]], [0.0, 0.0, 100.0, 32.0]], [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 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]]], [[[[27, 42.89, 8.0], [20, 51.81, 8.87]], [5.0, 0.0, 105.0, 8.0]], [[27, 780975], [20, 785407]]], [[[[7, 16.0, -4.65], [16, 16.22, -4.0]], [0.0, -4.0, 16.0, 4.0]], [[7, 349525], [16, 349525]]], [[[[6, -10.0, 6.42], [28, -7.78, 3.03]], [-10.0, 0.0, 6.0, 8.0]], [[28, 180318], [6, 657954]]], [[[[23, -10.0, 2.89], [10, -9.49, 0.0], [12, -10.79, 0.0], [24, -10.0, 8.0], [21, -10.0, 3.46], [15, -10.0, -0.74]], [-10.0, 0.0, -10.0, 8.0]], [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]]], [[[[21, 6.0, -0.03], [8, -2.52, 28.0], [12, 0.34, -1.72], [16, -10.48, 8.44]], [-10.0, -4.0, 6.0, 28.0]], [[16, 164008], [12, 287121], [21, 360447], [8, 785406]]]], [[[[[24, 18.92, 1.21], [28, 0.0, 4.0], [15, 88.88, -4.27], [6, 75.34, 2.92], [26, 85.85, -4.53], [7, 98.19, -2.3]], [0.0, -4.0, 100.0, 4.0]], [[26, 332885], [15, 344148], [7, 390867], [24, 578185], [28, 699050], [6, 993831]]], [[[[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]]], [[[[17, 0.31, 0.97], [20, 0.0, -4.0], [19, 0.21, -4.52], [12, 0.0, -1.71], [9, 0.0, 4.0]], [0.0, -4.0, 0.0, 4.0]], [[19, 0], [20, 0], [12, 133154], [17, 535200], [9, 699050]]], [[[[24, 54.6, 4.0], [1, 54.6, 4.0], [29, -10.0, -4.05], [13, -10.0, -4.0], [3, -10.0, -3.74], [12, -10.0, 4.82], [6, -10.0, -4.0], [7, 90.0, 4.0]], [-10.0, -4.0, 90.0, 4.0]], [[6, 0], [13, 0], [29, 0], [3, 2050], [12, 699050], [1, 977851], [24, 977851], [7, 1048575]]], [[[[17, 6.0, 23.49], [4, -10.0, 4.97], [14, -10.0, 11.29], [5, -10.0, 28.0], [27, 2.15, 28.38], [9, 6.0, -4.0], [3, 6.0, 13.56]], [-10.0, -4.0, 6.0, 28.0]], [[4, 131754], [14, 174210], [9, 349525], [5, 699050], [3, 876375], [17, 1015295], [27, 1026795]]], [[[[12, 101.57, 28.0], [2, 101.57, 28.0], [7, 71.05, 28.0], [19, 5.0, 28.0], [29, 105.0, 2.15]], [5.0, -4.0, 105.0, 28.0]], [[29, 390517], [19, 699050], [7, 978618], [2, 1047546], [12, 1047546]]], [[[[17, -10.0, 0.42], [11, -10.0, 0.42], [5, -10.73, 0.0], [24, -10.0, 0.0], [1, -9.52, 32.0], [19, -10.0, 27.12], [20, -10.0, 8.92]], [-10.0, 0.0, -10.0, 32.0]], [[5, 0], [24, 0], [11, 162], [17, 162], [20, 131746], [19, 665610], [1, 699050]]], [[[[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]]]], [[[[[18, 3.54, 4.0], [5, 4.61, 4.0], [6, 7.15, 4.0], [8, 6.15, 4.0]], [0.0, -4.0, 10.0, 4.0]], [[18, 769774], [5, 785386], [8, 966587], [6, 982010]]], [[[[10, -10.0, 27.45], [13, -10.0, 27.45], [2, -10.0, -4.0], [24, -10.0, -0.07], [7, -10.0, 28.0]], [-10.0, -4.0, -10.0, 28.0]], [[2, 0], [24, 10914], [10, 698536], [13, 698536], [7, 699050]]], [[[[6, 10.0, 8.0], [8, 10.0, 0.11], [20, 10.0, 4.45], [15, 3.12, 0.36]], [0.0, 0.0, 10.0, 8.0]], [[15, 69117], [8, 349693], [20, 876503], [6, 1048575]]], [[[[16, 56.84, 2.88], [5, 65.91, 8.0], [25, 6.98, 0.63], [13, 5.0, 8.0], [3, 26.28, 0.0], [15, 5.0, -0.81], [4, 105.0, 0.0], [17, 105.0, 0.0], [6, 13.5, 1.77]], [5.0, 0.0, 105.0, 8.0]], [[15, 0], [25, 8976], [3, 20801], [6, 47389], [4, 349525], [17, 349525], [16, 404228], [13, 699050], [5, 966399]]], [[[[20, 0.0, 0.82], [7, 0.0, 0.82], [22, -10.0, 3.54], [10, -8.22, 0.0], [14, -10.0, 6.39], [13, -4.48, 8.0], [15, -10.6, 5.53], [2, -10.0, 1.37]], [-10.0, 0.0, 0.0, 8.0]], [[10, 17684], [2, 34986], [22, 172066], [7, 359893], [20, 359893], [15, 565258], [14, 657922], [13, 962491]]], [[[[8, 1.97, -4.78], [27, 9.24, -2.19], [7, 0.0, -4.0]], [0.0, -4.0, 10.0, 4.0]], [[7, 0], [8, 20545], [27, 388398]]], [[[[25, 0.71, -4.92], [3, 0.0, 4.0], [14, 0.94, 4.27], [19, -0.4, 2.92], [28, -0.71, 4.0], [9, 5.44, 3.44]], [0.0, -4.0, 10.0, 4.0]], [[25, 4160], [19, 666146], [3, 699050], [28, 699050], [14, 704170], [9, 954065]]], [[[[29, 5.0, 4.73], [15, 16.49, -1.96], [3, 9.85, 4.0], [20, 16.44, 0.26], [28, 5.0, -1.62], [19, 16.73, 4.0], [8, 5.0, -4.51]], [5.0, -4.0, 21.0, 4.0]], [[8, 0], [28, 133632], [15, 414071], [29, 699050], [3, 765886], [20, 809298], [19, 982782]]]], [[[[[25, 69.59, 21.33], [1, 5.0, 28.0], [16, 15.52, 18.84], [27, 17.38, 7.05]], [5.0, -4.0, 105.0, 28.0]], [[27, 146774], [16, 571085], [1, 699050], [25, 936345]]], [[[[10, 0.0, -4.0], [18, 0.0, 1.87], [11, 10.24, 4.0], [17, 13.44, 4.0], [20, 15.66, 4.0], [2, 0.0, -1.78], [8, 16.0, -4.0], [4, 16.0, -2.59], [14, 5.21, -4.41], [21, 9.67, -4.0]], [0.0, -4.0, 16.0, 4.0]], [[10, 0], [14, 69713], [2, 131744], [21, 267332], [8, 349525], [4, 384885], [18, 567466], [11, 977663], [17, 1031162], [20, 1048302]]], [[[[2, 5.0, 0.0], [17, 5.0, 0.0], [19, 16.36, 1.31], [8, 4.99, 8.0], [27, 21.0, 8.0], [28, 18.96, 6.39]], [5.0, 0.0, 21.0, 8.0]], [[2, 0], [17, 0], [19, 317759], [8, 699050], [28, 991059], [27, 1048575]]], [[[[21, 13.34, 0.23], [8, 13.34, 0.23], [28, 13.33, 8.0], [1, 15.0, 5.19], [14, 4.58, 8.0], [13, 15.0, 8.0], [23, 15.5, 8.91], [19, 15.0, 4.94], [18, 7.91, 0.0]], [5.0, 0.0, 15.0, 8.0]], [[18, 66625], [8, 332726], [21, 332726], [14, 699050], [19, 884693], [1, 907221], [28, 1031098], [13, 1048575], [23, 1048575]]], [[[[2, 100.0, 4.0], [14, 19.7, 0.88], [25, 27.6, -2.94]], [0.0, -4.0, 100.0, 4.0]], [[25, 98670], [14, 555585], [2, 1048575]]], [[[[24, 6.0, 28.0], [15, 6.0, 28.0], [21, -10.0, 17.05], [12, -8.8, 19.12], [25, -5.09, 22.05]], [-10.0, -4.0, 6.0, 28.0]], [[21, 559106], [12, 571482], [25, 730438], [15, 1048575], [24, 1048575]]], [[[[15, 34.3, 7.41], [12, 34.3, 7.41], [4, -5.23, 1.64], [13, 90.0, 8.0], [2, 90.0, 8.0], [11, 32.52, 7.96], [22, 90.0, 7.07], [5, 73.63, 3.33], [9, 4.21, 8.0], [10, 61.24, 2.86]], [-10.0, 0.0, 90.0, 8.0]], [[4, 42754], [10, 424425], [5, 498120], [9, 715691], [12, 776753], [15, 776753], [11, 782221], [22, 1037781], [2, 1048575], [13, 1048575]]], [[[[5, -0.18, 28.0], [29, 16.0, 0.87], [16, 0.0, -4.0], [23, 15.26, -4.0], [24, 10.31, 28.0], [20, 15.76, 28.0], [12, 4.35, -4.0], [8, 13.87, 14.59], [4, 0.0, -4.0], [7, 0.0, 27.51]], [0.0, -4.0, 16.0, 28.0]], [[4, 0], [16, 0], [12, 65812], [23, 348416], [29, 382943], [7, 698880], [5, 699050], [8, 866077], [24, 977839], [20, 1048490]]]], [[[[[10, 5.0, 5.3], [29, 14.7, 25.88], [7, 4.37, 32.0], [6, 5.0, 0.0], [23, 6.09, 2.22], [20, 10.74, 32.0], [11, 15.0, 23.32], [14, 5.0, 19.76]], [5.0, 0.0, 15.0, 32.0]], [[6, 0], [23, 13439], [10, 34946], [14, 535168], [7, 699050], [11, 916957], [20, 965359], [29, 1007265]]], [[[[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]]], [[[[13, 15.0, 11.38], [18, 15.0, 28.0], [6, 14.52, 4.53], [5, 14.55, 28.0], [20, 13.11, 28.0], [16, 5.89, 1.96], [15, 5.0, -4.0], [10, 9.17, 28.0], [23, 14.46, 15.77], [19, 15.52, -4.0], [17, 10.19, 28.0]], [5.0, -4.0, 15.0, 28.0]], [[15, 0], [16, 39917], [19, 349525], [6, 479828], [13, 523765], [10, 782063], [23, 883392], [17, 961455], [20, 1028094], [5, 1047467], [18, 1048575]]], [[[[6, -10.0, 1.87], [22, -10.0, 1.87], [18, -10.0, 19.83], [27, -7.05, 6.24], [13, -7.53, 27.93], [8, -8.41, -0.77], [23, -10.0, 0.56]], [-10.0, 0.0, 6.0, 32.0]], [[23, 514], [6, 2698], [22, 2698], [8, 5137], [27, 58746], [18, 535176], [13, 682998]]], [[[[27, 1.75, 8.0], [28, 0.0, -0.68], [22, 0.0, 5.11], [12, 16.0, 8.0], [1, 9.94, 2.97], [8, 0.0, 0.0]], [0.0, 0.0, 16.0, 8.0]], [[8, 0], [28, 0], [1, 409584], [22, 557224], [27, 704426], [12, 1048575]]], [[[[27, 0.0, 8.0], [11, 10.0, 3.99], [26, 4.74, 0.0], [21, 10.0, 8.0], [7, 0.43, 4.89], [23, 10.0, 0.0], [29, 10.0, 0.0], [16, 4.68, 7.81], [24, -0.16, 8.0], [12, 1.68, 8.0]], [0.0, 0.0, 10.0, 8.0]], [[26, 87057], [23, 349525], [29, 349525], [11, 524285], [7, 536146], [24, 699050], [27, 699050], [12, 716538], [16, 784767], [21, 1048575]]], [[[[17, 0.0, -4.0], [14, 0.0, -4.0], [28, 0.0, -4.0], [6, 0.0, 3.21], [9, 0.0, 20.07], [24, 0.0, -4.0], [27, 0.69, 27.28], [21, -0.16, 18.67], [23, 0.0, 19.8]], [0.0, -4.0, 0.0, 28.0]], [[14, 0], [17, 0], [24, 0], [28, 0], [6, 43048], [21, 565794], [23, 567938], [9, 655368], [27, 698496]]], [[[[8, -2.26, 8.0], [21, -4.59, 7.78], [28, 0.0, 1.24], [29, -4.93, 6.43], [11, -2.4, 8.0], [5, -9.98, 8.0], [7, 0.0, 0.0], [15, -9.58, 2.26], [22, -10.78, 0.0], [20, -10.0, 0.86]], [-10.0, 0.0, 0.0, 8.0]], [[22, 0], [20, 10408], [15, 134215], [7, 349525], [28, 382973], [5, 699054], [29, 920127], [21, 961611], [11, 1026798], [8, 1027050]]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| case 0 | [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 699050]] | [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 699050]] | Passed |
| case 1 | [[15, 81], [4, 283921], [3, 699050], [23, 703147]] | [[15, 81], [4, 283921], [3, 699050], [23, 703147]] | Passed |
| case 2 | [[13, 699050], [29, 715631]] | [[29, 16709], [13, 699050]] | Failed |
| case 3 | [[27, 780975], [20, 785407]] | [[27, 780975], [20, 785407]] | Passed |
| case 4 | [[16, 349525], [7, 1039861]] | [[7, 349525], [16, 349525]] | Failed |
| case 5 | [[28, 180318], [6, 657954]] | [[28, 180318], [6, 657954]] | Passed |
| case 6 | [[10, 0], [12, 0], [23, 141826], [21, 166536], [15, 690178], [24, 699050]] | [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]] | Failed |
| case 7 | [[12, 287121], [21, 360447], [16, 513193], [8, 785406]] | [[16, 164008], [12, 287121], [21, 360447], [8, 785406]] | Failed |
SHA-256 / 76e300357b7321b68f309b865732618c0936e7edd48db700a8013d00b63bd981
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, abs(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 = [[[[[[29, 0.0, 10.76], [26, 0.0, 10.76], [13, 81.68, 0.0], [4, 0.0, 32.0], [10, 100.0, 0.3], [2, 71.74, 6.32]], [0.0, 0.0, 100.0, 32.0]], [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 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]]], [[[[27, 42.89, 8.0], [20, 51.81, 8.87]], [5.0, 0.0, 105.0, 8.0]], [[27, 780975], [20, 785407]]], [[[[7, 16.0, -4.65], [16, 16.22, -4.0]], [0.0, -4.0, 16.0, 4.0]], [[7, 349525], [16, 349525]]], [[[[6, -10.0, 6.42], [28, -7.78, 3.03]], [-10.0, 0.0, 6.0, 8.0]], [[28, 180318], [6, 657954]]], [[[[23, -10.0, 2.89], [10, -9.49, 0.0], [12, -10.79, 0.0], [24, -10.0, 8.0], [21, -10.0, 3.46], [15, -10.0, -0.74]], [-10.0, 0.0, -10.0, 8.0]], [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]]], [[[[21, 6.0, -0.03], [8, -2.52, 28.0], [12, 0.34, -1.72], [16, -10.48, 8.44]], [-10.0, -4.0, 6.0, 28.0]], [[16, 164008], [12, 287121], [21, 360447], [8, 785406]]]], [[[[[24, 18.92, 1.21], [28, 0.0, 4.0], [15, 88.88, -4.27], [6, 75.34, 2.92], [26, 85.85, -4.53], [7, 98.19, -2.3]], [0.0, -4.0, 100.0, 4.0]], [[26, 332885], [15, 344148], [7, 390867], [24, 578185], [28, 699050], [6, 993831]]], [[[[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]]], [[[[17, 0.31, 0.97], [20, 0.0, -4.0], [19, 0.21, -4.52], [12, 0.0, -1.71], [9, 0.0, 4.0]], [0.0, -4.0, 0.0, 4.0]], [[19, 0], [20, 0], [12, 133154], [17, 535200], [9, 699050]]], [[[[24, 54.6, 4.0], [1, 54.6, 4.0], [29, -10.0, -4.05], [13, -10.0, -4.0], [3, -10.0, -3.74], [12, -10.0, 4.82], [6, -10.0, -4.0], [7, 90.0, 4.0]], [-10.0, -4.0, 90.0, 4.0]], [[6, 0], [13, 0], [29, 0], [3, 2050], [12, 699050], [1, 977851], [24, 977851], [7, 1048575]]], [[[[17, 6.0, 23.49], [4, -10.0, 4.97], [14, -10.0, 11.29], [5, -10.0, 28.0], [27, 2.15, 28.38], [9, 6.0, -4.0], [3, 6.0, 13.56]], [-10.0, -4.0, 6.0, 28.0]], [[4, 131754], [14, 174210], [9, 349525], [5, 699050], [3, 876375], [17, 1015295], [27, 1026795]]], [[[[12, 101.57, 28.0], [2, 101.57, 28.0], [7, 71.05, 28.0], [19, 5.0, 28.0], [29, 105.0, 2.15]], [5.0, -4.0, 105.0, 28.0]], [[29, 390517], [19, 699050], [7, 978618], [2, 1047546], [12, 1047546]]], [[[[17, -10.0, 0.42], [11, -10.0, 0.42], [5, -10.73, 0.0], [24, -10.0, 0.0], [1, -9.52, 32.0], [19, -10.0, 27.12], [20, -10.0, 8.92]], [-10.0, 0.0, -10.0, 32.0]], [[5, 0], [24, 0], [11, 162], [17, 162], [20, 131746], [19, 665610], [1, 699050]]], [[[[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]]]], [[[[[18, 3.54, 4.0], [5, 4.61, 4.0], [6, 7.15, 4.0], [8, 6.15, 4.0]], [0.0, -4.0, 10.0, 4.0]], [[18, 769774], [5, 785386], [8, 966587], [6, 982010]]], [[[[10, -10.0, 27.45], [13, -10.0, 27.45], [2, -10.0, -4.0], [24, -10.0, -0.07], [7, -10.0, 28.0]], [-10.0, -4.0, -10.0, 28.0]], [[2, 0], [24, 10914], [10, 698536], [13, 698536], [7, 699050]]], [[[[6, 10.0, 8.0], [8, 10.0, 0.11], [20, 10.0, 4.45], [15, 3.12, 0.36]], [0.0, 0.0, 10.0, 8.0]], [[15, 69117], [8, 349693], [20, 876503], [6, 1048575]]], [[[[16, 56.84, 2.88], [5, 65.91, 8.0], [25, 6.98, 0.63], [13, 5.0, 8.0], [3, 26.28, 0.0], [15, 5.0, -0.81], [4, 105.0, 0.0], [17, 105.0, 0.0], [6, 13.5, 1.77]], [5.0, 0.0, 105.0, 8.0]], [[15, 0], [25, 8976], [3, 20801], [6, 47389], [4, 349525], [17, 349525], [16, 404228], [13, 699050], [5, 966399]]], [[[[20, 0.0, 0.82], [7, 0.0, 0.82], [22, -10.0, 3.54], [10, -8.22, 0.0], [14, -10.0, 6.39], [13, -4.48, 8.0], [15, -10.6, 5.53], [2, -10.0, 1.37]], [-10.0, 0.0, 0.0, 8.0]], [[10, 17684], [2, 34986], [22, 172066], [7, 359893], [20, 359893], [15, 565258], [14, 657922], [13, 962491]]], [[[[8, 1.97, -4.78], [27, 9.24, -2.19], [7, 0.0, -4.0]], [0.0, -4.0, 10.0, 4.0]], [[7, 0], [8, 20545], [27, 388398]]], [[[[25, 0.71, -4.92], [3, 0.0, 4.0], [14, 0.94, 4.27], [19, -0.4, 2.92], [28, -0.71, 4.0], [9, 5.44, 3.44]], [0.0, -4.0, 10.0, 4.0]], [[25, 4160], [19, 666146], [3, 699050], [28, 699050], [14, 704170], [9, 954065]]], [[[[29, 5.0, 4.73], [15, 16.49, -1.96], [3, 9.85, 4.0], [20, 16.44, 0.26], [28, 5.0, -1.62], [19, 16.73, 4.0], [8, 5.0, -4.51]], [5.0, -4.0, 21.0, 4.0]], [[8, 0], [28, 133632], [15, 414071], [29, 699050], [3, 765886], [20, 809298], [19, 982782]]]], [[[[[25, 69.59, 21.33], [1, 5.0, 28.0], [16, 15.52, 18.84], [27, 17.38, 7.05]], [5.0, -4.0, 105.0, 28.0]], [[27, 146774], [16, 571085], [1, 699050], [25, 936345]]], [[[[10, 0.0, -4.0], [18, 0.0, 1.87], [11, 10.24, 4.0], [17, 13.44, 4.0], [20, 15.66, 4.0], [2, 0.0, -1.78], [8, 16.0, -4.0], [4, 16.0, -2.59], [14, 5.21, -4.41], [21, 9.67, -4.0]], [0.0, -4.0, 16.0, 4.0]], [[10, 0], [14, 69713], [2, 131744], [21, 267332], [8, 349525], [4, 384885], [18, 567466], [11, 977663], [17, 1031162], [20, 1048302]]], [[[[2, 5.0, 0.0], [17, 5.0, 0.0], [19, 16.36, 1.31], [8, 4.99, 8.0], [27, 21.0, 8.0], [28, 18.96, 6.39]], [5.0, 0.0, 21.0, 8.0]], [[2, 0], [17, 0], [19, 317759], [8, 699050], [28, 991059], [27, 1048575]]], [[[[21, 13.34, 0.23], [8, 13.34, 0.23], [28, 13.33, 8.0], [1, 15.0, 5.19], [14, 4.58, 8.0], [13, 15.0, 8.0], [23, 15.5, 8.91], [19, 15.0, 4.94], [18, 7.91, 0.0]], [5.0, 0.0, 15.0, 8.0]], [[18, 66625], [8, 332726], [21, 332726], [14, 699050], [19, 884693], [1, 907221], [28, 1031098], [13, 1048575], [23, 1048575]]], [[[[2, 100.0, 4.0], [14, 19.7, 0.88], [25, 27.6, -2.94]], [0.0, -4.0, 100.0, 4.0]], [[25, 98670], [14, 555585], [2, 1048575]]], [[[[24, 6.0, 28.0], [15, 6.0, 28.0], [21, -10.0, 17.05], [12, -8.8, 19.12], [25, -5.09, 22.05]], [-10.0, -4.0, 6.0, 28.0]], [[21, 559106], [12, 571482], [25, 730438], [15, 1048575], [24, 1048575]]], [[[[15, 34.3, 7.41], [12, 34.3, 7.41], [4, -5.23, 1.64], [13, 90.0, 8.0], [2, 90.0, 8.0], [11, 32.52, 7.96], [22, 90.0, 7.07], [5, 73.63, 3.33], [9, 4.21, 8.0], [10, 61.24, 2.86]], [-10.0, 0.0, 90.0, 8.0]], [[4, 42754], [10, 424425], [5, 498120], [9, 715691], [12, 776753], [15, 776753], [11, 782221], [22, 1037781], [2, 1048575], [13, 1048575]]], [[[[5, -0.18, 28.0], [29, 16.0, 0.87], [16, 0.0, -4.0], [23, 15.26, -4.0], [24, 10.31, 28.0], [20, 15.76, 28.0], [12, 4.35, -4.0], [8, 13.87, 14.59], [4, 0.0, -4.0], [7, 0.0, 27.51]], [0.0, -4.0, 16.0, 28.0]], [[4, 0], [16, 0], [12, 65812], [23, 348416], [29, 382943], [7, 698880], [5, 699050], [8, 866077], [24, 977839], [20, 1048490]]]], [[[[[10, 5.0, 5.3], [29, 14.7, 25.88], [7, 4.37, 32.0], [6, 5.0, 0.0], [23, 6.09, 2.22], [20, 10.74, 32.0], [11, 15.0, 23.32], [14, 5.0, 19.76]], [5.0, 0.0, 15.0, 32.0]], [[6, 0], [23, 13439], [10, 34946], [14, 535168], [7, 699050], [11, 916957], [20, 965359], [29, 1007265]]], [[[[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]]], [[[[13, 15.0, 11.38], [18, 15.0, 28.0], [6, 14.52, 4.53], [5, 14.55, 28.0], [20, 13.11, 28.0], [16, 5.89, 1.96], [15, 5.0, -4.0], [10, 9.17, 28.0], [23, 14.46, 15.77], [19, 15.52, -4.0], [17, 10.19, 28.0]], [5.0, -4.0, 15.0, 28.0]], [[15, 0], [16, 39917], [19, 349525], [6, 479828], [13, 523765], [10, 782063], [23, 883392], [17, 961455], [20, 1028094], [5, 1047467], [18, 1048575]]], [[[[6, -10.0, 1.87], [22, -10.0, 1.87], [18, -10.0, 19.83], [27, -7.05, 6.24], [13, -7.53, 27.93], [8, -8.41, -0.77], [23, -10.0, 0.56]], [-10.0, 0.0, 6.0, 32.0]], [[23, 514], [6, 2698], [22, 2698], [8, 5137], [27, 58746], [18, 535176], [13, 682998]]], [[[[27, 1.75, 8.0], [28, 0.0, -0.68], [22, 0.0, 5.11], [12, 16.0, 8.0], [1, 9.94, 2.97], [8, 0.0, 0.0]], [0.0, 0.0, 16.0, 8.0]], [[8, 0], [28, 0], [1, 409584], [22, 557224], [27, 704426], [12, 1048575]]], [[[[27, 0.0, 8.0], [11, 10.0, 3.99], [26, 4.74, 0.0], [21, 10.0, 8.0], [7, 0.43, 4.89], [23, 10.0, 0.0], [29, 10.0, 0.0], [16, 4.68, 7.81], [24, -0.16, 8.0], [12, 1.68, 8.0]], [0.0, 0.0, 10.0, 8.0]], [[26, 87057], [23, 349525], [29, 349525], [11, 524285], [7, 536146], [24, 699050], [27, 699050], [12, 716538], [16, 784767], [21, 1048575]]], [[[[17, 0.0, -4.0], [14, 0.0, -4.0], [28, 0.0, -4.0], [6, 0.0, 3.21], [9, 0.0, 20.07], [24, 0.0, -4.0], [27, 0.69, 27.28], [21, -0.16, 18.67], [23, 0.0, 19.8]], [0.0, -4.0, 0.0, 28.0]], [[14, 0], [17, 0], [24, 0], [28, 0], [6, 43048], [21, 565794], [23, 567938], [9, 655368], [27, 698496]]], [[[[8, -2.26, 8.0], [21, -4.59, 7.78], [28, 0.0, 1.24], [29, -4.93, 6.43], [11, -2.4, 8.0], [5, -9.98, 8.0], [7, 0.0, 0.0], [15, -9.58, 2.26], [22, -10.78, 0.0], [20, -10.0, 0.86]], [-10.0, 0.0, 0.0, 8.0]], [[22, 0], [20, 10408], [15, 134215], [7, 349525], [28, 382973], [5, 699054], [29, 920127], [21, 961611], [11, 1026798], [8, 1027050]]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| case 0 | [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 699050]] | [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 699050]] | Passed |
| case 1 | [[15, 81], [4, 283921], [3, 699050], [23, 703147]] | [[15, 81], [4, 283921], [3, 699050], [23, 703147]] | Passed |
| case 2 | [[29, 16839], [13, 699050]] | [[29, 16709], [13, 699050]] | Failed |
| case 3 | [[27, 780975], [20, 785407]] | [[27, 780975], [20, 785407]] | Passed |
| case 4 | [[16, 349525], [7, 358261]] | [[7, 349525], [16, 349525]] | Failed |
| case 5 | [[28, 180318], [6, 657954]] | [[28, 180318], [6, 657954]] | Passed |
| case 6 | [[10, 0], [12, 0], [15, 8874], [23, 141826], [21, 166536], [24, 699050]] | [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]] | Failed |
| case 7 | [[16, 164349], [12, 287121], [21, 360447], [8, 785406]] | [[16, 164008], [12, 287121], [21, 360447], [8, 785406]] | Failed |
SHA-256 / d0c7231af2618d0ae8345688a0da92a7dffd58ae592456d5020778ad89676f41
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 = [[[[[[29, 0.0, 10.76], [26, 0.0, 10.76], [13, 81.68, 0.0], [4, 0.0, 32.0], [10, 100.0, 0.3], [2, 71.74, 6.32]], [0.0, 0.0, 100.0, 32.0]], [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 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]]], [[[[27, 42.89, 8.0], [20, 51.81, 8.87]], [5.0, 0.0, 105.0, 8.0]], [[27, 780975], [20, 785407]]], [[[[7, 16.0, -4.65], [16, 16.22, -4.0]], [0.0, -4.0, 16.0, 4.0]], [[7, 349525], [16, 349525]]], [[[[6, -10.0, 6.42], [28, -7.78, 3.03]], [-10.0, 0.0, 6.0, 8.0]], [[28, 180318], [6, 657954]]], [[[[23, -10.0, 2.89], [10, -9.49, 0.0], [12, -10.79, 0.0], [24, -10.0, 8.0], [21, -10.0, 3.46], [15, -10.0, -0.74]], [-10.0, 0.0, -10.0, 8.0]], [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]]], [[[[21, 6.0, -0.03], [8, -2.52, 28.0], [12, 0.34, -1.72], [16, -10.48, 8.44]], [-10.0, -4.0, 6.0, 28.0]], [[16, 164008], [12, 287121], [21, 360447], [8, 785406]]]], [[[[[24, 18.92, 1.21], [28, 0.0, 4.0], [15, 88.88, -4.27], [6, 75.34, 2.92], [26, 85.85, -4.53], [7, 98.19, -2.3]], [0.0, -4.0, 100.0, 4.0]], [[26, 332885], [15, 344148], [7, 390867], [24, 578185], [28, 699050], [6, 993831]]], [[[[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]]], [[[[17, 0.31, 0.97], [20, 0.0, -4.0], [19, 0.21, -4.52], [12, 0.0, -1.71], [9, 0.0, 4.0]], [0.0, -4.0, 0.0, 4.0]], [[19, 0], [20, 0], [12, 133154], [17, 535200], [9, 699050]]], [[[[24, 54.6, 4.0], [1, 54.6, 4.0], [29, -10.0, -4.05], [13, -10.0, -4.0], [3, -10.0, -3.74], [12, -10.0, 4.82], [6, -10.0, -4.0], [7, 90.0, 4.0]], [-10.0, -4.0, 90.0, 4.0]], [[6, 0], [13, 0], [29, 0], [3, 2050], [12, 699050], [1, 977851], [24, 977851], [7, 1048575]]], [[[[17, 6.0, 23.49], [4, -10.0, 4.97], [14, -10.0, 11.29], [5, -10.0, 28.0], [27, 2.15, 28.38], [9, 6.0, -4.0], [3, 6.0, 13.56]], [-10.0, -4.0, 6.0, 28.0]], [[4, 131754], [14, 174210], [9, 349525], [5, 699050], [3, 876375], [17, 1015295], [27, 1026795]]], [[[[12, 101.57, 28.0], [2, 101.57, 28.0], [7, 71.05, 28.0], [19, 5.0, 28.0], [29, 105.0, 2.15]], [5.0, -4.0, 105.0, 28.0]], [[29, 390517], [19, 699050], [7, 978618], [2, 1047546], [12, 1047546]]], [[[[17, -10.0, 0.42], [11, -10.0, 0.42], [5, -10.73, 0.0], [24, -10.0, 0.0], [1, -9.52, 32.0], [19, -10.0, 27.12], [20, -10.0, 8.92]], [-10.0, 0.0, -10.0, 32.0]], [[5, 0], [24, 0], [11, 162], [17, 162], [20, 131746], [19, 665610], [1, 699050]]], [[[[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]]]], [[[[[18, 3.54, 4.0], [5, 4.61, 4.0], [6, 7.15, 4.0], [8, 6.15, 4.0]], [0.0, -4.0, 10.0, 4.0]], [[18, 769774], [5, 785386], [8, 966587], [6, 982010]]], [[[[10, -10.0, 27.45], [13, -10.0, 27.45], [2, -10.0, -4.0], [24, -10.0, -0.07], [7, -10.0, 28.0]], [-10.0, -4.0, -10.0, 28.0]], [[2, 0], [24, 10914], [10, 698536], [13, 698536], [7, 699050]]], [[[[6, 10.0, 8.0], [8, 10.0, 0.11], [20, 10.0, 4.45], [15, 3.12, 0.36]], [0.0, 0.0, 10.0, 8.0]], [[15, 69117], [8, 349693], [20, 876503], [6, 1048575]]], [[[[16, 56.84, 2.88], [5, 65.91, 8.0], [25, 6.98, 0.63], [13, 5.0, 8.0], [3, 26.28, 0.0], [15, 5.0, -0.81], [4, 105.0, 0.0], [17, 105.0, 0.0], [6, 13.5, 1.77]], [5.0, 0.0, 105.0, 8.0]], [[15, 0], [25, 8976], [3, 20801], [6, 47389], [4, 349525], [17, 349525], [16, 404228], [13, 699050], [5, 966399]]], [[[[20, 0.0, 0.82], [7, 0.0, 0.82], [22, -10.0, 3.54], [10, -8.22, 0.0], [14, -10.0, 6.39], [13, -4.48, 8.0], [15, -10.6, 5.53], [2, -10.0, 1.37]], [-10.0, 0.0, 0.0, 8.0]], [[10, 17684], [2, 34986], [22, 172066], [7, 359893], [20, 359893], [15, 565258], [14, 657922], [13, 962491]]], [[[[8, 1.97, -4.78], [27, 9.24, -2.19], [7, 0.0, -4.0]], [0.0, -4.0, 10.0, 4.0]], [[7, 0], [8, 20545], [27, 388398]]], [[[[25, 0.71, -4.92], [3, 0.0, 4.0], [14, 0.94, 4.27], [19, -0.4, 2.92], [28, -0.71, 4.0], [9, 5.44, 3.44]], [0.0, -4.0, 10.0, 4.0]], [[25, 4160], [19, 666146], [3, 699050], [28, 699050], [14, 704170], [9, 954065]]], [[[[29, 5.0, 4.73], [15, 16.49, -1.96], [3, 9.85, 4.0], [20, 16.44, 0.26], [28, 5.0, -1.62], [19, 16.73, 4.0], [8, 5.0, -4.51]], [5.0, -4.0, 21.0, 4.0]], [[8, 0], [28, 133632], [15, 414071], [29, 699050], [3, 765886], [20, 809298], [19, 982782]]]], [[[[[25, 69.59, 21.33], [1, 5.0, 28.0], [16, 15.52, 18.84], [27, 17.38, 7.05]], [5.0, -4.0, 105.0, 28.0]], [[27, 146774], [16, 571085], [1, 699050], [25, 936345]]], [[[[10, 0.0, -4.0], [18, 0.0, 1.87], [11, 10.24, 4.0], [17, 13.44, 4.0], [20, 15.66, 4.0], [2, 0.0, -1.78], [8, 16.0, -4.0], [4, 16.0, -2.59], [14, 5.21, -4.41], [21, 9.67, -4.0]], [0.0, -4.0, 16.0, 4.0]], [[10, 0], [14, 69713], [2, 131744], [21, 267332], [8, 349525], [4, 384885], [18, 567466], [11, 977663], [17, 1031162], [20, 1048302]]], [[[[2, 5.0, 0.0], [17, 5.0, 0.0], [19, 16.36, 1.31], [8, 4.99, 8.0], [27, 21.0, 8.0], [28, 18.96, 6.39]], [5.0, 0.0, 21.0, 8.0]], [[2, 0], [17, 0], [19, 317759], [8, 699050], [28, 991059], [27, 1048575]]], [[[[21, 13.34, 0.23], [8, 13.34, 0.23], [28, 13.33, 8.0], [1, 15.0, 5.19], [14, 4.58, 8.0], [13, 15.0, 8.0], [23, 15.5, 8.91], [19, 15.0, 4.94], [18, 7.91, 0.0]], [5.0, 0.0, 15.0, 8.0]], [[18, 66625], [8, 332726], [21, 332726], [14, 699050], [19, 884693], [1, 907221], [28, 1031098], [13, 1048575], [23, 1048575]]], [[[[2, 100.0, 4.0], [14, 19.7, 0.88], [25, 27.6, -2.94]], [0.0, -4.0, 100.0, 4.0]], [[25, 98670], [14, 555585], [2, 1048575]]], [[[[24, 6.0, 28.0], [15, 6.0, 28.0], [21, -10.0, 17.05], [12, -8.8, 19.12], [25, -5.09, 22.05]], [-10.0, -4.0, 6.0, 28.0]], [[21, 559106], [12, 571482], [25, 730438], [15, 1048575], [24, 1048575]]], [[[[15, 34.3, 7.41], [12, 34.3, 7.41], [4, -5.23, 1.64], [13, 90.0, 8.0], [2, 90.0, 8.0], [11, 32.52, 7.96], [22, 90.0, 7.07], [5, 73.63, 3.33], [9, 4.21, 8.0], [10, 61.24, 2.86]], [-10.0, 0.0, 90.0, 8.0]], [[4, 42754], [10, 424425], [5, 498120], [9, 715691], [12, 776753], [15, 776753], [11, 782221], [22, 1037781], [2, 1048575], [13, 1048575]]], [[[[5, -0.18, 28.0], [29, 16.0, 0.87], [16, 0.0, -4.0], [23, 15.26, -4.0], [24, 10.31, 28.0], [20, 15.76, 28.0], [12, 4.35, -4.0], [8, 13.87, 14.59], [4, 0.0, -4.0], [7, 0.0, 27.51]], [0.0, -4.0, 16.0, 28.0]], [[4, 0], [16, 0], [12, 65812], [23, 348416], [29, 382943], [7, 698880], [5, 699050], [8, 866077], [24, 977839], [20, 1048490]]]], [[[[[10, 5.0, 5.3], [29, 14.7, 25.88], [7, 4.37, 32.0], [6, 5.0, 0.0], [23, 6.09, 2.22], [20, 10.74, 32.0], [11, 15.0, 23.32], [14, 5.0, 19.76]], [5.0, 0.0, 15.0, 32.0]], [[6, 0], [23, 13439], [10, 34946], [14, 535168], [7, 699050], [11, 916957], [20, 965359], [29, 1007265]]], [[[[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]]], [[[[13, 15.0, 11.38], [18, 15.0, 28.0], [6, 14.52, 4.53], [5, 14.55, 28.0], [20, 13.11, 28.0], [16, 5.89, 1.96], [15, 5.0, -4.0], [10, 9.17, 28.0], [23, 14.46, 15.77], [19, 15.52, -4.0], [17, 10.19, 28.0]], [5.0, -4.0, 15.0, 28.0]], [[15, 0], [16, 39917], [19, 349525], [6, 479828], [13, 523765], [10, 782063], [23, 883392], [17, 961455], [20, 1028094], [5, 1047467], [18, 1048575]]], [[[[6, -10.0, 1.87], [22, -10.0, 1.87], [18, -10.0, 19.83], [27, -7.05, 6.24], [13, -7.53, 27.93], [8, -8.41, -0.77], [23, -10.0, 0.56]], [-10.0, 0.0, 6.0, 32.0]], [[23, 514], [6, 2698], [22, 2698], [8, 5137], [27, 58746], [18, 535176], [13, 682998]]], [[[[27, 1.75, 8.0], [28, 0.0, -0.68], [22, 0.0, 5.11], [12, 16.0, 8.0], [1, 9.94, 2.97], [8, 0.0, 0.0]], [0.0, 0.0, 16.0, 8.0]], [[8, 0], [28, 0], [1, 409584], [22, 557224], [27, 704426], [12, 1048575]]], [[[[27, 0.0, 8.0], [11, 10.0, 3.99], [26, 4.74, 0.0], [21, 10.0, 8.0], [7, 0.43, 4.89], [23, 10.0, 0.0], [29, 10.0, 0.0], [16, 4.68, 7.81], [24, -0.16, 8.0], [12, 1.68, 8.0]], [0.0, 0.0, 10.0, 8.0]], [[26, 87057], [23, 349525], [29, 349525], [11, 524285], [7, 536146], [24, 699050], [27, 699050], [12, 716538], [16, 784767], [21, 1048575]]], [[[[17, 0.0, -4.0], [14, 0.0, -4.0], [28, 0.0, -4.0], [6, 0.0, 3.21], [9, 0.0, 20.07], [24, 0.0, -4.0], [27, 0.69, 27.28], [21, -0.16, 18.67], [23, 0.0, 19.8]], [0.0, -4.0, 0.0, 28.0]], [[14, 0], [17, 0], [24, 0], [28, 0], [6, 43048], [21, 565794], [23, 567938], [9, 655368], [27, 698496]]], [[[[8, -2.26, 8.0], [21, -4.59, 7.78], [28, 0.0, 1.24], [29, -4.93, 6.43], [11, -2.4, 8.0], [5, -9.98, 8.0], [7, 0.0, 0.0], [15, -9.58, 2.26], [22, -10.78, 0.0], [20, -10.0, 0.86]], [-10.0, 0.0, 0.0, 8.0]], [[22, 0], [20, 10408], [15, 134215], [7, 349525], [28, 382973], [5, 699054], [29, 920127], [21, 961611], [11, 1026798], [8, 1027050]]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| case 0 | [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 699050]] | [[26, 139904], [29, 139904], [2, 324060], [13, 331792], [10, 349655], [4, 699050]] | Passed |
| case 1 | [[15, 81], [4, 283921], [3, 699050], [23, 703147]] | [[15, 81], [4, 283921], [3, 699050], [23, 703147]] | Passed |
| case 2 | [[29, 16709], [13, 699050]] | [[29, 16709], [13, 699050]] | Passed |
| case 3 | [[27, 780975], [20, 785407]] | [[27, 780975], [20, 785407]] | Passed |
| case 4 | [[7, 349525], [16, 349525]] | [[7, 349525], [16, 349525]] | Passed |
| case 5 | [[28, 180318], [6, 657954]] | [[28, 180318], [6, 657954]] | Passed |
| case 6 | [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]] | [[10, 0], [12, 0], [15, 0], [23, 141826], [21, 166536], [24, 699050]] | Passed |
| case 7 | [[16, 164008], [12, 287121], [21, 360447], [8, 785406]] | [[16, 164008], [12, 287121], [21, 360447], [8, 785406]] | Passed |
SHA-256 / 5380efd5e7739d205ff68e63624399b2813324c8b02070d08643add6066b3e37
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:00.283750+00:00.
Case digest / 38f07f24eb4e2148c3d42242ae68f820d66b170e23dbb92be6e61b74a8d8f692