FAILURE MAP
← Case archive

FA-45976 / Bounded deques / Open access

Cursor on an erased interior node becomes end · case 01

Cursor on an erased interior node becomes end.

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

ROOT CAUSE

Erasure invalidation discards the required successor binding.

VERIFIED REPAIR

Restore the documented target successor invariant in cursor-erasure.

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

Case contract

Erase a selected position while updating independent stable cursors. A cursor at the erased element moves to its successor, or end; later cursors shift left, earlier cursors stay. Return values, cursor positions, and cursor-observed values; None denotes end.

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):
    items, at, cursors = x
    remaining = items[:at] + items[at+1:]
    updated = []
    for position in cursors:
        if position is None:
            next_position = None
        elif position < at:
            next_position = position
        elif position == at:
            next_position = None
        else:
            next_position = position - 1
        updated.append(next_position)
    observed = [remaining[p] if p is not None and 0 <= p < len(remaining) else None for p in updated]
    return [remaining,updated,observed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interior cursors', solve([[N,N+1,N+2,N+3],1,[0,1,2,3,None]]), [[N,N+2,N+3],[0,1,1,2,None],[N,N+2,N+2,N+3,None]])
check('erased last cursor', solve([[N,N+1],1,[0,1,None]]), [[N],[0,None,None],[N,None,None]])
check('all point at head', solve([[N,N+1,N+2],0,[0,0,2]]), [[N+1,N+2],[0,0,1],[N+1,N+1,N+2]])
check('single node erased', solve([[N],0,[0,None]]), [[],[None,None],[None,None]])
check('no cursors', solve([[N,N+1],0,[]]), [[N+1],[],[]])
check('unaffected cursors', solve([[N,N+1,N+2,N+3],3,[0,1,2]]), [[N,N+1,N+2],[0,1,2],[N,N+1,N+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
interior cursors[[1, 3, 4], [0, None, 1, 2, None], [1, None, 3, 4, None]][[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]]Failed
erased last cursor[[1], [0, None, None], [1, None, None]][[1], [0, None, None], [1, None, None]]Passed
all point at head[[2, 3], [None, None, 1], [None, None, 3]][[2, 3], [0, 0, 1], [2, 2, 3]]Failed
single node erased[[], [None, None], [None, None]][[], [None, None], [None, None]]Passed
no cursors[[2], [], []][[2], [], []]Passed
unaffected cursors[[1, 2, 3], [0, 1, 2], [1, 2, 3]][[1, 2, 3], [0, 1, 2], [1, 2, 3]]Passed

SHA-256 / 4d61b3dc650b97ef2abc0c87bc8185220b10c7f5f8f9eb0d3dc288891322b168

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    items, at, cursors = x
    remaining = items[:at] + items[at+1:]
    updated = []
    for position in cursors:
        if position is None:
            next_position = None
        elif position < at:
            next_position = position
        elif position == at:
            next_position = at if at == 0 and remaining else None
        else:
            next_position = position - 1
        updated.append(next_position)
    observed = [remaining[p] if p is not None and 0 <= p < len(remaining) else None for p in updated]
    return [remaining,updated,observed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interior cursors', solve([[N,N+1,N+2,N+3],1,[0,1,2,3,None]]), [[N,N+2,N+3],[0,1,1,2,None],[N,N+2,N+2,N+3,None]])
check('erased last cursor', solve([[N,N+1],1,[0,1,None]]), [[N],[0,None,None],[N,None,None]])
check('all point at head', solve([[N,N+1,N+2],0,[0,0,2]]), [[N+1,N+2],[0,0,1],[N+1,N+1,N+2]])
check('single node erased', solve([[N],0,[0,None]]), [[],[None,None],[None,None]])
check('no cursors', solve([[N,N+1],0,[]]), [[N+1],[],[]])
check('unaffected cursors', solve([[N,N+1,N+2,N+3],3,[0,1,2]]), [[N,N+1,N+2],[0,1,2],[N,N+1,N+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
interior cursors[[1, 3, 4], [0, None, 1, 2, None], [1, None, 3, 4, None]][[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]]Failed
erased last cursor[[1], [0, None, None], [1, None, None]][[1], [0, None, None], [1, None, None]]Passed
all point at head[[2, 3], [0, 0, 1], [2, 2, 3]][[2, 3], [0, 0, 1], [2, 2, 3]]Passed
single node erased[[], [None, None], [None, None]][[], [None, None], [None, None]]Passed
no cursors[[2], [], []][[2], [], []]Passed
unaffected cursors[[1, 2, 3], [0, 1, 2], [1, 2, 3]][[1, 2, 3], [0, 1, 2], [1, 2, 3]]Passed

SHA-256 / 9274b9fcde983f53eed30b8f258324a6fda725bf546ebab66b9350a484665949

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    items, at, cursors = x
    remaining = items[:at] + items[at+1:]
    updated = []
    for position in cursors:
        if position is None:
            next_position = None
        elif position < at:
            next_position = position
        elif position == at:
            next_position = at if at < len(remaining) else None
        else:
            next_position = position - 1
        updated.append(next_position)
    observed = [remaining[p] if p is not None and 0 <= p < len(remaining) else None for p in updated]
    return [remaining,updated,observed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interior cursors', solve([[N,N+1,N+2,N+3],1,[0,1,2,3,None]]), [[N,N+2,N+3],[0,1,1,2,None],[N,N+2,N+2,N+3,None]])
check('erased last cursor', solve([[N,N+1],1,[0,1,None]]), [[N],[0,None,None],[N,None,None]])
check('all point at head', solve([[N,N+1,N+2],0,[0,0,2]]), [[N+1,N+2],[0,0,1],[N+1,N+1,N+2]])
check('single node erased', solve([[N],0,[0,None]]), [[],[None,None],[None,None]])
check('no cursors', solve([[N,N+1],0,[]]), [[N+1],[],[]])
check('unaffected cursors', solve([[N,N+1,N+2,N+3],3,[0,1,2]]), [[N,N+1,N+2],[0,1,2],[N,N+1,N+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
interior cursors[[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]][[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]]Passed
erased last cursor[[1], [0, None, None], [1, None, None]][[1], [0, None, None], [1, None, None]]Passed
all point at head[[2, 3], [0, 0, 1], [2, 2, 3]][[2, 3], [0, 0, 1], [2, 2, 3]]Passed
single node erased[[], [None, None], [None, None]][[], [None, None], [None, None]]Passed
no cursors[[2], [], []][[2], [], []]Passed
unaffected cursors[[1, 2, 3], [0, 1, 2], [1, 2, 3]][[1, 2, 3], [0, 1, 2], [1, 2, 3]]Passed

SHA-256 / 0ccb67a73594c8343fb6af1a7384228dc32eb825c511c67aff3e5c31d7335d7e

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

Case digest / 56b13223b3b8881456c3b5cff0990f0073dbe416aed0e95ec86079715185392a