FAILURE MAP
← Case archive

FA-45896 / Bounded deques / Open access

Growth leaves old-capacity slack instead of new-capacity slack · case 01

Growth leaves old-capacity slack instead of new-capacity slack.

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

ROOT CAUSE

Allocation padding uses the previous capacity.

THE FAILURE

Allocation padding uses the previous capacity.

Unsuccessful approach: The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.

Case contract

Grow a ring to larger positive capacity. Linearize occupied slots in logical order, clear unused storage, reset head and report next insertion index and unchanged logical count.

Why this case matters

Controlled bounded deque implementation model with explicit storage and lifecycle observations.

1 / The failure

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

N = 1
observations = []
def solve(x):
    slots, head, size, capacity = x
    old = len(slots)
    live = [slots[(head + i) % old] for i in range(size)]
    new = live + [None] * (old - size)
    new_head = 0
    write = size % capacity
    return [new, new_head, write, size]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('wrapped live data', solve([[N,None,None,N+1,N+2],3,3,7]), [[N+1,N+2,N,None,None,None,None],0,3,3])
check('empty shifted ring', solve([[None]*4,3,0,6]), [[None]*6,0,0,0])
check('one shifted value', solve([[None,N,None],1,1,5]), [[N,None,None,None,None],0,1,1])
check('full old ring', solve([[N,N+1,N+2],1,3,5]), [[N+1,N+2,N,None,None],0,3,3])
check('head zero', solve([[N,N+1,None],0,2,6]), [[N,N+1,None,None,None,None],0,2,2])
check('two wrapped values', solve([[N,None,None,N+1],3,2,8]), [[N+1,N,None,None,None,None,None,None],0,2,2])
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
wrapped live data[[2, 3, 1, None, None], 0, 3, 3][[2, 3, 1, None, None, None, None], 0, 3, 3]Failed
empty shifted ring[[None, None, None, None], 0, 0, 0][[None, None, None, None, None, None], 0, 0, 0]Failed
one shifted value[[1, None, None], 0, 1, 1][[1, None, None, None, None], 0, 1, 1]Failed
full old ring[[2, 3, 1], 0, 3, 3][[2, 3, 1, None, None], 0, 3, 3]Failed
head zero[[1, 2, None], 0, 2, 2][[1, 2, None, None, None, None], 0, 2, 2]Failed
two wrapped values[[2, 1, None, None], 0, 2, 2][[2, 1, None, None, None, None, None, None], 0, 2, 2]Failed

SHA-256 / d931475eca92fbedd0e9d5729ead6cc2e897afa3f769f1e760db3a855a212ef5

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    slots, head, size, capacity = x
    old = len(slots)
    live = [slots[(head + i) % old] for i in range(size)]
    new = live + [None] * (capacity - size if size == 0 else old - size)
    new_head = 0
    write = size % capacity
    return [new, new_head, write, size]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('wrapped live data', solve([[N,None,None,N+1,N+2],3,3,7]), [[N+1,N+2,N,None,None,None,None],0,3,3])
check('empty shifted ring', solve([[None]*4,3,0,6]), [[None]*6,0,0,0])
check('one shifted value', solve([[None,N,None],1,1,5]), [[N,None,None,None,None],0,1,1])
check('full old ring', solve([[N,N+1,N+2],1,3,5]), [[N+1,N+2,N,None,None],0,3,3])
check('head zero', solve([[N,N+1,None],0,2,6]), [[N,N+1,None,None,None,None],0,2,2])
check('two wrapped values', solve([[N,None,None,N+1],3,2,8]), [[N+1,N,None,None,None,None,None,None],0,2,2])
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
wrapped live data[[2, 3, 1, None, None], 0, 3, 3][[2, 3, 1, None, None, None, None], 0, 3, 3]Failed
empty shifted ring[[None, None, None, None, None, None], 0, 0, 0][[None, None, None, None, None, None], 0, 0, 0]Passed
one shifted value[[1, None, None], 0, 1, 1][[1, None, None, None, None], 0, 1, 1]Failed
full old ring[[2, 3, 1], 0, 3, 3][[2, 3, 1, None, None], 0, 3, 3]Failed
head zero[[1, 2, None], 0, 2, 2][[1, 2, None, None, None, None], 0, 2, 2]Failed
two wrapped values[[2, 1, None, None], 0, 2, 2][[2, 1, None, None, None, None, None, None], 0, 2, 2]Failed

SHA-256 / 05ca3c664e8f69ff07d399516ea10d950cc3cb374436bea670dcc3b541163f4b

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 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

Offline finite deterministic model; no claim of production implementation or concurrent memory-model conformance. 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:44:26.983422+00:00.

Case digest / 4e27083be65ff550cedc8169ca2e667de059e77a762f8253e5c0086c6c6f85db