FAILURE MAP
← Case archive

FA-46931 / Bounded deques / Open access

Deque commit forgets already-published resident values · case 01

Deque commit forgets already-published resident values.

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

ROOT CAUSE

Deque commit forgets already-published resident values.

THE FAILURE

Deque commit forgets already-published resident values.

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

Case contract

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

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):
    a,reserved,values,written,cap,epoch=x
    if written<0 or written>len(values) or written>reserved:return [a,reserved,epoch,False,[]]
    if written>cap:return [a,reserved,epoch,False,[]]
    published=values[:written]
    state=a+published
    remaining=0
    version=epoch+(written>0)
    unused=values[written:]
    return [state,remaining,version,True,unused]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],3,[N+1,N+2,N+3],2,5,4]), {1: [[1, 2, 3], 0, 5, True, [4]], 2: [[2, 3, 4], 0, 5, True, [5]], 3: [[3, 4, 5], 0, 5, True, [6]], 4: [[4, 5, 6], 0, 5, True, [7]], 5: [[5, 6, 7], 0, 5, True, [8]]}[N])
check('1', solve([[N],1,[N+1,N+2],2,4,2]), {1: [[1], 1, 2, False, []], 2: [[2], 1, 2, False, []], 3: [[3], 1, 2, False, []], 4: [[4], 1, 2, False, []], 5: [[5], 1, 2, False, []]}[N])
check('2', solve([[N],3,[N+1],2,5,1]), {1: [[1], 3, 1, False, []], 2: [[2], 3, 1, False, []], 3: [[3], 3, 1, False, []], 4: [[4], 3, 1, False, []], 5: [[5], 3, 1, False, []]}[N])
check('3', solve([[N,N+1],2,[N+2,N+3],2,3,5]), {1: [[1, 2], 2, 5, False, []], 2: [[2, 3], 2, 5, False, []], 3: [[3, 4], 2, 5, False, []], 4: [[4, 5], 2, 5, False, []], 5: [[5, 6], 2, 5, False, []]}[N])
check('4', solve([[N],2,[N+1,N+2],0,4,7]), {1: [[1], 0, 7, True, [2, 3]], 2: [[2], 0, 7, True, [3, 4]], 3: [[3], 0, 7, True, [4, 5]], 4: [[4], 0, 7, True, [5, 6]], 5: [[5], 0, 7, True, [6, 7]]}[N])
check('5', solve([[],2,[N,N+1],2,2,0]), {1: [[1, 2], 0, 1, True, []], 2: [[2, 3], 0, 1, True, []], 3: [[3, 4], 0, 1, True, []], 4: [[4, 5], 0, 1, True, []], 5: [[5, 6], 0, 1, True, []]}[N])
check('6', solve([[N],2,[N+1],-1,4,1]), {1: [[1], 2, 1, False, []], 2: [[2], 2, 1, False, []], 3: [[3], 2, 1, False, []], 4: [[4], 2, 1, False, []], 5: [[5], 2, 1, False, []]}[N])
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
0[[1, 2, 3], 0, 5, True, [4]][[1, 2, 3], 0, 5, True, [4]]Passed
1[[1], 1, 2, False, []][[1], 1, 2, False, []]Passed
2[[1], 3, 1, False, []][[1], 3, 1, False, []]Passed
3[[1, 2, 3, 4], 0, 6, True, []][[1, 2], 2, 5, False, []]Failed
4[[1], 0, 7, True, [2, 3]][[1], 0, 7, True, [2, 3]]Passed
5[[1, 2], 0, 1, True, []][[1, 2], 0, 1, True, []]Passed
6[[1], 2, 1, False, []][[1], 2, 1, False, []]Passed

SHA-256 / f327ed2014f3bfa52fbcbf941ab003f6bd8acae3cf35fcb19b981624b7d108ed

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    a,reserved,values,written,cap,epoch=x
    if written<0 or written>len(values) or written>reserved:return [a,reserved,epoch,False,[]]
    if len(a)+written>cap and not a:return [a,reserved,epoch,False,[]]
    published=values[:written]
    state=a+published
    remaining=0
    version=epoch+(written>0)
    unused=values[written:]
    return [state,remaining,version,True,unused]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],3,[N+1,N+2,N+3],2,5,4]), {1: [[1, 2, 3], 0, 5, True, [4]], 2: [[2, 3, 4], 0, 5, True, [5]], 3: [[3, 4, 5], 0, 5, True, [6]], 4: [[4, 5, 6], 0, 5, True, [7]], 5: [[5, 6, 7], 0, 5, True, [8]]}[N])
check('1', solve([[N],1,[N+1,N+2],2,4,2]), {1: [[1], 1, 2, False, []], 2: [[2], 1, 2, False, []], 3: [[3], 1, 2, False, []], 4: [[4], 1, 2, False, []], 5: [[5], 1, 2, False, []]}[N])
check('2', solve([[N],3,[N+1],2,5,1]), {1: [[1], 3, 1, False, []], 2: [[2], 3, 1, False, []], 3: [[3], 3, 1, False, []], 4: [[4], 3, 1, False, []], 5: [[5], 3, 1, False, []]}[N])
check('3', solve([[N,N+1],2,[N+2,N+3],2,3,5]), {1: [[1, 2], 2, 5, False, []], 2: [[2, 3], 2, 5, False, []], 3: [[3, 4], 2, 5, False, []], 4: [[4, 5], 2, 5, False, []], 5: [[5, 6], 2, 5, False, []]}[N])
check('4', solve([[N],2,[N+1,N+2],0,4,7]), {1: [[1], 0, 7, True, [2, 3]], 2: [[2], 0, 7, True, [3, 4]], 3: [[3], 0, 7, True, [4, 5]], 4: [[4], 0, 7, True, [5, 6]], 5: [[5], 0, 7, True, [6, 7]]}[N])
check('5', solve([[],2,[N,N+1],2,2,0]), {1: [[1, 2], 0, 1, True, []], 2: [[2, 3], 0, 1, True, []], 3: [[3, 4], 0, 1, True, []], 4: [[4, 5], 0, 1, True, []], 5: [[5, 6], 0, 1, True, []]}[N])
check('6', solve([[N],2,[N+1],-1,4,1]), {1: [[1], 2, 1, False, []], 2: [[2], 2, 1, False, []], 3: [[3], 2, 1, False, []], 4: [[4], 2, 1, False, []], 5: [[5], 2, 1, False, []]}[N])
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
0[[1, 2, 3], 0, 5, True, [4]][[1, 2, 3], 0, 5, True, [4]]Passed
1[[1], 1, 2, False, []][[1], 1, 2, False, []]Passed
2[[1], 3, 1, False, []][[1], 3, 1, False, []]Passed
3[[1, 2, 3, 4], 0, 6, True, []][[1, 2], 2, 5, False, []]Failed
4[[1], 0, 7, True, [2, 3]][[1], 0, 7, True, [2, 3]]Passed
5[[1, 2], 0, 1, True, []][[1, 2], 0, 1, True, []]Passed
6[[1], 2, 1, False, []][[1], 2, 1, False, []]Passed

SHA-256 / d0446a7bdc7559c3c5d93790b2d84ba68228a6ce4cb074b0735d4a9bfc6f2a8f

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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

Case digest / 6a74809a1afa30548bf8400a65e82d7f4346de98b98feea32fa235b0f60fd8b8