FAILURE MAP
← Case archive

FA-46056 / Bounded deques / Open access

Self-splice reverses the moved block · case 01

Self-splice reverses the moved block.

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

ROOT CAUSE

Self-splice reverses the moved block.

VERIFIED REPAIR

Restore the documented moved order invariant in self-splice.

Unsuccessful approach: The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.

Case contract

Move a range within one bounded deque, preserving size and stable element identity. Gaps inside or at either boundary of the range are no-ops.

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,start,stop,gap = x
    if start <= gap <= stop: return a
    piece = a[start:stop]
    rest = a[:start]+a[stop:]
    new_gap = gap - (stop-start) if gap > stop else gap
    return rest[:new_gap]+piece[::-1]+rest[new_gap:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('move left', solve([[N,N+1,N+2,N+3,N+4],2,4,0]), {1: [3, 4, 1, 2, 5], 2: [4, 5, 2, 3, 6], 3: [5, 6, 3, 4, 7], 4: [6, 7, 4, 5, 8], 5: [7, 8, 5, 6, 9]}[N])
check('move right', solve([[N,N+1,N+2,N+3,N+4],0,2,5]), {1: [3, 4, 5, 1, 2], 2: [4, 5, 6, 2, 3], 3: [5, 6, 7, 3, 4], 4: [6, 7, 8, 4, 5], 5: [7, 8, 9, 5, 6]}[N])
check('inside no op', solve([[N,N+1,N+2,N+3],1,3,2]), {1: [1, 2, 3, 4], 2: [2, 3, 4, 5], 3: [3, 4, 5, 6], 4: [4, 5, 6, 7], 5: [5, 6, 7, 8]}[N])
check('end boundary', solve([[N,N+1,N+2,N+3],1,3,3]), {1: [1, 2, 3, 4], 2: [2, 3, 4, 5], 3: [3, 4, 5, 6], 4: [4, 5, 6, 7], 5: [5, 6, 7, 8]}[N])
check('empty range', solve([[N,N+1,N+2],1,1,3]), {1: [1, 2, 3], 2: [2, 3, 4], 3: [3, 4, 5], 4: [4, 5, 6], 5: [5, 6, 7]}[N])
check('interior right', solve([[N,N+1,N+2,N+3,N+4,N+5],1,3,5]), {1: [1, 4, 5, 2, 3, 6], 2: [2, 5, 6, 3, 4, 7], 3: [3, 6, 7, 4, 5, 8], 4: [4, 7, 8, 5, 6, 9], 5: [5, 8, 9, 6, 7, 10]}[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
move left[4, 3, 1, 2, 5][3, 4, 1, 2, 5]Failed
move right[3, 4, 5, 2, 1][3, 4, 5, 1, 2]Failed
inside no op[1, 2, 3, 4][1, 2, 3, 4]Passed
end boundary[1, 2, 3, 4][1, 2, 3, 4]Passed
empty range[1, 2, 3][1, 2, 3]Passed
interior right[1, 4, 5, 3, 2, 6][1, 4, 5, 2, 3, 6]Failed

SHA-256 / 3cc851cc847ab227279897a00447c9487ca93a60fc6ed129516269e1f9621a5d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,start,stop,gap = x
    if start <= gap <= stop: return a
    piece = a[start:stop]
    rest = a[:start]+a[stop:]
    new_gap = gap - (stop-start) if gap > stop else gap
    return rest[:new_gap]+(piece if new_gap==0 else piece[::-1])+rest[new_gap:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('move left', solve([[N,N+1,N+2,N+3,N+4],2,4,0]), {1: [3, 4, 1, 2, 5], 2: [4, 5, 2, 3, 6], 3: [5, 6, 3, 4, 7], 4: [6, 7, 4, 5, 8], 5: [7, 8, 5, 6, 9]}[N])
check('move right', solve([[N,N+1,N+2,N+3,N+4],0,2,5]), {1: [3, 4, 5, 1, 2], 2: [4, 5, 6, 2, 3], 3: [5, 6, 7, 3, 4], 4: [6, 7, 8, 4, 5], 5: [7, 8, 9, 5, 6]}[N])
check('inside no op', solve([[N,N+1,N+2,N+3],1,3,2]), {1: [1, 2, 3, 4], 2: [2, 3, 4, 5], 3: [3, 4, 5, 6], 4: [4, 5, 6, 7], 5: [5, 6, 7, 8]}[N])
check('end boundary', solve([[N,N+1,N+2,N+3],1,3,3]), {1: [1, 2, 3, 4], 2: [2, 3, 4, 5], 3: [3, 4, 5, 6], 4: [4, 5, 6, 7], 5: [5, 6, 7, 8]}[N])
check('empty range', solve([[N,N+1,N+2],1,1,3]), {1: [1, 2, 3], 2: [2, 3, 4], 3: [3, 4, 5], 4: [4, 5, 6], 5: [5, 6, 7]}[N])
check('interior right', solve([[N,N+1,N+2,N+3,N+4,N+5],1,3,5]), {1: [1, 4, 5, 2, 3, 6], 2: [2, 5, 6, 3, 4, 7], 3: [3, 6, 7, 4, 5, 8], 4: [4, 7, 8, 5, 6, 9], 5: [5, 8, 9, 6, 7, 10]}[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
move left[3, 4, 1, 2, 5][3, 4, 1, 2, 5]Passed
move right[3, 4, 5, 2, 1][3, 4, 5, 1, 2]Failed
inside no op[1, 2, 3, 4][1, 2, 3, 4]Passed
end boundary[1, 2, 3, 4][1, 2, 3, 4]Passed
empty range[1, 2, 3][1, 2, 3]Passed
interior right[1, 4, 5, 3, 2, 6][1, 4, 5, 2, 3, 6]Failed

SHA-256 / 4562f119f0cb9e524dce9ef9ed7992e6624a33e693718df0f6c45203c6a4f7c3

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,start,stop,gap = x
    if start <= gap <= stop: return a
    piece = a[start:stop]
    rest = a[:start]+a[stop:]
    new_gap = gap - (stop-start) if gap > stop else gap
    return rest[:new_gap]+piece+rest[new_gap:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('move left', solve([[N,N+1,N+2,N+3,N+4],2,4,0]), {1: [3, 4, 1, 2, 5], 2: [4, 5, 2, 3, 6], 3: [5, 6, 3, 4, 7], 4: [6, 7, 4, 5, 8], 5: [7, 8, 5, 6, 9]}[N])
check('move right', solve([[N,N+1,N+2,N+3,N+4],0,2,5]), {1: [3, 4, 5, 1, 2], 2: [4, 5, 6, 2, 3], 3: [5, 6, 7, 3, 4], 4: [6, 7, 8, 4, 5], 5: [7, 8, 9, 5, 6]}[N])
check('inside no op', solve([[N,N+1,N+2,N+3],1,3,2]), {1: [1, 2, 3, 4], 2: [2, 3, 4, 5], 3: [3, 4, 5, 6], 4: [4, 5, 6, 7], 5: [5, 6, 7, 8]}[N])
check('end boundary', solve([[N,N+1,N+2,N+3],1,3,3]), {1: [1, 2, 3, 4], 2: [2, 3, 4, 5], 3: [3, 4, 5, 6], 4: [4, 5, 6, 7], 5: [5, 6, 7, 8]}[N])
check('empty range', solve([[N,N+1,N+2],1,1,3]), {1: [1, 2, 3], 2: [2, 3, 4], 3: [3, 4, 5], 4: [4, 5, 6], 5: [5, 6, 7]}[N])
check('interior right', solve([[N,N+1,N+2,N+3,N+4,N+5],1,3,5]), {1: [1, 4, 5, 2, 3, 6], 2: [2, 5, 6, 3, 4, 7], 3: [3, 6, 7, 4, 5, 8], 4: [4, 7, 8, 5, 6, 9], 5: [5, 8, 9, 6, 7, 10]}[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
move left[3, 4, 1, 2, 5][3, 4, 1, 2, 5]Passed
move right[3, 4, 5, 1, 2][3, 4, 5, 1, 2]Passed
inside no op[1, 2, 3, 4][1, 2, 3, 4]Passed
end boundary[1, 2, 3, 4][1, 2, 3, 4]Passed
empty range[1, 2, 3][1, 2, 3]Passed
interior right[1, 4, 5, 2, 3, 6][1, 4, 5, 2, 3, 6]Passed

SHA-256 / 51d5500dee52c34b4dc3a63dd7e7764a5a93b4308cb3e25c8fb11efc2efe34e6

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

Case digest / a26767ca7a6058402e356512a36882b62192f6b44295731d5ff7f2012e7fe887