FAILURE MAP
← Case archive

FA-40736 / Heap invariants / Open access

Pairing cut clears sibling links before melding the detached subtree · case 01

The bounded pairing cut splice certificate reports an incorrect detached.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Pairing cut clears sibling links before melding the detached subtree.

VERIFIED REPAIR

Derive detached using [None,None,None] under the stated bounded certificate contract.

Unsuccessful approach: The local patch uses [None,None,after[0] if after else 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],after[0] if after else None],
    'roots': d["roots"]+[c],
    'detached': [p,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 fixtureActualExpectedOutcome
regression certificate 1{'children': [], 'detached': [9, 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}Failed
regression certificate 2{'children': [2], 'detached': [9, 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]}Failed
regression certificate 3{'children': [1], 'detached': [9, 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}Failed
regression certificate 4{'children': [1, 3], 'detached': [9, 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]}Failed
regression certificate 5{'children': [1, 2, 4], 'detached': [9, 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]}Failed
regression certificate 6{'children': [2, 3], 'detached': [9, 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]}Failed
variant-dependent certificate{'children': [1, 2, 3], 'detached': [9, 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}Failed

SHA-256 / 1a0a842912e920e51ac3110d948484d1f58f91da7e3a3369c725d94ccfe42dec

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],after[0] if after else None],
    'roots': d["roots"]+[c],
    'detached': [None,None,after[0] if after else 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 fixtureActualExpectedOutcome
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, 2], '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]}Failed
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, 3], '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]}Failed
regression certificate 5{'children': [1, 2, 4], 'detached': [None, None, 4], '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]}Failed
regression certificate 6{'children': [2, 3], 'detached': [None, None, 2], '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]}Failed
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 / 369077f5c3285579ee2378ad0825825e457b45eaffab8d6b8194c0f1f1d17e5e

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 fixtureActualExpectedOutcome
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.994539+00:00.

Case digest / d0467a785cdbdefb0eaa31d9f1faa4079416852b4f4d8c6408b2a3848452ae0a