broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    nodes=d['nodes']; original=d['payloads']; p=[list(x) for x in original]; p[0][1]=d['new_key']; swaps=[]; i=0
    while i+1<len(p) and p[i][1]<p[i+1][1]:
        p[i],p[i+1]=p[i+1],p[i]; swaps.append([nodes[i],nodes[i+1]]); i+=1
    return {'payloads': p,
    'locations': {x[0]:nodes[k] for k,x in enumerate(p)},
    'swaps': swaps,
    'changed_location': nodes[0],
    'structural_nodes': nodes,
    'minimum': min(x[1] for x in p)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 2}, {'payloads': [['b', 7], ['c', 5], ['a', 2], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 1}, {'payloads': [['b', 7], ['c', 5], ['a', 1], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 0}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': 0})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -1}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -1]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -2}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -2]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -2})]][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):
    nodes=d['nodes']; original=d['payloads']; p=[list(x) for x in original]; p[0][1]=d['new_key']; swaps=[]; i=0
    while i+1<len(p) and p[i][1]<p[i+1][1]:
        p[i],p[i+1]=p[i+1],p[i]; swaps.append([nodes[i],nodes[i+1]]); i+=1
    return {'payloads': p,
    'locations': {x[0]:nodes[k] for k,x in enumerate(p)},
    'swaps': swaps,
    'changed_location': nodes[-1],
    'structural_nodes': nodes,
    'minimum': min(x[1] for x in p)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 2}, {'payloads': [['b', 7], ['c', 5], ['a', 2], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 1}, {'payloads': [['b', 7], ['c', 5], ['a', 1], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 0}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': 0})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -1}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -1]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -2}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -2]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -2})]][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 binomial payload bubble certificate reports an incorrect changed location.

A binomial decrease-key bubble supplies the node-id path from leaf toward root, payloads [handle,key] at those nodes, and a decreased key for the first payload. While smaller than parent, exchange complete payloads. Structural nodes remain fixed; return final payload sequence, handle locations, swaps, decreased handle location, untouched structural path, and final minimum on this path.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    nodes=d['nodes']; original=d['payloads']; p=[list(x) for x in original]; p[0][1]=d['new_key']; swaps=[]; i=0
    while i+1<len(p) and p[i][1]<p[i+1][1]:
        p[i],p[i+1]=p[i+1],p[i]; swaps.append([nodes[i],nodes[i+1]]); i+=1
    return {'payloads': p,
    'locations': {x[0]:nodes[k] for k,x in enumerate(p)},
    'swaps': swaps,
    'changed_location': nodes[i],
    'structural_nodes': list(reversed(nodes)),
    'minimum': min(x[1] for x in p)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 2}, {'payloads': [['b', 7], ['c', 5], ['a', 2], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 1}, {'payloads': [['b', 7], ['c', 5], ['a', 1], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 0}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': 0})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -1}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -1]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -2}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -2]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -2})]][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):
    nodes=d['nodes']; original=d['payloads']; p=[list(x) for x in original]; p[0][1]=d['new_key']; swaps=[]; i=0
    while i+1<len(p) and p[i][1]<p[i+1][1]:
        p[i],p[i+1]=p[i+1],p[i]; swaps.append([nodes[i],nodes[i+1]]); i+=1
    return {'payloads': p,
    'locations': {x[0]:nodes[k] for k,x in enumerate(p)},
    'swaps': swaps,
    'changed_location': nodes[i],
    'structural_nodes': [nodes[k] for k in range(len(nodes)) if k!=i],
    'minimum': min(x[1] for x in p)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 2}, {'payloads': [['b', 7], ['c', 5], ['a', 2], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 1}, {'payloads': [['b', 7], ['c', 5], ['a', 1], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 0}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': 0})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -1}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -1]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -2}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -2]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -2})]][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 binomial payload bubble certificate reports an incorrect structural nodes.

A binomial decrease-key bubble supplies the node-id path from leaf toward root, payloads [handle,key] at those nodes, and a decreased key for the first payload. While smaller than parent, exchange complete payloads. Structural nodes remain fixed; return final payload sequence, handle locations, swaps, decreased handle location, untouched structural path, and final minimum on this path.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    nodes=d['nodes']; original=d['payloads']; p=[list(x) for x in original]; p[0][1]=d['new_key']; swaps=[]; i=0
    while i+1<len(p) and p[i][1]<p[i+1][1]:
        p[i],p[i+1]=p[i+1],p[i]; swaps.append([nodes[i],nodes[i+1]]); i+=1
    return {'payloads': p,
    'locations': {x[0]:nodes[k] for k,x in enumerate(p)},
    'swaps': swaps,
    'changed_location': nodes[i],
    'structural_nodes': nodes,
    'minimum': d["new_key"]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 2}, {'payloads': [['b', 7], ['c', 5], ['a', 2], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 1}, {'payloads': [['b', 7], ['c', 5], ['a', 1], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 0}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': 0})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -1}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -1]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -2}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -2]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -2})]][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):
    nodes=d['nodes']; original=d['payloads']; p=[list(x) for x in original]; p[0][1]=d['new_key']; swaps=[]; i=0
    while i+1<len(p) and p[i][1]<p[i+1][1]:
        p[i],p[i+1]=p[i+1],p[i]; swaps.append([nodes[i],nodes[i+1]]); i+=1
    return {'payloads': p,
    'locations': {x[0]:nodes[k] for k,x in enumerate(p)},
    'swaps': swaps,
    'changed_location': nodes[i],
    'structural_nodes': nodes,
    'minimum': p[0][1]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 2}, {'payloads': [['b', 7], ['c', 5], ['a', 2], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 1}, {'payloads': [['b', 7], ['c', 5], ['a', 1], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 0}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': 0})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -1}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -1]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -1})], [({'nodes': [10], 'payloads': [['a', 5]], 'new_key': 4}, {'payloads': [['a', 4]], 'locations': {'a': 10}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10], 'minimum': 4}), ({'nodes': [10, 11], 'payloads': [['a', 8], ['b', 3]], 'new_key': 1}, {'payloads': [['b', 3], ['a', 1]], 'locations': {'b': 10, 'a': 11}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11], 'minimum': 1}), ({'nodes': [10, 11, 12], 'payloads': [['a', 9], ['b', 6], ['c', 2]], 'new_key': 4}, {'payloads': [['b', 6], ['a', 4], ['c', 2]], 'locations': {'b': 10, 'a': 11, 'c': 12}, 'swaps': [[10, 11]], 'changed_location': 11, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12], 'payloads': [['a', 7], ['b', 5], ['c', 1]], 'new_key': 0}, {'payloads': [['b', 5], ['c', 1], ['a', 0]], 'locations': {'b': 10, 'c': 11, 'a': 12}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12], 'minimum': 0}), ({'nodes': [10, 11, 12], 'payloads': [['a', 8], ['b', 5], ['c', 2]], 'new_key': 5}, {'payloads': [['a', 5], ['b', 5], ['c', 2]], 'locations': {'a': 10, 'b': 11, 'c': 12}, 'swaps': [], 'changed_location': 10, 'structural_nodes': [10, 11, 12], 'minimum': 2}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': 3}, {'payloads': [['b', 7], ['c', 5], ['a', 3], ['d', 1]], 'locations': {'b': 10, 'c': 11, 'a': 12, 'd': 13}, 'swaps': [[10, 11], [11, 12]], 'changed_location': 12, 'structural_nodes': [10, 11, 12, 13], 'minimum': 1}), ({'nodes': [10, 11, 12, 13], 'payloads': [['a', 9], ['b', 7], ['c', 5], ['d', 1]], 'new_key': -2}, {'payloads': [['b', 7], ['c', 5], ['d', 1], ['a', -2]], 'locations': {'b': 10, 'c': 11, 'd': 12, 'a': 13}, 'swaps': [[10, 11], [11, 12], [12, 13]], 'changed_location': 13, 'structural_nodes': [10, 11, 12, 13], 'minimum': -2})]][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 binomial payload bubble certificate reports an incorrect minimum.

A binomial decrease-key bubble supplies the node-id path from leaf toward root, payloads [handle,key] at those nodes, and a decreased key for the first payload. While smaller than parent, exchange complete payloads. Structural nodes remain fixed; return final payload sequence, handle locations, swaps, decreased handle location, untouched structural path, and final minimum on this path.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    table={int(k):v for k,v in d['table'].items()}; start=d['degree']; degree=start; collisions=[]
    while degree in table:
        collisions.append(table[degree]); degree+=1
    out={k:v for k,v in table.items() if not start<=k<degree}; out[degree]=d['root']
    return {'collisions': [table[start]] if start in table else [],
    'final_degree': degree,
    'cleared': list(range(start,degree)),
    'occupied': sorted(out),
    'capacity': max(out,default=-1)+1,
    'carry_steps': len(collisions)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [1, 4, 6], 'capacity': 7, 'carry_steps': 2})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 3, 'root': 'x'}, {'collisions': ['c'], 'final_degree': 4, 'cleared': [3], 'occupied': [1, 2, 4, 6], 'capacity': 7, 'carry_steps': 1})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 4, 'root': 'x'}, {'collisions': [], 'final_degree': 4, 'cleared': [], 'occupied': [1, 2, 3, 4, 6], 'capacity': 7, 'carry_steps': 0})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 5, 'root': 'x'}, {'collisions': [], 'final_degree': 5, 'cleared': [], 'occupied': [1, 2, 3, 5, 6], 'capacity': 7, 'carry_steps': 0})]][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):
    table={int(k):v for k,v in d['table'].items()}; start=d['degree']; degree=start; collisions=[]
    while degree in table:
        collisions.append(table[degree]); degree+=1
    out={k:v for k,v in table.items() if not start<=k<degree}; out[degree]=d['root']
    return {'collisions': [v for k,v in sorted(table.items()) if k>=start],
    'final_degree': degree,
    'cleared': list(range(start,degree)),
    'occupied': sorted(out),
    'capacity': max(out,default=-1)+1,
    'carry_steps': len(collisions)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [1, 4, 6], 'capacity': 7, 'carry_steps': 2})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 3, 'root': 'x'}, {'collisions': ['c'], 'final_degree': 4, 'cleared': [3], 'occupied': [1, 2, 4, 6], 'capacity': 7, 'carry_steps': 1})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 4, 'root': 'x'}, {'collisions': [], 'final_degree': 4, 'cleared': [], 'occupied': [1, 2, 3, 4, 6], 'capacity': 7, 'carry_steps': 0})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 5, 'root': 'x'}, {'collisions': [], 'final_degree': 5, 'cleared': [], 'occupied': [1, 2, 3, 5, 6], 'capacity': 7, 'carry_steps': 0})]][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 fibonacci degree table certificate reports an incorrect collisions.

A Fibonacci consolidation trace gives occupied degree slots table degree->root id, incoming degree, and incoming root. Pop consecutive occupied degrees starting at incoming degree, collecting collision roots, then place incoming representative in first vacant slot. Report collisions, final degree, emptied slots, resulting occupied degree keys, required array capacity, and carry-step count. This is the degree-routing portion; key comparisons are outside this bounded model.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    table={int(k):v for k,v in d['table'].items()}; start=d['degree']; degree=start; collisions=[]
    while degree in table:
        collisions.append(table[degree]); degree+=1
    out={k:v for k,v in table.items() if not start<=k<degree}; out[degree]=d['root']
    return {'collisions': collisions,
    'final_degree': start+len(table),
    'cleared': list(range(start,degree)),
    'occupied': sorted(out),
    'capacity': max(out,default=-1)+1,
    'carry_steps': len(collisions)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [1, 4, 6], 'capacity': 7, 'carry_steps': 2})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 3, 'root': 'x'}, {'collisions': ['c'], 'final_degree': 4, 'cleared': [3], 'occupied': [1, 2, 4, 6], 'capacity': 7, 'carry_steps': 1})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 4, 'root': 'x'}, {'collisions': [], 'final_degree': 4, 'cleared': [], 'occupied': [1, 2, 3, 4, 6], 'capacity': 7, 'carry_steps': 0})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 5, 'root': 'x'}, {'collisions': [], 'final_degree': 5, 'cleared': [], 'occupied': [1, 2, 3, 5, 6], 'capacity': 7, 'carry_steps': 0})]][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):
    table={int(k):v for k,v in d['table'].items()}; start=d['degree']; degree=start; collisions=[]
    while degree in table:
        collisions.append(table[degree]); degree+=1
    out={k:v for k,v in table.items() if not start<=k<degree}; out[degree]=d['root']
    return {'collisions': collisions,
    'final_degree': start,
    'cleared': list(range(start,degree)),
    'occupied': sorted(out),
    'capacity': max(out,default=-1)+1,
    'carry_steps': len(collisions)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [1, 4, 6], 'capacity': 7, 'carry_steps': 2})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 3, 'root': 'x'}, {'collisions': ['c'], 'final_degree': 4, 'cleared': [3], 'occupied': [1, 2, 4, 6], 'capacity': 7, 'carry_steps': 1})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 4, 'root': 'x'}, {'collisions': [], 'final_degree': 4, 'cleared': [], 'occupied': [1, 2, 3, 4, 6], 'capacity': 7, 'carry_steps': 0})], [({'table': {}, 'degree': 0, 'root': 'x'}, {'collisions': [], 'final_degree': 0, 'cleared': [], 'occupied': [0], 'capacity': 1, 'carry_steps': 0}), ({'table': {'0': 'a'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a'], 'final_degree': 1, 'cleared': [0], 'occupied': [1], 'capacity': 2, 'carry_steps': 1}), ({'table': {'0': 'a', '1': 'b', '3': 'c'}, 'degree': 0, 'root': 'x'}, {'collisions': ['a', 'b'], 'final_degree': 2, 'cleared': [0, 1], 'occupied': [2, 3], 'capacity': 4, 'carry_steps': 2}), ({'table': {'0': 'a', '2': 'b', '3': 'c'}, 'degree': 2, 'root': 'x'}, {'collisions': ['b', 'c'], 'final_degree': 4, 'cleared': [2, 3], 'occupied': [0, 4], 'capacity': 5, 'carry_steps': 2}), ({'table': {'4': 'a'}, 'degree': 1, 'root': 'x'}, {'collisions': [], 'final_degree': 1, 'cleared': [], 'occupied': [1, 4], 'capacity': 5, 'carry_steps': 0}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 1, 'root': 'x'}, {'collisions': ['a', 'b', 'c'], 'final_degree': 4, 'cleared': [1, 2, 3], 'occupied': [4, 6], 'capacity': 7, 'carry_steps': 3}), ({'table': {'1': 'a', '2': 'b', '3': 'c', '6': 'd'}, 'degree': 5, 'root': 'x'}, {'collisions': [], 'final_degree': 5, 'cleared': [], 'occupied': [1, 2, 3, 5, 6], 'capacity': 7, 'carry_steps': 0})]][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 fibonacci degree table certificate reports an incorrect final degree.

A Fibonacci consolidation trace gives occupied degree slots table degree->root id, incoming degree, and incoming root. Pop consecutive occupied degrees starting at incoming degree, collecting collision roots, then place incoming representative in first vacant slot. Report collisions, final degree, emptied slots, resulting occupied degree keys, required array capacity, and carry-step count. This is the degree-routing portion; key comparisons are outside this bounded model.

split: open-access