FAILURE MAP
← Case archive

FA-46296 / Bounded deques / Open access

Reverse bookmark mapping reflects around global zero · case 01

Reverse bookmark mapping reflects around global zero.

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

ROOT CAUSE

Reverse bookmark mapping reflects around global zero.

THE FAILURE

Reverse bookmark mapping reflects around global zero.

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

Case contract

Reverse a valid half-open range in a bounded deque and return an old-index to new-index mapping for stable bookmarks. Empty ranges leave all positions unchanged.

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=x
    result=a[:start]+a[start:stop][::-1]+a[stop:]
    mapping=[]
    for i in range(len(a)):
        target=stop-1-i if start<=i<stop else i
        mapping.append(target)
    return [result,mapping]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N,N+1,N+2,N+3,N+4],1,4]), {1: [[1, 4, 3, 2, 5], [0, 3, 2, 1, 4]], 2: [[2, 5, 4, 3, 6], [0, 3, 2, 1, 4]], 3: [[3, 6, 5, 4, 7], [0, 3, 2, 1, 4]], 4: [[4, 7, 6, 5, 8], [0, 3, 2, 1, 4]], 5: [[5, 8, 7, 6, 9], [0, 3, 2, 1, 4]]}[N])
check('1', solve([[N,N+1,N+2],0,3]), {1: [[3, 2, 1], [2, 1, 0]], 2: [[4, 3, 2], [2, 1, 0]], 3: [[5, 4, 3], [2, 1, 0]], 4: [[6, 5, 4], [2, 1, 0]], 5: [[7, 6, 5], [2, 1, 0]]}[N])
check('2', solve([[N,N+1],1,1]), {1: [[1, 2], [0, 1]], 2: [[2, 3], [0, 1]], 3: [[3, 4], [0, 1]], 4: [[4, 5], [0, 1]], 5: [[5, 6], [0, 1]]}[N])
check('3', solve([[N],0,1]), {1: [[1], [0]], 2: [[2], [0]], 3: [[3], [0]], 4: [[4], [0]], 5: [[5], [0]]}[N])
check('4', solve([[],0,0]), {1: [[], []], 2: [[], []], 3: [[], []], 4: [[], []], 5: [[], []]}[N])
check('5', solve([[N,N+1,N+2,N+3],2,4]), {1: [[1, 2, 4, 3], [0, 1, 3, 2]], 2: [[2, 3, 5, 4], [0, 1, 3, 2]], 3: [[3, 4, 6, 5], [0, 1, 3, 2]], 4: [[4, 5, 7, 6], [0, 1, 3, 2]], 5: [[5, 6, 8, 7], [0, 1, 3, 2]]}[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
0[[1, 4, 3, 2, 5], [0, 2, 1, 0, 4]][[1, 4, 3, 2, 5], [0, 3, 2, 1, 4]]Failed
1[[3, 2, 1], [2, 1, 0]][[3, 2, 1], [2, 1, 0]]Passed
2[[1, 2], [0, 1]][[1, 2], [0, 1]]Passed
3[[1], [0]][[1], [0]]Passed
4[[], []][[], []]Passed
5[[1, 2, 4, 3], [0, 1, 1, 0]][[1, 2, 4, 3], [0, 1, 3, 2]]Failed

SHA-256 / 19692234943278845a7f3ea28c609ea23a1678a25be358bbba68e6ab7eeffc93

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=x
    result=a[:start]+a[start:stop][::-1]+a[stop:]
    mapping=[]
    for i in range(len(a)):
        target=start+stop-1-i if start==0 else stop-1-i if start<=i<stop else i
        mapping.append(target)
    return [result,mapping]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N,N+1,N+2,N+3,N+4],1,4]), {1: [[1, 4, 3, 2, 5], [0, 3, 2, 1, 4]], 2: [[2, 5, 4, 3, 6], [0, 3, 2, 1, 4]], 3: [[3, 6, 5, 4, 7], [0, 3, 2, 1, 4]], 4: [[4, 7, 6, 5, 8], [0, 3, 2, 1, 4]], 5: [[5, 8, 7, 6, 9], [0, 3, 2, 1, 4]]}[N])
check('1', solve([[N,N+1,N+2],0,3]), {1: [[3, 2, 1], [2, 1, 0]], 2: [[4, 3, 2], [2, 1, 0]], 3: [[5, 4, 3], [2, 1, 0]], 4: [[6, 5, 4], [2, 1, 0]], 5: [[7, 6, 5], [2, 1, 0]]}[N])
check('2', solve([[N,N+1],1,1]), {1: [[1, 2], [0, 1]], 2: [[2, 3], [0, 1]], 3: [[3, 4], [0, 1]], 4: [[4, 5], [0, 1]], 5: [[5, 6], [0, 1]]}[N])
check('3', solve([[N],0,1]), {1: [[1], [0]], 2: [[2], [0]], 3: [[3], [0]], 4: [[4], [0]], 5: [[5], [0]]}[N])
check('4', solve([[],0,0]), {1: [[], []], 2: [[], []], 3: [[], []], 4: [[], []], 5: [[], []]}[N])
check('5', solve([[N,N+1,N+2,N+3],2,4]), {1: [[1, 2, 4, 3], [0, 1, 3, 2]], 2: [[2, 3, 5, 4], [0, 1, 3, 2]], 3: [[3, 4, 6, 5], [0, 1, 3, 2]], 4: [[4, 5, 7, 6], [0, 1, 3, 2]], 5: [[5, 6, 8, 7], [0, 1, 3, 2]]}[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
0[[1, 4, 3, 2, 5], [0, 2, 1, 0, 4]][[1, 4, 3, 2, 5], [0, 3, 2, 1, 4]]Failed
1[[3, 2, 1], [2, 1, 0]][[3, 2, 1], [2, 1, 0]]Passed
2[[1, 2], [0, 1]][[1, 2], [0, 1]]Passed
3[[1], [0]][[1], [0]]Passed
4[[], []][[], []]Passed
5[[1, 2, 4, 3], [0, 1, 1, 0]][[1, 2, 4, 3], [0, 1, 3, 2]]Failed

SHA-256 / d8fb276ae30c4d1f1649b118179654a9e4952d90ff57761465dafff21d06868c

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / e3a4f8baf12b3baf97d1c60891fdb8eb13bdf922ac1a3b1b656441913f6a0ae4