FA-40036 / Heap invariants / Open access
Binomial carry consumes precisely the linked pair · case 01
The bounded binomial carry certificate reports an incorrect suffix.
ROOT CAUSE
Binomial carry consumes precisely the linked pair.
VERIFIED REPAIR
Derive suffix using r[i+2:] if link else r[i:] under the stated bounded certificate contract.
Unsuccessful approach: The local patch uses r[i+3:] if link else r[i:] and still violates the stated relation.
Case contract
A consolidation cursor sees ordered ranks and index i. Report whether to link now, current rank, carry rank, suffix retained after a link, triple-collision deferral, and link partner. In three equal consecutive ranks defer the first pair so a carry is not consolidated twice out of order. Empty cursor is allowed.
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):
r=d['ranks']; i=d['i']; exists=i<len(r); pair=i+1<len(r) and r[i]==r[i+1]; triple=i+2<len(r) and r[i]==r[i+1]==r[i+2]
link=pair and not triple
return {'link_now': link,
'current': r[i] if exists else None,
'carry_rank': r[i]+1 if link else None,
'suffix': r[i+1:] if link else r[i:],
'defer': triple,
'partner': i+1 if link else None}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [1, 2, 2, 3], 'i': 0}, {'link_now': False, 'current': 1, 'carry_rank': None, 'suffix': [1, 2, 2, 3], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [2, 3, 3, 4], 'i': 0}, {'link_now': False, 'current': 2, 'carry_rank': None, 'suffix': [2, 3, 3, 4], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [3, 4, 4, 5], 'i': 0}, {'link_now': False, 'current': 3, 'carry_rank': None, 'suffix': [3, 4, 4, 5], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [4, 5, 5, 6], 'i': 0}, {'link_now': False, 'current': 4, 'carry_rank': None, 'suffix': [4, 5, 5, 6], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [5, 6, 6, 7], 'i': 0}, {'link_now': False, 'current': 5, 'carry_rank': None, 'suffix': [5, 6, 6, 7], 'defer': False, 'partner': None})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression certificate 1 | {'carry_rank': None, 'current': None, 'defer': False, 'link_now': False, 'partner': None, 'suffix': []} | {'carry_rank': None, 'current': None, 'defer': False, 'link_now': False, 'partner': None, 'suffix': []} | Passed |
| regression certificate 2 | {'carry_rank': 1, 'current': 0, 'defer': False, 'link_now': True, 'partner': 1, 'suffix': [0]} | {'carry_rank': 1, 'current': 0, 'defer': False, 'link_now': True, 'partner': 1, 'suffix': []} | Failed |
| regression certificate 3 | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | Passed |
| regression certificate 4 | {'carry_rank': 2, 'current': 1, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [1, 3]} | {'carry_rank': 2, 'current': 1, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [3]} | Failed |
| regression certificate 5 | {'carry_rank': 3, 'current': 2, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [2, 4, 5]} | {'carry_rank': 3, 'current': 2, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [4, 5]} | Failed |
| regression certificate 6 | {'carry_rank': None, 'current': 0, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [0, 1, 1, 2]} | {'carry_rank': None, 'current': 0, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [0, 1, 1, 2]} | Passed |
| variant-dependent certificate | {'carry_rank': None, 'current': 1, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [1, 2, 2, 3]} | {'carry_rank': None, 'current': 1, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [1, 2, 2, 3]} | Passed |
SHA-256 / 2bfdbf0a7781331e32272e1c01c20f91ec843fed40c1e40e4e6d8fd81112d1d3
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
r=d['ranks']; i=d['i']; exists=i<len(r); pair=i+1<len(r) and r[i]==r[i+1]; triple=i+2<len(r) and r[i]==r[i+1]==r[i+2]
link=pair and not triple
return {'link_now': link,
'current': r[i] if exists else None,
'carry_rank': r[i]+1 if link else None,
'suffix': r[i+3:] if link else r[i:],
'defer': triple,
'partner': i+1 if link else None}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [1, 2, 2, 3], 'i': 0}, {'link_now': False, 'current': 1, 'carry_rank': None, 'suffix': [1, 2, 2, 3], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [2, 3, 3, 4], 'i': 0}, {'link_now': False, 'current': 2, 'carry_rank': None, 'suffix': [2, 3, 3, 4], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [3, 4, 4, 5], 'i': 0}, {'link_now': False, 'current': 3, 'carry_rank': None, 'suffix': [3, 4, 4, 5], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [4, 5, 5, 6], 'i': 0}, {'link_now': False, 'current': 4, 'carry_rank': None, 'suffix': [4, 5, 5, 6], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [5, 6, 6, 7], 'i': 0}, {'link_now': False, 'current': 5, 'carry_rank': None, 'suffix': [5, 6, 6, 7], 'defer': False, 'partner': None})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression certificate 1 | {'carry_rank': None, 'current': None, 'defer': False, 'link_now': False, 'partner': None, 'suffix': []} | {'carry_rank': None, 'current': None, 'defer': False, 'link_now': False, 'partner': None, 'suffix': []} | Passed |
| regression certificate 2 | {'carry_rank': 1, 'current': 0, 'defer': False, 'link_now': True, 'partner': 1, 'suffix': []} | {'carry_rank': 1, 'current': 0, 'defer': False, 'link_now': True, 'partner': 1, 'suffix': []} | Passed |
| regression certificate 3 | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | Passed |
| regression certificate 4 | {'carry_rank': 2, 'current': 1, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': []} | {'carry_rank': 2, 'current': 1, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [3]} | Failed |
| regression certificate 5 | {'carry_rank': 3, 'current': 2, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [5]} | {'carry_rank': 3, 'current': 2, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [4, 5]} | Failed |
| regression certificate 6 | {'carry_rank': None, 'current': 0, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [0, 1, 1, 2]} | {'carry_rank': None, 'current': 0, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [0, 1, 1, 2]} | Passed |
| variant-dependent certificate | {'carry_rank': None, 'current': 1, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [1, 2, 2, 3]} | {'carry_rank': None, 'current': 1, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [1, 2, 2, 3]} | Passed |
SHA-256 / 8cb352fb66ba036a0800ae10230723a406487a83fbd49cee1192089eacf56889
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
r=d['ranks']; i=d['i']; exists=i<len(r); pair=i+1<len(r) and r[i]==r[i+1]; triple=i+2<len(r) and r[i]==r[i+1]==r[i+2]
link=pair and not triple
return {'link_now': link,
'current': r[i] if exists else None,
'carry_rank': r[i]+1 if link else None,
'suffix': r[i+2:] if link else r[i:],
'defer': triple,
'partner': i+1 if link else None}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [1, 2, 2, 3], 'i': 0}, {'link_now': False, 'current': 1, 'carry_rank': None, 'suffix': [1, 2, 2, 3], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [2, 3, 3, 4], 'i': 0}, {'link_now': False, 'current': 2, 'carry_rank': None, 'suffix': [2, 3, 3, 4], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [3, 4, 4, 5], 'i': 0}, {'link_now': False, 'current': 3, 'carry_rank': None, 'suffix': [3, 4, 4, 5], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [4, 5, 5, 6], 'i': 0}, {'link_now': False, 'current': 4, 'carry_rank': None, 'suffix': [4, 5, 5, 6], 'defer': False, 'partner': None})], [({'ranks': [], 'i': 0}, {'link_now': False, 'current': None, 'carry_rank': None, 'suffix': [], 'defer': False, 'partner': None}), ({'ranks': [0, 0], 'i': 0}, {'link_now': True, 'current': 0, 'carry_rank': 1, 'suffix': [], 'defer': False, 'partner': 1}), ({'ranks': [0, 0, 0, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 0, 0, 2], 'defer': True, 'partner': None}), ({'ranks': [0, 1, 1, 3], 'i': 1}, {'link_now': True, 'current': 1, 'carry_rank': 2, 'suffix': [3], 'defer': False, 'partner': 2}), ({'ranks': [1, 2, 2, 4, 5], 'i': 1}, {'link_now': True, 'current': 2, 'carry_rank': 3, 'suffix': [4, 5], 'defer': False, 'partner': 2}), ({'ranks': [0, 1, 1, 2], 'i': 0}, {'link_now': False, 'current': 0, 'carry_rank': None, 'suffix': [0, 1, 1, 2], 'defer': False, 'partner': None}), ({'ranks': [5, 6, 6, 7], 'i': 0}, {'link_now': False, 'current': 5, 'carry_rank': None, 'suffix': [5, 6, 6, 7], 'defer': False, 'partner': None})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression certificate 1 | {'carry_rank': None, 'current': None, 'defer': False, 'link_now': False, 'partner': None, 'suffix': []} | {'carry_rank': None, 'current': None, 'defer': False, 'link_now': False, 'partner': None, 'suffix': []} | Passed |
| regression certificate 2 | {'carry_rank': 1, 'current': 0, 'defer': False, 'link_now': True, 'partner': 1, 'suffix': []} | {'carry_rank': 1, 'current': 0, 'defer': False, 'link_now': True, 'partner': 1, 'suffix': []} | Passed |
| regression certificate 3 | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | Passed |
| regression certificate 4 | {'carry_rank': 2, 'current': 1, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [3]} | {'carry_rank': 2, 'current': 1, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [3]} | Passed |
| regression certificate 5 | {'carry_rank': 3, 'current': 2, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [4, 5]} | {'carry_rank': 3, 'current': 2, 'defer': False, 'link_now': True, 'partner': 2, 'suffix': [4, 5]} | Passed |
| regression certificate 6 | {'carry_rank': None, 'current': 0, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [0, 1, 1, 2]} | {'carry_rank': None, 'current': 0, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [0, 1, 1, 2]} | Passed |
| variant-dependent certificate | {'carry_rank': None, 'current': 1, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [1, 2, 2, 3]} | {'carry_rank': None, 'current': 1, 'defer': False, 'link_now': False, 'partner': None, 'suffix': [1, 2, 2, 3]} | Passed |
SHA-256 / 845f4c069904d01e9ff3c652eca4efa3cf98e1acdcc917325c926aaf891f7bfd
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:27.168544+00:00.
Case digest / 049da8430813e56bc7f8100ff9da54f5b00dc0b4fc0685dadf3bcf91d3f1e0ee