FA-46026 / Bounded deques / Open access
Cross-splice inserts after the designated gap · case 01
Cross-splice inserts after the designated gap.
ROOT CAUSE
Cross-splice inserts after the designated gap.
VERIFIED REPAIR
Restore the documented insertion gap invariant in cross-splice.
Unsuccessful approach: The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.
Case contract
Move a half-open slice from one deque to another at a valid gap. Reject overflow atomically. Return [source,destination,accepted,moved].
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):
a,b,start,stop,gap,cap = x
piece = a[start:stop]
if len(b)+len(piece)>cap: return [a,b,False,0]
left = a[:start]+a[stop:]
right = b[:gap+1]+piece+b[gap+1:]
return [left,right,True,len(piece)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interior', solve([[N,N+1,N+2,N+3],[N+10,N+11],1,3,1,5]), {1: [[1, 4], [11, 2, 3, 12], True, 2], 2: [[2, 5], [12, 3, 4, 13], True, 2], 3: [[3, 6], [13, 4, 5, 14], True, 2], 4: [[4, 7], [14, 5, 6, 15], True, 2], 5: [[5, 8], [15, 6, 7, 16], True, 2]}[N])
check('overflow', solve([[N,N+1,N+2],[N+10],0,3,0,3]), {1: [[1, 2, 3], [11], False, 0], 2: [[2, 3, 4], [12], False, 0], 3: [[3, 4, 5], [13], False, 0], 4: [[4, 5, 6], [14], False, 0], 5: [[5, 6, 7], [15], False, 0]}[N])
check('empty slice', solve([[N,N+1],[N+10],1,1,0,2]), {1: [[1, 2], [11], True, 0], 2: [[2, 3], [12], True, 0], 3: [[3, 4], [13], True, 0], 4: [[4, 5], [14], True, 0], 5: [[5, 6], [15], True, 0]}[N])
check('whole source', solve([[N,N+1],[],0,2,0,2]), {1: [[], [1, 2], True, 2], 2: [[], [2, 3], True, 2], 3: [[], [3, 4], True, 2], 4: [[], [4, 5], True, 2], 5: [[], [5, 6], True, 2]}[N])
check('append splice', solve([[N,N+1,N+2],[N+10],0,2,1,4]), {1: [[3], [11, 1, 2], True, 2], 2: [[4], [12, 2, 3], True, 2], 3: [[5], [13, 3, 4], True, 2], 4: [[6], [14, 4, 5], True, 2], 5: [[7], [15, 5, 6], True, 2]}[N])
check('tail slice', solve([[N,N+1,N+2],[N+10],2,3,0,3]), {1: [[1, 2], [3, 11], True, 1], 2: [[2, 3], [4, 12], True, 1], 3: [[3, 4], [5, 13], True, 1], 4: [[4, 5], [6, 14], True, 1], 5: [[5, 6], [7, 15], True, 1]}[N])
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 | [[1, 4], [11, 12, 2, 3], True, 2] | [[1, 4], [11, 2, 3, 12], True, 2] | Failed |
| overflow | [[1, 2, 3], [11], False, 0] | [[1, 2, 3], [11], False, 0] | Passed |
| empty slice | [[1, 2], [11], True, 0] | [[1, 2], [11], True, 0] | Passed |
| whole source | [[], [1, 2], True, 2] | [[], [1, 2], True, 2] | Passed |
| append splice | [[3], [11, 1, 2], True, 2] | [[3], [11, 1, 2], True, 2] | Passed |
| tail slice | [[1, 2], [11, 3], True, 1] | [[1, 2], [3, 11], True, 1] | Failed |
SHA-256 / ecb9abcc07b4162e6aaf278f5ee800102654354589782f401447a48e38adc1b9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
a,b,start,stop,gap,cap = x
piece = a[start:stop]
if len(b)+len(piece)>cap: return [a,b,False,0]
left = a[:start]+a[stop:]
right = b[:gap]+piece+b[gap:] if gap==len(b) else b[:gap+1]+piece+b[gap+1:]
return [left,right,True,len(piece)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interior', solve([[N,N+1,N+2,N+3],[N+10,N+11],1,3,1,5]), {1: [[1, 4], [11, 2, 3, 12], True, 2], 2: [[2, 5], [12, 3, 4, 13], True, 2], 3: [[3, 6], [13, 4, 5, 14], True, 2], 4: [[4, 7], [14, 5, 6, 15], True, 2], 5: [[5, 8], [15, 6, 7, 16], True, 2]}[N])
check('overflow', solve([[N,N+1,N+2],[N+10],0,3,0,3]), {1: [[1, 2, 3], [11], False, 0], 2: [[2, 3, 4], [12], False, 0], 3: [[3, 4, 5], [13], False, 0], 4: [[4, 5, 6], [14], False, 0], 5: [[5, 6, 7], [15], False, 0]}[N])
check('empty slice', solve([[N,N+1],[N+10],1,1,0,2]), {1: [[1, 2], [11], True, 0], 2: [[2, 3], [12], True, 0], 3: [[3, 4], [13], True, 0], 4: [[4, 5], [14], True, 0], 5: [[5, 6], [15], True, 0]}[N])
check('whole source', solve([[N,N+1],[],0,2,0,2]), {1: [[], [1, 2], True, 2], 2: [[], [2, 3], True, 2], 3: [[], [3, 4], True, 2], 4: [[], [4, 5], True, 2], 5: [[], [5, 6], True, 2]}[N])
check('append splice', solve([[N,N+1,N+2],[N+10],0,2,1,4]), {1: [[3], [11, 1, 2], True, 2], 2: [[4], [12, 2, 3], True, 2], 3: [[5], [13, 3, 4], True, 2], 4: [[6], [14, 4, 5], True, 2], 5: [[7], [15, 5, 6], True, 2]}[N])
check('tail slice', solve([[N,N+1,N+2],[N+10],2,3,0,3]), {1: [[1, 2], [3, 11], True, 1], 2: [[2, 3], [4, 12], True, 1], 3: [[3, 4], [5, 13], True, 1], 4: [[4, 5], [6, 14], True, 1], 5: [[5, 6], [7, 15], True, 1]}[N])
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 | [[1, 4], [11, 12, 2, 3], True, 2] | [[1, 4], [11, 2, 3, 12], True, 2] | Failed |
| overflow | [[1, 2, 3], [11], False, 0] | [[1, 2, 3], [11], False, 0] | Passed |
| empty slice | [[1, 2], [11], True, 0] | [[1, 2], [11], True, 0] | Passed |
| whole source | [[], [1, 2], True, 2] | [[], [1, 2], True, 2] | Passed |
| append splice | [[3], [11, 1, 2], True, 2] | [[3], [11, 1, 2], True, 2] | Passed |
| tail slice | [[1, 2], [11, 3], True, 1] | [[1, 2], [3, 11], True, 1] | Failed |
SHA-256 / 295845bc3a129c198e54144f458795c6eed15c0015d0337c194c7a0fa9f5de3b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
a,b,start,stop,gap,cap = x
piece = a[start:stop]
if len(b)+len(piece)>cap: return [a,b,False,0]
left = a[:start]+a[stop:]
right = b[:gap]+piece+b[gap:]
return [left,right,True,len(piece)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interior', solve([[N,N+1,N+2,N+3],[N+10,N+11],1,3,1,5]), {1: [[1, 4], [11, 2, 3, 12], True, 2], 2: [[2, 5], [12, 3, 4, 13], True, 2], 3: [[3, 6], [13, 4, 5, 14], True, 2], 4: [[4, 7], [14, 5, 6, 15], True, 2], 5: [[5, 8], [15, 6, 7, 16], True, 2]}[N])
check('overflow', solve([[N,N+1,N+2],[N+10],0,3,0,3]), {1: [[1, 2, 3], [11], False, 0], 2: [[2, 3, 4], [12], False, 0], 3: [[3, 4, 5], [13], False, 0], 4: [[4, 5, 6], [14], False, 0], 5: [[5, 6, 7], [15], False, 0]}[N])
check('empty slice', solve([[N,N+1],[N+10],1,1,0,2]), {1: [[1, 2], [11], True, 0], 2: [[2, 3], [12], True, 0], 3: [[3, 4], [13], True, 0], 4: [[4, 5], [14], True, 0], 5: [[5, 6], [15], True, 0]}[N])
check('whole source', solve([[N,N+1],[],0,2,0,2]), {1: [[], [1, 2], True, 2], 2: [[], [2, 3], True, 2], 3: [[], [3, 4], True, 2], 4: [[], [4, 5], True, 2], 5: [[], [5, 6], True, 2]}[N])
check('append splice', solve([[N,N+1,N+2],[N+10],0,2,1,4]), {1: [[3], [11, 1, 2], True, 2], 2: [[4], [12, 2, 3], True, 2], 3: [[5], [13, 3, 4], True, 2], 4: [[6], [14, 4, 5], True, 2], 5: [[7], [15, 5, 6], True, 2]}[N])
check('tail slice', solve([[N,N+1,N+2],[N+10],2,3,0,3]), {1: [[1, 2], [3, 11], True, 1], 2: [[2, 3], [4, 12], True, 1], 3: [[3, 4], [5, 13], True, 1], 4: [[4, 5], [6, 14], True, 1], 5: [[5, 6], [7, 15], True, 1]}[N])
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 | [[1, 4], [11, 2, 3, 12], True, 2] | [[1, 4], [11, 2, 3, 12], True, 2] | Passed |
| overflow | [[1, 2, 3], [11], False, 0] | [[1, 2, 3], [11], False, 0] | Passed |
| empty slice | [[1, 2], [11], True, 0] | [[1, 2], [11], True, 0] | Passed |
| whole source | [[], [1, 2], True, 2] | [[], [1, 2], True, 2] | Passed |
| append splice | [[3], [11, 1, 2], True, 2] | [[3], [11, 1, 2], True, 2] | Passed |
| tail slice | [[1, 2], [3, 11], True, 1] | [[1, 2], [3, 11], True, 1] | Passed |
SHA-256 / a60b552814b1f3988246cfa74e81c14c34ee1ab7f492bf291a1fa02e23d6ead7
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:28.148114+00:00.
Case digest / 3340052c4cbea4628b53b71eca5216d3cfe4b4a0d1df2a5c4b3fdf89a74a9082