FAILURE MAP
← Case archive

FA-46916 / Bounded deques / Open access

Unknown deque checkpoint request clears saved history · case 01

Unknown deque checkpoint request clears saved history.

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

ROOT CAUSE

Unknown deque checkpoint request clears saved history.

THE FAILURE

Unknown deque checkpoint request clears saved history.

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

Case contract

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

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,stack,op,tag=x
    if op=='save':return [a,stack+[[tag,a[:]]],tag,True]
    where=next((i for i,z in enumerate(stack) if z[0]==tag),None)
    if where is None:return [a,[],None,False]
    retained=stack[:where]
    state=stack[where][1][:] if op=='rollback' else a[:]
    return [state,retained,tag,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N+2],[[1,[N]],[2,[N+1]]],"rollback",1]), {1: [[1], [], 1, True], 2: [[2], [], 1, True], 3: [[3], [], 1, True], 4: [[4], [], 1, True], 5: [[5], [], 1, True]}[N])
check('1', solve([[N+2],[[1,[N]],[2,[N+1]]],"rollback",2]), {1: [[2], [[1, [1]]], 2, True], 2: [[3], [[1, [2]]], 2, True], 3: [[4], [[1, [3]]], 2, True], 4: [[5], [[1, [4]]], 2, True], 5: [[6], [[1, [5]]], 2, True]}[N])
check('2', solve([[N+2],[[1,[N]],[2,[N+1]]],"release",1]), {1: [[3], [], 1, True], 2: [[4], [], 1, True], 3: [[5], [], 1, True], 4: [[6], [], 1, True], 5: [[7], [], 1, True]}[N])
check('3', solve([[N],[],"save",3]), {1: [[1], [[3, [1]]], 3, True], 2: [[2], [[3, [2]]], 3, True], 3: [[3], [[3, [3]]], 3, True], 4: [[4], [[3, [4]]], 3, True], 5: [[5], [[3, [5]]], 3, True]}[N])
check('4', solve([[N],[[1,[N-1]]],"save",4]), {1: [[1], [[1, [0]], [4, [1]]], 4, True], 2: [[2], [[1, [1]], [4, [2]]], 4, True], 3: [[3], [[1, [2]], [4, [3]]], 4, True], 4: [[4], [[1, [3]], [4, [4]]], 4, True], 5: [[5], [[1, [4]], [4, [5]]], 4, True]}[N])
check('5', solve([[N],[[1,[N-1]]],"rollback",9]), {1: [[1], [[1, [0]]], None, False], 2: [[2], [[1, [1]]], None, False], 3: [[3], [[1, [2]]], None, False], 4: [[4], [[1, [3]]], None, False], 5: [[5], [[1, [4]]], None, 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], [], 1, True][[1], [], 1, True]Passed
1[[2], [[1, [1]]], 2, True][[2], [[1, [1]]], 2, True]Passed
2[[3], [], 1, True][[3], [], 1, True]Passed
3[[1], [[3, [1]]], 3, True][[1], [[3, [1]]], 3, True]Passed
4[[1], [[1, [0]], [4, [1]]], 4, True][[1], [[1, [0]], [4, [1]]], 4, True]Passed
5[[1], [], None, False][[1], [[1, [0]]], None, False]Failed

SHA-256 / 2c8c436d23f58561b691c90600f45c3780f45cfb5a85c53b28e2c41653db9bc7

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    a,stack,op,tag=x
    if op=='save':return [a,stack+[[tag,a[:]]],tag,True]
    where=next((i for i,z in enumerate(stack) if z[0]==tag),None)
    if where is None:return [a,stack if not a else [],None,False]
    retained=stack[:where]
    state=stack[where][1][:] if op=='rollback' else a[:]
    return [state,retained,tag,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N+2],[[1,[N]],[2,[N+1]]],"rollback",1]), {1: [[1], [], 1, True], 2: [[2], [], 1, True], 3: [[3], [], 1, True], 4: [[4], [], 1, True], 5: [[5], [], 1, True]}[N])
check('1', solve([[N+2],[[1,[N]],[2,[N+1]]],"rollback",2]), {1: [[2], [[1, [1]]], 2, True], 2: [[3], [[1, [2]]], 2, True], 3: [[4], [[1, [3]]], 2, True], 4: [[5], [[1, [4]]], 2, True], 5: [[6], [[1, [5]]], 2, True]}[N])
check('2', solve([[N+2],[[1,[N]],[2,[N+1]]],"release",1]), {1: [[3], [], 1, True], 2: [[4], [], 1, True], 3: [[5], [], 1, True], 4: [[6], [], 1, True], 5: [[7], [], 1, True]}[N])
check('3', solve([[N],[],"save",3]), {1: [[1], [[3, [1]]], 3, True], 2: [[2], [[3, [2]]], 3, True], 3: [[3], [[3, [3]]], 3, True], 4: [[4], [[3, [4]]], 3, True], 5: [[5], [[3, [5]]], 3, True]}[N])
check('4', solve([[N],[[1,[N-1]]],"save",4]), {1: [[1], [[1, [0]], [4, [1]]], 4, True], 2: [[2], [[1, [1]], [4, [2]]], 4, True], 3: [[3], [[1, [2]], [4, [3]]], 4, True], 4: [[4], [[1, [3]], [4, [4]]], 4, True], 5: [[5], [[1, [4]], [4, [5]]], 4, True]}[N])
check('5', solve([[N],[[1,[N-1]]],"rollback",9]), {1: [[1], [[1, [0]]], None, False], 2: [[2], [[1, [1]]], None, False], 3: [[3], [[1, [2]]], None, False], 4: [[4], [[1, [3]]], None, False], 5: [[5], [[1, [4]]], None, 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], [], 1, True][[1], [], 1, True]Passed
1[[2], [[1, [1]]], 2, True][[2], [[1, [1]]], 2, True]Passed
2[[3], [], 1, True][[3], [], 1, True]Passed
3[[1], [[3, [1]]], 3, True][[1], [[3, [1]]], 3, True]Passed
4[[1], [[1, [0]], [4, [1]]], 4, True][[1], [[1, [0]], [4, [1]]], 4, True]Passed
5[[1], [], None, False][[1], [[1, [0]]], None, False]Failed

SHA-256 / 507fc51c0cbf335bc8849b36239a5b608866254f08af347afae6c32e6dda24ef

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

Case digest / 152063db5bba161a050dcfe35f8646f97c62818bdc6639c5fde07b71ffe20348