FA-46326 / Bounded deques / Open access
Bookmark reorder allocates one extra inverse entry · case 01
Bookmark reorder allocates one extra inverse entry.
ROOT CAUSE
Bookmark reorder allocates one extra inverse entry.
THE FAILURE
Bookmark reorder allocates one extra inverse entry.
Unsuccessful approach: The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.
Case contract
Reorder a bounded deque by a complete permutation of old indices, then return the inverse mapping used by bookmarks. Invalid duplicate, missing or out-of-range indices reject without changing the deque.
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,order=x
valid=sorted(order)==list(range(len(a)))
if not valid:return [a,False,[]]
result=[a[i] for i in order]
inverse=[0]*(len(a)+1)
for new,old in enumerate(order):inverse[old]=new
return [result,True,inverse]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N,N+1,N+2],[2,0,1]]), {1: [[3, 1, 2], True, [1, 2, 0]], 2: [[4, 2, 3], True, [1, 2, 0]], 3: [[5, 3, 4], True, [1, 2, 0]], 4: [[6, 4, 5], True, [1, 2, 0]], 5: [[7, 5, 6], True, [1, 2, 0]]}[N])
check('1', solve([[N,N+1],[0,0]]), {1: [[1, 2], False, []], 2: [[2, 3], False, []], 3: [[3, 4], False, []], 4: [[4, 5], False, []], 5: [[5, 6], False, []]}[N])
check('2', solve([[N,N+1],[0]]), {1: [[1, 2], False, []], 2: [[2, 3], False, []], 3: [[3, 4], False, []], 4: [[4, 5], False, []], 5: [[5, 6], False, []]}[N])
check('3', solve([[N],[0]]), {1: [[1], True, [0]], 2: [[2], True, [0]], 3: [[3], True, [0]], 4: [[4], True, [0]], 5: [[5], True, [0]]}[N])
check('4', solve([[],[]]), {1: [[], True, []], 2: [[], True, []], 3: [[], True, []], 4: [[], True, []], 5: [[], True, []]}[N])
check('5', solve([[N,N+1,N+2,N+3],[1,3,0,2]]), {1: [[2, 4, 1, 3], True, [2, 0, 3, 1]], 2: [[3, 5, 2, 4], True, [2, 0, 3, 1]], 3: [[4, 6, 3, 5], True, [2, 0, 3, 1]], 4: [[5, 7, 4, 6], True, [2, 0, 3, 1]], 5: [[6, 8, 5, 7], True, [2, 0, 3, 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 |
|---|---|---|---|
| 0 | [[3, 1, 2], True, [1, 2, 0, 0]] | [[3, 1, 2], True, [1, 2, 0]] | Failed |
| 1 | [[1, 2], False, []] | [[1, 2], False, []] | Passed |
| 2 | [[1, 2], False, []] | [[1, 2], False, []] | Passed |
| 3 | [[1], True, [0, 0]] | [[1], True, [0]] | Failed |
| 4 | [[], True, [0]] | [[], True, []] | Failed |
| 5 | [[2, 4, 1, 3], True, [2, 0, 3, 1, 0]] | [[2, 4, 1, 3], True, [2, 0, 3, 1]] | Failed |
SHA-256 / 659503000635c9bc14e5cd446c499d408297afa18ec9680e2479cabebad32cbf
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
a,order=x
valid=sorted(order)==list(range(len(a)))
if not valid:return [a,False,[]]
result=[a[i] for i in order]
inverse=[0]*(len(a) if not a else len(a)+1)
for new,old in enumerate(order):inverse[old]=new
return [result,True,inverse]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N,N+1,N+2],[2,0,1]]), {1: [[3, 1, 2], True, [1, 2, 0]], 2: [[4, 2, 3], True, [1, 2, 0]], 3: [[5, 3, 4], True, [1, 2, 0]], 4: [[6, 4, 5], True, [1, 2, 0]], 5: [[7, 5, 6], True, [1, 2, 0]]}[N])
check('1', solve([[N,N+1],[0,0]]), {1: [[1, 2], False, []], 2: [[2, 3], False, []], 3: [[3, 4], False, []], 4: [[4, 5], False, []], 5: [[5, 6], False, []]}[N])
check('2', solve([[N,N+1],[0]]), {1: [[1, 2], False, []], 2: [[2, 3], False, []], 3: [[3, 4], False, []], 4: [[4, 5], False, []], 5: [[5, 6], False, []]}[N])
check('3', solve([[N],[0]]), {1: [[1], True, [0]], 2: [[2], True, [0]], 3: [[3], True, [0]], 4: [[4], True, [0]], 5: [[5], True, [0]]}[N])
check('4', solve([[],[]]), {1: [[], True, []], 2: [[], True, []], 3: [[], True, []], 4: [[], True, []], 5: [[], True, []]}[N])
check('5', solve([[N,N+1,N+2,N+3],[1,3,0,2]]), {1: [[2, 4, 1, 3], True, [2, 0, 3, 1]], 2: [[3, 5, 2, 4], True, [2, 0, 3, 1]], 3: [[4, 6, 3, 5], True, [2, 0, 3, 1]], 4: [[5, 7, 4, 6], True, [2, 0, 3, 1]], 5: [[6, 8, 5, 7], True, [2, 0, 3, 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 |
|---|---|---|---|
| 0 | [[3, 1, 2], True, [1, 2, 0, 0]] | [[3, 1, 2], True, [1, 2, 0]] | Failed |
| 1 | [[1, 2], False, []] | [[1, 2], False, []] | Passed |
| 2 | [[1, 2], False, []] | [[1, 2], False, []] | Passed |
| 3 | [[1], True, [0, 0]] | [[1], True, [0]] | Failed |
| 4 | [[], True, []] | [[], True, []] | Passed |
| 5 | [[2, 4, 1, 3], True, [2, 0, 3, 1, 0]] | [[2, 4, 1, 3], True, [2, 0, 3, 1]] | Failed |
SHA-256 / 72910fedd5476ad77144697e4288eaeb369fc9d5018c9c3f7422ba4fb24a0bfb
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:31.009531+00:00.
Case digest / 8e5002d7b91fc8d5bbc97630f00a1d8a2cd31a2deda981439b12e39d56597d8d