FAILURE MAP
← Case archive

FA-87681 / Collision detection broadphase / Open access

Swept box only translates the maximum corner · case 01

Objects moving left or down tunnel because the swept box shrinks.

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

ROOT CAUSE

The sweep adds displacement to max coordinates and never extends min.

VERIFIED REPAIR

Take min/max of start and end boxes on every side.

Unsuccessful approach: Adding |d| to the max side still misses backward motion on the min side.

Case contract

solve(box, vel, dt, margin, others): CCD broadphase bounds. Swept box = union of box at t and t+dt expanded by margin on all sides. fast = displacement length > half the smaller box extent. Return [swept rounded to 6, fast, sorted ids of others ([id,minx,miny,maxx,maxy]) overlapping the swept box with closed intervals].

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(box, vel, dt, margin, others):
    dx, dy = vel[0] * dt, vel[1] * dt
    sw = [box[0] - margin, box[1] - margin,
          box[2] + dx + margin, box[3] + dy + margin]
    ext = min(box[2] - box[0], box[3] - box[1])
    fast = math.hypot(dx, dy) > 0.5 * ext
    hits = sorted(o[0] for o in others if o[1] <= sw[2] and sw[0] <= o[3] and o[2] <= sw[3] and sw[1] <= o[4])
    return [[round(c, 6) for c in sw], fast, hits]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[1, 0, 3, 0.5], [-12, 0], 0.125, 0.5, [[3, -4, 6, -4, 7]]], [[-1.0, -0.5, 3.5, 1.0], True, []]], [[[0, 2, 2, 3], [30, 16], 0.0625, 0.0, [[5, 5, 4, 7, 4]]], [[0.0, 2.0, 3.875, 4.0], True, []]], [[[1, 1, 3, 2], [30, -20], 0.125, 0.25, [[10, -3, 5, -3, 6], [13, 4, -6, 6, -6], [19, -1, -8, 1, -7], [24, 4, 3, 6, 5]]], [[0.75, -1.75, 7.0, 2.25], True, []]], [[[0, 4, 2, 5], [8, 3], 0.25, 0.5, [[4, -6, 8, -6, 10], [19, 2, -1, 3, 1], [25, -5, 6, -4, 7], [20, 2, -5, 2, -3]]], [[-0.5, 3.5, 4.5, 6.25], True, []]], [[[1, -2, 3, -1.5], [-12, 3], 0.25, 0.0, [[29, 8, 3, 10, 4]]], [[-2.0, -2.0, 3.0, -0.75], True, []]], [[[4, -4, 5, -3.5], [2, 16], 0.25, 0.0, [[13, 8, 2, 10, 3], [2, 2, -4, 4, -2]]], [[4.0, -4.0, 5.5, 0.5], True, [2]]], [[[-2, 2, 0, 2.5], [-2, 16], 0.25, 0.5, [[27, 2, 1, 2, 3], [24, 7, -8, 7, -7], [7, -1, 7, 0, 8], [14, -2, 6, -1, 7], [18, 2, -8, 2, -7]]], [[-3.0, 1.5, 0.5, 7.0], True, [7, 14]]], [[[0, 0, 1, 0.5], [-2, 16], 0.0625, 0.0, [[16, -4, 4, -2, 4], [1, 4, -6, 4, -4], [14, 7, 5, 7, 5]]], [[-0.125, 0.0, 1.0, 1.5], True, []]]], [[[[2, 0, 3, 1], [2, 3], 0.125, 0.25, [[9, -3, -5, -2, -4]]], [[1.75, -0.25, 3.5, 1.625], False, []]], [[[3, -1, 5, 2], [8, 16], 0.125, 0.25, [[16, 3, -5, 5, -4], [2, 3, -2, 4, -2], [19, 8, 6, 9, 6], [5, -6, 2, -4, 2]]], [[2.75, -1.25, 6.25, 4.25], True, []]], [[[-1, -2, 1, -1.5], [0, 0], 0.25, 0.5, [[19, -5, 0, -5, 1]]], [[-1.5, -2.5, 1.5, -1.0], False, []]], [[[-4, -1, -3, 2], [-2, -20], 0.0625, 0.25, [[11, -6, 1, -4, 3], [8, -6, 6, -5, 8], [17, -6, 0, -4, 1]]], [[-4.375, -2.5, -2.75, 2.25], True, [11, 17]]], [[[-1, -4, 1, -3.5], [-12, 0], 0.0625, 0.5, [[6, 5, 0, 7, 0], [21, -1, 3, 0, 5], [9, -3, -6, -1, -6], [12, -2, 1, 0, 1], [7, -3, -8, -3, -8]]], [[-2.25, -4.5, 1.5, -3.0], True, []]], [[[-4, 3, -3, 3.5], [2, -20], 0.0625, 0.5, [[18, -4, 6, -2, 8], [27, -6, 2, -5, 4], [16, 2, 8, 2, 8], [9, -4, 7, -4, 9], [11, 3, -6, 5, -6]]], [[-4.5, 1.25, -2.375, 4.0], True, []]], [[[-1, 1, -0.5, 4], [30, -20], 0.0625, 0.0, [[16, -8, -4, -6, -3], [9, 6, 1, 6, 3], [29, -4, 8, -3, 10], [1, 5, -3, 5, -2]]], [[-1.0, -0.25, 1.375, 4.0], True, []]], [[[0, 1, 2, 1.5], [0, -20], 0.125, 0.5, [[3, 2, 8, 4, 8], [21, 6, 3, 8, 4], [27, 5, -1, 6, -1]]], [[-0.5, -2.0, 2.5, 2.0], True, []]]], [[[[-3, 2, -2.5, 2.5], [0, -20], 0.125, 0.25, [[22, -3, -5, -1, -4], [10, 4, 8, 6, 10], [14, -1, 5, 1, 5], [19, 5, -5, 5, -3], [4, 3, 5, 4, 6]]], [[-3.25, -0.75, -2.25, 2.75], True, []]], [[[2, 1, 3, 1.5], [2, 0], 0.25, 0.25, [[26, -6, -8, -6, -6]]], [[1.75, 0.75, 3.75, 1.75], True, []]], [[[-2, -2, -1, -1.5], [-2, -3], 0.0625, 0.25, [[14, 0, 7, 0, 8], [20, -2, 2, -1, 4]]], [[-2.375, -2.4375, -0.75, -1.25], False, []]], [[[3, 4, 4, 4.5], [30, -3], 0.25, 0.0, [[6, 3, 5, 3, 7]]], [[3.0, 3.25, 11.5, 4.5], True, []]], [[[-1, 1, -0.5, 1.5], [30, -3], 0.125, 0.0, [[27, -8, -2, -7, 0], [14, -6, -3, -6, -2], [25, 8, -5, 8, -4], [12, -6, 3, -4, 5], [21, 5, -2, 6, -1]]], [[-1.0, 0.625, 3.25, 1.5], True, []]], [[[4, 3, 5, 3.5], [2, 0], 0.25, 0.5, [[24, -6, -1, -4, -1], [14, 4, 3, 4, 4], [1, -5, 5, -3, 6], [10, 6, -1, 8, 0]]], [[3.5, 2.5, 6.0, 4.0], True, [14]]], [[[-1, 0, 1, 0.5], [8, -3], 0.125, 0.0, [[8, 6, -8, 8, -8], [21, 4, -3, 5, -1]]], [[-1.0, -0.375, 2.0, 0.5], True, []]], [[[4, 2, 4.5, 5], [0, 3], 0.0625, 0.25, [[14, -8, -7, -6, -5]]], [[3.75, 1.75, 4.75, 5.4375], False, []]]], [[[[-1, -2, 1, -1], [30, 0], 0.125, 0.0, [[28, -2, -2, -2, 0]]], [[-1.0, -2.0, 4.75, -1.0], True, []]], [[[4, 4, 6, 5], [2, -20], 0.125, 0.5, [[18, 8, 1, 10, 1], [7, -8, 7, -6, 8], [1, 2, -3, 2, -1], [29, -3, 3, -2, 5], [28, -5, 0, -3, 1]]], [[3.5, 1.0, 6.75, 5.5], True, []]], [[[-3, -4, -2, -3], [-2, 3], 0.25, 0.25, [[28, 6, 3, 7, 3], [20, 1, 3, 3, 4], [17, -5, -6, -4, -5]]], [[-3.75, -4.25, -1.75, -2.0], True, []]], [[[0, -4, 0.5, -1], [8, -3], 0.125, 0.0, [[3, 2, -2, 3, -1], [2, 5, 0, 6, 1]]], [[0.0, -4.375, 1.5, -1.0], True, []]], [[[-4, -2, -2, -1.5], [8, 0], 0.0625, 0.25, [[11, -7, 8, -6, 9], [19, 5, -3, 6, -1], [29, -3, 3, -2, 5], [6, 3, 8, 4, 8], [16, -7, -8, -7, -7]]], [[-4.25, -2.25, -1.25, -1.25], True, []]], [[[3, -1, 3.5, 0], [2, 3], 0.0625, 0.5, [[13, 6, -8, 8, -6], [19, 6, 2, 8, 2]]], [[2.5, -1.5, 4.125, 0.6875], False, []]], [[[0, 4, 1, 4.5], [2, -3], 0.125, 0.0, [[6, 3, 3, 3, 3], [18, -7, -7, -5, -7]]], [[0.0, 3.625, 1.25, 4.5], True, []]], [[[1, 1, 3, 1.5], [-2, 3], 0.125, 0.25, [[13, 6, -7, 6, -7], [6, 0, 7, 0, 7], [4, -7, -6, -5, -6], [11, -3, -6, -3, -4], [16, -6, 7, -4, 8]]], [[0.5, 0.75, 3.25, 2.125], True, []]]], [[[[3, -2, 3.5, -1.5], [-12, -20], 0.0625, 0.25, [[20, -2, 3, 0, 4], [11, 1, -2, 3, -1], [10, -2, -5, -1, -5], [3, -7, -7, -6, -7]]], [[2.0, -3.5, 3.75, -1.25], True, [11]]], [[[0, 4, 2, 4.5], [2, 16], 0.125, 0.0, [[8, 2, 4, 3, 4], [4, 2, -4, 2, -2], [19, 8, 6, 10, 6]]], [[0.0, 4.0, 2.25, 6.5], True, [8]]], [[[-3, 0, -1, 1], [-2, 16], 0.125, 0.0, [[4, 6, 1, 8, 1]]], [[-3.25, 0.0, -1.0, 3.0], True, []]], [[[-3, 0, -2, 0.5], [0, -20], 0.125, 0.25, [[18, -2, -7, -1, -7], [9, 8, 7, 10, 8]]], [[-3.25, -2.75, -1.75, 0.75], True, []]], [[[-1, 1, -0.5, 2], [0, 0], 0.0625, 0.5, [[27, -3, -8, -2, -8]]], [[-1.5, 0.5, 0.0, 2.5], False, []]], [[[-4, -3, -3, -2], [2, 3], 0.25, 0.0, [[20, 1, 0, 3, 1], [25, 5, -2, 6, -1], [9, 6, -3, 7, -3], [15, 1, 0, 1, 0], [19, 0, -6, 2, -6]]], [[-4.0, -3.0, -2.5, -1.25], True, []]], [[[-4, 2, -3.5, 5], [0, -20], 0.25, 0.5, [[11, 6, -5, 7, -4], [1, -8, -1, -8, 1], [18, 5, 8, 7, 9], [3, 0, 5, 0, 5]]], [[-4.5, -3.5, -3.0, 5.5], True, []]], [[[3, 1, 5, 1.5], [8, -20], 0.0625, 0.25, [[14, -4, -6, -2, -6], [27, 3, 1, 4, 1], [19, -2, 0, 0, 0], [5, -1, 1, 1, 3], [3, -4, 4, -3, 5]]], [[2.75, -0.5, 5.75, 1.75], True, [27]]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("case %d" % i, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
case 0[[0.5, -0.5, 2.0, 1.0], True, []][[-1.0, -0.5, 3.5, 1.0], True, []]Failed
case 1[[0.0, 2.0, 3.875, 4.0], True, []][[0.0, 2.0, 3.875, 4.0], True, []]Passed
case 2[[0.75, 0.75, 7.0, -0.25], True, []][[0.75, -1.75, 7.0, 2.25], True, []]Failed
case 3[[-0.5, 3.5, 4.5, 6.25], True, []][[-0.5, 3.5, 4.5, 6.25], True, []]Passed
case 4[[1.0, -2.0, 0.0, -0.75], True, []][[-2.0, -2.0, 3.0, -0.75], True, []]Failed
case 5[[4.0, -4.0, 5.5, 0.5], True, [2]][[4.0, -4.0, 5.5, 0.5], True, [2]]Passed
case 6[[-2.5, 1.5, 0.0, 7.0], True, [7, 14]][[-3.0, 1.5, 0.5, 7.0], True, [7, 14]]Failed
case 7[[0.0, 0.0, 0.875, 1.5], True, []][[-0.125, 0.0, 1.0, 1.5], True, []]Failed

SHA-256 / 44300ad135455693834b62b09fcb646478ba6559cc1ba78d827ebe8a5777310e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(box, vel, dt, margin, others):
    dx, dy = vel[0] * dt, vel[1] * dt
    sw = [min(box[0], box[0] + dx) - margin, min(box[1], box[1] + dy) - margin,
          box[2] + abs(dx) + margin, box[3] + abs(dy) + margin]
    ext = min(box[2] - box[0], box[3] - box[1])
    fast = math.hypot(dx, dy) > 0.5 * ext
    hits = sorted(o[0] for o in others if o[1] <= sw[2] and sw[0] <= o[3] and o[2] <= sw[3] and sw[1] <= o[4])
    return [[round(c, 6) for c in sw], fast, hits]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[1, 0, 3, 0.5], [-12, 0], 0.125, 0.5, [[3, -4, 6, -4, 7]]], [[-1.0, -0.5, 3.5, 1.0], True, []]], [[[0, 2, 2, 3], [30, 16], 0.0625, 0.0, [[5, 5, 4, 7, 4]]], [[0.0, 2.0, 3.875, 4.0], True, []]], [[[1, 1, 3, 2], [30, -20], 0.125, 0.25, [[10, -3, 5, -3, 6], [13, 4, -6, 6, -6], [19, -1, -8, 1, -7], [24, 4, 3, 6, 5]]], [[0.75, -1.75, 7.0, 2.25], True, []]], [[[0, 4, 2, 5], [8, 3], 0.25, 0.5, [[4, -6, 8, -6, 10], [19, 2, -1, 3, 1], [25, -5, 6, -4, 7], [20, 2, -5, 2, -3]]], [[-0.5, 3.5, 4.5, 6.25], True, []]], [[[1, -2, 3, -1.5], [-12, 3], 0.25, 0.0, [[29, 8, 3, 10, 4]]], [[-2.0, -2.0, 3.0, -0.75], True, []]], [[[4, -4, 5, -3.5], [2, 16], 0.25, 0.0, [[13, 8, 2, 10, 3], [2, 2, -4, 4, -2]]], [[4.0, -4.0, 5.5, 0.5], True, [2]]], [[[-2, 2, 0, 2.5], [-2, 16], 0.25, 0.5, [[27, 2, 1, 2, 3], [24, 7, -8, 7, -7], [7, -1, 7, 0, 8], [14, -2, 6, -1, 7], [18, 2, -8, 2, -7]]], [[-3.0, 1.5, 0.5, 7.0], True, [7, 14]]], [[[0, 0, 1, 0.5], [-2, 16], 0.0625, 0.0, [[16, -4, 4, -2, 4], [1, 4, -6, 4, -4], [14, 7, 5, 7, 5]]], [[-0.125, 0.0, 1.0, 1.5], True, []]]], [[[[2, 0, 3, 1], [2, 3], 0.125, 0.25, [[9, -3, -5, -2, -4]]], [[1.75, -0.25, 3.5, 1.625], False, []]], [[[3, -1, 5, 2], [8, 16], 0.125, 0.25, [[16, 3, -5, 5, -4], [2, 3, -2, 4, -2], [19, 8, 6, 9, 6], [5, -6, 2, -4, 2]]], [[2.75, -1.25, 6.25, 4.25], True, []]], [[[-1, -2, 1, -1.5], [0, 0], 0.25, 0.5, [[19, -5, 0, -5, 1]]], [[-1.5, -2.5, 1.5, -1.0], False, []]], [[[-4, -1, -3, 2], [-2, -20], 0.0625, 0.25, [[11, -6, 1, -4, 3], [8, -6, 6, -5, 8], [17, -6, 0, -4, 1]]], [[-4.375, -2.5, -2.75, 2.25], True, [11, 17]]], [[[-1, -4, 1, -3.5], [-12, 0], 0.0625, 0.5, [[6, 5, 0, 7, 0], [21, -1, 3, 0, 5], [9, -3, -6, -1, -6], [12, -2, 1, 0, 1], [7, -3, -8, -3, -8]]], [[-2.25, -4.5, 1.5, -3.0], True, []]], [[[-4, 3, -3, 3.5], [2, -20], 0.0625, 0.5, [[18, -4, 6, -2, 8], [27, -6, 2, -5, 4], [16, 2, 8, 2, 8], [9, -4, 7, -4, 9], [11, 3, -6, 5, -6]]], [[-4.5, 1.25, -2.375, 4.0], True, []]], [[[-1, 1, -0.5, 4], [30, -20], 0.0625, 0.0, [[16, -8, -4, -6, -3], [9, 6, 1, 6, 3], [29, -4, 8, -3, 10], [1, 5, -3, 5, -2]]], [[-1.0, -0.25, 1.375, 4.0], True, []]], [[[0, 1, 2, 1.5], [0, -20], 0.125, 0.5, [[3, 2, 8, 4, 8], [21, 6, 3, 8, 4], [27, 5, -1, 6, -1]]], [[-0.5, -2.0, 2.5, 2.0], True, []]]], [[[[-3, 2, -2.5, 2.5], [0, -20], 0.125, 0.25, [[22, -3, -5, -1, -4], [10, 4, 8, 6, 10], [14, -1, 5, 1, 5], [19, 5, -5, 5, -3], [4, 3, 5, 4, 6]]], [[-3.25, -0.75, -2.25, 2.75], True, []]], [[[2, 1, 3, 1.5], [2, 0], 0.25, 0.25, [[26, -6, -8, -6, -6]]], [[1.75, 0.75, 3.75, 1.75], True, []]], [[[-2, -2, -1, -1.5], [-2, -3], 0.0625, 0.25, [[14, 0, 7, 0, 8], [20, -2, 2, -1, 4]]], [[-2.375, -2.4375, -0.75, -1.25], False, []]], [[[3, 4, 4, 4.5], [30, -3], 0.25, 0.0, [[6, 3, 5, 3, 7]]], [[3.0, 3.25, 11.5, 4.5], True, []]], [[[-1, 1, -0.5, 1.5], [30, -3], 0.125, 0.0, [[27, -8, -2, -7, 0], [14, -6, -3, -6, -2], [25, 8, -5, 8, -4], [12, -6, 3, -4, 5], [21, 5, -2, 6, -1]]], [[-1.0, 0.625, 3.25, 1.5], True, []]], [[[4, 3, 5, 3.5], [2, 0], 0.25, 0.5, [[24, -6, -1, -4, -1], [14, 4, 3, 4, 4], [1, -5, 5, -3, 6], [10, 6, -1, 8, 0]]], [[3.5, 2.5, 6.0, 4.0], True, [14]]], [[[-1, 0, 1, 0.5], [8, -3], 0.125, 0.0, [[8, 6, -8, 8, -8], [21, 4, -3, 5, -1]]], [[-1.0, -0.375, 2.0, 0.5], True, []]], [[[4, 2, 4.5, 5], [0, 3], 0.0625, 0.25, [[14, -8, -7, -6, -5]]], [[3.75, 1.75, 4.75, 5.4375], False, []]]], [[[[-1, -2, 1, -1], [30, 0], 0.125, 0.0, [[28, -2, -2, -2, 0]]], [[-1.0, -2.0, 4.75, -1.0], True, []]], [[[4, 4, 6, 5], [2, -20], 0.125, 0.5, [[18, 8, 1, 10, 1], [7, -8, 7, -6, 8], [1, 2, -3, 2, -1], [29, -3, 3, -2, 5], [28, -5, 0, -3, 1]]], [[3.5, 1.0, 6.75, 5.5], True, []]], [[[-3, -4, -2, -3], [-2, 3], 0.25, 0.25, [[28, 6, 3, 7, 3], [20, 1, 3, 3, 4], [17, -5, -6, -4, -5]]], [[-3.75, -4.25, -1.75, -2.0], True, []]], [[[0, -4, 0.5, -1], [8, -3], 0.125, 0.0, [[3, 2, -2, 3, -1], [2, 5, 0, 6, 1]]], [[0.0, -4.375, 1.5, -1.0], True, []]], [[[-4, -2, -2, -1.5], [8, 0], 0.0625, 0.25, [[11, -7, 8, -6, 9], [19, 5, -3, 6, -1], [29, -3, 3, -2, 5], [6, 3, 8, 4, 8], [16, -7, -8, -7, -7]]], [[-4.25, -2.25, -1.25, -1.25], True, []]], [[[3, -1, 3.5, 0], [2, 3], 0.0625, 0.5, [[13, 6, -8, 8, -6], [19, 6, 2, 8, 2]]], [[2.5, -1.5, 4.125, 0.6875], False, []]], [[[0, 4, 1, 4.5], [2, -3], 0.125, 0.0, [[6, 3, 3, 3, 3], [18, -7, -7, -5, -7]]], [[0.0, 3.625, 1.25, 4.5], True, []]], [[[1, 1, 3, 1.5], [-2, 3], 0.125, 0.25, [[13, 6, -7, 6, -7], [6, 0, 7, 0, 7], [4, -7, -6, -5, -6], [11, -3, -6, -3, -4], [16, -6, 7, -4, 8]]], [[0.5, 0.75, 3.25, 2.125], True, []]]], [[[[3, -2, 3.5, -1.5], [-12, -20], 0.0625, 0.25, [[20, -2, 3, 0, 4], [11, 1, -2, 3, -1], [10, -2, -5, -1, -5], [3, -7, -7, -6, -7]]], [[2.0, -3.5, 3.75, -1.25], True, [11]]], [[[0, 4, 2, 4.5], [2, 16], 0.125, 0.0, [[8, 2, 4, 3, 4], [4, 2, -4, 2, -2], [19, 8, 6, 10, 6]]], [[0.0, 4.0, 2.25, 6.5], True, [8]]], [[[-3, 0, -1, 1], [-2, 16], 0.125, 0.0, [[4, 6, 1, 8, 1]]], [[-3.25, 0.0, -1.0, 3.0], True, []]], [[[-3, 0, -2, 0.5], [0, -20], 0.125, 0.25, [[18, -2, -7, -1, -7], [9, 8, 7, 10, 8]]], [[-3.25, -2.75, -1.75, 0.75], True, []]], [[[-1, 1, -0.5, 2], [0, 0], 0.0625, 0.5, [[27, -3, -8, -2, -8]]], [[-1.5, 0.5, 0.0, 2.5], False, []]], [[[-4, -3, -3, -2], [2, 3], 0.25, 0.0, [[20, 1, 0, 3, 1], [25, 5, -2, 6, -1], [9, 6, -3, 7, -3], [15, 1, 0, 1, 0], [19, 0, -6, 2, -6]]], [[-4.0, -3.0, -2.5, -1.25], True, []]], [[[-4, 2, -3.5, 5], [0, -20], 0.25, 0.5, [[11, 6, -5, 7, -4], [1, -8, -1, -8, 1], [18, 5, 8, 7, 9], [3, 0, 5, 0, 5]]], [[-4.5, -3.5, -3.0, 5.5], True, []]], [[[3, 1, 5, 1.5], [8, -20], 0.0625, 0.25, [[14, -4, -6, -2, -6], [27, 3, 1, 4, 1], [19, -2, 0, 0, 0], [5, -1, 1, 1, 3], [3, -4, 4, -3, 5]]], [[2.75, -0.5, 5.75, 1.75], True, [27]]]]]
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[[-1.0, -0.5, 5.0, 1.0], True, []][[-1.0, -0.5, 3.5, 1.0], True, []]Failed
case 1[[0.0, 2.0, 3.875, 4.0], True, []][[0.0, 2.0, 3.875, 4.0], True, []]Passed
case 2[[0.75, -1.75, 7.0, 4.75], True, [24]][[0.75, -1.75, 7.0, 2.25], True, []]Failed
case 3[[-0.5, 3.5, 4.5, 6.25], True, []][[-0.5, 3.5, 4.5, 6.25], True, []]Passed
case 4[[-2.0, -2.0, 6.0, -0.75], True, []][[-2.0, -2.0, 3.0, -0.75], True, []]Failed
case 5[[4.0, -4.0, 5.5, 0.5], True, [2]][[4.0, -4.0, 5.5, 0.5], True, [2]]Passed
case 6[[-3.0, 1.5, 1.0, 7.0], True, [7, 14]][[-3.0, 1.5, 0.5, 7.0], True, [7, 14]]Failed
case 7[[-0.125, 0.0, 1.125, 1.5], True, []][[-0.125, 0.0, 1.0, 1.5], True, []]Failed

SHA-256 / c6dfa82872721e4f5cdccdac840bab6cc40fecd3e12eb08408f0450acb6a30c8

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(box, vel, dt, margin, others):
    dx, dy = vel[0] * dt, vel[1] * dt
    sw = [min(box[0], box[0] + dx) - margin, min(box[1], box[1] + dy) - margin,
          max(box[2], box[2] + dx) + margin, max(box[3], box[3] + dy) + margin]
    ext = min(box[2] - box[0], box[3] - box[1])
    fast = math.hypot(dx, dy) > 0.5 * ext
    hits = sorted(o[0] for o in others if o[1] <= sw[2] and sw[0] <= o[3] and o[2] <= sw[3] and sw[1] <= o[4])
    return [[round(c, 6) for c in sw], fast, hits]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[1, 0, 3, 0.5], [-12, 0], 0.125, 0.5, [[3, -4, 6, -4, 7]]], [[-1.0, -0.5, 3.5, 1.0], True, []]], [[[0, 2, 2, 3], [30, 16], 0.0625, 0.0, [[5, 5, 4, 7, 4]]], [[0.0, 2.0, 3.875, 4.0], True, []]], [[[1, 1, 3, 2], [30, -20], 0.125, 0.25, [[10, -3, 5, -3, 6], [13, 4, -6, 6, -6], [19, -1, -8, 1, -7], [24, 4, 3, 6, 5]]], [[0.75, -1.75, 7.0, 2.25], True, []]], [[[0, 4, 2, 5], [8, 3], 0.25, 0.5, [[4, -6, 8, -6, 10], [19, 2, -1, 3, 1], [25, -5, 6, -4, 7], [20, 2, -5, 2, -3]]], [[-0.5, 3.5, 4.5, 6.25], True, []]], [[[1, -2, 3, -1.5], [-12, 3], 0.25, 0.0, [[29, 8, 3, 10, 4]]], [[-2.0, -2.0, 3.0, -0.75], True, []]], [[[4, -4, 5, -3.5], [2, 16], 0.25, 0.0, [[13, 8, 2, 10, 3], [2, 2, -4, 4, -2]]], [[4.0, -4.0, 5.5, 0.5], True, [2]]], [[[-2, 2, 0, 2.5], [-2, 16], 0.25, 0.5, [[27, 2, 1, 2, 3], [24, 7, -8, 7, -7], [7, -1, 7, 0, 8], [14, -2, 6, -1, 7], [18, 2, -8, 2, -7]]], [[-3.0, 1.5, 0.5, 7.0], True, [7, 14]]], [[[0, 0, 1, 0.5], [-2, 16], 0.0625, 0.0, [[16, -4, 4, -2, 4], [1, 4, -6, 4, -4], [14, 7, 5, 7, 5]]], [[-0.125, 0.0, 1.0, 1.5], True, []]]], [[[[2, 0, 3, 1], [2, 3], 0.125, 0.25, [[9, -3, -5, -2, -4]]], [[1.75, -0.25, 3.5, 1.625], False, []]], [[[3, -1, 5, 2], [8, 16], 0.125, 0.25, [[16, 3, -5, 5, -4], [2, 3, -2, 4, -2], [19, 8, 6, 9, 6], [5, -6, 2, -4, 2]]], [[2.75, -1.25, 6.25, 4.25], True, []]], [[[-1, -2, 1, -1.5], [0, 0], 0.25, 0.5, [[19, -5, 0, -5, 1]]], [[-1.5, -2.5, 1.5, -1.0], False, []]], [[[-4, -1, -3, 2], [-2, -20], 0.0625, 0.25, [[11, -6, 1, -4, 3], [8, -6, 6, -5, 8], [17, -6, 0, -4, 1]]], [[-4.375, -2.5, -2.75, 2.25], True, [11, 17]]], [[[-1, -4, 1, -3.5], [-12, 0], 0.0625, 0.5, [[6, 5, 0, 7, 0], [21, -1, 3, 0, 5], [9, -3, -6, -1, -6], [12, -2, 1, 0, 1], [7, -3, -8, -3, -8]]], [[-2.25, -4.5, 1.5, -3.0], True, []]], [[[-4, 3, -3, 3.5], [2, -20], 0.0625, 0.5, [[18, -4, 6, -2, 8], [27, -6, 2, -5, 4], [16, 2, 8, 2, 8], [9, -4, 7, -4, 9], [11, 3, -6, 5, -6]]], [[-4.5, 1.25, -2.375, 4.0], True, []]], [[[-1, 1, -0.5, 4], [30, -20], 0.0625, 0.0, [[16, -8, -4, -6, -3], [9, 6, 1, 6, 3], [29, -4, 8, -3, 10], [1, 5, -3, 5, -2]]], [[-1.0, -0.25, 1.375, 4.0], True, []]], [[[0, 1, 2, 1.5], [0, -20], 0.125, 0.5, [[3, 2, 8, 4, 8], [21, 6, 3, 8, 4], [27, 5, -1, 6, -1]]], [[-0.5, -2.0, 2.5, 2.0], True, []]]], [[[[-3, 2, -2.5, 2.5], [0, -20], 0.125, 0.25, [[22, -3, -5, -1, -4], [10, 4, 8, 6, 10], [14, -1, 5, 1, 5], [19, 5, -5, 5, -3], [4, 3, 5, 4, 6]]], [[-3.25, -0.75, -2.25, 2.75], True, []]], [[[2, 1, 3, 1.5], [2, 0], 0.25, 0.25, [[26, -6, -8, -6, -6]]], [[1.75, 0.75, 3.75, 1.75], True, []]], [[[-2, -2, -1, -1.5], [-2, -3], 0.0625, 0.25, [[14, 0, 7, 0, 8], [20, -2, 2, -1, 4]]], [[-2.375, -2.4375, -0.75, -1.25], False, []]], [[[3, 4, 4, 4.5], [30, -3], 0.25, 0.0, [[6, 3, 5, 3, 7]]], [[3.0, 3.25, 11.5, 4.5], True, []]], [[[-1, 1, -0.5, 1.5], [30, -3], 0.125, 0.0, [[27, -8, -2, -7, 0], [14, -6, -3, -6, -2], [25, 8, -5, 8, -4], [12, -6, 3, -4, 5], [21, 5, -2, 6, -1]]], [[-1.0, 0.625, 3.25, 1.5], True, []]], [[[4, 3, 5, 3.5], [2, 0], 0.25, 0.5, [[24, -6, -1, -4, -1], [14, 4, 3, 4, 4], [1, -5, 5, -3, 6], [10, 6, -1, 8, 0]]], [[3.5, 2.5, 6.0, 4.0], True, [14]]], [[[-1, 0, 1, 0.5], [8, -3], 0.125, 0.0, [[8, 6, -8, 8, -8], [21, 4, -3, 5, -1]]], [[-1.0, -0.375, 2.0, 0.5], True, []]], [[[4, 2, 4.5, 5], [0, 3], 0.0625, 0.25, [[14, -8, -7, -6, -5]]], [[3.75, 1.75, 4.75, 5.4375], False, []]]], [[[[-1, -2, 1, -1], [30, 0], 0.125, 0.0, [[28, -2, -2, -2, 0]]], [[-1.0, -2.0, 4.75, -1.0], True, []]], [[[4, 4, 6, 5], [2, -20], 0.125, 0.5, [[18, 8, 1, 10, 1], [7, -8, 7, -6, 8], [1, 2, -3, 2, -1], [29, -3, 3, -2, 5], [28, -5, 0, -3, 1]]], [[3.5, 1.0, 6.75, 5.5], True, []]], [[[-3, -4, -2, -3], [-2, 3], 0.25, 0.25, [[28, 6, 3, 7, 3], [20, 1, 3, 3, 4], [17, -5, -6, -4, -5]]], [[-3.75, -4.25, -1.75, -2.0], True, []]], [[[0, -4, 0.5, -1], [8, -3], 0.125, 0.0, [[3, 2, -2, 3, -1], [2, 5, 0, 6, 1]]], [[0.0, -4.375, 1.5, -1.0], True, []]], [[[-4, -2, -2, -1.5], [8, 0], 0.0625, 0.25, [[11, -7, 8, -6, 9], [19, 5, -3, 6, -1], [29, -3, 3, -2, 5], [6, 3, 8, 4, 8], [16, -7, -8, -7, -7]]], [[-4.25, -2.25, -1.25, -1.25], True, []]], [[[3, -1, 3.5, 0], [2, 3], 0.0625, 0.5, [[13, 6, -8, 8, -6], [19, 6, 2, 8, 2]]], [[2.5, -1.5, 4.125, 0.6875], False, []]], [[[0, 4, 1, 4.5], [2, -3], 0.125, 0.0, [[6, 3, 3, 3, 3], [18, -7, -7, -5, -7]]], [[0.0, 3.625, 1.25, 4.5], True, []]], [[[1, 1, 3, 1.5], [-2, 3], 0.125, 0.25, [[13, 6, -7, 6, -7], [6, 0, 7, 0, 7], [4, -7, -6, -5, -6], [11, -3, -6, -3, -4], [16, -6, 7, -4, 8]]], [[0.5, 0.75, 3.25, 2.125], True, []]]], [[[[3, -2, 3.5, -1.5], [-12, -20], 0.0625, 0.25, [[20, -2, 3, 0, 4], [11, 1, -2, 3, -1], [10, -2, -5, -1, -5], [3, -7, -7, -6, -7]]], [[2.0, -3.5, 3.75, -1.25], True, [11]]], [[[0, 4, 2, 4.5], [2, 16], 0.125, 0.0, [[8, 2, 4, 3, 4], [4, 2, -4, 2, -2], [19, 8, 6, 10, 6]]], [[0.0, 4.0, 2.25, 6.5], True, [8]]], [[[-3, 0, -1, 1], [-2, 16], 0.125, 0.0, [[4, 6, 1, 8, 1]]], [[-3.25, 0.0, -1.0, 3.0], True, []]], [[[-3, 0, -2, 0.5], [0, -20], 0.125, 0.25, [[18, -2, -7, -1, -7], [9, 8, 7, 10, 8]]], [[-3.25, -2.75, -1.75, 0.75], True, []]], [[[-1, 1, -0.5, 2], [0, 0], 0.0625, 0.5, [[27, -3, -8, -2, -8]]], [[-1.5, 0.5, 0.0, 2.5], False, []]], [[[-4, -3, -3, -2], [2, 3], 0.25, 0.0, [[20, 1, 0, 3, 1], [25, 5, -2, 6, -1], [9, 6, -3, 7, -3], [15, 1, 0, 1, 0], [19, 0, -6, 2, -6]]], [[-4.0, -3.0, -2.5, -1.25], True, []]], [[[-4, 2, -3.5, 5], [0, -20], 0.25, 0.5, [[11, 6, -5, 7, -4], [1, -8, -1, -8, 1], [18, 5, 8, 7, 9], [3, 0, 5, 0, 5]]], [[-4.5, -3.5, -3.0, 5.5], True, []]], [[[3, 1, 5, 1.5], [8, -20], 0.0625, 0.25, [[14, -4, -6, -2, -6], [27, 3, 1, 4, 1], [19, -2, 0, 0, 0], [5, -1, 1, 1, 3], [3, -4, 4, -3, 5]]], [[2.75, -0.5, 5.75, 1.75], True, [27]]]]]
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[[-1.0, -0.5, 3.5, 1.0], True, []][[-1.0, -0.5, 3.5, 1.0], True, []]Passed
case 1[[0.0, 2.0, 3.875, 4.0], True, []][[0.0, 2.0, 3.875, 4.0], True, []]Passed
case 2[[0.75, -1.75, 7.0, 2.25], True, []][[0.75, -1.75, 7.0, 2.25], True, []]Passed
case 3[[-0.5, 3.5, 4.5, 6.25], True, []][[-0.5, 3.5, 4.5, 6.25], True, []]Passed
case 4[[-2.0, -2.0, 3.0, -0.75], True, []][[-2.0, -2.0, 3.0, -0.75], True, []]Passed
case 5[[4.0, -4.0, 5.5, 0.5], True, [2]][[4.0, -4.0, 5.5, 0.5], True, [2]]Passed
case 6[[-3.0, 1.5, 0.5, 7.0], True, [7, 14]][[-3.0, 1.5, 0.5, 7.0], True, [7, 14]]Passed
case 7[[-0.125, 0.0, 1.0, 1.5], True, []][[-0.125, 0.0, 1.0, 1.5], True, []]Passed

SHA-256 / 007d1ccbbe76b45f116cb23c16e4b19797ec2074231aea76b001de5752003aed

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

Case digest / 9823c3e0dad0e3e32e0267b797cddf07b729929ec92d7368a8b4a9562aab407b