{"abstract":"Split costs are halved relative to the leaf cost so splitting wins too often.","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":"Halving the parent perimeter keeps the child and parent measures inconsistent.","family":"w2-collision_detection_broadphase-sah-split-selection-parent-normalization","id":"FA-87451","implementations":{"attempt":{"sha256":"08d6dc82d75844450de6ff612a43727ea78e3c3a8bdfbe4a6c9d9e8f887a6712","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)) / 2\n    best_k, best = 0, float(n)\n    for k in range(1, 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 = [[[[[[6, 10, 11, 14], [2, 7, 4, 13], [8, 10, 11, 13], [1, 9, 5, 16]]], [2, 0, 3.315789, [1, 3]]], [[[[8, 1, 13, 2], [9, 2, 16, 9]]], [0, 1, 2.0, []]], [[[[5, 10, 9, 17], [7, 1, 11, 5], [1, 8, 8, 15]]], [1, 1, 2.615385, [1]]], [[[[6, 5, 10, 11], [5, 2, 11, 4]]], [0, 1, 2.0, []]], [[[[2, 3, 3, 7], [4, 8, 10, 11]]], [1, 0, 1.875, [0]]], [[[[3, 2, 7, 9], [6, 0, 8, 5], [4, 1, 8, 8], [9, 3, 11, 7], [1, 1, 3, 2], [0, 4, 6, 11]]], [3, 0, 5.363636, [0, 4, 5]]], [[[[10, 6, 16, 8], [1, 10, 4, 16], [0, 8, 6, 13], [9, 0, 15, 1], [3, 10, 9, 16], [1, 9, 8, 15]]], [2, 1, 4.0625, [0, 3]]], [[[[9, 8, 14, 10], [5, 6, 9, 8]]], [0, 0, 2.0, []]]], [[[[[9, 3, 13, 6], [4, 9, 6, 15]]], [1, 1, 1.714286, [0]]], [[[[10, 3, 12, 9], [6, 9, 10, 16], [4, 3, 9, 10], [6, 4, 10, 8], [8, 5, 11, 7]]], [4, 1, 4.380952, [0, 2, 3, 4]]], [[[[3, 2, 8, 6], [5, 10, 10, 17], [2, 1, 9, 5], [6, 5, 10, 10], [1, 9, 4, 14], [10, 10, 15, 12], [3, 9, 7, 12]]], [3, 1, 5.633333, [0, 2, 3]]], [[[[9, 0, 12, 5], [8, 3, 14, 7]]], [0, 1, 2.0, []]], [[[[5, 1, 12, 7], [10, 7, 17, 11], [3, 8, 6, 10], [8, 2, 14, 5], [2, 0, 3, 4], [9, 5, 14, 7], [2, 4, 7, 10]]], [3, 0, 6.115385, [2, 4, 6]]], [[[[9, 3, 16, 10], [5, 8, 11, 13]]], [0, 0, 2.0, []]], [[[[6, 2, 10, 4], [4, 1, 11, 6], [3, 3, 4, 4]]], [0, 0, 3.0, []]], [[[[3, 4, 8, 7], [6, 9, 8, 10], [2, 6, 4, 7], [7, 0, 13, 1], [7, 4, 9, 11], [6, 2, 8, 7], [6, 9, 9, 16]]], [4, 1, 5.333333, [0, 2, 3, 5]]]], [[[[[3, 4, 7, 5], [1, 2, 3, 4]]], [0, 0, 2.0, []]], [[[[1, 9, 7, 12], [9, 4, 14, 6], [7, 7, 11, 9], [9, 8, 16, 10], [2, 3, 6, 5], [7, 10, 12, 11]]], [2, 0, 4.916667, [0, 4]]], [[[[8, 5, 15, 8], [2, 3, 7, 7]]], [0, 0, 2.0, []]], [[[[9, 7, 11, 11], [4, 6, 6, 8], [7, 4, 12, 5]]], [1, 0, 2.866667, [1]]], [[[[9, 0, 16, 2], [2, 1, 5, 2], [6, 10, 9, 16], [8, 2, 13, 4], [3, 6, 7, 12], [2, 5, 8, 8]]], [3, 1, 4.6, [0, 1, 3]]], [[[[1, 3, 5, 10], [3, 0, 7, 7], [10, 4, 17, 6], [2, 2, 6, 9]]], [3, 0, 3.192308, [0, 1, 3]]], [[[[4, 6, 10, 12], [7, 8, 12, 14]]], [0, 0, 2.0, []]], [[[[1, 3, 2, 7], [0, 3, 2, 10], [2, 8, 8, 9], [0, 4, 6, 5], [4, 8, 7, 14], [7, 10, 9, 11]]], [3, 0, 4.9, [0, 1, 3]]]], [[[[[3, 8, 4, 15], [8, 6, 14, 12], [6, 0, 9, 3], [1, 9, 2, 12], [9, 4, 12, 9]]], [3, 1, 3.857143, [1, 2, 4]]], [[[[4, 4, 7, 11], [0, 5, 2, 9]]], [0, 0, 2.0, []]], [[[[0, 1, 3, 2], [7, 6, 9, 8], [3, 7, 7, 9], [5, 0, 7, 1], [7, 0, 13, 7], [7, 2, 12, 8]]], [3, 0, 5.090909, [0, 2, 3]]], [[[[7, 6, 11, 11], [7, 8, 12, 9], [10, 3, 17, 8], [0, 6, 3, 10]]], [1, 0, 3.44, [3]]], [[[[4, 6, 8, 7], [5, 5, 12, 11], [7, 2, 14, 7]]], [0, 0, 3.0, []]], [[[[2, 1, 8, 2], [5, 5, 12, 7]]], [0, 1, 2.0, []]], [[[[10, 5, 13, 7], [9, 3, 12, 10], [10, 0, 14, 5], [6, 0, 10, 2], [6, 4, 8, 5], [1, 4, 4, 5]]], [3, 0, 4.782609, [3, 4, 5]]], [[[[1, 10, 4, 15], [7, 0, 11, 6], [0, 3, 4, 8], [1, 10, 2, 14], [10, 3, 13, 7]]], [3, 0, 3.642857, [0, 2, 3]]]], [[[[[4, 8, 9, 10], [5, 6, 11, 9], [1, 10, 3, 12], [10, 10, 12, 11], [0, 6, 3, 8], [1, 9, 5, 15], [9, 6, 14, 11]]], [3, 0, 5.434783, [2, 4, 5]]], [[[[0, 0, 4, 5], [7, 8, 12, 12], [7, 0, 11, 3], [10, 8, 12, 12]]], [2, 0, 3.083333, [0, 2]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[7, 1, 13, 7], [5, 0, 8, 5]]], [0, 0, 2.0, []]], [[[[0, 2, 7, 5], [8, 0, 9, 5], [9, 7, 12, 8]]], [2, 0, 2.6, [0, 1]]], [[[[5, 0, 10, 3], [1, 1, 6, 7], [6, 4, 12, 10]]], [0, 0, 3.0, []]], [[[[8, 0, 15, 2], [7, 10, 14, 11], [1, 8, 3, 15], [4, 1, 10, 5]]], [2, 1, 3.482759, [0, 3]]], [[[[9, 10, 16, 16], [0, 5, 2, 12], [9, 1, 10, 5], [1, 8, 2, 11]]], [2, 0, 3.0, [1, 3]]]]]\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":"03a1f15852a544b2268febcee82021a45575dad985795b078b0e393c745993e3","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 = 2 * (ex + ey)\n    best_k, best = 0, float(n)\n    for k in range(1, 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 = [[[[[[6, 10, 11, 14], [2, 7, 4, 13], [8, 10, 11, 13], [1, 9, 5, 16]]], [2, 0, 3.315789, [1, 3]]], [[[[8, 1, 13, 2], [9, 2, 16, 9]]], [0, 1, 2.0, []]], [[[[5, 10, 9, 17], [7, 1, 11, 5], [1, 8, 8, 15]]], [1, 1, 2.615385, [1]]], [[[[6, 5, 10, 11], [5, 2, 11, 4]]], [0, 1, 2.0, []]], [[[[2, 3, 3, 7], [4, 8, 10, 11]]], [1, 0, 1.875, [0]]], [[[[3, 2, 7, 9], [6, 0, 8, 5], [4, 1, 8, 8], [9, 3, 11, 7], [1, 1, 3, 2], [0, 4, 6, 11]]], [3, 0, 5.363636, [0, 4, 5]]], [[[[10, 6, 16, 8], [1, 10, 4, 16], [0, 8, 6, 13], [9, 0, 15, 1], [3, 10, 9, 16], [1, 9, 8, 15]]], [2, 1, 4.0625, [0, 3]]], [[[[9, 8, 14, 10], [5, 6, 9, 8]]], [0, 0, 2.0, []]]], [[[[[9, 3, 13, 6], [4, 9, 6, 15]]], [1, 1, 1.714286, [0]]], [[[[10, 3, 12, 9], [6, 9, 10, 16], [4, 3, 9, 10], [6, 4, 10, 8], [8, 5, 11, 7]]], [4, 1, 4.380952, [0, 2, 3, 4]]], [[[[3, 2, 8, 6], [5, 10, 10, 17], [2, 1, 9, 5], [6, 5, 10, 10], [1, 9, 4, 14], [10, 10, 15, 12], [3, 9, 7, 12]]], [3, 1, 5.633333, [0, 2, 3]]], [[[[9, 0, 12, 5], [8, 3, 14, 7]]], [0, 1, 2.0, []]], [[[[5, 1, 12, 7], [10, 7, 17, 11], [3, 8, 6, 10], [8, 2, 14, 5], [2, 0, 3, 4], [9, 5, 14, 7], [2, 4, 7, 10]]], [3, 0, 6.115385, [2, 4, 6]]], [[[[9, 3, 16, 10], [5, 8, 11, 13]]], [0, 0, 2.0, []]], [[[[6, 2, 10, 4], [4, 1, 11, 6], [3, 3, 4, 4]]], [0, 0, 3.0, []]], [[[[3, 4, 8, 7], [6, 9, 8, 10], [2, 6, 4, 7], [7, 0, 13, 1], [7, 4, 9, 11], [6, 2, 8, 7], [6, 9, 9, 16]]], [4, 1, 5.333333, [0, 2, 3, 5]]]], [[[[[3, 4, 7, 5], [1, 2, 3, 4]]], [0, 0, 2.0, []]], [[[[1, 9, 7, 12], [9, 4, 14, 6], [7, 7, 11, 9], [9, 8, 16, 10], [2, 3, 6, 5], [7, 10, 12, 11]]], [2, 0, 4.916667, [0, 4]]], [[[[8, 5, 15, 8], [2, 3, 7, 7]]], [0, 0, 2.0, []]], [[[[9, 7, 11, 11], [4, 6, 6, 8], [7, 4, 12, 5]]], [1, 0, 2.866667, [1]]], [[[[9, 0, 16, 2], [2, 1, 5, 2], [6, 10, 9, 16], [8, 2, 13, 4], [3, 6, 7, 12], [2, 5, 8, 8]]], [3, 1, 4.6, [0, 1, 3]]], [[[[1, 3, 5, 10], [3, 0, 7, 7], [10, 4, 17, 6], [2, 2, 6, 9]]], [3, 0, 3.192308, [0, 1, 3]]], [[[[4, 6, 10, 12], [7, 8, 12, 14]]], [0, 0, 2.0, []]], [[[[1, 3, 2, 7], [0, 3, 2, 10], [2, 8, 8, 9], [0, 4, 6, 5], [4, 8, 7, 14], [7, 10, 9, 11]]], [3, 0, 4.9, [0, 1, 3]]]], [[[[[3, 8, 4, 15], [8, 6, 14, 12], [6, 0, 9, 3], [1, 9, 2, 12], [9, 4, 12, 9]]], [3, 1, 3.857143, [1, 2, 4]]], [[[[4, 4, 7, 11], [0, 5, 2, 9]]], [0, 0, 2.0, []]], [[[[0, 1, 3, 2], [7, 6, 9, 8], [3, 7, 7, 9], [5, 0, 7, 1], [7, 0, 13, 7], [7, 2, 12, 8]]], [3, 0, 5.090909, [0, 2, 3]]], [[[[7, 6, 11, 11], [7, 8, 12, 9], [10, 3, 17, 8], [0, 6, 3, 10]]], [1, 0, 3.44, [3]]], [[[[4, 6, 8, 7], [5, 5, 12, 11], [7, 2, 14, 7]]], [0, 0, 3.0, []]], [[[[2, 1, 8, 2], [5, 5, 12, 7]]], [0, 1, 2.0, []]], [[[[10, 5, 13, 7], [9, 3, 12, 10], [10, 0, 14, 5], [6, 0, 10, 2], [6, 4, 8, 5], [1, 4, 4, 5]]], [3, 0, 4.782609, [3, 4, 5]]], [[[[1, 10, 4, 15], [7, 0, 11, 6], [0, 3, 4, 8], [1, 10, 2, 14], [10, 3, 13, 7]]], [3, 0, 3.642857, [0, 2, 3]]]], [[[[[4, 8, 9, 10], [5, 6, 11, 9], [1, 10, 3, 12], [10, 10, 12, 11], [0, 6, 3, 8], [1, 9, 5, 15], [9, 6, 14, 11]]], [3, 0, 5.434783, [2, 4, 5]]], [[[[0, 0, 4, 5], [7, 8, 12, 12], [7, 0, 11, 3], [10, 8, 12, 12]]], [2, 0, 3.083333, [0, 2]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[7, 1, 13, 7], [5, 0, 8, 5]]], [0, 0, 2.0, []]], [[[[0, 2, 7, 5], [8, 0, 9, 5], [9, 7, 12, 8]]], [2, 0, 2.6, [0, 1]]], [[[[5, 0, 10, 3], [1, 1, 6, 7], [6, 4, 12, 10]]], [0, 0, 3.0, []]], [[[[8, 0, 15, 2], [7, 10, 14, 11], [1, 8, 3, 15], [4, 1, 10, 5]]], [2, 1, 3.482759, [0, 3]]], [[[[9, 10, 16, 16], [0, 5, 2, 12], [9, 1, 10, 5], [1, 8, 2, 11]]], [2, 0, 3.0, [1, 3]]]]]\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-parent-normalization","generated_at":"2026-09-29T14:50:58.951925+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 parent perimeter is replaced by the centroid bounds perimeter.","sha256":"2ca3c616fe2b6336fe649eb4d82007174302e75ca8f2ab5a508ea2ef2d5614fc","title":"SAH normalizes by the parent perimeter at half scale · 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":41.102,"exit_code":1,"observations":[{"actual":[0,0,4.0,[]],"check":"case 0","expected":[2,0,3.315789,[1,3]],"passed":false},{"actual":[0,1,2.0,[]],"check":"case 1","expected":[0,1,2.0,[]],"passed":true},{"actual":[0,1,3.0,[]],"check":"case 2","expected":[1,1,2.615385,[1]],"passed":false},{"actual":[0,1,2.0,[]],"check":"case 3","expected":[0,1,2.0,[]],"passed":true},{"actual":[0,0,2.0,[]],"check":"case 4","expected":[1,0,1.875,[0]],"passed":false},{"actual":[0,0,6.0,[]],"check":"case 5","expected":[3,0,5.363636,[0,4,5]],"passed":false},{"actual":[0,1,6.0,[]],"check":"case 6","expected":[2,1,4.0625,[0,3]],"passed":false},{"actual":[0,0,2.0,[]],"check":"case 7","expected":[0,0,2.0,[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [0, 0, 4.0, []], \"expected\": [2, 0, 3.315789, [1, 3]], \"passed\": false}, {\"check\": \"case 1\", \"actual\": [0, 1, 2.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": true}, {\"check\": \"case 2\", \"actual\": [0, 1, 3.0, []], \"expected\": [1, 1, 2.615385, [1]], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [0, 1, 2.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": true}, {\"check\": \"case 4\", \"actual\": [0, 0, 2.0, []], \"expected\": [1, 0, 1.875, [0]], \"passed\": false}, {\"check\": \"case 5\", \"actual\": [0, 0, 6.0, []], \"expected\": [3, 0, 5.363636, [0, 4, 5]], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [0, 1, 6.0, []], \"expected\": [2, 1, 4.0625, [0, 3]], \"passed\": false}, {\"check\": \"case 7\", \"actual\": [0, 0, 2.0, []], \"expected\": [0, 0, 2.0, []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.802,"exit_code":1,"observations":[{"actual":[0,0,4.0,[]],"check":"case 0","expected":[2,0,3.315789,[1,3]],"passed":false},{"actual":[0,1,2.0,[]],"check":"case 1","expected":[0,1,2.0,[]],"passed":true},{"actual":[0,1,3.0,[]],"check":"case 2","expected":[1,1,2.615385,[1]],"passed":false},{"actual":[0,1,2.0,[]],"check":"case 3","expected":[0,1,2.0,[]],"passed":true},{"actual":[0,0,2.0,[]],"check":"case 4","expected":[1,0,1.875,[0]],"passed":false},{"actual":[0,0,6.0,[]],"check":"case 5","expected":[3,0,5.363636,[0,4,5]],"passed":false},{"actual":[2,1,5.26087,[0,3]],"check":"case 6","expected":[2,1,4.0625,[0,3]],"passed":false},{"actual":[0,0,2.0,[]],"check":"case 7","expected":[0,0,2.0,[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [0, 0, 4.0, []], \"expected\": [2, 0, 3.315789, [1, 3]], \"passed\": false}, {\"check\": \"case 1\", \"actual\": [0, 1, 2.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": true}, {\"check\": \"case 2\", \"actual\": [0, 1, 3.0, []], \"expected\": [1, 1, 2.615385, [1]], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [0, 1, 2.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": true}, {\"check\": \"case 4\", \"actual\": [0, 0, 2.0, []], \"expected\": [1, 0, 1.875, [0]], \"passed\": false}, {\"check\": \"case 5\", \"actual\": [0, 0, 6.0, []], \"expected\": [3, 0, 5.363636, [0, 4, 5]], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [2, 1, 5.26087, [0, 3]], \"expected\": [2, 1, 4.0625, [0, 3]], \"passed\": false}, {\"check\": \"case 7\", \"actual\": [0, 0, 2.0, []], \"expected\": [0, 0, 2.0, []], \"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."}}