FA-45981 / Bounded deques / Open access
Cursor after an erased node retains its old index · case 01
Cursor after an erased node retains its old index.
ROOT CAUSE
Only the immediate successor cursor gets its ordinal corrected.
THE FAILURE
Only the immediate successor cursor gets its ordinal corrected.
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 = at if at < len(remaining) else None
else:
next_position = position
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interior cursors | [[1, 3, 4], [0, 1, 2, 3, None], [1, 3, 4, None, 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, 2], [2, 2, None]] | [[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 / c46a16aba034a2f046bc5357392e13f583d158c19fa75765f8434f05cfe67d2a
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 < len(remaining) else None
else:
next_position = position - 1 if position == at + 1 else position
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interior cursors | [[1, 3, 4], [0, 1, 1, 3, None], [1, 3, 3, None, 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, 2], [2, 2, None]] | [[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 / 0ac8e734c3ca9ea3423d1459560bfd759902e48cc1bbd6f245e9badfdae9f0b7
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 / c38c05c8f00301d567e8f5dc807db418c8b08a88ea0e5657998b9ab5d7b13222