{"abstract":"Splitting off a single outlier on the far side is never considered.","category":"Collision detection broadphase","checks":8,"contract":"solve(prims): top-down BVH build step. Split axis = larger centroid extent (x on ties). Primitives sorted by centroid on that axis (index tiebreak). Cost of split k = 1 + (P(L)*k + P(R)*(n-k))/P(parent) with P the box perimeter of the primitives' bounds; leaf cost n. Return [best k or 0 for leaf, axis, cost rounded to 6, sorted left indices].","contract_signature":"prims","evaluation_group":"w2-collision_detection_broadphase-sah-split-selection","failed_approach":"Starting at k=2 skips the first candidate instead.","family":"w2-collision_detection_broadphase-sah-split-selection-candidate-split-range","id":"FA-87446","implementations":{"attempt":{"sha256":"257bb14b9596b0147f4e85268f11a40ac2fe18365fb510a6df90fe8c60d70073","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(prims):\n    n = len(prims)\n    cent = [((p[0] + p[2]) / 2, (p[1] + p[3]) / 2) for p in prims]\n    ex = max(c[0] for c in cent) - min(c[0] for c in cent)\n    ey = max(c[1] for c in cent) - min(c[1] for c in cent)\n    axis = 0 if ex >= ey else 1\n    order = sorted(range(n), key=lambda i: (cent[i][axis], i))\n    def box(ids):\n        return [min(prims[i][0] for i in ids), min(prims[i][1] for i in ids), max(prims[i][2] for i in ids), max(prims[i][3] for i in ids)]\n    def perim(b):\n        return 2 * ((b[2] - b[0]) + (b[3] - b[1]))\n    pa = perim(box(order))\n    best_k, best = 0, float(n)\n    for k in range(2, n):\n        cost = 1 + (perim(box(order[:k])) * k + perim(box(order[k:])) * (n - k)) / pa\n        if cost < best:\n            best_k, best = k, cost\n    return [best_k, axis, round(best, 6), sorted(order[:best_k])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[[7, 6, 12, 8], [6, 7, 13, 10], [3, 6, 8, 10], [1, 2, 2, 4]]], [1, 0, 3.25, [3]]], [[[[5, 4, 6, 7], [8, 9, 14, 15], [5, 0, 7, 2], [7, 6, 8, 9]]], [3, 1, 3.0, [0, 2, 3]]], [[[[9, 5, 12, 11], [10, 8, 17, 13], [3, 8, 8, 15], [10, 6, 15, 10], [8, 5, 11, 11], [8, 3, 11, 5]]], [1, 0, 5.115385, [2]]], [[[[0, 7, 6, 9], [10, 2, 14, 6]]], [1, 0, 1.761905, [0]]], [[[[3, 5, 4, 8], [0, 1, 4, 8], [3, 6, 9, 11], [4, 1, 8, 3], [10, 3, 17, 7]]], [4, 0, 4.222222, [0, 1, 2, 3]]], [[[[10, 3, 13, 6], [4, 9, 7, 15]]], [1, 1, 1.714286, [0]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[3, 5, 5, 12], [7, 1, 11, 2], [0, 10, 6, 16]]], [1, 1, 2.5, [1]]]], [[[[[8, 9, 12, 16], [4, 0, 10, 3], [6, 3, 10, 5], [0, 3, 6, 7], [7, 0, 13, 7]]], [4, 1, 4.137931, [1, 2, 3, 4]]], [[[[8, 3, 10, 6], [1, 0, 2, 4]]], [1, 0, 1.666667, [1]]], [[[[0, 0, 6, 2], [2, 10, 5, 16]]], [1, 1, 1.772727, [0]]], [[[[1, 2, 7, 4], [7, 2, 10, 9], [0, 0, 3, 4], [6, 10, 10, 11], [1, 0, 5, 4], [3, 4, 5, 10], [7, 9, 12, 15]]], [3, 1, 5.481481, [0, 2, 4]]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[4, 9, 8, 10], [2, 5, 7, 7], [2, 9, 3, 10], [9, 10, 10, 17], [4, 7, 8, 8]]], [4, 1, 3.6, [0, 1, 2, 4]]], [[[[8, 5, 12, 10], [9, 8, 15, 15]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 7], [8, 7, 11, 10], [10, 0, 11, 1], [0, 8, 4, 15], [7, 3, 10, 7]]], [4, 1, 3.576923, [0, 1, 2, 4]]]], [[[[[9, 9, 14, 10], [8, 10, 11, 14], [7, 3, 11, 4]]], [1, 1, 2.5, [2]]], [[[[7, 7, 13, 11], [6, 10, 12, 15], [10, 10, 11, 16], [2, 10, 5, 14], [5, 5, 12, 9], [6, 5, 10, 9]]], [1, 0, 5.636364, [3]]], [[[[9, 7, 13, 11], [6, 3, 8, 5]]], [1, 1, 1.8, [1]]], [[[[3, 10, 5, 12], [6, 4, 9, 11], [8, 7, 14, 11], [10, 2, 13, 8], [3, 9, 4, 10], [3, 3, 9, 8]]], [2, 0, 5.285714, [0, 4]]], [[[[6, 4, 13, 11], [2, 7, 9, 8], [6, 5, 12, 6], [6, 10, 13, 15]]], [0, 1, 4.0, []]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[7, 0, 10, 1], [0, 8, 6, 13]]], [1, 1, 1.652174, [0]]], [[[[2, 1, 7, 3], [2, 3, 3, 9], [2, 1, 8, 8], [7, 4, 10, 5], [1, 9, 5, 16], [2, 2, 9, 8]]], [5, 1, 4.791667, [0, 1, 2, 3, 5]]]], [[[[[1, 5, 7, 6], [9, 5, 11, 9], [0, 7, 1, 10]]], [2, 0, 2.875, [0, 2]]], [[[[9, 5, 16, 9], [3, 2, 10, 4], [7, 8, 8, 12]]], [1, 1, 2.782609, [1]]], [[[[9, 7, 15, 12], [8, 5, 15, 7], [3, 6, 4, 10]]], [1, 0, 2.736842, [2]]], [[[[8, 2, 10, 3], [6, 1, 9, 7], [6, 10, 10, 15], [5, 0, 9, 5], [2, 10, 9, 11], [2, 1, 6, 6], [5, 9, 9, 10]]], [4, 1, 5.434783, [0, 1, 3, 5]]], [[[[3, 8, 6, 12], [9, 5, 16, 12], [2, 10, 3, 14], [2, 6, 6, 13], [10, 3, 14, 8], [7, 9, 12, 16], [7, 8, 10, 15]]], [3, 0, 5.592593, [0, 2, 3]]], [[[[6, 10, 7, 17], [10, 9, 15, 12], [2, 10, 8, 14], [1, 4, 5, 6]]], [2, 0, 3.518519, [2, 3]]], [[[[7, 7, 12, 11], [6, 2, 9, 5], [4, 2, 8, 4], [6, 1, 8, 6], [5, 2, 7, 7]]], [4, 1, 3.944444, [1, 2, 3, 4]]], [[[[8, 4, 11, 8], [1, 9, 5, 10], [1, 3, 6, 6]]], [2, 0, 2.823529, [1, 2]]]], [[[[[0, 6, 2, 8], [1, 3, 5, 10], [7, 1, 12, 4], [3, 10, 10, 17], [10, 4, 11, 6], [5, 7, 12, 8], [5, 9, 10, 15]]], [5, 1, 5.821429, [0, 1, 2, 4, 5]]], [[[[1, 8, 3, 11], [10, 1, 12, 3], [3, 5, 5, 6]]], [2, 0, 2.142857, [0, 2]]], [[[[0, 10, 3, 12], [6, 6, 10, 12]]], [1, 0, 1.9375, [0]]], [[[[0, 9, 2, 11], [4, 1, 7, 6]]], [1, 1, 1.705882, [1]]], [[[[2, 0, 8, 4], [10, 6, 14, 8], [9, 6, 15, 8], [7, 7, 10, 12], [9, 6, 15, 8], [8, 6, 9, 13]]], [1, 1, 4.269231, [0]]], [[[[9, 0, 16, 4], [8, 7, 14, 8], [0, 9, 3, 13]]], [1, 0, 2.344828, [2]]], [[[[6, 6, 13, 10], [0, 0, 1, 5], [1, 7, 7, 11]]], [1, 0, 2.666667, [1]]], [[[[0, 10, 4, 12], [4, 4, 11, 8], [2, 10, 4, 12], [1, 8, 8, 15], [0, 8, 1, 14]]], [4, 0, 4.227273, [0, 2, 3, 4]]]]]\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":"90ef3ec43ec06f85de85b093eadc8629ee6e611a2f7df3167597ce7f5f39d7d5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(prims):\n    n = len(prims)\n    cent = [((p[0] + p[2]) / 2, (p[1] + p[3]) / 2) for p in prims]\n    ex = max(c[0] for c in cent) - min(c[0] for c in cent)\n    ey = max(c[1] for c in cent) - min(c[1] for c in cent)\n    axis = 0 if ex >= ey else 1\n    order = sorted(range(n), key=lambda i: (cent[i][axis], i))\n    def box(ids):\n        return [min(prims[i][0] for i in ids), min(prims[i][1] for i in ids), max(prims[i][2] for i in ids), max(prims[i][3] for i in ids)]\n    def perim(b):\n        return 2 * ((b[2] - b[0]) + (b[3] - b[1]))\n    pa = perim(box(order))\n    best_k, best = 0, float(n)\n    for k in range(1, n - 1):\n        cost = 1 + (perim(box(order[:k])) * k + perim(box(order[k:])) * (n - k)) / pa\n        if cost < best:\n            best_k, best = k, cost\n    return [best_k, axis, round(best, 6), sorted(order[:best_k])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[[7, 6, 12, 8], [6, 7, 13, 10], [3, 6, 8, 10], [1, 2, 2, 4]]], [1, 0, 3.25, [3]]], [[[[5, 4, 6, 7], [8, 9, 14, 15], [5, 0, 7, 2], [7, 6, 8, 9]]], [3, 1, 3.0, [0, 2, 3]]], [[[[9, 5, 12, 11], [10, 8, 17, 13], [3, 8, 8, 15], [10, 6, 15, 10], [8, 5, 11, 11], [8, 3, 11, 5]]], [1, 0, 5.115385, [2]]], [[[[0, 7, 6, 9], [10, 2, 14, 6]]], [1, 0, 1.761905, [0]]], [[[[3, 5, 4, 8], [0, 1, 4, 8], [3, 6, 9, 11], [4, 1, 8, 3], [10, 3, 17, 7]]], [4, 0, 4.222222, [0, 1, 2, 3]]], [[[[10, 3, 13, 6], [4, 9, 7, 15]]], [1, 1, 1.714286, [0]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[3, 5, 5, 12], [7, 1, 11, 2], [0, 10, 6, 16]]], [1, 1, 2.5, [1]]]], [[[[[8, 9, 12, 16], [4, 0, 10, 3], [6, 3, 10, 5], [0, 3, 6, 7], [7, 0, 13, 7]]], [4, 1, 4.137931, [1, 2, 3, 4]]], [[[[8, 3, 10, 6], [1, 0, 2, 4]]], [1, 0, 1.666667, [1]]], [[[[0, 0, 6, 2], [2, 10, 5, 16]]], [1, 1, 1.772727, [0]]], [[[[1, 2, 7, 4], [7, 2, 10, 9], [0, 0, 3, 4], [6, 10, 10, 11], [1, 0, 5, 4], [3, 4, 5, 10], [7, 9, 12, 15]]], [3, 1, 5.481481, [0, 2, 4]]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[4, 9, 8, 10], [2, 5, 7, 7], [2, 9, 3, 10], [9, 10, 10, 17], [4, 7, 8, 8]]], [4, 1, 3.6, [0, 1, 2, 4]]], [[[[8, 5, 12, 10], [9, 8, 15, 15]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 7], [8, 7, 11, 10], [10, 0, 11, 1], [0, 8, 4, 15], [7, 3, 10, 7]]], [4, 1, 3.576923, [0, 1, 2, 4]]]], [[[[[9, 9, 14, 10], [8, 10, 11, 14], [7, 3, 11, 4]]], [1, 1, 2.5, [2]]], [[[[7, 7, 13, 11], [6, 10, 12, 15], [10, 10, 11, 16], [2, 10, 5, 14], [5, 5, 12, 9], [6, 5, 10, 9]]], [1, 0, 5.636364, [3]]], [[[[9, 7, 13, 11], [6, 3, 8, 5]]], [1, 1, 1.8, [1]]], [[[[3, 10, 5, 12], [6, 4, 9, 11], [8, 7, 14, 11], [10, 2, 13, 8], [3, 9, 4, 10], [3, 3, 9, 8]]], [2, 0, 5.285714, [0, 4]]], [[[[6, 4, 13, 11], [2, 7, 9, 8], [6, 5, 12, 6], [6, 10, 13, 15]]], [0, 1, 4.0, []]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[7, 0, 10, 1], [0, 8, 6, 13]]], [1, 1, 1.652174, [0]]], [[[[2, 1, 7, 3], [2, 3, 3, 9], [2, 1, 8, 8], [7, 4, 10, 5], [1, 9, 5, 16], [2, 2, 9, 8]]], [5, 1, 4.791667, [0, 1, 2, 3, 5]]]], [[[[[1, 5, 7, 6], [9, 5, 11, 9], [0, 7, 1, 10]]], [2, 0, 2.875, [0, 2]]], [[[[9, 5, 16, 9], [3, 2, 10, 4], [7, 8, 8, 12]]], [1, 1, 2.782609, [1]]], [[[[9, 7, 15, 12], [8, 5, 15, 7], [3, 6, 4, 10]]], [1, 0, 2.736842, [2]]], [[[[8, 2, 10, 3], [6, 1, 9, 7], [6, 10, 10, 15], [5, 0, 9, 5], [2, 10, 9, 11], [2, 1, 6, 6], [5, 9, 9, 10]]], [4, 1, 5.434783, [0, 1, 3, 5]]], [[[[3, 8, 6, 12], [9, 5, 16, 12], [2, 10, 3, 14], [2, 6, 6, 13], [10, 3, 14, 8], [7, 9, 12, 16], [7, 8, 10, 15]]], [3, 0, 5.592593, [0, 2, 3]]], [[[[6, 10, 7, 17], [10, 9, 15, 12], [2, 10, 8, 14], [1, 4, 5, 6]]], [2, 0, 3.518519, [2, 3]]], [[[[7, 7, 12, 11], [6, 2, 9, 5], [4, 2, 8, 4], [6, 1, 8, 6], [5, 2, 7, 7]]], [4, 1, 3.944444, [1, 2, 3, 4]]], [[[[8, 4, 11, 8], [1, 9, 5, 10], [1, 3, 6, 6]]], [2, 0, 2.823529, [1, 2]]]], [[[[[0, 6, 2, 8], [1, 3, 5, 10], [7, 1, 12, 4], [3, 10, 10, 17], [10, 4, 11, 6], [5, 7, 12, 8], [5, 9, 10, 15]]], [5, 1, 5.821429, [0, 1, 2, 4, 5]]], [[[[1, 8, 3, 11], [10, 1, 12, 3], [3, 5, 5, 6]]], [2, 0, 2.142857, [0, 2]]], [[[[0, 10, 3, 12], [6, 6, 10, 12]]], [1, 0, 1.9375, [0]]], [[[[0, 9, 2, 11], [4, 1, 7, 6]]], [1, 1, 1.705882, [1]]], [[[[2, 0, 8, 4], [10, 6, 14, 8], [9, 6, 15, 8], [7, 7, 10, 12], [9, 6, 15, 8], [8, 6, 9, 13]]], [1, 1, 4.269231, [0]]], [[[[9, 0, 16, 4], [8, 7, 14, 8], [0, 9, 3, 13]]], [1, 0, 2.344828, [2]]], [[[[6, 6, 13, 10], [0, 0, 1, 5], [1, 7, 7, 11]]], [1, 0, 2.666667, [1]]], [[[[0, 10, 4, 12], [4, 4, 11, 8], [2, 10, 4, 12], [1, 8, 8, 15], [0, 8, 1, 14]]], [4, 0, 4.227273, [0, 2, 3, 4]]]]]\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-sah-split-selection-candidate-split-range","generated_at":"2026-09-29T14:50:58.952114+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.","root_cause":"The loop runs k in range(1, n-1).","sha256":"ccdeb7f09ed7dd88e512f50f179e93e91ff78ea2be780101058051b20defc38e","title":"SAH skips the last candidate split position · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.987,"exit_code":1,"observations":[{"actual":[2,0,3.6,[2,3]],"check":"case 0","expected":[1,0,3.25,[3]],"passed":false},{"actual":[3,1,3.0,[0,2,3]],"check":"case 1","expected":[3,1,3.0,[0,2,3]],"passed":true},{"actual":[3,0,5.153846,[2,4,5]],"check":"case 2","expected":[1,0,5.115385,[2]],"passed":false},{"actual":[0,0,2.0,[]],"check":"case 3","expected":[1,0,1.761905,[0]],"passed":false},{"actual":[4,0,4.222222,[0,1,2,3]],"check":"case 4","expected":[4,0,4.222222,[0,1,2,3]],"passed":true},{"actual":[0,1,2.0,[]],"check":"case 5","expected":[1,1,1.714286,[0]],"passed":false},{"actual":[2,0,2.619048,[0,2]],"check":"case 6","expected":[2,0,2.619048,[0,2]],"passed":true},{"actual":[2,1,2.923077,[0,1]],"check":"case 7","expected":[1,1,2.5,[1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [2, 0, 3.6, [2, 3]], \"expected\": [1, 0, 3.25, [3]], \"passed\": false}, {\"check\": \"case 1\", \"actual\": [3, 1, 3.0, [0, 2, 3]], \"expected\": [3, 1, 3.0, [0, 2, 3]], \"passed\": true}, {\"check\": \"case 2\", \"actual\": [3, 0, 5.153846, [2, 4, 5]], \"expected\": [1, 0, 5.115385, [2]], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [0, 0, 2.0, []], \"expected\": [1, 0, 1.761905, [0]], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [4, 0, 4.222222, [0, 1, 2, 3]], \"expected\": [4, 0, 4.222222, [0, 1, 2, 3]], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [0, 1, 2.0, []], \"expected\": [1, 1, 1.714286, [0]], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [2, 0, 2.619048, [0, 2]], \"expected\": [2, 0, 2.619048, [0, 2]], \"passed\": true}, {\"check\": \"case 7\", \"actual\": [2, 1, 2.923077, [0, 1]], \"expected\": [1, 1, 2.5, [1]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.729,"exit_code":1,"observations":[{"actual":[1,0,3.25,[3]],"check":"case 0","expected":[1,0,3.25,[3]],"passed":true},{"actual":[2,1,3.083333,[0,2]],"check":"case 1","expected":[3,1,3.0,[0,2,3]],"passed":false},{"actual":[1,0,5.115385,[2]],"check":"case 2","expected":[1,0,5.115385,[2]],"passed":true},{"actual":[0,0,2.0,[]],"check":"case 3","expected":[1,0,1.761905,[0]],"passed":false},{"actual":[2,0,4.481481,[0,1]],"check":"case 4","expected":[4,0,4.222222,[0,1,2,3]],"passed":false},{"actual":[0,1,2.0,[]],"check":"case 5","expected":[1,1,1.714286,[0]],"passed":false},{"actual":[0,0,3.0,[]],"check":"case 6","expected":[2,0,2.619048,[0,2]],"passed":false},{"actual":[1,1,2.5,[1]],"check":"case 7","expected":[1,1,2.5,[1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [1, 0, 3.25, [3]], \"expected\": [1, 0, 3.25, [3]], \"passed\": true}, {\"check\": \"case 1\", \"actual\": [2, 1, 3.083333, [0, 2]], \"expected\": [3, 1, 3.0, [0, 2, 3]], \"passed\": false}, {\"check\": \"case 2\", \"actual\": [1, 0, 5.115385, [2]], \"expected\": [1, 0, 5.115385, [2]], \"passed\": true}, {\"check\": \"case 3\", \"actual\": [0, 0, 2.0, []], \"expected\": [1, 0, 1.761905, [0]], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [2, 0, 4.481481, [0, 1]], \"expected\": [4, 0, 4.222222, [0, 1, 2, 3]], \"passed\": false}, {\"check\": \"case 5\", \"actual\": [0, 1, 2.0, []], \"expected\": [1, 1, 1.714286, [0]], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [0, 0, 3.0, []], \"expected\": [2, 0, 2.619048, [0, 2]], \"passed\": false}, {\"check\": \"case 7\", \"actual\": [1, 1, 2.5, [1]], \"expected\": [1, 1, 2.5, [1]], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}