FA-87491 / Collision detection broadphase / Open access
Child node origins are laid out column-major while indices are row-major · case 01
Objects are stored in a child covering the wrong region and queries miss them.
ROOT CAUSE
Child k uses x offset k//2 and y offset k%2.
THE FAILURE
Child k uses x offset k//2 and y offset k%2.
Unsuccessful approach: Using k%2 for both offsets collapses two quadrants onto the diagonal.
Case contract
solve(objs, cap, max_depth, q): quadtree over [0,16]^2. Insert [id,minx,miny,maxx,maxy] in order. A node splits when it holds more than cap objects and depth<max_depth; children are ordered cy*2+cx. An object goes to a child only if it fits entirely: maxx<mid -> left, minx>=mid -> right (same for y); straddlers stay. On split all node objects are re-inserted. Query returns [sorted ids of objects in nodes whose closed bounds overlap q, total node count, max depth].
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(objs, cap, max_depth, q):
def make(x, y, s, d):
return {'x': x, 'y': y, 's': s, 'd': d, 'objs': [], 'kids': None}
def child_index(n, o):
h = n['s'] / 2
mx, my = n['x'] + h, n['y'] + h
if o[3] < mx:
cx = 0
elif o[1] >= mx:
cx = 1
else:
return -1
if o[4] < my:
cy = 0
elif o[2] >= my:
cy = 1
else:
return -1
return cy * 2 + cx
def split(n):
h = n['s'] / 2
n['kids'] = [make(n['x'] + (k // 2) * h, n['y'] + (k % 2) * h, h, n['d'] + 1) for k in range(4)]
old, n['objs'] = n['objs'], []
for o in old:
insert(n, o)
def insert(n, o):
if n['kids'] is not None:
k = child_index(n, o)
if k >= 0:
insert(n['kids'][k], o)
return
n['objs'].append(o)
if n['kids'] is None and len(n['objs']) > cap and n['d'] < max_depth:
split(n)
root = make(0, 0, 16, 0)
for o in objs:
insert(root, o)
found, count, deep = [], 0, 0
stack = [root]
while stack:
n = stack.pop()
count += 1
deep = max(deep, n['d'])
if n['kids']:
stack.extend(n['kids'])
if n['x'] <= q[2] and q[0] <= n['x'] + n['s'] and n['y'] <= q[3] and q[1] <= n['y'] + n['s']:
found.extend(o[0] for o in n['objs'])
return [sorted(found), count, deep]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, 1, 11, 3, 11], [44, 11, 8, 12, 9], [49, 10, 8, 11, 9], [19, 0, 12, 1, 12]], 2, 2, [8, 9, 12, 14]], [[5, 19, 44, 49], 5, 1]], [[[[41, 4, 10, 5, 12], [18, 13, 15, 14, 15], [8, 15, 2, 16, 5], [21, 13, 14, 14, 16], [43, 10, 4, 13, 6], [1, 8, 15, 9, 16]], 1, 3, [9, 8, 10, 12]], [[1, 8, 43], 17, 3]], [[[[3, 15, 7, 16, 7], [5, 1, 8, 3, 10], [28, 2, 13, 3, 14], [8, 13, 13, 14, 14], [16, 8, 14, 11, 16], [42, 11, 14, 14, 14], [17, 0, 15, 1, 15]], 1, 1, [3, 9, 5, 14]], [[5, 17, 28], 5, 1]], [[[[25, 14, 12, 16, 13], [7, 2, 13, 3, 14], [22, 7, 4, 7, 5], [33, 9, 9, 11, 11]], 1, 3, [5, 1, 5, 2]], [[22], 9, 2]], [[[[7, 15, 7, 16, 9], [25, 3, 3, 6, 4], [9, 0, 4, 3, 6], [15, 11, 10, 14, 10]], 3, 2, [9, 10, 13, 13]], [[7, 15], 5, 1]], [[[[2, 8, 0, 10, 1], [48, 2, 13, 2, 16], [16, 0, 6, 3, 8], [24, 0, 15, 1, 16], [21, 6, 1, 9, 4], [20, 10, 5, 11, 8], [9, 6, 7, 6, 7]], 2, 2, [7, 1, 12, 3]], [[2, 9, 16, 20, 21], 5, 1]], [[[[8, 4, 3, 5, 5], [30, 7, 3, 8, 5], [26, 10, 12, 13, 14], [37, 7, 5, 10, 8], [47, 1, 9, 4, 10], [42, 5, 8, 5, 9], [36, 15, 14, 16, 16]], 1, 2, [8, 5, 13, 7]], [[8, 30, 37], 13, 2]], [[[[42, 6, 14, 7, 16], [40, 13, 14, 13, 16]], 1, 3, [8, 6, 13, 7]], [[], 5, 1]]], [[[[[18, 13, 7, 13, 9], [37, 13, 0, 14, 1], [36, 5, 15, 8, 16], [44, 10, 5, 12, 5], [15, 5, 15, 7, 16], [45, 10, 10, 12, 12], [17, 3, 15, 6, 16], [43, 9, 7, 12, 9], [28, 7, 4, 8, 4]], 3, 1, [6, 7, 10, 9]], [[15, 17, 18, 28, 36, 37, 43, 44, 45], 5, 1]], [[[[37, 6, 12, 7, 15], [36, 13, 15, 16, 16], [24, 9, 12, 12, 15]], 3, 2, [8, 8, 13, 13]], [[24, 36, 37], 1, 0]], [[[[45, 15, 11, 16, 11], [24, 11, 4, 12, 5], [3, 1, 6, 1, 9], [37, 12, 8, 15, 11], [44, 7, 10, 9, 11], [9, 13, 4, 16, 5], [27, 11, 11, 11, 14]], 1, 3, [7, 13, 9, 15]], [[3, 27, 44], 17, 3]], [[[[44, 4, 13, 6, 13], [34, 7, 8, 8, 11], [5, 6, 8, 7, 10], [32, 0, 9, 3, 12], [47, 5, 0, 7, 1], [8, 13, 1, 13, 1], [1, 10, 15, 11, 16], [30, 0, 10, 3, 13], [45, 3, 7, 4, 7]], 2, 3, [2, 6, 6, 7]], [[34, 45, 47], 9, 2]], [[[[30, 13, 11, 14, 11], [37, 9, 10, 12, 13], [17, 4, 10, 5, 13], [2, 8, 8, 8, 11], [27, 12, 0, 12, 0], [31, 2, 3, 3, 4]], 1, 2, [11, 4, 12, 6]], [[27], 9, 2]], [[[[17, 15, 0, 15, 0], [8, 3, 11, 5, 11], [2, 13, 1, 13, 2], [37, 4, 11, 4, 12], [28, 3, 7, 6, 8], [30, 15, 3, 16, 4], [11, 1, 2, 1, 4]], 2, 3, [6, 11, 7, 16]], [[8, 28, 37], 9, 2]], [[[[16, 3, 0, 5, 3], [33, 4, 15, 7, 16], [42, 9, 9, 11, 11], [10, 11, 6, 14, 7], [29, 12, 11, 14, 11]], 3, 1, [5, 10, 6, 10]], [[33], 5, 1]], [[[[28, 8, 6, 10, 6], [2, 15, 11, 16, 14], [46, 11, 3, 12, 6], [48, 6, 1, 9, 1], [42, 6, 5, 7, 6], [20, 6, 0, 6, 0], [7, 15, 4, 16, 5], [25, 4, 15, 4, 16]], 1, 1, [2, 5, 6, 7]], [[20, 42, 48], 5, 1]]], [[[[[23, 8, 12, 9, 13], [11, 5, 4, 8, 6], [13, 4, 4, 4, 4], [40, 4, 5, 6, 5], [28, 15, 10, 16, 10], [14, 5, 14, 7, 16]], 3, 2, [2, 1, 4, 1]], [[11, 13, 40], 5, 1]], [[[[24, 7, 9, 7, 12], [27, 7, 14, 10, 15], [4, 6, 10, 8, 12]], 1, 2, [4, 10, 6, 10]], [[4, 24, 27], 5, 1]], [[[[15, 10, 8, 13, 11], [12, 14, 4, 16, 5], [28, 15, 13, 16, 13], [5, 3, 1, 4, 4], [29, 3, 0, 6, 2], [14, 6, 11, 8, 11], [37, 3, 11, 4, 13], [26, 13, 11, 15, 13], [35, 13, 9, 16, 12], [9, 15, 9, 16, 12]], 1, 1, [9, 14, 14, 18]], [[9, 14, 15, 26, 28, 35], 5, 1]], [[[[8, 15, 5, 16, 6], [23, 12, 4, 12, 5], [39, 8, 1, 8, 1], [41, 13, 11, 15, 14], [27, 12, 11, 12, 12]], 1, 2, [8, 3, 10, 8]], [[27, 39, 41], 13, 2]], [[[[42, 4, 12, 4, 15], [5, 15, 7, 15, 8], [35, 10, 5, 11, 5], [16, 2, 12, 4, 15], [39, 6, 12, 8, 15], [40, 15, 14, 16, 16], [33, 13, 7, 14, 9], [46, 9, 13, 9, 16]], 2, 1, [9, 1, 13, 6]], [[5, 33, 35, 39], 5, 1]], [[[[17, 1, 13, 1, 15], [4, 12, 5, 14, 8], [42, 0, 3, 1, 5], [1, 15, 3, 16, 3]], 2, 1, [13, 14, 18, 18]], [[4], 5, 1]], [[[[42, 9, 3, 10, 5], [26, 12, 6, 14, 7], [12, 15, 5, 16, 7], [28, 0, 7, 0, 8], [3, 1, 10, 3, 13], [22, 0, 11, 0, 14], [13, 5, 1, 8, 2], [45, 5, 7, 6, 10], [40, 13, 2, 14, 5]], 3, 3, [12, 11, 15, 11]], [[13, 28, 45], 9, 2]], [[[[31, 9, 1, 11, 1], [18, 6, 9, 9, 9], [28, 4, 7, 5, 8]], 2, 3, [14, 6, 16, 10]], [[18, 28, 31], 5, 1]]], [[[[[12, 15, 3, 16, 4], [5, 7, 11, 9, 14], [24, 9, 4, 11, 7]], 2, 2, [14, 5, 17, 10]], [[5, 12, 24], 5, 1]], [[[[46, 12, 14, 13, 15], [30, 1, 6, 2, 7], [2, 8, 0, 10, 0], [4, 15, 12, 15, 14], [24, 12, 5, 14, 5], [31, 2, 15, 2, 15]], 2, 3, [10, 11, 14, 14]], [[4, 46], 5, 1]], [[[[30, 5, 1, 5, 3], [15, 13, 14, 13, 16], [18, 15, 10, 16, 10]], 1, 1, [2, 3, 4, 4]], [[30], 5, 1]], [[[[32, 4, 11, 6, 14], [9, 2, 6, 5, 8], [21, 7, 5, 8, 8], [25, 2, 4, 3, 6], [17, 5, 5, 6, 6], [23, 1, 8, 4, 8], [4, 6, 11, 9, 13], [41, 0, 5, 1, 7], [33, 14, 10, 15, 10], [14, 14, 4, 15, 7]], 1, 1, [5, 8, 9, 10]], [[4, 9, 14, 17, 21, 23, 25, 32, 33, 41], 5, 1]], [[[[3, 14, 5, 15, 7], [29, 15, 0, 16, 1], [25, 1, 10, 1, 12], [10, 6, 14, 6, 16], [27, 5, 6, 5, 9], [43, 0, 10, 3, 13], [33, 4, 9, 7, 9], [45, 9, 4, 11, 7], [18, 8, 14, 11, 15], [28, 11, 9, 12, 10]], 1, 1, [8, 9, 11, 10]], [[10, 18, 25, 27, 28, 33, 43], 5, 1]], [[[[28, 4, 4, 4, 7], [24, 7, 10, 9, 12], [14, 5, 5, 7, 6], [49, 6, 0, 7, 3], [20, 6, 10, 7, 13], [13, 1, 8, 3, 10], [3, 10, 12, 10, 13], [36, 2, 5, 5, 7], [38, 11, 11, 14, 14], [40, 10, 5, 12, 6], [25, 14, 11, 16, 12]], 3, 2, [13, 13, 17, 14]], [[3, 24, 25, 38], 9, 2]], [[[[8, 3, 4, 3, 5], [37, 2, 9, 2, 9], [18, 9, 12, 10, 13], [6, 11, 7, 14, 10], [36, 0, 5, 1, 5], [25, 5, 2, 6, 5], [2, 3, 1, 3, 4], [39, 2, 11, 4, 12]], 1, 3, [0, 5, 2, 10]], [[2, 6, 8, 25, 36, 37, 39], 17, 3]], [[[[28, 6, 13, 6, 15], [12, 0, 1, 0, 3], [30, 1, 2, 2, 2], [9, 14, 12, 16, 13], [7, 5, 11, 8, 12]], 1, 3, [8, 2, 12, 3]], [[7], 13, 3]]], [[[[[41, 10, 13, 10, 13], [4, 5, 13, 5, 14], [36, 10, 15, 12, 16], [35, 5, 5, 7, 6], [47, 9, 4, 10, 5], [27, 10, 14, 13, 14], [13, 8, 8, 10, 10], [15, 6, 14, 8, 14], [11, 11, 3, 13, 4]], 2, 2, [7, 2, 7, 7]], [[15, 35], 9, 2]], [[[[49, 11, 1, 11, 4], [4, 9, 14, 12, 16], [3, 1, 4, 2, 7], [11, 10, 4, 10, 5], [25, 6, 12, 9, 12], [26, 11, 14, 13, 15], [36, 3, 14, 6, 16], [18, 3, 1, 3, 2], [6, 15, 5, 16, 7], [31, 3, 11, 3, 12], [40, 2, 6, 4, 9]], 3, 3, [11, 14, 15, 14]], [[4, 25, 26, 40], 5, 1]], [[[[34, 13, 8, 16, 9], [35, 0, 9, 2, 12], [8, 11, 12, 13, 13], [43, 12, 9, 15, 9], [42, 12, 3, 15, 5], [21, 13, 3, 13, 3], [27, 12, 0, 12, 3], [37, 6, 2, 8, 5], [25, 0, 9, 2, 12]], 2, 3, [10, 6, 10, 11]], [[8, 37, 42], 13, 2]], [[[[37, 6, 14, 6, 16], [40, 1, 4, 3, 4]], 3, 3, [5, 10, 6, 10]], [[37, 40], 1, 0]], [[[[27, 4, 14, 7, 14], [36, 6, 1, 8, 4], [10, 8, 9, 10, 11], [15, 13, 4, 13, 5], [24, 9, 5, 12, 7], [48, 11, 0, 14, 1], [20, 5, 6, 7, 9], [47, 1, 11, 1, 12]], 3, 3, [6, 7, 6, 7]], [[20, 36], 5, 1]], [[[[12, 12, 2, 13, 3], [39, 8, 10, 9, 10], [18, 7, 1, 7, 3]], 2, 3, [8, 12, 9, 16]], [[39], 5, 1]], [[[[40, 14, 12, 14, 13], [36, 3, 9, 5, 9], [27, 1, 0, 1, 3], [22, 0, 9, 2, 12], [9, 7, 11, 7, 12], [6, 10, 7, 12, 8]], 1, 1, [4, 10, 5, 10]], [[6, 9, 22, 36], 5, 1]], [[[[45, 11, 12, 11, 14], [46, 10, 11, 11, 14], [5, 14, 10, 16, 12], [25, 13, 4, 14, 5], [14, 1, 4, 4, 6], [33, 11, 10, 11, 10]], 2, 2, [11, 14, 11, 18]], [[5, 45, 46], 9, 2]]]]
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 | [[44, 49], 5, 1] | [[5, 19, 44, 49], 5, 1] | Failed |
| case 1 | [[41], 21, 3] | [[1, 8, 43], 17, 3] | Failed |
| case 2 | [[3], 5, 1] | [[5, 17, 28], 5, 1] | Failed |
| case 3 | [[22], 9, 2] | [[22], 9, 2] | Passed |
| case 4 | [[7, 15], 5, 1] | [[7, 15], 5, 1] | Passed |
| case 5 | [[9, 16, 20, 21, 24, 48], 5, 1] | [[2, 9, 16, 20, 21], 5, 1] | Failed |
| case 6 | [[8, 30, 37], 13, 2] | [[8, 30, 37], 13, 2] | Passed |
| case 7 | [[42], 5, 1] | [[], 5, 1] | Failed |
SHA-256 / 022af507efd60291c32679ca76dcf37e64e8d475573e5081f8e67c233fee737c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(objs, cap, max_depth, q):
def make(x, y, s, d):
return {'x': x, 'y': y, 's': s, 'd': d, 'objs': [], 'kids': None}
def child_index(n, o):
h = n['s'] / 2
mx, my = n['x'] + h, n['y'] + h
if o[3] < mx:
cx = 0
elif o[1] >= mx:
cx = 1
else:
return -1
if o[4] < my:
cy = 0
elif o[2] >= my:
cy = 1
else:
return -1
return cy * 2 + cx
def split(n):
h = n['s'] / 2
n['kids'] = [make(n['x'] + (k % 2) * h, n['y'] + (k % 2) * h, h, n['d'] + 1) for k in range(4)]
old, n['objs'] = n['objs'], []
for o in old:
insert(n, o)
def insert(n, o):
if n['kids'] is not None:
k = child_index(n, o)
if k >= 0:
insert(n['kids'][k], o)
return
n['objs'].append(o)
if n['kids'] is None and len(n['objs']) > cap and n['d'] < max_depth:
split(n)
root = make(0, 0, 16, 0)
for o in objs:
insert(root, o)
found, count, deep = [], 0, 0
stack = [root]
while stack:
n = stack.pop()
count += 1
deep = max(deep, n['d'])
if n['kids']:
stack.extend(n['kids'])
if n['x'] <= q[2] and q[0] <= n['x'] + n['s'] and n['y'] <= q[3] and q[1] <= n['y'] + n['s']:
found.extend(o[0] for o in n['objs'])
return [sorted(found), count, deep]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[[5, 1, 11, 3, 11], [44, 11, 8, 12, 9], [49, 10, 8, 11, 9], [19, 0, 12, 1, 12]], 2, 2, [8, 9, 12, 14]], [[5, 19, 44, 49], 5, 1]], [[[[41, 4, 10, 5, 12], [18, 13, 15, 14, 15], [8, 15, 2, 16, 5], [21, 13, 14, 14, 16], [43, 10, 4, 13, 6], [1, 8, 15, 9, 16]], 1, 3, [9, 8, 10, 12]], [[1, 8, 43], 17, 3]], [[[[3, 15, 7, 16, 7], [5, 1, 8, 3, 10], [28, 2, 13, 3, 14], [8, 13, 13, 14, 14], [16, 8, 14, 11, 16], [42, 11, 14, 14, 14], [17, 0, 15, 1, 15]], 1, 1, [3, 9, 5, 14]], [[5, 17, 28], 5, 1]], [[[[25, 14, 12, 16, 13], [7, 2, 13, 3, 14], [22, 7, 4, 7, 5], [33, 9, 9, 11, 11]], 1, 3, [5, 1, 5, 2]], [[22], 9, 2]], [[[[7, 15, 7, 16, 9], [25, 3, 3, 6, 4], [9, 0, 4, 3, 6], [15, 11, 10, 14, 10]], 3, 2, [9, 10, 13, 13]], [[7, 15], 5, 1]], [[[[2, 8, 0, 10, 1], [48, 2, 13, 2, 16], [16, 0, 6, 3, 8], [24, 0, 15, 1, 16], [21, 6, 1, 9, 4], [20, 10, 5, 11, 8], [9, 6, 7, 6, 7]], 2, 2, [7, 1, 12, 3]], [[2, 9, 16, 20, 21], 5, 1]], [[[[8, 4, 3, 5, 5], [30, 7, 3, 8, 5], [26, 10, 12, 13, 14], [37, 7, 5, 10, 8], [47, 1, 9, 4, 10], [42, 5, 8, 5, 9], [36, 15, 14, 16, 16]], 1, 2, [8, 5, 13, 7]], [[8, 30, 37], 13, 2]], [[[[42, 6, 14, 7, 16], [40, 13, 14, 13, 16]], 1, 3, [8, 6, 13, 7]], [[], 5, 1]]], [[[[[18, 13, 7, 13, 9], [37, 13, 0, 14, 1], [36, 5, 15, 8, 16], [44, 10, 5, 12, 5], [15, 5, 15, 7, 16], [45, 10, 10, 12, 12], [17, 3, 15, 6, 16], [43, 9, 7, 12, 9], [28, 7, 4, 8, 4]], 3, 1, [6, 7, 10, 9]], [[15, 17, 18, 28, 36, 37, 43, 44, 45], 5, 1]], [[[[37, 6, 12, 7, 15], [36, 13, 15, 16, 16], [24, 9, 12, 12, 15]], 3, 2, [8, 8, 13, 13]], [[24, 36, 37], 1, 0]], [[[[45, 15, 11, 16, 11], [24, 11, 4, 12, 5], [3, 1, 6, 1, 9], [37, 12, 8, 15, 11], [44, 7, 10, 9, 11], [9, 13, 4, 16, 5], [27, 11, 11, 11, 14]], 1, 3, [7, 13, 9, 15]], [[3, 27, 44], 17, 3]], [[[[44, 4, 13, 6, 13], [34, 7, 8, 8, 11], [5, 6, 8, 7, 10], [32, 0, 9, 3, 12], [47, 5, 0, 7, 1], [8, 13, 1, 13, 1], [1, 10, 15, 11, 16], [30, 0, 10, 3, 13], [45, 3, 7, 4, 7]], 2, 3, [2, 6, 6, 7]], [[34, 45, 47], 9, 2]], [[[[30, 13, 11, 14, 11], [37, 9, 10, 12, 13], [17, 4, 10, 5, 13], [2, 8, 8, 8, 11], [27, 12, 0, 12, 0], [31, 2, 3, 3, 4]], 1, 2, [11, 4, 12, 6]], [[27], 9, 2]], [[[[17, 15, 0, 15, 0], [8, 3, 11, 5, 11], [2, 13, 1, 13, 2], [37, 4, 11, 4, 12], [28, 3, 7, 6, 8], [30, 15, 3, 16, 4], [11, 1, 2, 1, 4]], 2, 3, [6, 11, 7, 16]], [[8, 28, 37], 9, 2]], [[[[16, 3, 0, 5, 3], [33, 4, 15, 7, 16], [42, 9, 9, 11, 11], [10, 11, 6, 14, 7], [29, 12, 11, 14, 11]], 3, 1, [5, 10, 6, 10]], [[33], 5, 1]], [[[[28, 8, 6, 10, 6], [2, 15, 11, 16, 14], [46, 11, 3, 12, 6], [48, 6, 1, 9, 1], [42, 6, 5, 7, 6], [20, 6, 0, 6, 0], [7, 15, 4, 16, 5], [25, 4, 15, 4, 16]], 1, 1, [2, 5, 6, 7]], [[20, 42, 48], 5, 1]]], [[[[[23, 8, 12, 9, 13], [11, 5, 4, 8, 6], [13, 4, 4, 4, 4], [40, 4, 5, 6, 5], [28, 15, 10, 16, 10], [14, 5, 14, 7, 16]], 3, 2, [2, 1, 4, 1]], [[11, 13, 40], 5, 1]], [[[[24, 7, 9, 7, 12], [27, 7, 14, 10, 15], [4, 6, 10, 8, 12]], 1, 2, [4, 10, 6, 10]], [[4, 24, 27], 5, 1]], [[[[15, 10, 8, 13, 11], [12, 14, 4, 16, 5], [28, 15, 13, 16, 13], [5, 3, 1, 4, 4], [29, 3, 0, 6, 2], [14, 6, 11, 8, 11], [37, 3, 11, 4, 13], [26, 13, 11, 15, 13], [35, 13, 9, 16, 12], [9, 15, 9, 16, 12]], 1, 1, [9, 14, 14, 18]], [[9, 14, 15, 26, 28, 35], 5, 1]], [[[[8, 15, 5, 16, 6], [23, 12, 4, 12, 5], [39, 8, 1, 8, 1], [41, 13, 11, 15, 14], [27, 12, 11, 12, 12]], 1, 2, [8, 3, 10, 8]], [[27, 39, 41], 13, 2]], [[[[42, 4, 12, 4, 15], [5, 15, 7, 15, 8], [35, 10, 5, 11, 5], [16, 2, 12, 4, 15], [39, 6, 12, 8, 15], [40, 15, 14, 16, 16], [33, 13, 7, 14, 9], [46, 9, 13, 9, 16]], 2, 1, [9, 1, 13, 6]], [[5, 33, 35, 39], 5, 1]], [[[[17, 1, 13, 1, 15], [4, 12, 5, 14, 8], [42, 0, 3, 1, 5], [1, 15, 3, 16, 3]], 2, 1, [13, 14, 18, 18]], [[4], 5, 1]], [[[[42, 9, 3, 10, 5], [26, 12, 6, 14, 7], [12, 15, 5, 16, 7], [28, 0, 7, 0, 8], [3, 1, 10, 3, 13], [22, 0, 11, 0, 14], [13, 5, 1, 8, 2], [45, 5, 7, 6, 10], [40, 13, 2, 14, 5]], 3, 3, [12, 11, 15, 11]], [[13, 28, 45], 9, 2]], [[[[31, 9, 1, 11, 1], [18, 6, 9, 9, 9], [28, 4, 7, 5, 8]], 2, 3, [14, 6, 16, 10]], [[18, 28, 31], 5, 1]]], [[[[[12, 15, 3, 16, 4], [5, 7, 11, 9, 14], [24, 9, 4, 11, 7]], 2, 2, [14, 5, 17, 10]], [[5, 12, 24], 5, 1]], [[[[46, 12, 14, 13, 15], [30, 1, 6, 2, 7], [2, 8, 0, 10, 0], [4, 15, 12, 15, 14], [24, 12, 5, 14, 5], [31, 2, 15, 2, 15]], 2, 3, [10, 11, 14, 14]], [[4, 46], 5, 1]], [[[[30, 5, 1, 5, 3], [15, 13, 14, 13, 16], [18, 15, 10, 16, 10]], 1, 1, [2, 3, 4, 4]], [[30], 5, 1]], [[[[32, 4, 11, 6, 14], [9, 2, 6, 5, 8], [21, 7, 5, 8, 8], [25, 2, 4, 3, 6], [17, 5, 5, 6, 6], [23, 1, 8, 4, 8], [4, 6, 11, 9, 13], [41, 0, 5, 1, 7], [33, 14, 10, 15, 10], [14, 14, 4, 15, 7]], 1, 1, [5, 8, 9, 10]], [[4, 9, 14, 17, 21, 23, 25, 32, 33, 41], 5, 1]], [[[[3, 14, 5, 15, 7], [29, 15, 0, 16, 1], [25, 1, 10, 1, 12], [10, 6, 14, 6, 16], [27, 5, 6, 5, 9], [43, 0, 10, 3, 13], [33, 4, 9, 7, 9], [45, 9, 4, 11, 7], [18, 8, 14, 11, 15], [28, 11, 9, 12, 10]], 1, 1, [8, 9, 11, 10]], [[10, 18, 25, 27, 28, 33, 43], 5, 1]], [[[[28, 4, 4, 4, 7], [24, 7, 10, 9, 12], [14, 5, 5, 7, 6], [49, 6, 0, 7, 3], [20, 6, 10, 7, 13], [13, 1, 8, 3, 10], [3, 10, 12, 10, 13], [36, 2, 5, 5, 7], [38, 11, 11, 14, 14], [40, 10, 5, 12, 6], [25, 14, 11, 16, 12]], 3, 2, [13, 13, 17, 14]], [[3, 24, 25, 38], 9, 2]], [[[[8, 3, 4, 3, 5], [37, 2, 9, 2, 9], [18, 9, 12, 10, 13], [6, 11, 7, 14, 10], [36, 0, 5, 1, 5], [25, 5, 2, 6, 5], [2, 3, 1, 3, 4], [39, 2, 11, 4, 12]], 1, 3, [0, 5, 2, 10]], [[2, 6, 8, 25, 36, 37, 39], 17, 3]], [[[[28, 6, 13, 6, 15], [12, 0, 1, 0, 3], [30, 1, 2, 2, 2], [9, 14, 12, 16, 13], [7, 5, 11, 8, 12]], 1, 3, [8, 2, 12, 3]], [[7], 13, 3]]], [[[[[41, 10, 13, 10, 13], [4, 5, 13, 5, 14], [36, 10, 15, 12, 16], [35, 5, 5, 7, 6], [47, 9, 4, 10, 5], [27, 10, 14, 13, 14], [13, 8, 8, 10, 10], [15, 6, 14, 8, 14], [11, 11, 3, 13, 4]], 2, 2, [7, 2, 7, 7]], [[15, 35], 9, 2]], [[[[49, 11, 1, 11, 4], [4, 9, 14, 12, 16], [3, 1, 4, 2, 7], [11, 10, 4, 10, 5], [25, 6, 12, 9, 12], [26, 11, 14, 13, 15], [36, 3, 14, 6, 16], [18, 3, 1, 3, 2], [6, 15, 5, 16, 7], [31, 3, 11, 3, 12], [40, 2, 6, 4, 9]], 3, 3, [11, 14, 15, 14]], [[4, 25, 26, 40], 5, 1]], [[[[34, 13, 8, 16, 9], [35, 0, 9, 2, 12], [8, 11, 12, 13, 13], [43, 12, 9, 15, 9], [42, 12, 3, 15, 5], [21, 13, 3, 13, 3], [27, 12, 0, 12, 3], [37, 6, 2, 8, 5], [25, 0, 9, 2, 12]], 2, 3, [10, 6, 10, 11]], [[8, 37, 42], 13, 2]], [[[[37, 6, 14, 6, 16], [40, 1, 4, 3, 4]], 3, 3, [5, 10, 6, 10]], [[37, 40], 1, 0]], [[[[27, 4, 14, 7, 14], [36, 6, 1, 8, 4], [10, 8, 9, 10, 11], [15, 13, 4, 13, 5], [24, 9, 5, 12, 7], [48, 11, 0, 14, 1], [20, 5, 6, 7, 9], [47, 1, 11, 1, 12]], 3, 3, [6, 7, 6, 7]], [[20, 36], 5, 1]], [[[[12, 12, 2, 13, 3], [39, 8, 10, 9, 10], [18, 7, 1, 7, 3]], 2, 3, [8, 12, 9, 16]], [[39], 5, 1]], [[[[40, 14, 12, 14, 13], [36, 3, 9, 5, 9], [27, 1, 0, 1, 3], [22, 0, 9, 2, 12], [9, 7, 11, 7, 12], [6, 10, 7, 12, 8]], 1, 1, [4, 10, 5, 10]], [[6, 9, 22, 36], 5, 1]], [[[[45, 11, 12, 11, 14], [46, 10, 11, 11, 14], [5, 14, 10, 16, 12], [25, 13, 4, 14, 5], [14, 1, 4, 4, 6], [33, 11, 10, 11, 10]], 2, 2, [11, 14, 11, 18]], [[5, 45, 46], 9, 2]]]]
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 | [[44, 49], 5, 1] | [[5, 19, 44, 49], 5, 1] | Failed |
| case 1 | [[1, 43], 17, 3] | [[1, 8, 43], 17, 3] | Failed |
| case 2 | [[], 5, 1] | [[5, 17, 28], 5, 1] | Failed |
| case 3 | [[7, 22], 9, 2] | [[22], 9, 2] | Failed |
| case 4 | [[7, 15], 5, 1] | [[7, 15], 5, 1] | Passed |
| case 5 | [[9, 16, 20, 21, 24, 48], 5, 1] | [[2, 9, 16, 20, 21], 5, 1] | Failed |
| case 6 | [[8, 30, 37, 42, 47], 13, 2] | [[8, 30, 37], 13, 2] | Failed |
| case 7 | [[42], 5, 1] | [[], 5, 1] | Failed |
SHA-256 / 55de7b8762098e52cd0c4c28f98ed1ad01936b5c9bd14f526c87cad65a9ff5b2
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.261668+00:00.
Case digest / 3822e975b0afa94e6c27152ce4ae871d8240ea70881d8d75e7dfe1583a412818