broken_source:
"""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': cs[0] if len(cs)>1 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)

source:
"""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': after[0] if after 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)

prompt:
The bounded pairing cut splice certificate reports an incorrect first.

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.

split: open-access


broken_source:
"""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],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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""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],c],
    '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)

prompt:
The bounded pairing cut splice certificate reports an incorrect successor previous.

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.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
The bounded pairing cut splice certificate reports an incorrect predecessor next.

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.

split: open-access


broken_source:
"""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"]+[p],
    '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)

source:
"""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': [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)

prompt:
The bounded pairing cut splice certificate reports an incorrect roots.

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.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
The bounded pairing cut splice certificate reports an incorrect detached.

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.

split: open-access