FA-40726 / Heap invariants / Open access
Pairing cut predecessor bypasses the removed child to its successor · case 01
The bounded pairing cut splice certificate reports an incorrect predecessor next.
ROOT CAUSE
Pairing cut predecessor bypasses the removed child to its successor.
VERIFIED REPAIR
Derive predecessor next using None if not before else [before[-1],after[0] if after else None] under the stated bounded certificate contract.
Unsuccessful approach: The local patch uses None if not before else [before[-1],None] and still violates the stated relation.
Case contract
A pairing-heap cut input contains parent id, ordered child ids, selected child, and preexisting roots. Remove the child while preserving sibling order. Return remaining children, new first child, successor previous pointer (parent if selected was first), predecessor next pointer, promoted root list, and detached child links [parent,previous,next] all None.
Why this case matters
This isolates an internal heap representation or priority-structure invariant using deterministic finite records.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
p=d['parent']; cs=d['children']; c=d['child']; k=cs.index(c); before=cs[:k]; after=cs[k+1:]; kept=before+after
return {'children': kept,
'first': kept[0] if kept else None,
'successor_previous': None if not after else [after[0],before[-1] if before else p],
'predecessor_next': None if not before else [before[-1],c],
'roots': d["roots"]+[c],
'detached': [None,None,None]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100], 'child': 100, 'roots': [9, 8]}, {'children': [1, 2, 3], 'first': 1, 'successor_previous': None, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101], 'child': 101, 'roots': [9, 8]}, {'children': [1, 2, 3, 100], 'first': 1, 'successor_previous': None, 'predecessor_next': [100, None], 'roots': [9, 8, 101], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102], 'child': 102, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101], 'first': 1, 'successor_previous': None, 'predecessor_next': [101, None], 'roots': [9, 8, 102], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102, 103], 'child': 103, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101, 102], 'first': 1, 'successor_previous': None, 'predecessor_next': [102, None], 'roots': [9, 8, 103], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102, 103, 104], 'child': 104, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101, 102, 103], 'first': 1, 'successor_previous': None, 'predecessor_next': [103, None], 'roots': [9, 8, 104], 'detached': [None, None, None]})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression certificate 1 | {'children': [], 'detached': [None, None, None], 'first': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': None} | {'children': [], 'detached': [None, None, None], 'first': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': None} | Passed |
| regression certificate 2 | {'children': [2], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | {'children': [2], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | Passed |
| regression certificate 3 | {'children': [1], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, 2], 'roots': [9, 8, 2], 'successor_previous': None} | {'children': [1], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'successor_previous': None} | Failed |
| regression certificate 4 | {'children': [1, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, 2], 'roots': [9, 8, 2], 'successor_previous': [3, 1]} | {'children': [1, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'successor_previous': [3, 1]} | Failed |
| regression certificate 5 | {'children': [1, 2, 4], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [2, 3], 'roots': [9, 8, 3], 'successor_previous': [4, 2]} | {'children': [1, 2, 4], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'successor_previous': [4, 2]} | Failed |
| regression certificate 6 | {'children': [2, 3], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | {'children': [2, 3], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | Passed |
| variant-dependent certificate | {'children': [1, 2, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [3, 100], 'roots': [9, 8, 100], 'successor_previous': None} | {'children': [1, 2, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'successor_previous': None} | Failed |
SHA-256 / 8804d8ac99e74aef4e4e7832f994c8de55c4e77253ea1860fab5c3b2231529fb
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
p=d['parent']; cs=d['children']; c=d['child']; k=cs.index(c); before=cs[:k]; after=cs[k+1:]; kept=before+after
return {'children': kept,
'first': kept[0] if kept else None,
'successor_previous': None if not after else [after[0],before[-1] if before else p],
'predecessor_next': None if not before else [before[-1],None],
'roots': d["roots"]+[c],
'detached': [None,None,None]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100], 'child': 100, 'roots': [9, 8]}, {'children': [1, 2, 3], 'first': 1, 'successor_previous': None, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101], 'child': 101, 'roots': [9, 8]}, {'children': [1, 2, 3, 100], 'first': 1, 'successor_previous': None, 'predecessor_next': [100, None], 'roots': [9, 8, 101], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102], 'child': 102, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101], 'first': 1, 'successor_previous': None, 'predecessor_next': [101, None], 'roots': [9, 8, 102], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102, 103], 'child': 103, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101, 102], 'first': 1, 'successor_previous': None, 'predecessor_next': [102, None], 'roots': [9, 8, 103], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102, 103, 104], 'child': 104, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101, 102, 103], 'first': 1, 'successor_previous': None, 'predecessor_next': [103, None], 'roots': [9, 8, 104], 'detached': [None, None, None]})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression certificate 1 | {'children': [], 'detached': [None, None, None], 'first': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': None} | {'children': [], 'detached': [None, None, None], 'first': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': None} | Passed |
| regression certificate 2 | {'children': [2], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | {'children': [2], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | Passed |
| regression certificate 3 | {'children': [1], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'successor_previous': None} | {'children': [1], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'successor_previous': None} | Passed |
| regression certificate 4 | {'children': [1, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'successor_previous': [3, 1]} | {'children': [1, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'successor_previous': [3, 1]} | Failed |
| regression certificate 5 | {'children': [1, 2, 4], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [2, None], 'roots': [9, 8, 3], 'successor_previous': [4, 2]} | {'children': [1, 2, 4], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'successor_previous': [4, 2]} | Failed |
| regression certificate 6 | {'children': [2, 3], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | {'children': [2, 3], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | Passed |
| variant-dependent certificate | {'children': [1, 2, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'successor_previous': None} | {'children': [1, 2, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'successor_previous': None} | Passed |
SHA-256 / 04fac7096672446c37d611d86ee20db0c513a6e2dbcb9cd43e62d7f4f2a62d81
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
p=d['parent']; cs=d['children']; c=d['child']; k=cs.index(c); before=cs[:k]; after=cs[k+1:]; kept=before+after
return {'children': kept,
'first': kept[0] if kept else None,
'successor_previous': None if not after else [after[0],before[-1] if before else p],
'predecessor_next': None if not before else [before[-1],after[0] if after else None],
'roots': d["roots"]+[c],
'detached': [None,None,None]}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100], 'child': 100, 'roots': [9, 8]}, {'children': [1, 2, 3], 'first': 1, 'successor_previous': None, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101], 'child': 101, 'roots': [9, 8]}, {'children': [1, 2, 3, 100], 'first': 1, 'successor_previous': None, 'predecessor_next': [100, None], 'roots': [9, 8, 101], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102], 'child': 102, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101], 'first': 1, 'successor_previous': None, 'predecessor_next': [101, None], 'roots': [9, 8, 102], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102, 103], 'child': 103, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101, 102], 'first': 1, 'successor_previous': None, 'predecessor_next': [102, None], 'roots': [9, 8, 103], 'detached': [None, None, None]})], [({'parent': 9, 'children': [1], 'child': 1, 'roots': [9, 8]}, {'children': [], 'first': None, 'successor_previous': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 1, 'roots': [9, 8]}, {'children': [2], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2], 'child': 2, 'roots': [9, 8]}, {'children': [1], 'first': 1, 'successor_previous': None, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 2, 'roots': [9, 8]}, {'children': [1, 3], 'first': 1, 'successor_previous': [3, 1], 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 4], 'child': 3, 'roots': [9, 8]}, {'children': [1, 2, 4], 'first': 1, 'successor_previous': [4, 2], 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3], 'child': 1, 'roots': [9, 8]}, {'children': [2, 3], 'first': 2, 'successor_previous': [2, 9], 'predecessor_next': None, 'roots': [9, 8, 1], 'detached': [None, None, None]}), ({'parent': 9, 'children': [1, 2, 3, 100, 101, 102, 103, 104], 'child': 104, 'roots': [9, 8]}, {'children': [1, 2, 3, 100, 101, 102, 103], 'first': 1, 'successor_previous': None, 'predecessor_next': [103, None], 'roots': [9, 8, 104], 'detached': [None, None, None]})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression certificate 1 | {'children': [], 'detached': [None, None, None], 'first': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': None} | {'children': [], 'detached': [None, None, None], 'first': None, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': None} | Passed |
| regression certificate 2 | {'children': [2], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | {'children': [2], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | Passed |
| regression certificate 3 | {'children': [1], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'successor_previous': None} | {'children': [1], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, None], 'roots': [9, 8, 2], 'successor_previous': None} | Passed |
| regression certificate 4 | {'children': [1, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'successor_previous': [3, 1]} | {'children': [1, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [1, 3], 'roots': [9, 8, 2], 'successor_previous': [3, 1]} | Passed |
| regression certificate 5 | {'children': [1, 2, 4], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'successor_previous': [4, 2]} | {'children': [1, 2, 4], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [2, 4], 'roots': [9, 8, 3], 'successor_previous': [4, 2]} | Passed |
| regression certificate 6 | {'children': [2, 3], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | {'children': [2, 3], 'detached': [None, None, None], 'first': 2, 'predecessor_next': None, 'roots': [9, 8, 1], 'successor_previous': [2, 9]} | Passed |
| variant-dependent certificate | {'children': [1, 2, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'successor_previous': None} | {'children': [1, 2, 3], 'detached': [None, None, None], 'first': 1, 'predecessor_next': [3, None], 'roots': [9, 8, 100], 'successor_previous': None} | Passed |
SHA-256 / bb56ccd20fdc1c76ac210d3b9601c108b672b1ada81a4401ef60947955785779
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:43:33.857923+00:00.
Case digest / 036d0dd6751e18f8d644a09735700b261d7609028cc86a2f41565ffdeddddc6d