FAILURE MAP
← Case archive

FA-46016 / Bounded deques / Open access

Cross-splice checks the incoming range without resident occupancy · case 01

Cross-splice checks the incoming range without resident occupancy.

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

ROOT CAUSE

Cross-splice checks the incoming range without resident occupancy.

VERIFIED REPAIR

Restore the documented combined budget 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(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 fixtureActualExpectedOutcome
interior[[1, 4], [11, 2, 3, 12], True, 2][[1, 4], [11, 2, 3, 12], True, 2]Passed
overflow[[], [1, 2, 3, 11], True, 3][[1, 2, 3], [11], False, 0]Failed
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 / b904c6b816b89eee54a886ac081cb15298e9ccf9d375af5368f18aa1492170f4

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)==cap or 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 fixtureActualExpectedOutcome
interior[[1, 4], [11, 2, 3, 12], True, 2][[1, 4], [11, 2, 3, 12], True, 2]Passed
overflow[[], [1, 2, 3, 11], True, 3][[1, 2, 3], [11], False, 0]Failed
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 / b7c5faf7f38f3d2d4bc283b9fb72f423f32e1ebd87aec7bb7a1adc01125ec7df

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

Case digest / 66042907387592a9d49c6f2ec5191a8a5fd68c7e95ec3c0386bb3b77808fd552