FAILURE MAP
← Case archive

FA-45971 / Bounded deques / Open access

Erase shifts cursors that precede the erased position · case 01

Erase shifts cursors that precede the erased position.

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

ROOT CAUSE

Index adjustment is applied on the wrong side of the deletion boundary.

THE FAILURE

Index adjustment is applied on the wrong side of the deletion boundary.

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 - 1
        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], [-1, 1, 1, 2, None], [None, 3, 3, 4, None]][[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]]Failed
erased last cursor[[1], [-1, None, None], [None, None, None]][[1], [0, None, None], [1, None, None]]Failed
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], [-1, 0, 1], [None, 1, 2]][[1, 2, 3], [0, 1, 2], [1, 2, 3]]Failed

SHA-256 / bc3b71bedfab90e030ca43945f9fc6dade31f998e61b6c981dca738204e09526

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 if position == 0 else position - 1
        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, 0, 1], [1, 1, 2]][[1, 2, 3], [0, 1, 2], [1, 2, 3]]Failed

SHA-256 / 07d9f9829826784a56110ad5a6ce5d6891c7817a0aec1f5733f9e8ebab8d3d83

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

Case digest / a41c74c89349021e7e0854bc25f4ad8c4d4639da9b92cce4d1a428bfa6e9631a