FAILURE MAP
← Case archive

FA-41191 / Heap invariants / Open access

Paged heap addresses divide the zero-based global slot into page and offset · case 01

The bounded paged heap layout certificate reports an incorrect address.

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

ROOT CAUSE

Paged heap addresses divide the zero-based global slot into page and offset.

VERIFIED REPAIR

Derive address using address(i) under the stated bounded certificate contract.

Unsuccessful approach: The local patch uses [(i+1)//b,(i+1)%b] and still violates the stated relation.

Case contract

A binary heap is stored in fixed-size pages of B slots using zero-based global indices. For n logical members and selected live index i report its page/offset, parent address or None, child addresses, allocated page count, last-page live occupancy, and pages touched by reading i and its existing children. B>=1 and 0<=i<n.

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):
    n=d['size']; b=d['page_size']; i=d['index']; children=[j for j in (2*i+1,2*i+2) if j<n]
    def address(j): return [j//b,j%b]
    return {'address': [i%b,i//b],
    'parent': None if i==0 else address((i-1)//2),
    'children': [address(j) for j in children],
    'pages': (n+b-1)//b,
    'tail_occupancy': (n-1)%b+1,
    'touched': sorted({j//b for j in [i]+children})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 11, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'tail_occupancy': 2, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 12, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'tail_occupancy': 3, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 13, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 1, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 14, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 2, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 15, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 3, 'touched': [1, 3]})]][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{'address': [0, 0], 'children': [], 'pages': 1, 'parent': None, 'tail_occupancy': 1, 'touched': [0]}{'address': [0, 0], 'children': [], 'pages': 1, 'parent': None, 'tail_occupancy': 1, 'touched': [0]}Passed
regression certificate 2{'address': [3, 0], 'children': [[1, 3]], 'pages': 2, 'parent': [0, 1], 'tail_occupancy': 4, 'touched': [0, 1]}{'address': [0, 3], 'children': [[1, 3]], 'pages': 2, 'parent': [0, 1], 'tail_occupancy': 4, 'touched': [0, 1]}Failed
regression certificate 3{'address': [2, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'parent': [0, 0], 'tail_occupancy': 1, 'touched': [0, 1]}{'address': [0, 2], 'children': [[1, 1], [1, 2]], 'pages': 3, 'parent': [0, 0], 'tail_occupancy': 1, 'touched': [0, 1]}Failed
regression certificate 4{'address': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'parent': [0, 2], 'tail_occupancy': 3, 'touched': [2, 4]}{'address': [2, 0], 'children': [[4, 1], [4, 2]], 'pages': 5, 'parent': [0, 2], 'tail_occupancy': 3, 'touched': [2, 4]}Failed
regression certificate 5{'address': [3, 1], 'children': [[3, 3]], 'pages': 4, 'parent': [0, 3], 'tail_occupancy': 4, 'touched': [1, 3]}{'address': [1, 3], 'children': [[3, 3]], 'pages': 4, 'parent': [0, 3], 'tail_occupancy': 4, 'touched': [1, 3]}Failed
regression certificate 6{'address': [1, 1], 'children': [[3, 0]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 1, 'touched': [1, 3]}{'address': [1, 1], 'children': [[3, 0]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 1, 'touched': [1, 3]}Passed
variant-dependent certificate{'address': [1, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 2, 'touched': [1, 3]}{'address': [1, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 2, 'touched': [1, 3]}Passed

SHA-256 / 2afd58846f3467e9c2853a5461365c0d2e25fae46e9ac1d07503ad2d5a3f59a8

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    n=d['size']; b=d['page_size']; i=d['index']; children=[j for j in (2*i+1,2*i+2) if j<n]
    def address(j): return [j//b,j%b]
    return {'address': [(i+1)//b,(i+1)%b],
    'parent': None if i==0 else address((i-1)//2),
    'children': [address(j) for j in children],
    'pages': (n+b-1)//b,
    'tail_occupancy': (n-1)%b+1,
    'touched': sorted({j//b for j in [i]+children})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 11, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'tail_occupancy': 2, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 12, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'tail_occupancy': 3, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 13, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 1, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 14, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 2, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 15, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 3, 'touched': [1, 3]})]][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{'address': [0, 1], 'children': [], 'pages': 1, 'parent': None, 'tail_occupancy': 1, 'touched': [0]}{'address': [0, 0], 'children': [], 'pages': 1, 'parent': None, 'tail_occupancy': 1, 'touched': [0]}Failed
regression certificate 2{'address': [1, 0], 'children': [[1, 3]], 'pages': 2, 'parent': [0, 1], 'tail_occupancy': 4, 'touched': [0, 1]}{'address': [0, 3], 'children': [[1, 3]], 'pages': 2, 'parent': [0, 1], 'tail_occupancy': 4, 'touched': [0, 1]}Failed
regression certificate 3{'address': [0, 3], 'children': [[1, 1], [1, 2]], 'pages': 3, 'parent': [0, 0], 'tail_occupancy': 1, 'touched': [0, 1]}{'address': [0, 2], 'children': [[1, 1], [1, 2]], 'pages': 3, 'parent': [0, 0], 'tail_occupancy': 1, 'touched': [0, 1]}Failed
regression certificate 4{'address': [2, 1], 'children': [[4, 1], [4, 2]], 'pages': 5, 'parent': [0, 2], 'tail_occupancy': 3, 'touched': [2, 4]}{'address': [2, 0], 'children': [[4, 1], [4, 2]], 'pages': 5, 'parent': [0, 2], 'tail_occupancy': 3, 'touched': [2, 4]}Failed
regression certificate 5{'address': [2, 0], 'children': [[3, 3]], 'pages': 4, 'parent': [0, 3], 'tail_occupancy': 4, 'touched': [1, 3]}{'address': [1, 3], 'children': [[3, 3]], 'pages': 4, 'parent': [0, 3], 'tail_occupancy': 4, 'touched': [1, 3]}Failed
regression certificate 6{'address': [1, 2], 'children': [[3, 0]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 1, 'touched': [1, 3]}{'address': [1, 1], 'children': [[3, 0]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 1, 'touched': [1, 3]}Failed
variant-dependent certificate{'address': [1, 2], 'children': [[3, 0], [3, 1]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 2, 'touched': [1, 3]}{'address': [1, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 2, 'touched': [1, 3]}Failed

SHA-256 / 7d3b6e9fb480c68b6a53a19bcb31b39b4e5bdd9bb2ca28d9dda05145d1b66707

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    n=d['size']; b=d['page_size']; i=d['index']; children=[j for j in (2*i+1,2*i+2) if j<n]
    def address(j): return [j//b,j%b]
    return {'address': address(i),
    'parent': None if i==0 else address((i-1)//2),
    'children': [address(j) for j in children],
    'pages': (n+b-1)//b,
    'tail_occupancy': (n-1)%b+1,
    'touched': sorted({j//b for j in [i]+children})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 11, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'tail_occupancy': 2, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 12, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'tail_occupancy': 3, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 13, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 1, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 14, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 2, 'touched': [1, 3]})], [({'size': 1, 'page_size': 4, 'index': 0}, {'address': [0, 0], 'parent': None, 'children': [], 'pages': 1, 'tail_occupancy': 1, 'touched': [0]}), ({'size': 8, 'page_size': 4, 'index': 3}, {'address': [0, 3], 'parent': [0, 1], 'children': [[1, 3]], 'pages': 2, 'tail_occupancy': 4, 'touched': [0, 1]}), ({'size': 9, 'page_size': 4, 'index': 2}, {'address': [0, 2], 'parent': [0, 0], 'children': [[1, 1], [1, 2]], 'pages': 3, 'tail_occupancy': 1, 'touched': [0, 1]}), ({'size': 15, 'page_size': 3, 'index': 6}, {'address': [2, 0], 'parent': [0, 2], 'children': [[4, 1], [4, 2]], 'pages': 5, 'tail_occupancy': 3, 'touched': [2, 4]}), ({'size': 16, 'page_size': 4, 'index': 7}, {'address': [1, 3], 'parent': [0, 3], 'children': [[3, 3]], 'pages': 4, 'tail_occupancy': 4, 'touched': [1, 3]}), ({'size': 10, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0]], 'pages': 4, 'tail_occupancy': 1, 'touched': [1, 3]}), ({'size': 15, 'page_size': 3, 'index': 4}, {'address': [1, 1], 'parent': [0, 1], 'children': [[3, 0], [3, 1]], 'pages': 5, 'tail_occupancy': 3, 'touched': [1, 3]})]][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{'address': [0, 0], 'children': [], 'pages': 1, 'parent': None, 'tail_occupancy': 1, 'touched': [0]}{'address': [0, 0], 'children': [], 'pages': 1, 'parent': None, 'tail_occupancy': 1, 'touched': [0]}Passed
regression certificate 2{'address': [0, 3], 'children': [[1, 3]], 'pages': 2, 'parent': [0, 1], 'tail_occupancy': 4, 'touched': [0, 1]}{'address': [0, 3], 'children': [[1, 3]], 'pages': 2, 'parent': [0, 1], 'tail_occupancy': 4, 'touched': [0, 1]}Passed
regression certificate 3{'address': [0, 2], 'children': [[1, 1], [1, 2]], 'pages': 3, 'parent': [0, 0], 'tail_occupancy': 1, 'touched': [0, 1]}{'address': [0, 2], 'children': [[1, 1], [1, 2]], 'pages': 3, 'parent': [0, 0], 'tail_occupancy': 1, 'touched': [0, 1]}Passed
regression certificate 4{'address': [2, 0], 'children': [[4, 1], [4, 2]], 'pages': 5, 'parent': [0, 2], 'tail_occupancy': 3, 'touched': [2, 4]}{'address': [2, 0], 'children': [[4, 1], [4, 2]], 'pages': 5, 'parent': [0, 2], 'tail_occupancy': 3, 'touched': [2, 4]}Passed
regression certificate 5{'address': [1, 3], 'children': [[3, 3]], 'pages': 4, 'parent': [0, 3], 'tail_occupancy': 4, 'touched': [1, 3]}{'address': [1, 3], 'children': [[3, 3]], 'pages': 4, 'parent': [0, 3], 'tail_occupancy': 4, 'touched': [1, 3]}Passed
regression certificate 6{'address': [1, 1], 'children': [[3, 0]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 1, 'touched': [1, 3]}{'address': [1, 1], 'children': [[3, 0]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 1, 'touched': [1, 3]}Passed
variant-dependent certificate{'address': [1, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 2, 'touched': [1, 3]}{'address': [1, 1], 'children': [[3, 0], [3, 1]], 'pages': 4, 'parent': [0, 1], 'tail_occupancy': 2, 'touched': [1, 3]}Passed

SHA-256 / 45273083a38d2e5da74c177e7ee349ed2534a86fb0bd77b862533faa3107b4f5

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:38.440963+00:00.

Case digest / a0d1bedc239fde1aeb796568c72ff9293a78eeaa19f018ee6debca653c701c6b