FA-46001 / Bounded deques / Open access
Block lookup treats logical head as having a wrapped predecessor · case 01
Block lookup treats logical head as having a wrapped predecessor.
ROOT CAUSE
Ring backing wrap leaks into the logical sequence neighbor contract.
VERIFIED REPAIR
Restore the documented predecessor boundary invariant in block-directory.
Unsuccessful approach: The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.
Case contract
For nonempty, variable-size deque blocks, resolve a logical index into [block index, local offset, value, total size, predecessor value, successor value]. Null neighbors mark sequence endpoints. Directory is built from cumulative block lengths.
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):
blocks, index = x
ends = []
total = 0
for block in blocks:
total += len(block)
ends.append(total)
b = next((i for i,end in enumerate(ends) if index < end), None)
if b is None: return 'invalid directory'
start = ends[b-1] if b else 0
local = index - start
value = blocks[b][local] if -len(blocks[b]) <= local < len(blocks[b]) else 'invalid offset'
flat = [v for block in blocks for v in block]
previous = flat[index-1]
following = flat[index+1] if index+1 < total else None
return [b,local,value,total,previous,following]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('second block first', solve([[[N,N+1],[N+2,N+3,N+4]],2]), [1,0,N+2,5,N+1,N+3])
check('second block interior', solve([[[N],[N+1,N+2,N+3],[N+4]],2]), [1,1,N+2,5,N+1,N+3])
check('first element', solve([[[N,N+1],[N+2]],0]), [0,0,N,3,None,N+1])
check('last element', solve([[[N],[N+1],[N+2,N+3]],3]), [2,1,N+3,4,N+2,None])
check('single value', solve([[[N]],0]), [0,0,N,1,None,None])
check('third block head', solve([[[N,N+1],[N+2],[N+3,N+4]],3]), [2,0,N+3,5,N+2,N+4])
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 |
|---|---|---|---|
| second block first | [1, 0, 3, 5, 2, 4] | [1, 0, 3, 5, 2, 4] | Passed |
| second block interior | [1, 1, 3, 5, 2, 4] | [1, 1, 3, 5, 2, 4] | Passed |
| first element | [0, 0, 1, 3, 3, 2] | [0, 0, 1, 3, None, 2] | Failed |
| last element | [2, 1, 4, 4, 3, None] | [2, 1, 4, 4, 3, None] | Passed |
| single value | [0, 0, 1, 1, 1, None] | [0, 0, 1, 1, None, None] | Failed |
| third block head | [2, 0, 4, 5, 3, 5] | [2, 0, 4, 5, 3, 5] | Passed |
SHA-256 / 28ec8aeac0c9c5fbebbc02f0f7ff157494a67d3284e850485f4caae40b891e60
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
blocks, index = x
ends = []
total = 0
for block in blocks:
total += len(block)
ends.append(total)
b = next((i for i,end in enumerate(ends) if index < end), None)
if b is None: return 'invalid directory'
start = ends[b-1] if b else 0
local = index - start
value = blocks[b][local] if -len(blocks[b]) <= local < len(blocks[b]) else 'invalid offset'
flat = [v for block in blocks for v in block]
previous = flat[index-1] if len(flat)>1 else None
following = flat[index+1] if index+1 < total else None
return [b,local,value,total,previous,following]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('second block first', solve([[[N,N+1],[N+2,N+3,N+4]],2]), [1,0,N+2,5,N+1,N+3])
check('second block interior', solve([[[N],[N+1,N+2,N+3],[N+4]],2]), [1,1,N+2,5,N+1,N+3])
check('first element', solve([[[N,N+1],[N+2]],0]), [0,0,N,3,None,N+1])
check('last element', solve([[[N],[N+1],[N+2,N+3]],3]), [2,1,N+3,4,N+2,None])
check('single value', solve([[[N]],0]), [0,0,N,1,None,None])
check('third block head', solve([[[N,N+1],[N+2],[N+3,N+4]],3]), [2,0,N+3,5,N+2,N+4])
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 |
|---|---|---|---|
| second block first | [1, 0, 3, 5, 2, 4] | [1, 0, 3, 5, 2, 4] | Passed |
| second block interior | [1, 1, 3, 5, 2, 4] | [1, 1, 3, 5, 2, 4] | Passed |
| first element | [0, 0, 1, 3, 3, 2] | [0, 0, 1, 3, None, 2] | Failed |
| last element | [2, 1, 4, 4, 3, None] | [2, 1, 4, 4, 3, None] | Passed |
| single value | [0, 0, 1, 1, None, None] | [0, 0, 1, 1, None, None] | Passed |
| third block head | [2, 0, 4, 5, 3, 5] | [2, 0, 4, 5, 3, 5] | Passed |
SHA-256 / 842e45bc60b20efcba2847c0b8195e111dbb2c17cc04cd3d296b4647040b547d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
blocks, index = x
ends = []
total = 0
for block in blocks:
total += len(block)
ends.append(total)
b = next((i for i,end in enumerate(ends) if index < end), None)
if b is None: return 'invalid directory'
start = ends[b-1] if b else 0
local = index - start
value = blocks[b][local] if -len(blocks[b]) <= local < len(blocks[b]) else 'invalid offset'
flat = [v for block in blocks for v in block]
previous = flat[index-1] if index else None
following = flat[index+1] if index+1 < total else None
return [b,local,value,total,previous,following]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('second block first', solve([[[N,N+1],[N+2,N+3,N+4]],2]), [1,0,N+2,5,N+1,N+3])
check('second block interior', solve([[[N],[N+1,N+2,N+3],[N+4]],2]), [1,1,N+2,5,N+1,N+3])
check('first element', solve([[[N,N+1],[N+2]],0]), [0,0,N,3,None,N+1])
check('last element', solve([[[N],[N+1],[N+2,N+3]],3]), [2,1,N+3,4,N+2,None])
check('single value', solve([[[N]],0]), [0,0,N,1,None,None])
check('third block head', solve([[[N,N+1],[N+2],[N+3,N+4]],3]), [2,0,N+3,5,N+2,N+4])
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 |
|---|---|---|---|
| second block first | [1, 0, 3, 5, 2, 4] | [1, 0, 3, 5, 2, 4] | Passed |
| second block interior | [1, 1, 3, 5, 2, 4] | [1, 1, 3, 5, 2, 4] | Passed |
| first element | [0, 0, 1, 3, None, 2] | [0, 0, 1, 3, None, 2] | Passed |
| last element | [2, 1, 4, 4, 3, None] | [2, 1, 4, 4, 3, None] | Passed |
| single value | [0, 0, 1, 1, None, None] | [0, 0, 1, 1, None, None] | Passed |
| third block head | [2, 0, 4, 5, 3, 5] | [2, 0, 4, 5, 3, 5] | Passed |
SHA-256 / 73d490a7aa291918a8fbc006c1725286face25151d2f8a2d3a7d5fe9a7ec6e20
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.835515+00:00.
Case digest / 5101d4ee58b636d9a8c14d1205c60b12929fdc1ec7038b7b2556b83e39f6c5c4