{"abstract":"Tiny nodes are split although a leaf is cheaper, deepening the tree.","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].","evaluation_group":"w2-collision_detection_broadphase-sah-split-selection","failed_approach":"Starting at n-1 still misjudges when a leaf is preferable.","family":"w2-collision_detection_broadphase-sah-split-selection-leaf-cost-baseline","id":"FA-87441","implementations":{"attempt":{"sha256":"f435062914d4434e0365e539cc31664f6f6b61cd4c69ee7e30e2c9c46faef1b8","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 - 1)\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 = [[[[[[1, 10, 6, 11], [1, 0, 5, 2], [2, 8, 5, 15], [8, 2, 15, 7]]], [2, 1, 3.275862, [1, 3]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[9, 0, 13, 3], [6, 7, 13, 13], [9, 7, 13, 10]]], [1, 1, 2.65, [0]]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.0, []]], [[[[0, 5, 6, 9], [5, 8, 7, 14], [6, 3, 8, 4], [6, 2, 11, 5], [8, 0, 14, 1], [7, 8, 11, 9]]], [3, 1, 4.535714, [2, 3, 4]]], [[[[7, 3, 13, 5], [4, 3, 9, 7]]], [0, 0, 2.0, []]], [[[[3, 6, 9, 9], [1, 4, 7, 5]]], [0, 1, 2.0, []]], [[[[4, 6, 10, 13], [2, 0, 6, 6]]], [0, 1, 2.0, []]]], [[[[[10, 6, 14, 10], [6, 6, 8, 8], [5, 0, 8, 5], [7, 7, 8, 11]]], [2, 1, 3.3, [1, 2]]], [[[[0, 4, 4, 11], [9, 4, 13, 10]]], [0, 0, 2.0, []]], [[[[8, 1, 13, 2], [3, 8, 9, 15], [3, 1, 8, 2], [10, 0, 12, 2]]], [3, 1, 2.96, [0, 2, 3]]], [[[[6, 4, 9, 11], [0, 6, 2, 13], [8, 8, 10, 13], [3, 8, 10, 14], [6, 7, 9, 12], [8, 0, 14, 2], [10, 0, 17, 1]]], [5, 0, 4.935484, [0, 1, 2, 3, 4]]], [[[[4, 3, 6, 8], [0, 6, 1, 13], [0, 7, 1, 11], [0, 2, 5, 4], [4, 1, 7, 2]]], [3, 1, 4.052632, [0, 3, 4]]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[7, 9, 12, 14], [6, 1, 12, 4], [7, 9, 13, 12]]], [1, 1, 2.55, [1]]]], [[[[[6, 3, 13, 8], [8, 5, 14, 10], [0, 0, 7, 1], [7, 10, 9, 17]]], [1, 1, 3.387097, [2]]], [[[[10, 5, 16, 9], [8, 3, 11, 7]]], [0, 0, 2.0, []]], [[[[8, 7, 13, 8], [8, 5, 10, 7], [4, 1, 5, 5], [7, 1, 9, 5]]], [2, 0, 3.125, [2, 3]]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[9, 7, 16, 12], [8, 0, 10, 3]]], [1, 1, 1.85, [1]]], [[[[8, 8, 13, 9], [6, 8, 11, 12]]], [0, 0, 2.0, []]], [[[[1, 2, 8, 6], [8, 3, 9, 6]]], [0, 0, 2.0, []]], [[[[1, 7, 8, 13], [8, 5, 9, 10], [6, 7, 10, 11]]], [1, 0, 2.941176, [0]]]], [[[[[3, 5, 4, 12], [0, 6, 3, 13], [2, 2, 8, 4], [8, 6, 12, 7], [8, 8, 14, 13], [5, 6, 10, 8], [3, 6, 8, 13]]], [4, 0, 5.96, [0, 1, 2, 6]]], [[[[3, 4, 5, 6], [9, 10, 15, 13]]], [1, 0, 1.619048, [0]]], [[[[4, 4, 6, 7], [7, 4, 14, 6], [9, 0, 11, 7], [1, 0, 3, 1], [1, 3, 4, 8], [10, 2, 14, 8]]], [3, 0, 5.0, [0, 3, 4]]], [[[[10, 4, 11, 7], [3, 6, 10, 10], [4, 8, 7, 14], [1, 3, 8, 9]]], [0, 0, 4.0, []]], [[[[3, 1, 8, 2], [5, 2, 11, 7]]], [0, 1, 2.0, []]], [[[[1, 3, 3, 9], [3, 9, 10, 14], [9, 7, 15, 9], [10, 10, 11, 12], [0, 5, 4, 12], [10, 3, 13, 5]]], [3, 0, 5.153846, [0, 1, 4]]], [[[[4, 8, 7, 15], [10, 7, 17, 13], [5, 2, 11, 9]]], [0, 0, 3.0, []]], [[[[2, 0, 9, 3], [7, 1, 13, 7], [8, 3, 15, 4], [4, 3, 11, 10], [8, 10, 13, 13], [8, 9, 12, 11], [4, 7, 7, 13]]], [3, 1, 6.230769, [0, 1, 2]]]], [[[[[8, 5, 9, 7], [2, 5, 8, 8], [5, 7, 10, 10]]], [0, 0, 3.0, []]], [[[[5, 10, 9, 16], [7, 10, 14, 11], [8, 2, 11, 4], [10, 3, 15, 6], [2, 7, 7, 10]]], [2, 1, 4.148148, [2, 3]]], [[[[5, 8, 7, 13], [6, 8, 12, 14], [5, 1, 10, 7], [2, 0, 9, 7], [0, 7, 1, 14], [6, 10, 10, 15], [5, 0, 11, 2]]], [3, 1, 5.740741, [2, 3, 6]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 8], [4, 4, 6, 6], [10, 10, 16, 17]]], [2, 1, 2.24, [0, 1]]], [[[[6, 3, 10, 4], [6, 6, 13, 13]]], [0, 1, 2.0, []]], [[[[9, 1, 12, 4], [0, 9, 7, 11], [8, 3, 11, 5]]], [2, 1, 2.136364, [0, 2]]], [[[[10, 2, 16, 7], [4, 2, 5, 5], [9, 8, 10, 9], [7, 4, 11, 9], [8, 9, 12, 10], [0, 3, 2, 9], [0, 7, 7, 8]]], [3, 0, 5.583333, [1, 5, 6]]]]]\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":"ca8be1bf077650cccab1ebea2a8cc76662fad3ef6f7057045e250f1612d2631a","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 * 1000)\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 = [[[[[[1, 10, 6, 11], [1, 0, 5, 2], [2, 8, 5, 15], [8, 2, 15, 7]]], [2, 1, 3.275862, [1, 3]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[9, 0, 13, 3], [6, 7, 13, 13], [9, 7, 13, 10]]], [1, 1, 2.65, [0]]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.0, []]], [[[[0, 5, 6, 9], [5, 8, 7, 14], [6, 3, 8, 4], [6, 2, 11, 5], [8, 0, 14, 1], [7, 8, 11, 9]]], [3, 1, 4.535714, [2, 3, 4]]], [[[[7, 3, 13, 5], [4, 3, 9, 7]]], [0, 0, 2.0, []]], [[[[3, 6, 9, 9], [1, 4, 7, 5]]], [0, 1, 2.0, []]], [[[[4, 6, 10, 13], [2, 0, 6, 6]]], [0, 1, 2.0, []]]], [[[[[10, 6, 14, 10], [6, 6, 8, 8], [5, 0, 8, 5], [7, 7, 8, 11]]], [2, 1, 3.3, [1, 2]]], [[[[0, 4, 4, 11], [9, 4, 13, 10]]], [0, 0, 2.0, []]], [[[[8, 1, 13, 2], [3, 8, 9, 15], [3, 1, 8, 2], [10, 0, 12, 2]]], [3, 1, 2.96, [0, 2, 3]]], [[[[6, 4, 9, 11], [0, 6, 2, 13], [8, 8, 10, 13], [3, 8, 10, 14], [6, 7, 9, 12], [8, 0, 14, 2], [10, 0, 17, 1]]], [5, 0, 4.935484, [0, 1, 2, 3, 4]]], [[[[4, 3, 6, 8], [0, 6, 1, 13], [0, 7, 1, 11], [0, 2, 5, 4], [4, 1, 7, 2]]], [3, 1, 4.052632, [0, 3, 4]]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[7, 9, 12, 14], [6, 1, 12, 4], [7, 9, 13, 12]]], [1, 1, 2.55, [1]]]], [[[[[6, 3, 13, 8], [8, 5, 14, 10], [0, 0, 7, 1], [7, 10, 9, 17]]], [1, 1, 3.387097, [2]]], [[[[10, 5, 16, 9], [8, 3, 11, 7]]], [0, 0, 2.0, []]], [[[[8, 7, 13, 8], [8, 5, 10, 7], [4, 1, 5, 5], [7, 1, 9, 5]]], [2, 0, 3.125, [2, 3]]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[9, 7, 16, 12], [8, 0, 10, 3]]], [1, 1, 1.85, [1]]], [[[[8, 8, 13, 9], [6, 8, 11, 12]]], [0, 0, 2.0, []]], [[[[1, 2, 8, 6], [8, 3, 9, 6]]], [0, 0, 2.0, []]], [[[[1, 7, 8, 13], [8, 5, 9, 10], [6, 7, 10, 11]]], [1, 0, 2.941176, [0]]]], [[[[[3, 5, 4, 12], [0, 6, 3, 13], [2, 2, 8, 4], [8, 6, 12, 7], [8, 8, 14, 13], [5, 6, 10, 8], [3, 6, 8, 13]]], [4, 0, 5.96, [0, 1, 2, 6]]], [[[[3, 4, 5, 6], [9, 10, 15, 13]]], [1, 0, 1.619048, [0]]], [[[[4, 4, 6, 7], [7, 4, 14, 6], [9, 0, 11, 7], [1, 0, 3, 1], [1, 3, 4, 8], [10, 2, 14, 8]]], [3, 0, 5.0, [0, 3, 4]]], [[[[10, 4, 11, 7], [3, 6, 10, 10], [4, 8, 7, 14], [1, 3, 8, 9]]], [0, 0, 4.0, []]], [[[[3, 1, 8, 2], [5, 2, 11, 7]]], [0, 1, 2.0, []]], [[[[1, 3, 3, 9], [3, 9, 10, 14], [9, 7, 15, 9], [10, 10, 11, 12], [0, 5, 4, 12], [10, 3, 13, 5]]], [3, 0, 5.153846, [0, 1, 4]]], [[[[4, 8, 7, 15], [10, 7, 17, 13], [5, 2, 11, 9]]], [0, 0, 3.0, []]], [[[[2, 0, 9, 3], [7, 1, 13, 7], [8, 3, 15, 4], [4, 3, 11, 10], [8, 10, 13, 13], [8, 9, 12, 11], [4, 7, 7, 13]]], [3, 1, 6.230769, [0, 1, 2]]]], [[[[[8, 5, 9, 7], [2, 5, 8, 8], [5, 7, 10, 10]]], [0, 0, 3.0, []]], [[[[5, 10, 9, 16], [7, 10, 14, 11], [8, 2, 11, 4], [10, 3, 15, 6], [2, 7, 7, 10]]], [2, 1, 4.148148, [2, 3]]], [[[[5, 8, 7, 13], [6, 8, 12, 14], [5, 1, 10, 7], [2, 0, 9, 7], [0, 7, 1, 14], [6, 10, 10, 15], [5, 0, 11, 2]]], [3, 1, 5.740741, [2, 3, 6]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 8], [4, 4, 6, 6], [10, 10, 16, 17]]], [2, 1, 2.24, [0, 1]]], [[[[6, 3, 10, 4], [6, 6, 13, 13]]], [0, 1, 2.0, []]], [[[[9, 1, 12, 4], [0, 9, 7, 11], [8, 3, 11, 5]]], [2, 1, 2.136364, [0, 2]]], [[[[10, 2, 16, 7], [4, 2, 5, 5], [9, 8, 10, 9], [7, 4, 11, 9], [8, 9, 12, 10], [0, 3, 2, 9], [0, 7, 7, 8]]], [3, 0, 5.583333, [1, 5, 6]]]]]\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":"9b63dd5c4b6d3d4a4730c87452ddcb5965d3ee20894448389a31f58fe3e88708","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):\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 = [[[[[[1, 10, 6, 11], [1, 0, 5, 2], [2, 8, 5, 15], [8, 2, 15, 7]]], [2, 1, 3.275862, [1, 3]]], [[[[4, 5, 6, 7], [9, 7, 15, 11], [3, 7, 5, 14]]], [2, 0, 2.619048, [0, 2]]], [[[[9, 0, 13, 3], [6, 7, 13, 13], [9, 7, 13, 10]]], [1, 1, 2.65, [0]]], [[[[7, 4, 12, 10], [9, 4, 12, 9]]], [0, 0, 2.0, []]], [[[[0, 5, 6, 9], [5, 8, 7, 14], [6, 3, 8, 4], [6, 2, 11, 5], [8, 0, 14, 1], [7, 8, 11, 9]]], [3, 1, 4.535714, [2, 3, 4]]], [[[[7, 3, 13, 5], [4, 3, 9, 7]]], [0, 0, 2.0, []]], [[[[3, 6, 9, 9], [1, 4, 7, 5]]], [0, 1, 2.0, []]], [[[[4, 6, 10, 13], [2, 0, 6, 6]]], [0, 1, 2.0, []]]], [[[[[10, 6, 14, 10], [6, 6, 8, 8], [5, 0, 8, 5], [7, 7, 8, 11]]], [2, 1, 3.3, [1, 2]]], [[[[0, 4, 4, 11], [9, 4, 13, 10]]], [0, 0, 2.0, []]], [[[[8, 1, 13, 2], [3, 8, 9, 15], [3, 1, 8, 2], [10, 0, 12, 2]]], [3, 1, 2.96, [0, 2, 3]]], [[[[6, 4, 9, 11], [0, 6, 2, 13], [8, 8, 10, 13], [3, 8, 10, 14], [6, 7, 9, 12], [8, 0, 14, 2], [10, 0, 17, 1]]], [5, 0, 4.935484, [0, 1, 2, 3, 4]]], [[[[4, 3, 6, 8], [0, 6, 1, 13], [0, 7, 1, 11], [0, 2, 5, 4], [4, 1, 7, 2]]], [3, 1, 4.052632, [0, 3, 4]]], [[[[5, 6, 6, 11], [5, 5, 10, 8]]], [0, 0, 2.0, []]], [[[[2, 9, 7, 12], [5, 10, 9, 12], [0, 9, 4, 10]]], [0, 0, 3.0, []]], [[[[7, 9, 12, 14], [6, 1, 12, 4], [7, 9, 13, 12]]], [1, 1, 2.55, [1]]]], [[[[[6, 3, 13, 8], [8, 5, 14, 10], [0, 0, 7, 1], [7, 10, 9, 17]]], [1, 1, 3.387097, [2]]], [[[[10, 5, 16, 9], [8, 3, 11, 7]]], [0, 0, 2.0, []]], [[[[8, 7, 13, 8], [8, 5, 10, 7], [4, 1, 5, 5], [7, 1, 9, 5]]], [2, 0, 3.125, [2, 3]]], [[[[8, 1, 12, 7], [3, 7, 10, 12]]], [0, 1, 2.0, []]], [[[[9, 7, 16, 12], [8, 0, 10, 3]]], [1, 1, 1.85, [1]]], [[[[8, 8, 13, 9], [6, 8, 11, 12]]], [0, 0, 2.0, []]], [[[[1, 2, 8, 6], [8, 3, 9, 6]]], [0, 0, 2.0, []]], [[[[1, 7, 8, 13], [8, 5, 9, 10], [6, 7, 10, 11]]], [1, 0, 2.941176, [0]]]], [[[[[3, 5, 4, 12], [0, 6, 3, 13], [2, 2, 8, 4], [8, 6, 12, 7], [8, 8, 14, 13], [5, 6, 10, 8], [3, 6, 8, 13]]], [4, 0, 5.96, [0, 1, 2, 6]]], [[[[3, 4, 5, 6], [9, 10, 15, 13]]], [1, 0, 1.619048, [0]]], [[[[4, 4, 6, 7], [7, 4, 14, 6], [9, 0, 11, 7], [1, 0, 3, 1], [1, 3, 4, 8], [10, 2, 14, 8]]], [3, 0, 5.0, [0, 3, 4]]], [[[[10, 4, 11, 7], [3, 6, 10, 10], [4, 8, 7, 14], [1, 3, 8, 9]]], [0, 0, 4.0, []]], [[[[3, 1, 8, 2], [5, 2, 11, 7]]], [0, 1, 2.0, []]], [[[[1, 3, 3, 9], [3, 9, 10, 14], [9, 7, 15, 9], [10, 10, 11, 12], [0, 5, 4, 12], [10, 3, 13, 5]]], [3, 0, 5.153846, [0, 1, 4]]], [[[[4, 8, 7, 15], [10, 7, 17, 13], [5, 2, 11, 9]]], [0, 0, 3.0, []]], [[[[2, 0, 9, 3], [7, 1, 13, 7], [8, 3, 15, 4], [4, 3, 11, 10], [8, 10, 13, 13], [8, 9, 12, 11], [4, 7, 7, 13]]], [3, 1, 6.230769, [0, 1, 2]]]], [[[[[8, 5, 9, 7], [2, 5, 8, 8], [5, 7, 10, 10]]], [0, 0, 3.0, []]], [[[[5, 10, 9, 16], [7, 10, 14, 11], [8, 2, 11, 4], [10, 3, 15, 6], [2, 7, 7, 10]]], [2, 1, 4.148148, [2, 3]]], [[[[5, 8, 7, 13], [6, 8, 12, 14], [5, 1, 10, 7], [2, 0, 9, 7], [0, 7, 1, 14], [6, 10, 10, 15], [5, 0, 11, 2]]], [3, 1, 5.740741, [2, 3, 6]]], [[[[8, 4, 11, 8], [8, 1, 14, 2]]], [0, 1, 2.0, []]], [[[[8, 4, 9, 8], [4, 4, 6, 6], [10, 10, 16, 17]]], [2, 1, 2.24, [0, 1]]], [[[[6, 3, 10, 4], [6, 6, 13, 13]]], [0, 1, 2.0, []]], [[[[9, 1, 12, 4], [0, 9, 7, 11], [8, 3, 11, 5]]], [2, 1, 2.136364, [0, 2]]], [[[[10, 2, 16, 7], [4, 2, 5, 5], [9, 8, 10, 9], [7, 4, 11, 9], [8, 9, 12, 10], [0, 3, 2, 9], [0, 7, 7, 8]]], [3, 0, 5.583333, [1, 5, 6]]]]]\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-leaf-cost-baseline","generated_at":"2026-09-29T14:50:58.862602+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":"Start from the leaf cost n and split only when cheaper.","root_cause":"The best cost starts at a huge sentinel instead of the leaf cost n.","sha256":"c5f56d0e670da4e39c501a475d0fc325715c201dd7bba2dcc49f7ed2685e764a","title":"SAH always splits because the leaf cost is ignored · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.592,"exit_code":1,"observations":[{"actual":[0,1,3.0,[]],"check":"case 0","expected":[2,1,3.275862,[1,3]],"passed":false},{"actual":[0,0,2.0,[]],"check":"case 1","expected":[2,0,2.619048,[0,2]],"passed":false},{"actual":[0,1,2.0,[]],"check":"case 2","expected":[1,1,2.65,[0]],"passed":false},{"actual":[0,0,1.0,[]],"check":"case 3","expected":[0,0,2.0,[]],"passed":false},{"actual":[3,1,4.535714,[2,3,4]],"check":"case 4","expected":[3,1,4.535714,[2,3,4]],"passed":true},{"actual":[0,0,1.0,[]],"check":"case 5","expected":[0,0,2.0,[]],"passed":false},{"actual":[0,1,1.0,[]],"check":"case 6","expected":[0,1,2.0,[]],"passed":false},{"actual":[0,1,1.0,[]],"check":"case 7","expected":[0,1,2.0,[]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [0, 1, 3.0, []], \"expected\": [2, 1, 3.275862, [1, 3]], \"passed\": false}, {\"check\": \"case 1\", \"actual\": [0, 0, 2.0, []], \"expected\": [2, 0, 2.619048, [0, 2]], \"passed\": false}, {\"check\": \"case 2\", \"actual\": [0, 1, 2.0, []], \"expected\": [1, 1, 2.65, [0]], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [0, 0, 1.0, []], \"expected\": [0, 0, 2.0, []], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [3, 1, 4.535714, [2, 3, 4]], \"expected\": [3, 1, 4.535714, [2, 3, 4]], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [0, 0, 1.0, []], \"expected\": [0, 0, 2.0, []], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [0, 1, 1.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": false}, {\"check\": \"case 7\", \"actual\": [0, 1, 1.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.413,"exit_code":1,"observations":[{"actual":[2,1,3.275862,[1,3]],"check":"case 0","expected":[2,1,3.275862,[1,3]],"passed":true},{"actual":[2,0,2.619048,[0,2]],"check":"case 1","expected":[2,0,2.619048,[0,2]],"passed":true},{"actual":[1,1,2.65,[0]],"check":"case 2","expected":[1,1,2.65,[0]],"passed":true},{"actual":[1,0,2.727273,[0]],"check":"case 3","expected":[0,0,2.0,[]],"passed":false},{"actual":[3,1,4.535714,[2,3,4]],"check":"case 4","expected":[3,1,4.535714,[2,3,4]],"passed":true},{"actual":[1,0,2.307692,[1]],"check":"case 5","expected":[0,0,2.0,[]],"passed":false},{"actual":[1,1,2.230769,[1]],"check":"case 6","expected":[0,1,2.0,[]],"passed":false},{"actual":[1,1,2.095238,[1]],"check":"case 7","expected":[0,1,2.0,[]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [2, 1, 3.275862, [1, 3]], \"expected\": [2, 1, 3.275862, [1, 3]], \"passed\": true}, {\"check\": \"case 1\", \"actual\": [2, 0, 2.619048, [0, 2]], \"expected\": [2, 0, 2.619048, [0, 2]], \"passed\": true}, {\"check\": \"case 2\", \"actual\": [1, 1, 2.65, [0]], \"expected\": [1, 1, 2.65, [0]], \"passed\": true}, {\"check\": \"case 3\", \"actual\": [1, 0, 2.727273, [0]], \"expected\": [0, 0, 2.0, []], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [3, 1, 4.535714, [2, 3, 4]], \"expected\": [3, 1, 4.535714, [2, 3, 4]], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [1, 0, 2.307692, [1]], \"expected\": [0, 0, 2.0, []], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [1, 1, 2.230769, [1]], \"expected\": [0, 1, 2.0, []], \"passed\": false}, {\"check\": \"case 7\", \"actual\": [1, 1, 2.095238, [1]], \"expected\": [0, 1, 2.0, []], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.502,"exit_code":0,"observations":[{"actual":[2,1,3.275862,[1,3]],"check":"case 0","expected":[2,1,3.275862,[1,3]],"passed":true},{"actual":[2,0,2.619048,[0,2]],"check":"case 1","expected":[2,0,2.619048,[0,2]],"passed":true},{"actual":[1,1,2.65,[0]],"check":"case 2","expected":[1,1,2.65,[0]],"passed":true},{"actual":[0,0,2.0,[]],"check":"case 3","expected":[0,0,2.0,[]],"passed":true},{"actual":[3,1,4.535714,[2,3,4]],"check":"case 4","expected":[3,1,4.535714,[2,3,4]],"passed":true},{"actual":[0,0,2.0,[]],"check":"case 5","expected":[0,0,2.0,[]],"passed":true},{"actual":[0,1,2.0,[]],"check":"case 6","expected":[0,1,2.0,[]],"passed":true},{"actual":[0,1,2.0,[]],"check":"case 7","expected":[0,1,2.0,[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [2, 1, 3.275862, [1, 3]], \"expected\": [2, 1, 3.275862, [1, 3]], \"passed\": true}, {\"check\": \"case 1\", \"actual\": [2, 0, 2.619048, [0, 2]], \"expected\": [2, 0, 2.619048, [0, 2]], \"passed\": true}, {\"check\": \"case 2\", \"actual\": [1, 1, 2.65, [0]], \"expected\": [1, 1, 2.65, [0]], \"passed\": true}, {\"check\": \"case 3\", \"actual\": [0, 0, 2.0, []], \"expected\": [0, 0, 2.0, []], \"passed\": true}, {\"check\": \"case 4\", \"actual\": [3, 1, 4.535714, [2, 3, 4]], \"expected\": [3, 1, 4.535714, [2, 3, 4]], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [0, 0, 2.0, []], \"expected\": [0, 0, 2.0, []], \"passed\": true}, {\"check\": \"case 6\", \"actual\": [0, 1, 2.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": true}, {\"check\": \"case 7\", \"actual\": [0, 1, 2.0, []], \"expected\": [0, 1, 2.0, []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}