FAILURE MAP
← Case archive

FA-41326 / Heap invariants / Open access

Skew heap potential counts heavy right edges rather than their subtree mass · case 01

The bounded skew heavy certificate certificate reports an incorrect potential.

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

ROOT CAUSE

Skew heap potential counts heavy right edges rather than their subtree mass.

THE FAILURE

Skew heap potential counts heavy right edges rather than their subtree mass.

Unsuccessful approach: The local patch uses len(a)-len(heavy) and still violates the stated relation.

Case contract

A skew-heap amortized certificate supplies nodes [id,left_size,right_size] with nonnegative subtree sizes. A right edge is heavy when right_size exceeds half the complete subtree size (1+left+right). Report heavy ids, light right ids, complete sizes, heavy potential, right-path charged light visits, and potential change between before and after certificates. Path ids refer to before nodes; this is a stipulated accounting model.

Why this case matters

This isolates an internal heap representation or priority-structure invariant using deterministic finite records.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['before']; after=d['after']; path=d['path']; heavy=[x[0] for x in a if 2*x[2]>1+x[1]+x[2]]; newheavy=[x[0] for x in after if 2*x[2]>1+x[1]+x[2]]
    return {'heavy': heavy,
    'light_right': [x[0] for x in a if x[2]>0 and x[0] not in heavy],
    'subtree_sizes': [1+x[1]+x[2] for x in a],
    'potential': sum(x[2] for x in a if x[0] in heavy),
    'light_visits': sum(i not in heavy for i in path),
    'potential_delta': len(newheavy)-len(heavy)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 6], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [7, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 7], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [8, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 8], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [9, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 9], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [10, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 10], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [11, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 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)
Boundary fixtureActualExpectedOutcome
regression certificate 1{'heavy': [], 'light_right': [], 'light_visits': 0, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': []}{'heavy': [], 'light_right': [], 'light_visits': 0, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': []}Passed
regression certificate 2{'heavy': [], 'light_right': [], 'light_visits': 1, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': [1]}{'heavy': [], 'light_right': [], 'light_visits': 1, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': [1]}Passed
regression certificate 3{'heavy': ['b'], 'light_right': ['a'], 'light_visits': 1, 'potential': 2, 'potential_delta': -1, 'subtree_sizes': [2, 3]}{'heavy': ['b'], 'light_right': ['a'], 'light_visits': 1, 'potential': 1, 'potential_delta': -1, 'subtree_sizes': [2, 3]}Failed
regression certificate 4{'heavy': ['a', 'b'], 'light_right': [], 'light_visits': 0, 'potential': 7, 'potential_delta': 0, 'subtree_sizes': [7, 5]}{'heavy': ['a', 'b'], 'light_right': [], 'light_visits': 0, 'potential': 2, 'potential_delta': 0, 'subtree_sizes': [7, 5]}Failed
regression certificate 5{'heavy': [], 'light_right': ['a', 'b'], 'light_visits': 1, 'potential': 0, 'potential_delta': 1, 'subtree_sizes': [6, 6]}{'heavy': [], 'light_right': ['a', 'b'], 'light_visits': 1, 'potential': 0, 'potential_delta': 1, 'subtree_sizes': [6, 6]}Passed
regression certificate 6{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 5, 'potential_delta': 0, 'subtree_sizes': [6, 1, 5]}{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 1, 'potential_delta': 0, 'subtree_sizes': [6, 1, 5]}Failed
variant-dependent certificate{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 6, 'potential_delta': 0, 'subtree_sizes': [7, 1, 5]}{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 1, 'potential_delta': 0, 'subtree_sizes': [7, 1, 5]}Failed

SHA-256 / bde22ac736996c327c8cc72bbba3465f0acb37b3f156a76a6133812b14a7a3a4

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['before']; after=d['after']; path=d['path']; heavy=[x[0] for x in a if 2*x[2]>1+x[1]+x[2]]; newheavy=[x[0] for x in after if 2*x[2]>1+x[1]+x[2]]
    return {'heavy': heavy,
    'light_right': [x[0] for x in a if x[2]>0 and x[0] not in heavy],
    'subtree_sizes': [1+x[1]+x[2] for x in a],
    'potential': len(a)-len(heavy),
    'light_visits': sum(i not in heavy for i in path),
    'potential_delta': len(newheavy)-len(heavy)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 6], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [7, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 7], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [8, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 8], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [9, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 9], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [10, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0})], [({'before': [], 'after': [], 'path': []}, {'heavy': [], 'light_right': [], 'subtree_sizes': [], 'potential': 0, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 0, 0]], 'after': [['a', 0, 0]], 'path': ['a']}, {'heavy': [], 'light_right': [], 'subtree_sizes': [1], 'potential': 0, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 1], ['b', 0, 2]], 'after': [['a', 1, 0], ['b', 2, 0]], 'path': ['a', 'b']}, {'heavy': ['b'], 'light_right': ['a'], 'subtree_sizes': [2, 3], 'potential': 1, 'light_visits': 1, 'potential_delta': -1}), ({'before': [['a', 2, 4], ['b', 1, 3]], 'after': [['a', 0, 5], ['b', 1, 3]], 'path': ['a']}, {'heavy': ['a', 'b'], 'light_right': [], 'subtree_sizes': [7, 5], 'potential': 2, 'light_visits': 0, 'potential_delta': 0}), ({'before': [['a', 2, 3], ['b', 3, 2]], 'after': [['a', 4, 1], ['b', 0, 4]], 'path': ['b']}, {'heavy': [], 'light_right': ['a', 'b'], 'subtree_sizes': [6, 6], 'potential': 0, 'light_visits': 1, 'potential_delta': 1}), ({'before': [['a', 0, 5], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [6, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 0}), ({'before': [['a', 0, 10], ['b', 0, 0], ['c', 2, 2]], 'after': [['a', 3, 2], ['b', 0, 0], ['c', 0, 4]], 'path': ['a', 'c']}, {'heavy': ['a'], 'light_right': ['c'], 'subtree_sizes': [11, 1, 5], 'potential': 1, 'light_visits': 1, 'potential_delta': 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)
Boundary fixtureActualExpectedOutcome
regression certificate 1{'heavy': [], 'light_right': [], 'light_visits': 0, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': []}{'heavy': [], 'light_right': [], 'light_visits': 0, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': []}Passed
regression certificate 2{'heavy': [], 'light_right': [], 'light_visits': 1, 'potential': 1, 'potential_delta': 0, 'subtree_sizes': [1]}{'heavy': [], 'light_right': [], 'light_visits': 1, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': [1]}Failed
regression certificate 3{'heavy': ['b'], 'light_right': ['a'], 'light_visits': 1, 'potential': 1, 'potential_delta': -1, 'subtree_sizes': [2, 3]}{'heavy': ['b'], 'light_right': ['a'], 'light_visits': 1, 'potential': 1, 'potential_delta': -1, 'subtree_sizes': [2, 3]}Passed
regression certificate 4{'heavy': ['a', 'b'], 'light_right': [], 'light_visits': 0, 'potential': 0, 'potential_delta': 0, 'subtree_sizes': [7, 5]}{'heavy': ['a', 'b'], 'light_right': [], 'light_visits': 0, 'potential': 2, 'potential_delta': 0, 'subtree_sizes': [7, 5]}Failed
regression certificate 5{'heavy': [], 'light_right': ['a', 'b'], 'light_visits': 1, 'potential': 2, 'potential_delta': 1, 'subtree_sizes': [6, 6]}{'heavy': [], 'light_right': ['a', 'b'], 'light_visits': 1, 'potential': 0, 'potential_delta': 1, 'subtree_sizes': [6, 6]}Failed
regression certificate 6{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 2, 'potential_delta': 0, 'subtree_sizes': [6, 1, 5]}{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 1, 'potential_delta': 0, 'subtree_sizes': [6, 1, 5]}Failed
variant-dependent certificate{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 2, 'potential_delta': 0, 'subtree_sizes': [7, 1, 5]}{'heavy': ['a'], 'light_right': ['c'], 'light_visits': 1, 'potential': 1, 'potential_delta': 0, 'subtree_sizes': [7, 1, 5]}Failed

SHA-256 / 71952e2110b08e438053e75fb6f03e6df276fe1ba96af0dd1bca4c2d594686b5

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A stipulated offline diagnostic model; it does not implement a production allocator, concurrency protocol, or complete heap library. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:43:39.926798+00:00.

Case digest / 7920ec46c3b07e6e7d375bf28e86889ad3a9203eb43aba216ab0cef0bc22ceba