{"abstract":"Contacts approaching from below or left start late.","category":"Collision detection broadphase","checks":8,"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].","evaluation_group":"w2-collision_detection_broadphase-swept-ccd-bounds","failed_approach":"Restoring the x-min margin leaves the y-min side unexpanded.","family":"w2-collision_detection_broadphase-swept-ccd-bounds-speculative-margin-sides","id":"FA-87691","implementations":{"attempt":{"sha256":"71a3a3d6f2524ca4ea971268108cb0ab8d71da1fbe573ca4533068d03cdc2f26","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(box, vel, dt, margin, others):\n    dx, dy = vel[0] * dt, vel[1] * dt\n    sw = [min(box[0], box[0] + dx) - margin, min(box[1], box[1] + dy),\n          max(box[2], box[2] + dx) + margin, max(box[3], box[3] + dy) + margin]\n    ext = min(box[2] - box[0], box[3] - box[1])\n    fast = math.hypot(dx, dy) > 0.5 * ext\n    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])\n    return [[round(c, 6) for c in sw], fast, hits]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[2, -2, 3, -1], [30, 16], 0.25, 0.0, [[2, 6, -8, 8, -8], [11, 1, 7, 2, 8], [27, 8, 0, 9, 2]]], [[2.0, -2.0, 10.5, 3.0], True, [27]]], [[[4, -2, 6, 1], [-12, 0], 0.25, 0.5, [[6, 7, -2, 9, -1], [21, 6, 0, 7, 2], [16, -8, 2, -7, 4], [12, 7, -5, 9, -5], [5, 7, 8, 7, 10]]], [[0.5, -2.5, 6.5, 1.5], True, [21]]], [[[3, 1, 5, 4], [-12, 16], 0.125, 0.25, [[1, 5, -2, 7, 0]]], [[1.25, 0.75, 5.25, 6.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, []]], [[[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, []]], [[[-3, 4, -2.5, 5], [0, -20], 0.0625, 0.5, [[5, -4, -7, -3, -7], [16, 1, -1, 1, -1], [28, -7, -3, -6, -1]]], [[-3.5, 2.25, -2.0, 5.5], 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, 1.5, 4], [-2, 16], 0.125, 0.25, [[3, 3, 2, 3, 4], [21, 6, 4, 6, 4]]], [[0.5, 0.75, 1.75, 6.25], True, []]]], [[[[0, -4, 1, -1], [8, 3], 0.25, 0.25, [[9, 3, -1, 3, 0]]], [[-0.25, -4.25, 3.25, 0.0], True, [9]]], [[[2, 0, 4, 3], [2, 0], 0.0625, 0.0, [[28, 7, -1, 8, -1], [1, 3, 2, 3, 2], [23, 5, -3, 5, -3], [29, 4, 2, 5, 4], [5, 7, 0, 9, 0]]], [[2.0, 0.0, 4.125, 3.0], False, [1, 29]]], [[[3, 1, 4, 2], [-2, -3], 0.25, 0.25, [[2, -6, -4, -4, -3], [22, -6, 1, -6, 1], [11, 1, 5, 2, 5], [15, -1, -8, 0, -8]]], [[2.25, 0.0, 4.25, 2.25], True, []]], [[[2, -1, 4, 0], [0, 16], 0.25, 0.5, [[12, -8, -4, -8, -4], [19, 7, 2, 7, 2], [16, -2, 2, -2, 4]]], [[1.5, -1.5, 4.5, 4.5], True, []]], [[[2, 3, 4, 3.5], [0, 3], 0.25, 0.25, [[25, 5, 7, 5, 7], [20, 7, -1, 9, 1], [24, 2, -8, 4, -8], [28, -3, -7, -3, -7]]], [[1.75, 2.75, 4.25, 4.5], True, []]], [[[-4, 1, -3.5, 2], [-12, 16], 0.0625, 0.0, [[15, 5, -7, 7, -6]]], [[-4.75, 1.0, -3.5, 3.0], True, []]], [[[-1, 1, 0, 1.5], [-2, -20], 0.0625, 0.25, [[25, 0, 4, 1, 5], [11, -1, 3, 1, 5], [22, 4, 7, 4, 9], [23, 1, -1, 2, 1], [8, -4, -4, -3, -3]]], [[-1.375, -0.5, 0.25, 1.75], True, []]], [[[4, -2, 5, -1.5], [2, 16], 0.0625, 0.0, [[2, -1, 1, 1, 2], [20, -1, -1, -1, -1]]], [[4.0, -2.0, 5.125, -0.5], True, []]]], [[[[-2, 3, -1.5, 6], [30, -3], 0.125, 0.25, [[21, 1, 4, 3, 4], [25, -1, 2, 0, 4], [8, -3, 4, -1, 5], [6, 2, -2, 4, 0], [16, 2, 7, 4, 9]]], [[-2.25, 2.375, 2.5, 6.25], True, [8, 21, 25]]], [[[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]]], [[[-2, 2, -1.5, 5], [0, -3], 0.125, 0.5, [[23, -4, 0, -4, 2], [22, -6, -3, -6, -1], [7, 8, -1, 8, 1], [4, -4, -4, -3, -2]]], [[-2.5, 1.125, -1.0, 5.5], 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, []]], [[[1, 0, 2, 3], [-2, -3], 0.125, 0.0, [[10, -7, 6, -5, 8], [16, -3, 2, -3, 3], [19, -8, -5, -8, -4], [11, 1, -7, 1, -7]]], [[0.75, -0.375, 2.0, 3.0], False, []]], [[[3, -1, 5, 0], [-2, 3], 0.25, 0.0, [[5, -8, -7, -6, -6], [8, 7, 0, 7, 1], [27, -1, 0, 0, 0]]], [[2.5, -1.0, 5.0, 0.75], True, []]], [[[-2, -2, -1.5, -1.5], [-2, -20], 0.25, 0.5, [[25, -2, 3, 0, 5]]], [[-3.0, -7.5, -1.0, -1.0], True, []]], [[[4, 4, 5, 7], [-2, 0], 0.25, 0.0, [[14, -3, 3, -1, 3], [19, 5, -3, 6, -3], [11, -5, 3, -3, 4], [29, 6, 1, 8, 1], [26, -4, 8, -3, 9]]], [[3.5, 4.0, 5.0, 7.0], False, []]]], [[[[1, 0, 2, 3], [-12, 3], 0.25, 0.25, [[1, 4, -4, 5, -4], [13, -8, 4, -7, 4]]], [[-2.25, -0.25, 2.25, 4.0], True, []]], [[[-1, -2, 1, -1], [30, 0], 0.125, 0.0, [[28, -2, -2, -2, 0]]], [[-1.0, -2.0, 4.75, -1.0], True, []]], [[[3, -4, 5, -3], [-2, 3], 0.25, 0.25, [[27, 3, -4, 3, -4], [3, -4, 4, -3, 5], [6, 3, -8, 3, -8], [10, -8, 1, -6, 1]]], [[2.25, -4.25, 5.25, -2.0], True, [27]]], [[[-2, -2, 0, 1], [-12, 0], 0.0625, 0.25, [[14, 3, 5, 4, 5], [16, -7, 4, -7, 5], [19, 2, -6, 4, -6], [25, -6, -6, -5, -5]]], [[-3.0, -2.25, 0.25, 1.25], False, []]], [[[-2, -1, 0, 0], [-12, 0], 0.0625, 0.25, [[11, 3, -5, 4, -5], [2, -7, 2, -6, 2], [24, 3, 3, 5, 4]]], [[-3.0, -1.25, 0.25, 0.25], True, []]], [[[-1, -4, 1, -3.5], [8, 3], 0.25, 0.0, [[2, -1, -3, 0, -2], [7, 7, -8, 9, -7]]], [[-1.0, -4.0, 3.0, -2.75], True, [2]]], [[[-4, -3, -3, -2.5], [8, -20], 0.0625, 0.0, [[26, 6, -6, 7, -4], [7, 8, -4, 10, -2], [27, 7, 1, 7, 3], [4, -7, -8, -6, -7], [20, 5, 5, 5, 6]]], [[-4.0, -4.25, -2.5, -2.5], True, []]], [[[-2, 3, -1, 3.5], [8, 3], 0.0625, 0.5, [[12, 0, -4, 1, -2], [2, -1, -8, 0, -7]]], [[-2.5, 2.5, 0.0, 4.1875], True, []]]], [[[[-2, -3, 0, 0], [0, 16], 0.0625, 0.5, [[23, 3, 1, 5, 2], [3, 4, 3, 4, 3], [8, 1, 7, 3, 7]]], [[-2.5, -3.5, 0.5, 1.5], False, []]], [[[-3, 4, -2, 5], [2, 16], 0.25, 0.5, [[16, 1, 6, 2, 6], [24, 4, 4, 5, 5], [28, 0, 7, 2, 7], [29, -5, 8, -5, 8]]], [[-3.5, 3.5, -1.0, 9.5], True, []]], [[[-4, 3, -3, 3.5], [0, 3], 0.25, 0.5, [[26, -4, 7, -3, 8]]], [[-4.5, 2.5, -2.5, 4.75], True, []]], [[[-4, -4, -3.5, -1], [8, 16], 0.25, 0.5, [[10, -1, 8, -1, 10], [20, 2, 7, 4, 9], [24, -1, 8, 1, 10], [1, -8, -6, -8, -5], [8, 2, 3, 2, 4]]], [[-4.5, -4.5, -1.0, 3.5], True, []]], [[[1, -1, 1.5, 2], [-12, 16], 0.25, 0.0, [[4, 7, 4, 7, 5], [23, 1, -8, 1, -8], [22, -6, -4, -6, -4], [5, -7, 6, -7, 6], [27, 7, 2, 9, 4]]], [[-2.0, -1.0, 1.5, 6.0], 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]]], [[[-3, 1, -2.5, 1.5], [0, 3], 0.125, 0.0, [[16, 6, -5, 8, -5]]], [[-3.0, 1.0, -2.5, 1.875], True, []]], [[[3, -3, 4, 0], [-2, 3], 0.125, 0.0, [[27, 4, 3, 6, 5], [8, -3, 0, -2, 2]]], [[2.75, -3.0, 4.0, 0.375], False, []]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"case %d\" % i, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"879a5985770e2b6c54731ff5b740dc54a7335decb314278af4acc68d43e067ff","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(box, vel, dt, margin, others):\n    dx, dy = vel[0] * dt, vel[1] * dt\n    sw = [min(box[0], box[0] + dx), min(box[1], box[1] + dy),\n          max(box[2], box[2] + dx) + margin, max(box[3], box[3] + dy) + margin]\n    ext = min(box[2] - box[0], box[3] - box[1])\n    fast = math.hypot(dx, dy) > 0.5 * ext\n    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])\n    return [[round(c, 6) for c in sw], fast, hits]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[2, -2, 3, -1], [30, 16], 0.25, 0.0, [[2, 6, -8, 8, -8], [11, 1, 7, 2, 8], [27, 8, 0, 9, 2]]], [[2.0, -2.0, 10.5, 3.0], True, [27]]], [[[4, -2, 6, 1], [-12, 0], 0.25, 0.5, [[6, 7, -2, 9, -1], [21, 6, 0, 7, 2], [16, -8, 2, -7, 4], [12, 7, -5, 9, -5], [5, 7, 8, 7, 10]]], [[0.5, -2.5, 6.5, 1.5], True, [21]]], [[[3, 1, 5, 4], [-12, 16], 0.125, 0.25, [[1, 5, -2, 7, 0]]], [[1.25, 0.75, 5.25, 6.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, []]], [[[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, []]], [[[-3, 4, -2.5, 5], [0, -20], 0.0625, 0.5, [[5, -4, -7, -3, -7], [16, 1, -1, 1, -1], [28, -7, -3, -6, -1]]], [[-3.5, 2.25, -2.0, 5.5], 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, 1.5, 4], [-2, 16], 0.125, 0.25, [[3, 3, 2, 3, 4], [21, 6, 4, 6, 4]]], [[0.5, 0.75, 1.75, 6.25], True, []]]], [[[[0, -4, 1, -1], [8, 3], 0.25, 0.25, [[9, 3, -1, 3, 0]]], [[-0.25, -4.25, 3.25, 0.0], True, [9]]], [[[2, 0, 4, 3], [2, 0], 0.0625, 0.0, [[28, 7, -1, 8, -1], [1, 3, 2, 3, 2], [23, 5, -3, 5, -3], [29, 4, 2, 5, 4], [5, 7, 0, 9, 0]]], [[2.0, 0.0, 4.125, 3.0], False, [1, 29]]], [[[3, 1, 4, 2], [-2, -3], 0.25, 0.25, [[2, -6, -4, -4, -3], [22, -6, 1, -6, 1], [11, 1, 5, 2, 5], [15, -1, -8, 0, -8]]], [[2.25, 0.0, 4.25, 2.25], True, []]], [[[2, -1, 4, 0], [0, 16], 0.25, 0.5, [[12, -8, -4, -8, -4], [19, 7, 2, 7, 2], [16, -2, 2, -2, 4]]], [[1.5, -1.5, 4.5, 4.5], True, []]], [[[2, 3, 4, 3.5], [0, 3], 0.25, 0.25, [[25, 5, 7, 5, 7], [20, 7, -1, 9, 1], [24, 2, -8, 4, -8], [28, -3, -7, -3, -7]]], [[1.75, 2.75, 4.25, 4.5], True, []]], [[[-4, 1, -3.5, 2], [-12, 16], 0.0625, 0.0, [[15, 5, -7, 7, -6]]], [[-4.75, 1.0, -3.5, 3.0], True, []]], [[[-1, 1, 0, 1.5], [-2, -20], 0.0625, 0.25, [[25, 0, 4, 1, 5], [11, -1, 3, 1, 5], [22, 4, 7, 4, 9], [23, 1, -1, 2, 1], [8, -4, -4, -3, -3]]], [[-1.375, -0.5, 0.25, 1.75], True, []]], [[[4, -2, 5, -1.5], [2, 16], 0.0625, 0.0, [[2, -1, 1, 1, 2], [20, -1, -1, -1, -1]]], [[4.0, -2.0, 5.125, -0.5], True, []]]], [[[[-2, 3, -1.5, 6], [30, -3], 0.125, 0.25, [[21, 1, 4, 3, 4], [25, -1, 2, 0, 4], [8, -3, 4, -1, 5], [6, 2, -2, 4, 0], [16, 2, 7, 4, 9]]], [[-2.25, 2.375, 2.5, 6.25], True, [8, 21, 25]]], [[[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]]], [[[-2, 2, -1.5, 5], [0, -3], 0.125, 0.5, [[23, -4, 0, -4, 2], [22, -6, -3, -6, -1], [7, 8, -1, 8, 1], [4, -4, -4, -3, -2]]], [[-2.5, 1.125, -1.0, 5.5], 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, []]], [[[1, 0, 2, 3], [-2, -3], 0.125, 0.0, [[10, -7, 6, -5, 8], [16, -3, 2, -3, 3], [19, -8, -5, -8, -4], [11, 1, -7, 1, -7]]], [[0.75, -0.375, 2.0, 3.0], False, []]], [[[3, -1, 5, 0], [-2, 3], 0.25, 0.0, [[5, -8, -7, -6, -6], [8, 7, 0, 7, 1], [27, -1, 0, 0, 0]]], [[2.5, -1.0, 5.0, 0.75], True, []]], [[[-2, -2, -1.5, -1.5], [-2, -20], 0.25, 0.5, [[25, -2, 3, 0, 5]]], [[-3.0, -7.5, -1.0, -1.0], True, []]], [[[4, 4, 5, 7], [-2, 0], 0.25, 0.0, [[14, -3, 3, -1, 3], [19, 5, -3, 6, -3], [11, -5, 3, -3, 4], [29, 6, 1, 8, 1], [26, -4, 8, -3, 9]]], [[3.5, 4.0, 5.0, 7.0], False, []]]], [[[[1, 0, 2, 3], [-12, 3], 0.25, 0.25, [[1, 4, -4, 5, -4], [13, -8, 4, -7, 4]]], [[-2.25, -0.25, 2.25, 4.0], True, []]], [[[-1, -2, 1, -1], [30, 0], 0.125, 0.0, [[28, -2, -2, -2, 0]]], [[-1.0, -2.0, 4.75, -1.0], True, []]], [[[3, -4, 5, -3], [-2, 3], 0.25, 0.25, [[27, 3, -4, 3, -4], [3, -4, 4, -3, 5], [6, 3, -8, 3, -8], [10, -8, 1, -6, 1]]], [[2.25, -4.25, 5.25, -2.0], True, [27]]], [[[-2, -2, 0, 1], [-12, 0], 0.0625, 0.25, [[14, 3, 5, 4, 5], [16, -7, 4, -7, 5], [19, 2, -6, 4, -6], [25, -6, -6, -5, -5]]], [[-3.0, -2.25, 0.25, 1.25], False, []]], [[[-2, -1, 0, 0], [-12, 0], 0.0625, 0.25, [[11, 3, -5, 4, -5], [2, -7, 2, -6, 2], [24, 3, 3, 5, 4]]], [[-3.0, -1.25, 0.25, 0.25], True, []]], [[[-1, -4, 1, -3.5], [8, 3], 0.25, 0.0, [[2, -1, -3, 0, -2], [7, 7, -8, 9, -7]]], [[-1.0, -4.0, 3.0, -2.75], True, [2]]], [[[-4, -3, -3, -2.5], [8, -20], 0.0625, 0.0, [[26, 6, -6, 7, -4], [7, 8, -4, 10, -2], [27, 7, 1, 7, 3], [4, -7, -8, -6, -7], [20, 5, 5, 5, 6]]], [[-4.0, -4.25, -2.5, -2.5], True, []]], [[[-2, 3, -1, 3.5], [8, 3], 0.0625, 0.5, [[12, 0, -4, 1, -2], [2, -1, -8, 0, -7]]], [[-2.5, 2.5, 0.0, 4.1875], True, []]]], [[[[-2, -3, 0, 0], [0, 16], 0.0625, 0.5, [[23, 3, 1, 5, 2], [3, 4, 3, 4, 3], [8, 1, 7, 3, 7]]], [[-2.5, -3.5, 0.5, 1.5], False, []]], [[[-3, 4, -2, 5], [2, 16], 0.25, 0.5, [[16, 1, 6, 2, 6], [24, 4, 4, 5, 5], [28, 0, 7, 2, 7], [29, -5, 8, -5, 8]]], [[-3.5, 3.5, -1.0, 9.5], True, []]], [[[-4, 3, -3, 3.5], [0, 3], 0.25, 0.5, [[26, -4, 7, -3, 8]]], [[-4.5, 2.5, -2.5, 4.75], True, []]], [[[-4, -4, -3.5, -1], [8, 16], 0.25, 0.5, [[10, -1, 8, -1, 10], [20, 2, 7, 4, 9], [24, -1, 8, 1, 10], [1, -8, -6, -8, -5], [8, 2, 3, 2, 4]]], [[-4.5, -4.5, -1.0, 3.5], True, []]], [[[1, -1, 1.5, 2], [-12, 16], 0.25, 0.0, [[4, 7, 4, 7, 5], [23, 1, -8, 1, -8], [22, -6, -4, -6, -4], [5, -7, 6, -7, 6], [27, 7, 2, 9, 4]]], [[-2.0, -1.0, 1.5, 6.0], 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]]], [[[-3, 1, -2.5, 1.5], [0, 3], 0.125, 0.0, [[16, 6, -5, 8, -5]]], [[-3.0, 1.0, -2.5, 1.875], True, []]], [[[3, -3, 4, 0], [-2, 3], 0.125, 0.0, [[27, 4, 3, 6, 5], [8, -3, 0, -2, 2]]], [[2.75, -3.0, 4.0, 0.375], False, []]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"case %d\" % i, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"ff9b321b290ed807c482b034629452977d47a92c2c9abd227c33dfac8c408950","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(box, vel, dt, margin, others):\n    dx, dy = vel[0] * dt, vel[1] * dt\n    sw = [min(box[0], box[0] + dx) - margin, min(box[1], box[1] + dy) - margin,\n          max(box[2], box[2] + dx) + margin, max(box[3], box[3] + dy) + margin]\n    ext = min(box[2] - box[0], box[3] - box[1])\n    fast = math.hypot(dx, dy) > 0.5 * ext\n    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])\n    return [[round(c, 6) for c in sw], fast, hits]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[2, -2, 3, -1], [30, 16], 0.25, 0.0, [[2, 6, -8, 8, -8], [11, 1, 7, 2, 8], [27, 8, 0, 9, 2]]], [[2.0, -2.0, 10.5, 3.0], True, [27]]], [[[4, -2, 6, 1], [-12, 0], 0.25, 0.5, [[6, 7, -2, 9, -1], [21, 6, 0, 7, 2], [16, -8, 2, -7, 4], [12, 7, -5, 9, -5], [5, 7, 8, 7, 10]]], [[0.5, -2.5, 6.5, 1.5], True, [21]]], [[[3, 1, 5, 4], [-12, 16], 0.125, 0.25, [[1, 5, -2, 7, 0]]], [[1.25, 0.75, 5.25, 6.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, []]], [[[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, []]], [[[-3, 4, -2.5, 5], [0, -20], 0.0625, 0.5, [[5, -4, -7, -3, -7], [16, 1, -1, 1, -1], [28, -7, -3, -6, -1]]], [[-3.5, 2.25, -2.0, 5.5], 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, 1.5, 4], [-2, 16], 0.125, 0.25, [[3, 3, 2, 3, 4], [21, 6, 4, 6, 4]]], [[0.5, 0.75, 1.75, 6.25], True, []]]], [[[[0, -4, 1, -1], [8, 3], 0.25, 0.25, [[9, 3, -1, 3, 0]]], [[-0.25, -4.25, 3.25, 0.0], True, [9]]], [[[2, 0, 4, 3], [2, 0], 0.0625, 0.0, [[28, 7, -1, 8, -1], [1, 3, 2, 3, 2], [23, 5, -3, 5, -3], [29, 4, 2, 5, 4], [5, 7, 0, 9, 0]]], [[2.0, 0.0, 4.125, 3.0], False, [1, 29]]], [[[3, 1, 4, 2], [-2, -3], 0.25, 0.25, [[2, -6, -4, -4, -3], [22, -6, 1, -6, 1], [11, 1, 5, 2, 5], [15, -1, -8, 0, -8]]], [[2.25, 0.0, 4.25, 2.25], True, []]], [[[2, -1, 4, 0], [0, 16], 0.25, 0.5, [[12, -8, -4, -8, -4], [19, 7, 2, 7, 2], [16, -2, 2, -2, 4]]], [[1.5, -1.5, 4.5, 4.5], True, []]], [[[2, 3, 4, 3.5], [0, 3], 0.25, 0.25, [[25, 5, 7, 5, 7], [20, 7, -1, 9, 1], [24, 2, -8, 4, -8], [28, -3, -7, -3, -7]]], [[1.75, 2.75, 4.25, 4.5], True, []]], [[[-4, 1, -3.5, 2], [-12, 16], 0.0625, 0.0, [[15, 5, -7, 7, -6]]], [[-4.75, 1.0, -3.5, 3.0], True, []]], [[[-1, 1, 0, 1.5], [-2, -20], 0.0625, 0.25, [[25, 0, 4, 1, 5], [11, -1, 3, 1, 5], [22, 4, 7, 4, 9], [23, 1, -1, 2, 1], [8, -4, -4, -3, -3]]], [[-1.375, -0.5, 0.25, 1.75], True, []]], [[[4, -2, 5, -1.5], [2, 16], 0.0625, 0.0, [[2, -1, 1, 1, 2], [20, -1, -1, -1, -1]]], [[4.0, -2.0, 5.125, -0.5], True, []]]], [[[[-2, 3, -1.5, 6], [30, -3], 0.125, 0.25, [[21, 1, 4, 3, 4], [25, -1, 2, 0, 4], [8, -3, 4, -1, 5], [6, 2, -2, 4, 0], [16, 2, 7, 4, 9]]], [[-2.25, 2.375, 2.5, 6.25], True, [8, 21, 25]]], [[[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]]], [[[-2, 2, -1.5, 5], [0, -3], 0.125, 0.5, [[23, -4, 0, -4, 2], [22, -6, -3, -6, -1], [7, 8, -1, 8, 1], [4, -4, -4, -3, -2]]], [[-2.5, 1.125, -1.0, 5.5], 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, []]], [[[1, 0, 2, 3], [-2, -3], 0.125, 0.0, [[10, -7, 6, -5, 8], [16, -3, 2, -3, 3], [19, -8, -5, -8, -4], [11, 1, -7, 1, -7]]], [[0.75, -0.375, 2.0, 3.0], False, []]], [[[3, -1, 5, 0], [-2, 3], 0.25, 0.0, [[5, -8, -7, -6, -6], [8, 7, 0, 7, 1], [27, -1, 0, 0, 0]]], [[2.5, -1.0, 5.0, 0.75], True, []]], [[[-2, -2, -1.5, -1.5], [-2, -20], 0.25, 0.5, [[25, -2, 3, 0, 5]]], [[-3.0, -7.5, -1.0, -1.0], True, []]], [[[4, 4, 5, 7], [-2, 0], 0.25, 0.0, [[14, -3, 3, -1, 3], [19, 5, -3, 6, -3], [11, -5, 3, -3, 4], [29, 6, 1, 8, 1], [26, -4, 8, -3, 9]]], [[3.5, 4.0, 5.0, 7.0], False, []]]], [[[[1, 0, 2, 3], [-12, 3], 0.25, 0.25, [[1, 4, -4, 5, -4], [13, -8, 4, -7, 4]]], [[-2.25, -0.25, 2.25, 4.0], True, []]], [[[-1, -2, 1, -1], [30, 0], 0.125, 0.0, [[28, -2, -2, -2, 0]]], [[-1.0, -2.0, 4.75, -1.0], True, []]], [[[3, -4, 5, -3], [-2, 3], 0.25, 0.25, [[27, 3, -4, 3, -4], [3, -4, 4, -3, 5], [6, 3, -8, 3, -8], [10, -8, 1, -6, 1]]], [[2.25, -4.25, 5.25, -2.0], True, [27]]], [[[-2, -2, 0, 1], [-12, 0], 0.0625, 0.25, [[14, 3, 5, 4, 5], [16, -7, 4, -7, 5], [19, 2, -6, 4, -6], [25, -6, -6, -5, -5]]], [[-3.0, -2.25, 0.25, 1.25], False, []]], [[[-2, -1, 0, 0], [-12, 0], 0.0625, 0.25, [[11, 3, -5, 4, -5], [2, -7, 2, -6, 2], [24, 3, 3, 5, 4]]], [[-3.0, -1.25, 0.25, 0.25], True, []]], [[[-1, -4, 1, -3.5], [8, 3], 0.25, 0.0, [[2, -1, -3, 0, -2], [7, 7, -8, 9, -7]]], [[-1.0, -4.0, 3.0, -2.75], True, [2]]], [[[-4, -3, -3, -2.5], [8, -20], 0.0625, 0.0, [[26, 6, -6, 7, -4], [7, 8, -4, 10, -2], [27, 7, 1, 7, 3], [4, -7, -8, -6, -7], [20, 5, 5, 5, 6]]], [[-4.0, -4.25, -2.5, -2.5], True, []]], [[[-2, 3, -1, 3.5], [8, 3], 0.0625, 0.5, [[12, 0, -4, 1, -2], [2, -1, -8, 0, -7]]], [[-2.5, 2.5, 0.0, 4.1875], True, []]]], [[[[-2, -3, 0, 0], [0, 16], 0.0625, 0.5, [[23, 3, 1, 5, 2], [3, 4, 3, 4, 3], [8, 1, 7, 3, 7]]], [[-2.5, -3.5, 0.5, 1.5], False, []]], [[[-3, 4, -2, 5], [2, 16], 0.25, 0.5, [[16, 1, 6, 2, 6], [24, 4, 4, 5, 5], [28, 0, 7, 2, 7], [29, -5, 8, -5, 8]]], [[-3.5, 3.5, -1.0, 9.5], True, []]], [[[-4, 3, -3, 3.5], [0, 3], 0.25, 0.5, [[26, -4, 7, -3, 8]]], [[-4.5, 2.5, -2.5, 4.75], True, []]], [[[-4, -4, -3.5, -1], [8, 16], 0.25, 0.5, [[10, -1, 8, -1, 10], [20, 2, 7, 4, 9], [24, -1, 8, 1, 10], [1, -8, -6, -8, -5], [8, 2, 3, 2, 4]]], [[-4.5, -4.5, -1.0, 3.5], True, []]], [[[1, -1, 1.5, 2], [-12, 16], 0.25, 0.0, [[4, 7, 4, 7, 5], [23, 1, -8, 1, -8], [22, -6, -4, -6, -4], [5, -7, 6, -7, 6], [27, 7, 2, 9, 4]]], [[-2.0, -1.0, 1.5, 6.0], 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]]], [[[-3, 1, -2.5, 1.5], [0, 3], 0.125, 0.0, [[16, 6, -5, 8, -5]]], [[-3.0, 1.0, -2.5, 1.875], True, []]], [[[3, -3, 4, 0], [-2, 3], 0.125, 0.0, [[27, 4, 3, 6, 5], [8, -3, 0, -2, 2]]], [[2.75, -3.0, 4.0, 0.375], False, []]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"case %d\" % i, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-collision_detection_broadphase-swept-ccd-bounds-speculative-margin-sides","generated_at":"2026-09-29T14:51:01.168934+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"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.","repair":"Expand every side by the margin.","root_cause":"The min corner omits the margin.","sha256":"47c1686028d282029c68e5b8769b731158ea55122ca47e7f266200f4fb2a1219","title":"Speculative margin is added only on the maximum sides · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.331,"exit_code":1,"observations":[{"actual":[[2.0,-2,10.5,3.0],true,[27]],"check":"case 0","expected":[[2.0,-2.0,10.5,3.0],true,[27]],"passed":true},{"actual":[[0.5,-2,6.5,1.5],true,[21]],"check":"case 1","expected":[[0.5,-2.5,6.5,1.5],true,[21]],"passed":false},{"actual":[[1.25,1,5.25,6.25],true,[]],"check":"case 2","expected":[[1.25,0.75,5.25,6.25],true,[]],"passed":false},{"actual":[[-0.5,4,4.5,6.25],true,[]],"check":"case 3","expected":[[-0.5,3.5,4.5,6.25],true,[]],"passed":false},{"actual":[[-0.125,0,1.0,1.5],true,[]],"check":"case 4","expected":[[-0.125,0.0,1.0,1.5],true,[]],"passed":true},{"actual":[[-3.5,2.75,-2.0,5.5],true,[]],"check":"case 5","expected":[[-3.5,2.25,-2.0,5.5],true,[]],"passed":false},{"actual":[[0.0,2,3.875,4.0],true,[]],"check":"case 6","expected":[[0.0,2.0,3.875,4.0],true,[]],"passed":true},{"actual":[[0.5,1,1.75,6.25],true,[]],"check":"case 7","expected":[[0.5,0.75,1.75,6.25],true,[]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [[2.0, -2, 10.5, 3.0], true, [27]], \"expected\": [[2.0, -2.0, 10.5, 3.0], true, [27]], \"passed\": true}, {\"check\": \"case 1\", \"actual\": [[0.5, -2, 6.5, 1.5], true, [21]], \"expected\": [[0.5, -2.5, 6.5, 1.5], true, [21]], \"passed\": false}, {\"check\": \"case 2\", \"actual\": [[1.25, 1, 5.25, 6.25], true, []], \"expected\": [[1.25, 0.75, 5.25, 6.25], true, []], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [[-0.5, 4, 4.5, 6.25], true, []], \"expected\": [[-0.5, 3.5, 4.5, 6.25], true, []], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [[-0.125, 0, 1.0, 1.5], true, []], \"expected\": [[-0.125, 0.0, 1.0, 1.5], true, []], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [[-3.5, 2.75, -2.0, 5.5], true, []], \"expected\": [[-3.5, 2.25, -2.0, 5.5], true, []], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [[0.0, 2, 3.875, 4.0], true, []], \"expected\": [[0.0, 2.0, 3.875, 4.0], true, []], \"passed\": true}, {\"check\": \"case 7\", \"actual\": [[0.5, 1, 1.75, 6.25], true, []], \"expected\": [[0.5, 0.75, 1.75, 6.25], true, []], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.593,"exit_code":1,"observations":[{"actual":[[2,-2,10.5,3.0],true,[27]],"check":"case 0","expected":[[2.0,-2.0,10.5,3.0],true,[27]],"passed":true},{"actual":[[1.0,-2,6.5,1.5],true,[21]],"check":"case 1","expected":[[0.5,-2.5,6.5,1.5],true,[21]],"passed":false},{"actual":[[1.5,1,5.25,6.25],true,[]],"check":"case 2","expected":[[1.25,0.75,5.25,6.25],true,[]],"passed":false},{"actual":[[0,4,4.5,6.25],true,[]],"check":"case 3","expected":[[-0.5,3.5,4.5,6.25],true,[]],"passed":false},{"actual":[[-0.125,0,1.0,1.5],true,[]],"check":"case 4","expected":[[-0.125,0.0,1.0,1.5],true,[]],"passed":true},{"actual":[[-3,2.75,-2.0,5.5],true,[]],"check":"case 5","expected":[[-3.5,2.25,-2.0,5.5],true,[]],"passed":false},{"actual":[[0,2,3.875,4.0],true,[]],"check":"case 6","expected":[[0.0,2.0,3.875,4.0],true,[]],"passed":true},{"actual":[[0.75,1,1.75,6.25],true,[]],"check":"case 7","expected":[[0.5,0.75,1.75,6.25],true,[]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [[2, -2, 10.5, 3.0], true, [27]], \"expected\": [[2.0, -2.0, 10.5, 3.0], true, [27]], \"passed\": true}, {\"check\": \"case 1\", \"actual\": [[1.0, -2, 6.5, 1.5], true, [21]], \"expected\": [[0.5, -2.5, 6.5, 1.5], true, [21]], \"passed\": false}, {\"check\": \"case 2\", \"actual\": [[1.5, 1, 5.25, 6.25], true, []], \"expected\": [[1.25, 0.75, 5.25, 6.25], true, []], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [[0, 4, 4.5, 6.25], true, []], \"expected\": [[-0.5, 3.5, 4.5, 6.25], true, []], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [[-0.125, 0, 1.0, 1.5], true, []], \"expected\": [[-0.125, 0.0, 1.0, 1.5], true, []], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [[-3, 2.75, -2.0, 5.5], true, []], \"expected\": [[-3.5, 2.25, -2.0, 5.5], true, []], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [[0, 2, 3.875, 4.0], true, []], \"expected\": [[0.0, 2.0, 3.875, 4.0], true, []], \"passed\": true}, {\"check\": \"case 7\", \"actual\": [[0.75, 1, 1.75, 6.25], true, []], \"expected\": [[0.5, 0.75, 1.75, 6.25], true, []], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.215,"exit_code":0,"observations":[{"actual":[[2.0,-2.0,10.5,3.0],true,[27]],"check":"case 0","expected":[[2.0,-2.0,10.5,3.0],true,[27]],"passed":true},{"actual":[[0.5,-2.5,6.5,1.5],true,[21]],"check":"case 1","expected":[[0.5,-2.5,6.5,1.5],true,[21]],"passed":true},{"actual":[[1.25,0.75,5.25,6.25],true,[]],"check":"case 2","expected":[[1.25,0.75,5.25,6.25],true,[]],"passed":true},{"actual":[[-0.5,3.5,4.5,6.25],true,[]],"check":"case 3","expected":[[-0.5,3.5,4.5,6.25],true,[]],"passed":true},{"actual":[[-0.125,0.0,1.0,1.5],true,[]],"check":"case 4","expected":[[-0.125,0.0,1.0,1.5],true,[]],"passed":true},{"actual":[[-3.5,2.25,-2.0,5.5],true,[]],"check":"case 5","expected":[[-3.5,2.25,-2.0,5.5],true,[]],"passed":true},{"actual":[[0.0,2.0,3.875,4.0],true,[]],"check":"case 6","expected":[[0.0,2.0,3.875,4.0],true,[]],"passed":true},{"actual":[[0.5,0.75,1.75,6.25],true,[]],"check":"case 7","expected":[[0.5,0.75,1.75,6.25],true,[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [[2.0, -2.0, 10.5, 3.0], true, [27]], \"expected\": [[2.0, -2.0, 10.5, 3.0], true, [27]], \"passed\": true}, {\"check\": \"case 1\", \"actual\": [[0.5, -2.5, 6.5, 1.5], true, [21]], \"expected\": [[0.5, -2.5, 6.5, 1.5], true, [21]], \"passed\": true}, {\"check\": \"case 2\", \"actual\": [[1.25, 0.75, 5.25, 6.25], true, []], \"expected\": [[1.25, 0.75, 5.25, 6.25], true, []], \"passed\": true}, {\"check\": \"case 3\", \"actual\": [[-0.5, 3.5, 4.5, 6.25], true, []], \"expected\": [[-0.5, 3.5, 4.5, 6.25], true, []], \"passed\": true}, {\"check\": \"case 4\", \"actual\": [[-0.125, 0.0, 1.0, 1.5], true, []], \"expected\": [[-0.125, 0.0, 1.0, 1.5], true, []], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [[-3.5, 2.25, -2.0, 5.5], true, []], \"expected\": [[-3.5, 2.25, -2.0, 5.5], true, []], \"passed\": true}, {\"check\": \"case 6\", \"actual\": [[0.0, 2.0, 3.875, 4.0], true, []], \"expected\": [[0.0, 2.0, 3.875, 4.0], true, []], \"passed\": true}, {\"check\": \"case 7\", \"actual\": [[0.5, 0.75, 1.75, 6.25], true, []], \"expected\": [[0.5, 0.75, 1.75, 6.25], true, []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}