FA-45961 / Bounded deques / Open access
Cursor erase drops the successor along with its target · case 01
Cursor erase drops the successor along with its target.
ROOT CAUSE
The end-exclusive deletion boundary skips the first surviving element.
VERIFIED REPAIR
Restore the documented sequence suffix 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+2:]
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, 4], [0, 1, 1, 2, None], [1, 4, 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 | [[3], [0, 0, 1], [3, 3, 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], [], []] | Failed |
| unaffected cursors | [[1, 2, 3], [0, 1, 2], [1, 2, 3]] | [[1, 2, 3], [0, 1, 2], [1, 2, 3]] | Passed |
SHA-256 / f6e7732df4e2220a9ba03da858c08e4b294e397e6ad1913bcd0d6ba2fad03007
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:] if at == 0 else items[:at] + items[at+2:]
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, 4], [0, 1, 1, 2, None], [1, 4, 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, 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 / 79f5bcb9cd12b463193757f5d91f060bc75ba61ec8bbc954b1b537f7dd918554
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.527278+00:00.
Case digest / 7c8277bc9eb9b01eef84f02ac5a6431500694f4a32816dafc8be3faf9cca672b