FAILURE MAP
← Case archive

FA-39986 / Heap invariants / Open access

Radix width guard accepts the unrepresentable upper endpoint · case 01

The bounded radix buckets certificate reports an incorrect overflow.

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

ROOT CAUSE

A width-bit unsigned key admits the all-ones value but excludes exactly two-to-width.

VERIFIED REPAIR

Derive overflow using [x[1] for x in entries if x[0]>=2**width] under the stated bounded certificate contract.

Unsuccessful approach: The local patch uses [x[1] for x in entries if x[0].bit_length()>=width] and still violates the stated relation.

Case contract

A monotone integer radix-heap certificate has nonnegative last, entries [key,id,bucket], and width. Bucket index is bit_length(key XOR last). Report monotonicity violations, bucket assignment violations, zero-bucket members, next nonempty bucket, next extraction threshold, and overflow keys. This is an unsigned bounded toy representation.

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):
    last=d['last']; entries=d['entries']; width=d['width']
    return {'monotone': [x[1] for x in entries if x[0]<last],
    'placement': [x[1] for x in entries if x[2]!=(x[0]^last).bit_length()],
    'zero_members': [x[1] for x in entries if x[0]==last],
    'next_bucket': min([x[2] for x in entries if x[2]>0],default=None),
    'new_last': min([x[0] for x in entries],default=last),
    'overflow': [x[1] for x in entries if x[0]>2**width]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [16, 'variant', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [32, 'variant', 6]], 'width': 5}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [64, 'variant', 7]], 'width': 6}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [128, 'variant', 8]], 'width': 7}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [256, 'variant', 9]], 'width': 8}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})]][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{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': []}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': []}Passed
regression certificate 2{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}Passed
regression certificate 3{'monotone': [], 'new_last': 7, 'next_bucket': 4, 'overflow': [], 'placement': [], 'zero_members': ['b']}{'monotone': [], 'new_last': 7, 'next_bucket': 4, 'overflow': ['d'], 'placement': [], 'zero_members': ['b']}Failed
regression certificate 4{'monotone': [], 'new_last': 4, 'next_bucket': 1, 'overflow': [], 'placement': ['c'], 'zero_members': ['c']}{'monotone': [], 'new_last': 4, 'next_bucket': 1, 'overflow': [], 'placement': ['c'], 'zero_members': ['c']}Passed
regression certificate 5{'monotone': ['a', 'd'], 'new_last': 2, 'next_bucket': 1, 'overflow': [], 'placement': [], 'zero_members': ['b']}{'monotone': ['a', 'd'], 'new_last': 2, 'next_bucket': 1, 'overflow': [], 'placement': [], 'zero_members': ['b']}Passed
regression certificate 6{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': [], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['a'], 'placement': [], 'zero_members': ['d']}Failed
variant-dependent certificate{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': [], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['variant'], 'placement': [], 'zero_members': ['d']}Failed

SHA-256 / c40de34f253facf3422a904dc9dddb05aca790df5129927737ac40c6769882da

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    last=d['last']; entries=d['entries']; width=d['width']
    return {'monotone': [x[1] for x in entries if x[0]<last],
    'placement': [x[1] for x in entries if x[2]!=(x[0]^last).bit_length()],
    'zero_members': [x[1] for x in entries if x[0]==last],
    'next_bucket': min([x[2] for x in entries if x[2]>0],default=None),
    'new_last': min([x[0] for x in entries],default=last),
    'overflow': [x[1] for x in entries if x[0].bit_length()>=width]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [16, 'variant', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [32, 'variant', 6]], 'width': 5}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [64, 'variant', 7]], 'width': 6}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [128, 'variant', 8]], 'width': 7}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [256, 'variant', 9]], 'width': 8}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})]][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{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': []}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': []}Passed
regression certificate 2{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}Passed
regression certificate 3{'monotone': [], 'new_last': 7, 'next_bucket': 4, 'overflow': ['a', 'c', 'd'], 'placement': [], 'zero_members': ['b']}{'monotone': [], 'new_last': 7, 'next_bucket': 4, 'overflow': ['d'], 'placement': [], 'zero_members': ['b']}Failed
regression certificate 4{'monotone': [], 'new_last': 4, 'next_bucket': 1, 'overflow': ['a', 'b', 'c'], 'placement': ['c'], 'zero_members': ['c']}{'monotone': [], 'new_last': 4, 'next_bucket': 1, 'overflow': [], 'placement': ['c'], 'zero_members': ['c']}Failed
regression certificate 5{'monotone': ['a', 'd'], 'new_last': 2, 'next_bucket': 1, 'overflow': ['a', 'b', 'c'], 'placement': [], 'zero_members': ['b']}{'monotone': ['a', 'd'], 'new_last': 2, 'next_bucket': 1, 'overflow': [], 'placement': [], 'zero_members': ['b']}Failed
regression certificate 6{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['a'], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['a'], 'placement': [], 'zero_members': ['d']}Passed
variant-dependent certificate{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['a', 'variant'], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['variant'], 'placement': [], 'zero_members': ['d']}Failed

SHA-256 / 177367048a4b63311cfe49046431fd0f5d9fe6569728cf58c7d9b970a43f2a9b

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    last=d['last']; entries=d['entries']; width=d['width']
    return {'monotone': [x[1] for x in entries if x[0]<last],
    'placement': [x[1] for x in entries if x[2]!=(x[0]^last).bit_length()],
    'zero_members': [x[1] for x in entries if x[0]==last],
    'next_bucket': min([x[2] for x in entries if x[2]>0],default=None),
    'new_last': min([x[0] for x in entries],default=last),
    'overflow': [x[1] for x in entries if x[0]>=2**width]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [16, 'variant', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [32, 'variant', 6]], 'width': 5}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [64, 'variant', 7]], 'width': 6}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [128, 'variant', 8]], 'width': 7}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})], [({'last': 3, 'entries': [], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': [], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 3, 'entries': [[3, 'a', 0]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['a'], 'next_bucket': None, 'new_last': 3, 'overflow': []}), ({'last': 7, 'entries': [[8, 'a', 4], [7, 'b', 0], [15, 'c', 4], [16, 'd', 5]], 'width': 4}, {'monotone': [], 'placement': [], 'zero_members': ['b'], 'next_bucket': 4, 'new_last': 7, 'overflow': ['d']}), ({'last': 4, 'entries': [[7, 'a', 2], [5, 'b', 1], [4, 'c', 1]], 'width': 3}, {'monotone': [], 'placement': ['c'], 'zero_members': ['c'], 'next_bucket': 1, 'new_last': 4, 'overflow': []}), ({'last': 9, 'entries': [[8, 'a', 1], [9, 'b', 0], [12, 'c', 3], [2, 'd', 4]], 'width': 4}, {'monotone': ['a', 'd'], 'placement': [], 'zero_members': ['b'], 'next_bucket': 1, 'new_last': 2, 'overflow': []}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0]], 'width': 3}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['a']}), ({'last': 1, 'entries': [[8, 'a', 4], [3, 'b', 2], [2, 'c', 2], [1, 'd', 0], [256, 'variant', 9]], 'width': 8}, {'monotone': [], 'placement': [], 'zero_members': ['d'], 'next_bucket': 2, 'new_last': 1, 'overflow': ['variant']})]][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{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': []}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': []}Passed
regression certificate 2{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}Passed
regression certificate 3{'monotone': [], 'new_last': 7, 'next_bucket': 4, 'overflow': ['d'], 'placement': [], 'zero_members': ['b']}{'monotone': [], 'new_last': 7, 'next_bucket': 4, 'overflow': ['d'], 'placement': [], 'zero_members': ['b']}Passed
regression certificate 4{'monotone': [], 'new_last': 4, 'next_bucket': 1, 'overflow': [], 'placement': ['c'], 'zero_members': ['c']}{'monotone': [], 'new_last': 4, 'next_bucket': 1, 'overflow': [], 'placement': ['c'], 'zero_members': ['c']}Passed
regression certificate 5{'monotone': ['a', 'd'], 'new_last': 2, 'next_bucket': 1, 'overflow': [], 'placement': [], 'zero_members': ['b']}{'monotone': ['a', 'd'], 'new_last': 2, 'next_bucket': 1, 'overflow': [], 'placement': [], 'zero_members': ['b']}Passed
regression certificate 6{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['a'], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['a'], 'placement': [], 'zero_members': ['d']}Passed
variant-dependent certificate{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['variant'], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['variant'], 'placement': [], 'zero_members': ['d']}Passed

SHA-256 / 0a466368204adfb3aac3974335727685f2c4bb85ebad9c1e07698407361ff089

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

Case digest / 51cb8bb5bd3e5f858f82d87616caa6d6805f76a3e154d7c61264f39b0017233a