FAILURE MAP
← Case archive

FA-39961 / Heap invariants / Open access

Radix monotonicity rejects a key equal to the last extraction · case 01

The bounded radix buckets certificate reports an incorrect monotone.

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

ROOT CAUSE

Monotonicity is relative to the last extracted key, with equality allowed.

VERIFIED REPAIR

Derive monotone using [x[1] for x in entries if x[0]<last] under the stated bounded certificate contract.

Unsuccessful approach: The local patch uses [x[1] for x in entries if x[0]<0] 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': ['a'], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}{'monotone': [], 'new_last': 3, 'next_bucket': None, 'overflow': [], 'placement': [], 'zero_members': ['a']}Failed
regression certificate 3{'monotone': ['b'], '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']}Failed
regression certificate 4{'monotone': ['c'], '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']}Failed
regression certificate 5{'monotone': ['a', 'b', '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']}Failed
regression certificate 6{'monotone': ['d'], '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']}Failed
variant-dependent certificate{'monotone': ['d'], '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']}Failed

SHA-256 / 65c00dbf9a3648c7dd8af29ab6855d2a7dcb67c28e216dd308893b8cd03b0397

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]<0],
    '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': [], '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']}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': ['variant'], 'placement': [], 'zero_members': ['d']}{'monotone': [], 'new_last': 1, 'next_bucket': 2, 'overflow': ['variant'], 'placement': [], 'zero_members': ['d']}Passed

SHA-256 / 0072cc4e6d6e6292d63d31fe602eb3d1ad5acca3840d52019a7077913b826d41

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

Case digest / c3e836635d70ae0c54d49cbee9f75f32193f8e7cc0da2f7f6620615de44e4a12