{"abstract":"Objects are stored in a child covering the wrong region and queries miss them.","category":"Collision detection broadphase","checks":8,"contract":"solve(objs, cap, max_depth, q): quadtree over [0,16]^2. Insert [id,minx,miny,maxx,maxy] in order. A node splits when it holds more than cap objects and depth<max_depth; children are ordered cy*2+cx. An object goes to a child only if it fits entirely: maxx<mid -> left, minx>=mid -> right (same for y); straddlers stay. On split all node objects are re-inserted. Query returns [sorted ids of objects in nodes whose closed bounds overlap q, total node count, max depth].","contract_signature":"objs, cap, max_depth, q","evaluation_group":"w2-collision_detection_broadphase-quadtree-straddle","failed_approach":"Using k%2 for both offsets collapses two quadrants onto the diagonal.","family":"w2-collision_detection_broadphase-quadtree-straddle-child-quadrant-layout","id":"FA-87491","implementations":{"attempt":{"sha256":"55de7b8762098e52cd0c4c28f98ed1ad01936b5c9bd14f526c87cad65a9ff5b2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(objs, cap, max_depth, q):\n    def make(x, y, s, d):\n        return {'x': x, 'y': y, 's': s, 'd': d, 'objs': [], 'kids': None}\n    def child_index(n, o):\n        h = n['s'] / 2\n        mx, my = n['x'] + h, n['y'] + h\n        if o[3] < mx:\n            cx = 0\n        elif o[1] >= mx:\n            cx = 1\n        else:\n            return -1\n        if o[4] < my:\n            cy = 0\n        elif o[2] >= my:\n            cy = 1\n        else:\n            return -1\n        return cy * 2 + cx\n    def split(n):\n        h = n['s'] / 2\n        n['kids'] = [make(n['x'] + (k % 2) * h, n['y'] + (k % 2) * h, h, n['d'] + 1) for k in range(4)]\n        old, n['objs'] = n['objs'], []\n        for o in old:\n            insert(n, o)\n    def insert(n, o):\n        if n['kids'] is not None:\n            k = child_index(n, o)\n            if k >= 0:\n                insert(n['kids'][k], o)\n                return\n        n['objs'].append(o)\n        if n['kids'] is None and len(n['objs']) > cap and n['d'] < max_depth:\n            split(n)\n    root = make(0, 0, 16, 0)\n    for o in objs:\n        insert(root, o)\n    found, count, deep = [], 0, 0\n    stack = [root]\n    while stack:\n        n = stack.pop()\n        count += 1\n        deep = max(deep, n['d'])\n        if n['kids']:\n            stack.extend(n['kids'])\n        if n['x'] <= q[2] and q[0] <= n['x'] + n['s'] and n['y'] <= q[3] and q[1] <= n['y'] + n['s']:\n            found.extend(o[0] for o in n['objs'])\n    return [sorted(found), count, deep]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[[5, 1, 11, 3, 11], [44, 11, 8, 12, 9], [49, 10, 8, 11, 9], [19, 0, 12, 1, 12]], 2, 2, [8, 9, 12, 14]], [[5, 19, 44, 49], 5, 1]], [[[[41, 4, 10, 5, 12], [18, 13, 15, 14, 15], [8, 15, 2, 16, 5], [21, 13, 14, 14, 16], [43, 10, 4, 13, 6], [1, 8, 15, 9, 16]], 1, 3, [9, 8, 10, 12]], [[1, 8, 43], 17, 3]], [[[[3, 15, 7, 16, 7], [5, 1, 8, 3, 10], [28, 2, 13, 3, 14], [8, 13, 13, 14, 14], [16, 8, 14, 11, 16], [42, 11, 14, 14, 14], [17, 0, 15, 1, 15]], 1, 1, [3, 9, 5, 14]], [[5, 17, 28], 5, 1]], [[[[25, 14, 12, 16, 13], [7, 2, 13, 3, 14], [22, 7, 4, 7, 5], [33, 9, 9, 11, 11]], 1, 3, [5, 1, 5, 2]], [[22], 9, 2]], [[[[7, 15, 7, 16, 9], [25, 3, 3, 6, 4], [9, 0, 4, 3, 6], [15, 11, 10, 14, 10]], 3, 2, [9, 10, 13, 13]], [[7, 15], 5, 1]], [[[[2, 8, 0, 10, 1], [48, 2, 13, 2, 16], [16, 0, 6, 3, 8], [24, 0, 15, 1, 16], [21, 6, 1, 9, 4], [20, 10, 5, 11, 8], [9, 6, 7, 6, 7]], 2, 2, [7, 1, 12, 3]], [[2, 9, 16, 20, 21], 5, 1]], [[[[8, 4, 3, 5, 5], [30, 7, 3, 8, 5], [26, 10, 12, 13, 14], [37, 7, 5, 10, 8], [47, 1, 9, 4, 10], [42, 5, 8, 5, 9], [36, 15, 14, 16, 16]], 1, 2, [8, 5, 13, 7]], [[8, 30, 37], 13, 2]], [[[[42, 6, 14, 7, 16], [40, 13, 14, 13, 16]], 1, 3, [8, 6, 13, 7]], [[], 5, 1]]], [[[[[18, 13, 7, 13, 9], [37, 13, 0, 14, 1], [36, 5, 15, 8, 16], [44, 10, 5, 12, 5], [15, 5, 15, 7, 16], [45, 10, 10, 12, 12], [17, 3, 15, 6, 16], [43, 9, 7, 12, 9], [28, 7, 4, 8, 4]], 3, 1, [6, 7, 10, 9]], [[15, 17, 18, 28, 36, 37, 43, 44, 45], 5, 1]], [[[[37, 6, 12, 7, 15], [36, 13, 15, 16, 16], [24, 9, 12, 12, 15]], 3, 2, [8, 8, 13, 13]], [[24, 36, 37], 1, 0]], [[[[45, 15, 11, 16, 11], [24, 11, 4, 12, 5], [3, 1, 6, 1, 9], [37, 12, 8, 15, 11], [44, 7, 10, 9, 11], [9, 13, 4, 16, 5], [27, 11, 11, 11, 14]], 1, 3, [7, 13, 9, 15]], [[3, 27, 44], 17, 3]], [[[[44, 4, 13, 6, 13], [34, 7, 8, 8, 11], [5, 6, 8, 7, 10], [32, 0, 9, 3, 12], [47, 5, 0, 7, 1], [8, 13, 1, 13, 1], [1, 10, 15, 11, 16], [30, 0, 10, 3, 13], [45, 3, 7, 4, 7]], 2, 3, [2, 6, 6, 7]], [[34, 45, 47], 9, 2]], [[[[30, 13, 11, 14, 11], [37, 9, 10, 12, 13], [17, 4, 10, 5, 13], [2, 8, 8, 8, 11], [27, 12, 0, 12, 0], [31, 2, 3, 3, 4]], 1, 2, [11, 4, 12, 6]], [[27], 9, 2]], [[[[17, 15, 0, 15, 0], [8, 3, 11, 5, 11], [2, 13, 1, 13, 2], [37, 4, 11, 4, 12], [28, 3, 7, 6, 8], [30, 15, 3, 16, 4], [11, 1, 2, 1, 4]], 2, 3, [6, 11, 7, 16]], [[8, 28, 37], 9, 2]], [[[[16, 3, 0, 5, 3], [33, 4, 15, 7, 16], [42, 9, 9, 11, 11], [10, 11, 6, 14, 7], [29, 12, 11, 14, 11]], 3, 1, [5, 10, 6, 10]], [[33], 5, 1]], [[[[28, 8, 6, 10, 6], [2, 15, 11, 16, 14], [46, 11, 3, 12, 6], [48, 6, 1, 9, 1], [42, 6, 5, 7, 6], [20, 6, 0, 6, 0], [7, 15, 4, 16, 5], [25, 4, 15, 4, 16]], 1, 1, [2, 5, 6, 7]], [[20, 42, 48], 5, 1]]], [[[[[23, 8, 12, 9, 13], [11, 5, 4, 8, 6], [13, 4, 4, 4, 4], [40, 4, 5, 6, 5], [28, 15, 10, 16, 10], [14, 5, 14, 7, 16]], 3, 2, [2, 1, 4, 1]], [[11, 13, 40], 5, 1]], [[[[24, 7, 9, 7, 12], [27, 7, 14, 10, 15], [4, 6, 10, 8, 12]], 1, 2, [4, 10, 6, 10]], [[4, 24, 27], 5, 1]], [[[[15, 10, 8, 13, 11], [12, 14, 4, 16, 5], [28, 15, 13, 16, 13], [5, 3, 1, 4, 4], [29, 3, 0, 6, 2], [14, 6, 11, 8, 11], [37, 3, 11, 4, 13], [26, 13, 11, 15, 13], [35, 13, 9, 16, 12], [9, 15, 9, 16, 12]], 1, 1, [9, 14, 14, 18]], [[9, 14, 15, 26, 28, 35], 5, 1]], [[[[8, 15, 5, 16, 6], [23, 12, 4, 12, 5], [39, 8, 1, 8, 1], [41, 13, 11, 15, 14], [27, 12, 11, 12, 12]], 1, 2, [8, 3, 10, 8]], [[27, 39, 41], 13, 2]], [[[[42, 4, 12, 4, 15], [5, 15, 7, 15, 8], [35, 10, 5, 11, 5], [16, 2, 12, 4, 15], [39, 6, 12, 8, 15], [40, 15, 14, 16, 16], [33, 13, 7, 14, 9], [46, 9, 13, 9, 16]], 2, 1, [9, 1, 13, 6]], [[5, 33, 35, 39], 5, 1]], [[[[17, 1, 13, 1, 15], [4, 12, 5, 14, 8], [42, 0, 3, 1, 5], [1, 15, 3, 16, 3]], 2, 1, [13, 14, 18, 18]], [[4], 5, 1]], [[[[42, 9, 3, 10, 5], [26, 12, 6, 14, 7], [12, 15, 5, 16, 7], [28, 0, 7, 0, 8], [3, 1, 10, 3, 13], [22, 0, 11, 0, 14], [13, 5, 1, 8, 2], [45, 5, 7, 6, 10], [40, 13, 2, 14, 5]], 3, 3, [12, 11, 15, 11]], [[13, 28, 45], 9, 2]], [[[[31, 9, 1, 11, 1], [18, 6, 9, 9, 9], [28, 4, 7, 5, 8]], 2, 3, [14, 6, 16, 10]], [[18, 28, 31], 5, 1]]], [[[[[12, 15, 3, 16, 4], [5, 7, 11, 9, 14], [24, 9, 4, 11, 7]], 2, 2, [14, 5, 17, 10]], [[5, 12, 24], 5, 1]], [[[[46, 12, 14, 13, 15], [30, 1, 6, 2, 7], [2, 8, 0, 10, 0], [4, 15, 12, 15, 14], [24, 12, 5, 14, 5], [31, 2, 15, 2, 15]], 2, 3, [10, 11, 14, 14]], [[4, 46], 5, 1]], [[[[30, 5, 1, 5, 3], [15, 13, 14, 13, 16], [18, 15, 10, 16, 10]], 1, 1, [2, 3, 4, 4]], [[30], 5, 1]], [[[[32, 4, 11, 6, 14], [9, 2, 6, 5, 8], [21, 7, 5, 8, 8], [25, 2, 4, 3, 6], [17, 5, 5, 6, 6], [23, 1, 8, 4, 8], [4, 6, 11, 9, 13], [41, 0, 5, 1, 7], [33, 14, 10, 15, 10], [14, 14, 4, 15, 7]], 1, 1, [5, 8, 9, 10]], [[4, 9, 14, 17, 21, 23, 25, 32, 33, 41], 5, 1]], [[[[3, 14, 5, 15, 7], [29, 15, 0, 16, 1], [25, 1, 10, 1, 12], [10, 6, 14, 6, 16], [27, 5, 6, 5, 9], [43, 0, 10, 3, 13], [33, 4, 9, 7, 9], [45, 9, 4, 11, 7], [18, 8, 14, 11, 15], [28, 11, 9, 12, 10]], 1, 1, [8, 9, 11, 10]], [[10, 18, 25, 27, 28, 33, 43], 5, 1]], [[[[28, 4, 4, 4, 7], [24, 7, 10, 9, 12], [14, 5, 5, 7, 6], [49, 6, 0, 7, 3], [20, 6, 10, 7, 13], [13, 1, 8, 3, 10], [3, 10, 12, 10, 13], [36, 2, 5, 5, 7], [38, 11, 11, 14, 14], [40, 10, 5, 12, 6], [25, 14, 11, 16, 12]], 3, 2, [13, 13, 17, 14]], [[3, 24, 25, 38], 9, 2]], [[[[8, 3, 4, 3, 5], [37, 2, 9, 2, 9], [18, 9, 12, 10, 13], [6, 11, 7, 14, 10], [36, 0, 5, 1, 5], [25, 5, 2, 6, 5], [2, 3, 1, 3, 4], [39, 2, 11, 4, 12]], 1, 3, [0, 5, 2, 10]], [[2, 6, 8, 25, 36, 37, 39], 17, 3]], [[[[28, 6, 13, 6, 15], [12, 0, 1, 0, 3], [30, 1, 2, 2, 2], [9, 14, 12, 16, 13], [7, 5, 11, 8, 12]], 1, 3, [8, 2, 12, 3]], [[7], 13, 3]]], [[[[[41, 10, 13, 10, 13], [4, 5, 13, 5, 14], [36, 10, 15, 12, 16], [35, 5, 5, 7, 6], [47, 9, 4, 10, 5], [27, 10, 14, 13, 14], [13, 8, 8, 10, 10], [15, 6, 14, 8, 14], [11, 11, 3, 13, 4]], 2, 2, [7, 2, 7, 7]], [[15, 35], 9, 2]], [[[[49, 11, 1, 11, 4], [4, 9, 14, 12, 16], [3, 1, 4, 2, 7], [11, 10, 4, 10, 5], [25, 6, 12, 9, 12], [26, 11, 14, 13, 15], [36, 3, 14, 6, 16], [18, 3, 1, 3, 2], [6, 15, 5, 16, 7], [31, 3, 11, 3, 12], [40, 2, 6, 4, 9]], 3, 3, [11, 14, 15, 14]], [[4, 25, 26, 40], 5, 1]], [[[[34, 13, 8, 16, 9], [35, 0, 9, 2, 12], [8, 11, 12, 13, 13], [43, 12, 9, 15, 9], [42, 12, 3, 15, 5], [21, 13, 3, 13, 3], [27, 12, 0, 12, 3], [37, 6, 2, 8, 5], [25, 0, 9, 2, 12]], 2, 3, [10, 6, 10, 11]], [[8, 37, 42], 13, 2]], [[[[37, 6, 14, 6, 16], [40, 1, 4, 3, 4]], 3, 3, [5, 10, 6, 10]], [[37, 40], 1, 0]], [[[[27, 4, 14, 7, 14], [36, 6, 1, 8, 4], [10, 8, 9, 10, 11], [15, 13, 4, 13, 5], [24, 9, 5, 12, 7], [48, 11, 0, 14, 1], [20, 5, 6, 7, 9], [47, 1, 11, 1, 12]], 3, 3, [6, 7, 6, 7]], [[20, 36], 5, 1]], [[[[12, 12, 2, 13, 3], [39, 8, 10, 9, 10], [18, 7, 1, 7, 3]], 2, 3, [8, 12, 9, 16]], [[39], 5, 1]], [[[[40, 14, 12, 14, 13], [36, 3, 9, 5, 9], [27, 1, 0, 1, 3], [22, 0, 9, 2, 12], [9, 7, 11, 7, 12], [6, 10, 7, 12, 8]], 1, 1, [4, 10, 5, 10]], [[6, 9, 22, 36], 5, 1]], [[[[45, 11, 12, 11, 14], [46, 10, 11, 11, 14], [5, 14, 10, 16, 12], [25, 13, 4, 14, 5], [14, 1, 4, 4, 6], [33, 11, 10, 11, 10]], 2, 2, [11, 14, 11, 18]], [[5, 45, 46], 9, 2]]]]\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":"022af507efd60291c32679ca76dcf37e64e8d475573e5081f8e67c233fee737c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(objs, cap, max_depth, q):\n    def make(x, y, s, d):\n        return {'x': x, 'y': y, 's': s, 'd': d, 'objs': [], 'kids': None}\n    def child_index(n, o):\n        h = n['s'] / 2\n        mx, my = n['x'] + h, n['y'] + h\n        if o[3] < mx:\n            cx = 0\n        elif o[1] >= mx:\n            cx = 1\n        else:\n            return -1\n        if o[4] < my:\n            cy = 0\n        elif o[2] >= my:\n            cy = 1\n        else:\n            return -1\n        return cy * 2 + cx\n    def split(n):\n        h = n['s'] / 2\n        n['kids'] = [make(n['x'] + (k // 2) * h, n['y'] + (k % 2) * h, h, n['d'] + 1) for k in range(4)]\n        old, n['objs'] = n['objs'], []\n        for o in old:\n            insert(n, o)\n    def insert(n, o):\n        if n['kids'] is not None:\n            k = child_index(n, o)\n            if k >= 0:\n                insert(n['kids'][k], o)\n                return\n        n['objs'].append(o)\n        if n['kids'] is None and len(n['objs']) > cap and n['d'] < max_depth:\n            split(n)\n    root = make(0, 0, 16, 0)\n    for o in objs:\n        insert(root, o)\n    found, count, deep = [], 0, 0\n    stack = [root]\n    while stack:\n        n = stack.pop()\n        count += 1\n        deep = max(deep, n['d'])\n        if n['kids']:\n            stack.extend(n['kids'])\n        if n['x'] <= q[2] and q[0] <= n['x'] + n['s'] and n['y'] <= q[3] and q[1] <= n['y'] + n['s']:\n            found.extend(o[0] for o in n['objs'])\n    return [sorted(found), count, deep]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[[[5, 1, 11, 3, 11], [44, 11, 8, 12, 9], [49, 10, 8, 11, 9], [19, 0, 12, 1, 12]], 2, 2, [8, 9, 12, 14]], [[5, 19, 44, 49], 5, 1]], [[[[41, 4, 10, 5, 12], [18, 13, 15, 14, 15], [8, 15, 2, 16, 5], [21, 13, 14, 14, 16], [43, 10, 4, 13, 6], [1, 8, 15, 9, 16]], 1, 3, [9, 8, 10, 12]], [[1, 8, 43], 17, 3]], [[[[3, 15, 7, 16, 7], [5, 1, 8, 3, 10], [28, 2, 13, 3, 14], [8, 13, 13, 14, 14], [16, 8, 14, 11, 16], [42, 11, 14, 14, 14], [17, 0, 15, 1, 15]], 1, 1, [3, 9, 5, 14]], [[5, 17, 28], 5, 1]], [[[[25, 14, 12, 16, 13], [7, 2, 13, 3, 14], [22, 7, 4, 7, 5], [33, 9, 9, 11, 11]], 1, 3, [5, 1, 5, 2]], [[22], 9, 2]], [[[[7, 15, 7, 16, 9], [25, 3, 3, 6, 4], [9, 0, 4, 3, 6], [15, 11, 10, 14, 10]], 3, 2, [9, 10, 13, 13]], [[7, 15], 5, 1]], [[[[2, 8, 0, 10, 1], [48, 2, 13, 2, 16], [16, 0, 6, 3, 8], [24, 0, 15, 1, 16], [21, 6, 1, 9, 4], [20, 10, 5, 11, 8], [9, 6, 7, 6, 7]], 2, 2, [7, 1, 12, 3]], [[2, 9, 16, 20, 21], 5, 1]], [[[[8, 4, 3, 5, 5], [30, 7, 3, 8, 5], [26, 10, 12, 13, 14], [37, 7, 5, 10, 8], [47, 1, 9, 4, 10], [42, 5, 8, 5, 9], [36, 15, 14, 16, 16]], 1, 2, [8, 5, 13, 7]], [[8, 30, 37], 13, 2]], [[[[42, 6, 14, 7, 16], [40, 13, 14, 13, 16]], 1, 3, [8, 6, 13, 7]], [[], 5, 1]]], [[[[[18, 13, 7, 13, 9], [37, 13, 0, 14, 1], [36, 5, 15, 8, 16], [44, 10, 5, 12, 5], [15, 5, 15, 7, 16], [45, 10, 10, 12, 12], [17, 3, 15, 6, 16], [43, 9, 7, 12, 9], [28, 7, 4, 8, 4]], 3, 1, [6, 7, 10, 9]], [[15, 17, 18, 28, 36, 37, 43, 44, 45], 5, 1]], [[[[37, 6, 12, 7, 15], [36, 13, 15, 16, 16], [24, 9, 12, 12, 15]], 3, 2, [8, 8, 13, 13]], [[24, 36, 37], 1, 0]], [[[[45, 15, 11, 16, 11], [24, 11, 4, 12, 5], [3, 1, 6, 1, 9], [37, 12, 8, 15, 11], [44, 7, 10, 9, 11], [9, 13, 4, 16, 5], [27, 11, 11, 11, 14]], 1, 3, [7, 13, 9, 15]], [[3, 27, 44], 17, 3]], [[[[44, 4, 13, 6, 13], [34, 7, 8, 8, 11], [5, 6, 8, 7, 10], [32, 0, 9, 3, 12], [47, 5, 0, 7, 1], [8, 13, 1, 13, 1], [1, 10, 15, 11, 16], [30, 0, 10, 3, 13], [45, 3, 7, 4, 7]], 2, 3, [2, 6, 6, 7]], [[34, 45, 47], 9, 2]], [[[[30, 13, 11, 14, 11], [37, 9, 10, 12, 13], [17, 4, 10, 5, 13], [2, 8, 8, 8, 11], [27, 12, 0, 12, 0], [31, 2, 3, 3, 4]], 1, 2, [11, 4, 12, 6]], [[27], 9, 2]], [[[[17, 15, 0, 15, 0], [8, 3, 11, 5, 11], [2, 13, 1, 13, 2], [37, 4, 11, 4, 12], [28, 3, 7, 6, 8], [30, 15, 3, 16, 4], [11, 1, 2, 1, 4]], 2, 3, [6, 11, 7, 16]], [[8, 28, 37], 9, 2]], [[[[16, 3, 0, 5, 3], [33, 4, 15, 7, 16], [42, 9, 9, 11, 11], [10, 11, 6, 14, 7], [29, 12, 11, 14, 11]], 3, 1, [5, 10, 6, 10]], [[33], 5, 1]], [[[[28, 8, 6, 10, 6], [2, 15, 11, 16, 14], [46, 11, 3, 12, 6], [48, 6, 1, 9, 1], [42, 6, 5, 7, 6], [20, 6, 0, 6, 0], [7, 15, 4, 16, 5], [25, 4, 15, 4, 16]], 1, 1, [2, 5, 6, 7]], [[20, 42, 48], 5, 1]]], [[[[[23, 8, 12, 9, 13], [11, 5, 4, 8, 6], [13, 4, 4, 4, 4], [40, 4, 5, 6, 5], [28, 15, 10, 16, 10], [14, 5, 14, 7, 16]], 3, 2, [2, 1, 4, 1]], [[11, 13, 40], 5, 1]], [[[[24, 7, 9, 7, 12], [27, 7, 14, 10, 15], [4, 6, 10, 8, 12]], 1, 2, [4, 10, 6, 10]], [[4, 24, 27], 5, 1]], [[[[15, 10, 8, 13, 11], [12, 14, 4, 16, 5], [28, 15, 13, 16, 13], [5, 3, 1, 4, 4], [29, 3, 0, 6, 2], [14, 6, 11, 8, 11], [37, 3, 11, 4, 13], [26, 13, 11, 15, 13], [35, 13, 9, 16, 12], [9, 15, 9, 16, 12]], 1, 1, [9, 14, 14, 18]], [[9, 14, 15, 26, 28, 35], 5, 1]], [[[[8, 15, 5, 16, 6], [23, 12, 4, 12, 5], [39, 8, 1, 8, 1], [41, 13, 11, 15, 14], [27, 12, 11, 12, 12]], 1, 2, [8, 3, 10, 8]], [[27, 39, 41], 13, 2]], [[[[42, 4, 12, 4, 15], [5, 15, 7, 15, 8], [35, 10, 5, 11, 5], [16, 2, 12, 4, 15], [39, 6, 12, 8, 15], [40, 15, 14, 16, 16], [33, 13, 7, 14, 9], [46, 9, 13, 9, 16]], 2, 1, [9, 1, 13, 6]], [[5, 33, 35, 39], 5, 1]], [[[[17, 1, 13, 1, 15], [4, 12, 5, 14, 8], [42, 0, 3, 1, 5], [1, 15, 3, 16, 3]], 2, 1, [13, 14, 18, 18]], [[4], 5, 1]], [[[[42, 9, 3, 10, 5], [26, 12, 6, 14, 7], [12, 15, 5, 16, 7], [28, 0, 7, 0, 8], [3, 1, 10, 3, 13], [22, 0, 11, 0, 14], [13, 5, 1, 8, 2], [45, 5, 7, 6, 10], [40, 13, 2, 14, 5]], 3, 3, [12, 11, 15, 11]], [[13, 28, 45], 9, 2]], [[[[31, 9, 1, 11, 1], [18, 6, 9, 9, 9], [28, 4, 7, 5, 8]], 2, 3, [14, 6, 16, 10]], [[18, 28, 31], 5, 1]]], [[[[[12, 15, 3, 16, 4], [5, 7, 11, 9, 14], [24, 9, 4, 11, 7]], 2, 2, [14, 5, 17, 10]], [[5, 12, 24], 5, 1]], [[[[46, 12, 14, 13, 15], [30, 1, 6, 2, 7], [2, 8, 0, 10, 0], [4, 15, 12, 15, 14], [24, 12, 5, 14, 5], [31, 2, 15, 2, 15]], 2, 3, [10, 11, 14, 14]], [[4, 46], 5, 1]], [[[[30, 5, 1, 5, 3], [15, 13, 14, 13, 16], [18, 15, 10, 16, 10]], 1, 1, [2, 3, 4, 4]], [[30], 5, 1]], [[[[32, 4, 11, 6, 14], [9, 2, 6, 5, 8], [21, 7, 5, 8, 8], [25, 2, 4, 3, 6], [17, 5, 5, 6, 6], [23, 1, 8, 4, 8], [4, 6, 11, 9, 13], [41, 0, 5, 1, 7], [33, 14, 10, 15, 10], [14, 14, 4, 15, 7]], 1, 1, [5, 8, 9, 10]], [[4, 9, 14, 17, 21, 23, 25, 32, 33, 41], 5, 1]], [[[[3, 14, 5, 15, 7], [29, 15, 0, 16, 1], [25, 1, 10, 1, 12], [10, 6, 14, 6, 16], [27, 5, 6, 5, 9], [43, 0, 10, 3, 13], [33, 4, 9, 7, 9], [45, 9, 4, 11, 7], [18, 8, 14, 11, 15], [28, 11, 9, 12, 10]], 1, 1, [8, 9, 11, 10]], [[10, 18, 25, 27, 28, 33, 43], 5, 1]], [[[[28, 4, 4, 4, 7], [24, 7, 10, 9, 12], [14, 5, 5, 7, 6], [49, 6, 0, 7, 3], [20, 6, 10, 7, 13], [13, 1, 8, 3, 10], [3, 10, 12, 10, 13], [36, 2, 5, 5, 7], [38, 11, 11, 14, 14], [40, 10, 5, 12, 6], [25, 14, 11, 16, 12]], 3, 2, [13, 13, 17, 14]], [[3, 24, 25, 38], 9, 2]], [[[[8, 3, 4, 3, 5], [37, 2, 9, 2, 9], [18, 9, 12, 10, 13], [6, 11, 7, 14, 10], [36, 0, 5, 1, 5], [25, 5, 2, 6, 5], [2, 3, 1, 3, 4], [39, 2, 11, 4, 12]], 1, 3, [0, 5, 2, 10]], [[2, 6, 8, 25, 36, 37, 39], 17, 3]], [[[[28, 6, 13, 6, 15], [12, 0, 1, 0, 3], [30, 1, 2, 2, 2], [9, 14, 12, 16, 13], [7, 5, 11, 8, 12]], 1, 3, [8, 2, 12, 3]], [[7], 13, 3]]], [[[[[41, 10, 13, 10, 13], [4, 5, 13, 5, 14], [36, 10, 15, 12, 16], [35, 5, 5, 7, 6], [47, 9, 4, 10, 5], [27, 10, 14, 13, 14], [13, 8, 8, 10, 10], [15, 6, 14, 8, 14], [11, 11, 3, 13, 4]], 2, 2, [7, 2, 7, 7]], [[15, 35], 9, 2]], [[[[49, 11, 1, 11, 4], [4, 9, 14, 12, 16], [3, 1, 4, 2, 7], [11, 10, 4, 10, 5], [25, 6, 12, 9, 12], [26, 11, 14, 13, 15], [36, 3, 14, 6, 16], [18, 3, 1, 3, 2], [6, 15, 5, 16, 7], [31, 3, 11, 3, 12], [40, 2, 6, 4, 9]], 3, 3, [11, 14, 15, 14]], [[4, 25, 26, 40], 5, 1]], [[[[34, 13, 8, 16, 9], [35, 0, 9, 2, 12], [8, 11, 12, 13, 13], [43, 12, 9, 15, 9], [42, 12, 3, 15, 5], [21, 13, 3, 13, 3], [27, 12, 0, 12, 3], [37, 6, 2, 8, 5], [25, 0, 9, 2, 12]], 2, 3, [10, 6, 10, 11]], [[8, 37, 42], 13, 2]], [[[[37, 6, 14, 6, 16], [40, 1, 4, 3, 4]], 3, 3, [5, 10, 6, 10]], [[37, 40], 1, 0]], [[[[27, 4, 14, 7, 14], [36, 6, 1, 8, 4], [10, 8, 9, 10, 11], [15, 13, 4, 13, 5], [24, 9, 5, 12, 7], [48, 11, 0, 14, 1], [20, 5, 6, 7, 9], [47, 1, 11, 1, 12]], 3, 3, [6, 7, 6, 7]], [[20, 36], 5, 1]], [[[[12, 12, 2, 13, 3], [39, 8, 10, 9, 10], [18, 7, 1, 7, 3]], 2, 3, [8, 12, 9, 16]], [[39], 5, 1]], [[[[40, 14, 12, 14, 13], [36, 3, 9, 5, 9], [27, 1, 0, 1, 3], [22, 0, 9, 2, 12], [9, 7, 11, 7, 12], [6, 10, 7, 12, 8]], 1, 1, [4, 10, 5, 10]], [[6, 9, 22, 36], 5, 1]], [[[[45, 11, 12, 11, 14], [46, 10, 11, 11, 14], [5, 14, 10, 16, 12], [25, 13, 4, 14, 5], [14, 1, 4, 4, 6], [33, 11, 10, 11, 10]], 2, 2, [11, 14, 11, 18]], [[5, 45, 46], 9, 2]]]]\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-quadtree-straddle-child-quadrant-layout","generated_at":"2026-09-29T14:50:59.261668+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":"Child k uses x offset k//2 and y offset k%2.","sha256":"3822e975b0afa94e6c27152ce4ae871d8240ea70881d8d75e7dfe1583a412818","title":"Child node origins are laid out column-major while indices are row-major · 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":42.103,"exit_code":1,"observations":[{"actual":[[44,49],5,1],"check":"case 0","expected":[[5,19,44,49],5,1],"passed":false},{"actual":[[1,43],17,3],"check":"case 1","expected":[[1,8,43],17,3],"passed":false},{"actual":[[],5,1],"check":"case 2","expected":[[5,17,28],5,1],"passed":false},{"actual":[[7,22],9,2],"check":"case 3","expected":[[22],9,2],"passed":false},{"actual":[[7,15],5,1],"check":"case 4","expected":[[7,15],5,1],"passed":true},{"actual":[[9,16,20,21,24,48],5,1],"check":"case 5","expected":[[2,9,16,20,21],5,1],"passed":false},{"actual":[[8,30,37,42,47],13,2],"check":"case 6","expected":[[8,30,37],13,2],"passed":false},{"actual":[[42],5,1],"check":"case 7","expected":[[],5,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [[44, 49], 5, 1], \"expected\": [[5, 19, 44, 49], 5, 1], \"passed\": false}, {\"check\": \"case 1\", \"actual\": [[1, 43], 17, 3], \"expected\": [[1, 8, 43], 17, 3], \"passed\": false}, {\"check\": \"case 2\", \"actual\": [[], 5, 1], \"expected\": [[5, 17, 28], 5, 1], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [[7, 22], 9, 2], \"expected\": [[22], 9, 2], \"passed\": false}, {\"check\": \"case 4\", \"actual\": [[7, 15], 5, 1], \"expected\": [[7, 15], 5, 1], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [[9, 16, 20, 21, 24, 48], 5, 1], \"expected\": [[2, 9, 16, 20, 21], 5, 1], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [[8, 30, 37, 42, 47], 13, 2], \"expected\": [[8, 30, 37], 13, 2], \"passed\": false}, {\"check\": \"case 7\", \"actual\": [[42], 5, 1], \"expected\": [[], 5, 1], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.522,"exit_code":1,"observations":[{"actual":[[44,49],5,1],"check":"case 0","expected":[[5,19,44,49],5,1],"passed":false},{"actual":[[41],21,3],"check":"case 1","expected":[[1,8,43],17,3],"passed":false},{"actual":[[3],5,1],"check":"case 2","expected":[[5,17,28],5,1],"passed":false},{"actual":[[22],9,2],"check":"case 3","expected":[[22],9,2],"passed":true},{"actual":[[7,15],5,1],"check":"case 4","expected":[[7,15],5,1],"passed":true},{"actual":[[9,16,20,21,24,48],5,1],"check":"case 5","expected":[[2,9,16,20,21],5,1],"passed":false},{"actual":[[8,30,37],13,2],"check":"case 6","expected":[[8,30,37],13,2],"passed":true},{"actual":[[42],5,1],"check":"case 7","expected":[[],5,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"case 0\", \"actual\": [[44, 49], 5, 1], \"expected\": [[5, 19, 44, 49], 5, 1], \"passed\": false}, {\"check\": \"case 1\", \"actual\": [[41], 21, 3], \"expected\": [[1, 8, 43], 17, 3], \"passed\": false}, {\"check\": \"case 2\", \"actual\": [[3], 5, 1], \"expected\": [[5, 17, 28], 5, 1], \"passed\": false}, {\"check\": \"case 3\", \"actual\": [[22], 9, 2], \"expected\": [[22], 9, 2], \"passed\": true}, {\"check\": \"case 4\", \"actual\": [[7, 15], 5, 1], \"expected\": [[7, 15], 5, 1], \"passed\": true}, {\"check\": \"case 5\", \"actual\": [[9, 16, 20, 21, 24, 48], 5, 1], \"expected\": [[2, 9, 16, 20, 21], 5, 1], \"passed\": false}, {\"check\": \"case 6\", \"actual\": [[8, 30, 37], 13, 2], \"expected\": [[8, 30, 37], 13, 2], \"passed\": true}, {\"check\": \"case 7\", \"actual\": [[42], 5, 1], \"expected\": [[], 5, 1], \"passed\": false}], \"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."}}