FA-45966 / Bounded deques / Open access
End cursor is rebound to the first element after erase · case 01
End cursor is rebound to the first element after erase.
ROOT CAUSE
End is represented as an ordinary index during cursor repair.
VERIFIED REPAIR
Restore the documented end stickiness 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 = 0
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interior cursors | [[1, 3, 4], [0, 1, 1, 2, 0], [1, 3, 3, 4, 1]] | [[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]] | Failed |
| erased last cursor | [[1], [0, None, 0], [1, None, 1]] | [[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, 0], [None, None]] | [[], [None, None], [None, None]] | Failed |
| 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 / 497a30f8e07b8e420d770f3af7485ecd479d26420c0bfd9787a1bb1e3ca69186
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 if not remaining else 0
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| interior cursors | [[1, 3, 4], [0, 1, 1, 2, 0], [1, 3, 3, 4, 1]] | [[1, 3, 4], [0, 1, 1, 2, None], [1, 3, 3, 4, None]] | Failed |
| erased last cursor | [[1], [0, None, 0], [1, None, 1]] | [[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], [0, 1, 2], [1, 2, 3]] | [[1, 2, 3], [0, 1, 2], [1, 2, 3]] | Passed |
SHA-256 / f6e1c71ac9212f62abdccd7e81385c29d4d26baf3df884df4fa1e99a4ab0b426
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.568099+00:00.
Case digest / eb5d020203ea71c99707936dba36433664e7bd694cd3bb429ef84cee438a655b