{"abstract":"The bounded leftist meld step certificate reports an incorrect right id.","category":"Heap invariants","checks":7,"contract":"A leftist meld unwind record gives chosen root id, left subtree [id,npl,size] or None, returned right subtree similarly, and root key. Orient children by npl (null=-1), retain left on equal rank, set npl to right npl+1, and size to one plus both child sizes.","evaluation_group":"s3-heap-model-leftist-meld-step","failed_approach":"The local patch uses left[0] if left else None and still violates the stated relation.","family":"s3-heap-leftist-meld-step-right_id","id":"FA-40176","implementations":{"attempt":{"sha256":"8c944d52564cb6bd2349a21ad9f42ade5caa484dcd5916efb5c7a52aa3810233","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    left=d['left']; right=d['right']; ln=-1 if left is None else left[1]; rn=-1 if right is None else right[1]\n    l,r=(right,left) if ln<rn else (left,right)\n    return {'left_id': l[0] if l else None,\n    'right_id': left[0] if left else None,\n    'npl': 1+(-1 if r is None else r[1]),\n    'size': 1+sum(x[2] for x in (l,r) if x),\n    'swap': ln<rn,\n    'parent_assignments': [[x[0],d[\"root\"]] for x in (l,r) if x]}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 3], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 13, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 4], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 14, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 5], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 15, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 6], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 16, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 7], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 17, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})]][N-1]\ncheck('regression certificate 1', solve(cases[0][0]), cases[0][1])\ncheck('regression certificate 2', solve(cases[1][0]), cases[1][1])\ncheck('regression certificate 3', solve(cases[2][0]), cases[2][1])\ncheck('regression certificate 4', solve(cases[3][0]), cases[3][1])\ncheck('regression certificate 5', solve(cases[4][0]), cases[4][1])\ncheck('regression certificate 6', solve(cases[5][0]), cases[5][1])\ncheck('variant-dependent certificate', solve(cases[6][0]), cases[6][1])\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":"87cf3dd1eed105041a69fd723e80d1aa42d7c6dc74d6b91a96fb488844526b96","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    left=d['left']; right=d['right']; ln=-1 if left is None else left[1]; rn=-1 if right is None else right[1]\n    l,r=(right,left) if ln<rn else (left,right)\n    return {'left_id': l[0] if l else None,\n    'right_id': right[0] if right else None,\n    'npl': 1+(-1 if r is None else r[1]),\n    'size': 1+sum(x[2] for x in (l,r) if x),\n    'swap': ln<rn,\n    'parent_assignments': [[x[0],d[\"root\"]] for x in (l,r) if x]}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 3], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 13, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 4], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 14, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 5], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 15, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 6], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 16, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 7], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 17, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})]][N-1]\ncheck('regression certificate 1', solve(cases[0][0]), cases[0][1])\ncheck('regression certificate 2', solve(cases[1][0]), cases[1][1])\ncheck('regression certificate 3', solve(cases[2][0]), cases[2][1])\ncheck('regression certificate 4', solve(cases[3][0]), cases[3][1])\ncheck('regression certificate 5', solve(cases[4][0]), cases[4][1])\ncheck('regression certificate 6', solve(cases[5][0]), cases[5][1])\ncheck('variant-dependent certificate', solve(cases[6][0]), cases[6][1])\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":"03d9877ccee17e015cdd57d4ea10a984bce5e5c60e796c986bdd8df7c78044f9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    left=d['left']; right=d['right']; ln=-1 if left is None else left[1]; rn=-1 if right is None else right[1]\n    l,r=(right,left) if ln<rn else (left,right)\n    return {'left_id': l[0] if l else None,\n    'right_id': r[0] if r else None,\n    'npl': 1+(-1 if r is None else r[1]),\n    'size': 1+sum(x[2] for x in (l,r) if x),\n    'swap': ln<rn,\n    'parent_assignments': [[x[0],d[\"root\"]] for x in (l,r) if x]}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 3], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 13, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 4], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 14, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 5], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 15, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 6], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 16, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})], [({'root': 9, 'left': None, 'right': None, 'key': 0}, {'left_id': None, 'right_id': None, 'npl': 0, 'size': 1, 'swap': False, 'parent_assignments': []}), ({'root': 9, 'left': [1, 0, 1], 'right': None, 'key': 0}, {'left_id': 1, 'right_id': None, 'npl': 0, 'size': 2, 'swap': False, 'parent_assignments': [[1, 9]]}), ({'root': 9, 'left': None, 'right': [2, 1, 3], 'key': 0}, {'left_id': 2, 'right_id': None, 'npl': 0, 'size': 4, 'swap': True, 'parent_assignments': [[2, 9]]}), ({'root': 9, 'left': [1, 2, 7], 'right': [2, 0, 2], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 1, 'size': 10, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 1, 3], 'right': [2, 1, 5], 'key': 0}, {'left_id': 1, 'right_id': 2, 'npl': 2, 'size': 9, 'swap': False, 'parent_assignments': [[1, 9], [2, 9]]}), ({'root': 9, 'left': [1, 0, 2], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 12, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]}), ({'root': 9, 'left': [1, 0, 7], 'right': [2, 2, 9], 'key': 0}, {'left_id': 2, 'right_id': 1, 'npl': 1, 'size': 17, 'swap': True, 'parent_assignments': [[2, 9], [1, 9]]})]][N-1]\ncheck('regression certificate 1', solve(cases[0][0]), cases[0][1])\ncheck('regression certificate 2', solve(cases[1][0]), cases[1][1])\ncheck('regression certificate 3', solve(cases[2][0]), cases[2][1])\ncheck('regression certificate 4', solve(cases[3][0]), cases[3][1])\ncheck('regression certificate 5', solve(cases[4][0]), cases[4][1])\ncheck('regression certificate 6', solve(cases[5][0]), cases[5][1])\ncheck('variant-dependent certificate', solve(cases[6][0]), cases[6][1])\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 stipulated offline diagnostic model; it does not implement a production allocator, concurrency protocol, or complete heap library. 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":"s3-heap-leftist-meld-step-right_id","generated_at":"2026-09-29T14:43:28.503273+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"This isolates an internal heap representation or priority-structure invariant using deterministic finite records.","repair":"Derive right id using r[0] if r else None under the stated bounded certificate contract.","root_cause":"Leftist unwind retains both subtrees when restoring orientation.","sha256":"60c85ffed8084fd79b2d65859ecb115624f02808b22626c7911399d416271541","title":"Leftist unwind retains both subtrees when restoring orientation · case 01","variant":1,"variant_policy":"Six explicit regression certificates are retained; a seventh changes structural size, position, priority, or bounds with N.","verification":{"attempt":{"elapsed_ms":39.488,"exit_code":1,"observations":[{"actual":{"left_id":null,"npl":0,"parent_assignments":[],"right_id":null,"size":1,"swap":false},"check":"regression certificate 1","expected":{"left_id":null,"npl":0,"parent_assignments":[],"right_id":null,"size":1,"swap":false},"passed":true},{"actual":{"left_id":1,"npl":0,"parent_assignments":[[1,9]],"right_id":1,"size":2,"swap":false},"check":"regression certificate 2","expected":{"left_id":1,"npl":0,"parent_assignments":[[1,9]],"right_id":null,"size":2,"swap":false},"passed":false},{"actual":{"left_id":2,"npl":0,"parent_assignments":[[2,9]],"right_id":null,"size":4,"swap":true},"check":"regression certificate 3","expected":{"left_id":2,"npl":0,"parent_assignments":[[2,9]],"right_id":null,"size":4,"swap":true},"passed":true},{"actual":{"left_id":1,"npl":1,"parent_assignments":[[1,9],[2,9]],"right_id":1,"size":10,"swap":false},"check":"regression certificate 4","expected":{"left_id":1,"npl":1,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":10,"swap":false},"passed":false},{"actual":{"left_id":1,"npl":2,"parent_assignments":[[1,9],[2,9]],"right_id":1,"size":9,"swap":false},"check":"regression certificate 5","expected":{"left_id":1,"npl":2,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":9,"swap":false},"passed":false},{"actual":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":12,"swap":true},"check":"regression certificate 6","expected":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":12,"swap":true},"passed":true},{"actual":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":13,"swap":true},"check":"variant-dependent certificate","expected":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":13,"swap":true},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression certificate 1\", \"actual\": {\"left_id\": null, \"right_id\": null, \"npl\": 0, \"size\": 1, \"swap\": false, \"parent_assignments\": []}, \"expected\": {\"left_id\": null, \"right_id\": null, \"npl\": 0, \"size\": 1, \"swap\": false, \"parent_assignments\": []}, \"passed\": true}, {\"check\": \"regression certificate 2\", \"actual\": {\"left_id\": 1, \"right_id\": 1, \"npl\": 0, \"size\": 2, \"swap\": false, \"parent_assignments\": [[1, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": null, \"npl\": 0, \"size\": 2, \"swap\": false, \"parent_assignments\": [[1, 9]]}, \"passed\": false}, {\"check\": \"regression certificate 3\", \"actual\": {\"left_id\": 2, \"right_id\": null, \"npl\": 0, \"size\": 4, \"swap\": true, \"parent_assignments\": [[2, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": null, \"npl\": 0, \"size\": 4, \"swap\": true, \"parent_assignments\": [[2, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 4\", \"actual\": {\"left_id\": 1, \"right_id\": 1, \"npl\": 1, \"size\": 10, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 1, \"size\": 10, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"passed\": false}, {\"check\": \"regression certificate 5\", \"actual\": {\"left_id\": 1, \"right_id\": 1, \"npl\": 2, \"size\": 9, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 2, \"size\": 9, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"passed\": false}, {\"check\": \"regression certificate 6\", \"actual\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 12, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 12, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"passed\": true}, {\"check\": \"variant-dependent certificate\", \"actual\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 13, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 13, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.548,"exit_code":1,"observations":[{"actual":{"left_id":null,"npl":0,"parent_assignments":[],"right_id":null,"size":1,"swap":false},"check":"regression certificate 1","expected":{"left_id":null,"npl":0,"parent_assignments":[],"right_id":null,"size":1,"swap":false},"passed":true},{"actual":{"left_id":1,"npl":0,"parent_assignments":[[1,9]],"right_id":null,"size":2,"swap":false},"check":"regression certificate 2","expected":{"left_id":1,"npl":0,"parent_assignments":[[1,9]],"right_id":null,"size":2,"swap":false},"passed":true},{"actual":{"left_id":2,"npl":0,"parent_assignments":[[2,9]],"right_id":2,"size":4,"swap":true},"check":"regression certificate 3","expected":{"left_id":2,"npl":0,"parent_assignments":[[2,9]],"right_id":null,"size":4,"swap":true},"passed":false},{"actual":{"left_id":1,"npl":1,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":10,"swap":false},"check":"regression certificate 4","expected":{"left_id":1,"npl":1,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":10,"swap":false},"passed":true},{"actual":{"left_id":1,"npl":2,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":9,"swap":false},"check":"regression certificate 5","expected":{"left_id":1,"npl":2,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":9,"swap":false},"passed":true},{"actual":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":2,"size":12,"swap":true},"check":"regression certificate 6","expected":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":12,"swap":true},"passed":false},{"actual":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":2,"size":13,"swap":true},"check":"variant-dependent certificate","expected":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":13,"swap":true},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression certificate 1\", \"actual\": {\"left_id\": null, \"right_id\": null, \"npl\": 0, \"size\": 1, \"swap\": false, \"parent_assignments\": []}, \"expected\": {\"left_id\": null, \"right_id\": null, \"npl\": 0, \"size\": 1, \"swap\": false, \"parent_assignments\": []}, \"passed\": true}, {\"check\": \"regression certificate 2\", \"actual\": {\"left_id\": 1, \"right_id\": null, \"npl\": 0, \"size\": 2, \"swap\": false, \"parent_assignments\": [[1, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": null, \"npl\": 0, \"size\": 2, \"swap\": false, \"parent_assignments\": [[1, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 3\", \"actual\": {\"left_id\": 2, \"right_id\": 2, \"npl\": 0, \"size\": 4, \"swap\": true, \"parent_assignments\": [[2, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": null, \"npl\": 0, \"size\": 4, \"swap\": true, \"parent_assignments\": [[2, 9]]}, \"passed\": false}, {\"check\": \"regression certificate 4\", \"actual\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 1, \"size\": 10, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 1, \"size\": 10, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 5\", \"actual\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 2, \"size\": 9, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 2, \"size\": 9, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 6\", \"actual\": {\"left_id\": 2, \"right_id\": 2, \"npl\": 1, \"size\": 12, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 12, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"passed\": false}, {\"check\": \"variant-dependent certificate\", \"actual\": {\"left_id\": 2, \"right_id\": 2, \"npl\": 1, \"size\": 13, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 13, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.606,"exit_code":0,"observations":[{"actual":{"left_id":null,"npl":0,"parent_assignments":[],"right_id":null,"size":1,"swap":false},"check":"regression certificate 1","expected":{"left_id":null,"npl":0,"parent_assignments":[],"right_id":null,"size":1,"swap":false},"passed":true},{"actual":{"left_id":1,"npl":0,"parent_assignments":[[1,9]],"right_id":null,"size":2,"swap":false},"check":"regression certificate 2","expected":{"left_id":1,"npl":0,"parent_assignments":[[1,9]],"right_id":null,"size":2,"swap":false},"passed":true},{"actual":{"left_id":2,"npl":0,"parent_assignments":[[2,9]],"right_id":null,"size":4,"swap":true},"check":"regression certificate 3","expected":{"left_id":2,"npl":0,"parent_assignments":[[2,9]],"right_id":null,"size":4,"swap":true},"passed":true},{"actual":{"left_id":1,"npl":1,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":10,"swap":false},"check":"regression certificate 4","expected":{"left_id":1,"npl":1,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":10,"swap":false},"passed":true},{"actual":{"left_id":1,"npl":2,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":9,"swap":false},"check":"regression certificate 5","expected":{"left_id":1,"npl":2,"parent_assignments":[[1,9],[2,9]],"right_id":2,"size":9,"swap":false},"passed":true},{"actual":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":12,"swap":true},"check":"regression certificate 6","expected":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":12,"swap":true},"passed":true},{"actual":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":13,"swap":true},"check":"variant-dependent certificate","expected":{"left_id":2,"npl":1,"parent_assignments":[[2,9],[1,9]],"right_id":1,"size":13,"swap":true},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression certificate 1\", \"actual\": {\"left_id\": null, \"right_id\": null, \"npl\": 0, \"size\": 1, \"swap\": false, \"parent_assignments\": []}, \"expected\": {\"left_id\": null, \"right_id\": null, \"npl\": 0, \"size\": 1, \"swap\": false, \"parent_assignments\": []}, \"passed\": true}, {\"check\": \"regression certificate 2\", \"actual\": {\"left_id\": 1, \"right_id\": null, \"npl\": 0, \"size\": 2, \"swap\": false, \"parent_assignments\": [[1, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": null, \"npl\": 0, \"size\": 2, \"swap\": false, \"parent_assignments\": [[1, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 3\", \"actual\": {\"left_id\": 2, \"right_id\": null, \"npl\": 0, \"size\": 4, \"swap\": true, \"parent_assignments\": [[2, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": null, \"npl\": 0, \"size\": 4, \"swap\": true, \"parent_assignments\": [[2, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 4\", \"actual\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 1, \"size\": 10, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 1, \"size\": 10, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 5\", \"actual\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 2, \"size\": 9, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"expected\": {\"left_id\": 1, \"right_id\": 2, \"npl\": 2, \"size\": 9, \"swap\": false, \"parent_assignments\": [[1, 9], [2, 9]]}, \"passed\": true}, {\"check\": \"regression certificate 6\", \"actual\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 12, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 12, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"passed\": true}, {\"check\": \"variant-dependent certificate\", \"actual\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 13, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"expected\": {\"left_id\": 2, \"right_id\": 1, \"npl\": 1, \"size\": 13, \"swap\": true, \"parent_assignments\": [[2, 9], [1, 9]]}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}