FA-40021 / Heap invariants / Open access
Binomial carry defers the first pair when three equal ranks are pending · case 01
The bounded binomial carry certificate reports an incorrect link now.
ROOT CAUSE
Binomial carry defers the first pair when three equal ranks are pending.
THE FAILURE
Binomial carry defers the first pair when three equal ranks are pending.
Unsuccessful approach: The local patch uses pair and i+2==len(r) 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': pair,
'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': True, 'partner': None, 'suffix': [0, 0, 0, 2]} | {'carry_rank': None, 'current': 0, 'defer': True, 'link_now': False, 'partner': None, 'suffix': [0, 0, 0, 2]} | Failed |
| 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 / fcd41bbd969a2ce9f7d06fb260c1d000415b7da00353f706af20734aea51a849
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': pair and i+2==len(r),
'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': False, 'partner': 2, 'suffix': [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': False, 'partner': 2, 'suffix': [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 / 53c07743f23bdb734d39d81799a38302af8b8f180160a6e3add8ac6c8b79b5af
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:27.285137+00:00.
Case digest / 4b0e1672c43ff3960fa7d9fc20db40b3cb527ac164285d4b1b56f44de5293644