FAILURE MAP
← Case archive

FA-47041 / Bounded deques / Open access

Deque strided view reports span width instead of selected count · case 01

Deque strided view reports span width instead of selected count.

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

ROOT CAUSE

Deque strided view reports span width instead of selected count.

VERIFIED REPAIR

Restore the documented view count invariant in strided-view.

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

Case contract

Read an explicitly valid positive- or negative-stride bounded deque view. Preserve index order, capture an epoch, and report first/last source positions or null for an empty view.

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,step,epoch=x
    indices=list(range(start,stop,step))
    values=[a[i] for i in indices]
    length=abs(stop-start)
    version=epoch
    first=indices[0] if indices else None
    last=indices[-1] if indices else None
    return [values,indices,length,version,first,last]
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],0,5,2,4]), {1: [[1, 3, 5], [0, 2, 4], 3, 4, 0, 4], 2: [[2, 4, 6], [0, 2, 4], 3, 4, 0, 4], 3: [[3, 5, 7], [0, 2, 4], 3, 4, 0, 4], 4: [[4, 6, 8], [0, 2, 4], 3, 4, 0, 4], 5: [[5, 7, 9], [0, 2, 4], 3, 4, 0, 4]}[N])
check('1', solve([[N,N+1,N+2,N+3,N+4],4,-1,-2,3]), {1: [[5, 3, 1], [4, 2, 0], 3, 3, 4, 0], 2: [[6, 4, 2], [4, 2, 0], 3, 3, 4, 0], 3: [[7, 5, 3], [4, 2, 0], 3, 3, 4, 0], 4: [[8, 6, 4], [4, 2, 0], 3, 3, 4, 0], 5: [[9, 7, 5], [4, 2, 0], 3, 3, 4, 0]}[N])
check('2', solve([[N,N+1,N+2],1,1,1,2]), {1: [[], [], 0, 2, None, None], 2: [[], [], 0, 2, None, None], 3: [[], [], 0, 2, None, None], 4: [[], [], 0, 2, None, None], 5: [[], [], 0, 2, None, None]}[N])
check('3', solve([[N],0,1,1,0]), {1: [[1], [0], 1, 0, 0, 0], 2: [[2], [0], 1, 0, 0, 0], 3: [[3], [0], 1, 0, 0, 0], 4: [[4], [0], 1, 0, 0, 0], 5: [[5], [0], 1, 0, 0, 0]}[N])
check('4', solve([[N,N+1,N+2,N+3],1,4,2,7]), {1: [[2, 4], [1, 3], 2, 7, 1, 3], 2: [[3, 5], [1, 3], 2, 7, 1, 3], 3: [[4, 6], [1, 3], 2, 7, 1, 3], 4: [[5, 7], [1, 3], 2, 7, 1, 3], 5: [[6, 8], [1, 3], 2, 7, 1, 3]}[N])
check('5', solve([[N,N+1,N+2,N+3],3,0,-1,1]), {1: [[4, 3, 2], [3, 2, 1], 3, 1, 3, 1], 2: [[5, 4, 3], [3, 2, 1], 3, 1, 3, 1], 3: [[6, 5, 4], [3, 2, 1], 3, 1, 3, 1], 4: [[7, 6, 5], [3, 2, 1], 3, 1, 3, 1], 5: [[8, 7, 6], [3, 2, 1], 3, 1, 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 fixtureActualExpectedOutcome
0[[1, 3, 5], [0, 2, 4], 5, 4, 0, 4][[1, 3, 5], [0, 2, 4], 3, 4, 0, 4]Failed
1[[5, 3, 1], [4, 2, 0], 5, 3, 4, 0][[5, 3, 1], [4, 2, 0], 3, 3, 4, 0]Failed
2[[], [], 0, 2, None, None][[], [], 0, 2, None, None]Passed
3[[1], [0], 1, 0, 0, 0][[1], [0], 1, 0, 0, 0]Passed
4[[2, 4], [1, 3], 3, 7, 1, 3][[2, 4], [1, 3], 2, 7, 1, 3]Failed
5[[4, 3, 2], [3, 2, 1], 3, 1, 3, 1][[4, 3, 2], [3, 2, 1], 3, 1, 3, 1]Passed

SHA-256 / 48f348f9715ca025169cb42dafb68bc338b5c319726e0eea020bcd0776d743b8

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,step,epoch=x
    indices=list(range(start,stop,step))
    values=[a[i] for i in indices]
    length=len(indices) if not indices else abs(stop-start)
    version=epoch
    first=indices[0] if indices else None
    last=indices[-1] if indices else None
    return [values,indices,length,version,first,last]
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],0,5,2,4]), {1: [[1, 3, 5], [0, 2, 4], 3, 4, 0, 4], 2: [[2, 4, 6], [0, 2, 4], 3, 4, 0, 4], 3: [[3, 5, 7], [0, 2, 4], 3, 4, 0, 4], 4: [[4, 6, 8], [0, 2, 4], 3, 4, 0, 4], 5: [[5, 7, 9], [0, 2, 4], 3, 4, 0, 4]}[N])
check('1', solve([[N,N+1,N+2,N+3,N+4],4,-1,-2,3]), {1: [[5, 3, 1], [4, 2, 0], 3, 3, 4, 0], 2: [[6, 4, 2], [4, 2, 0], 3, 3, 4, 0], 3: [[7, 5, 3], [4, 2, 0], 3, 3, 4, 0], 4: [[8, 6, 4], [4, 2, 0], 3, 3, 4, 0], 5: [[9, 7, 5], [4, 2, 0], 3, 3, 4, 0]}[N])
check('2', solve([[N,N+1,N+2],1,1,1,2]), {1: [[], [], 0, 2, None, None], 2: [[], [], 0, 2, None, None], 3: [[], [], 0, 2, None, None], 4: [[], [], 0, 2, None, None], 5: [[], [], 0, 2, None, None]}[N])
check('3', solve([[N],0,1,1,0]), {1: [[1], [0], 1, 0, 0, 0], 2: [[2], [0], 1, 0, 0, 0], 3: [[3], [0], 1, 0, 0, 0], 4: [[4], [0], 1, 0, 0, 0], 5: [[5], [0], 1, 0, 0, 0]}[N])
check('4', solve([[N,N+1,N+2,N+3],1,4,2,7]), {1: [[2, 4], [1, 3], 2, 7, 1, 3], 2: [[3, 5], [1, 3], 2, 7, 1, 3], 3: [[4, 6], [1, 3], 2, 7, 1, 3], 4: [[5, 7], [1, 3], 2, 7, 1, 3], 5: [[6, 8], [1, 3], 2, 7, 1, 3]}[N])
check('5', solve([[N,N+1,N+2,N+3],3,0,-1,1]), {1: [[4, 3, 2], [3, 2, 1], 3, 1, 3, 1], 2: [[5, 4, 3], [3, 2, 1], 3, 1, 3, 1], 3: [[6, 5, 4], [3, 2, 1], 3, 1, 3, 1], 4: [[7, 6, 5], [3, 2, 1], 3, 1, 3, 1], 5: [[8, 7, 6], [3, 2, 1], 3, 1, 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 fixtureActualExpectedOutcome
0[[1, 3, 5], [0, 2, 4], 5, 4, 0, 4][[1, 3, 5], [0, 2, 4], 3, 4, 0, 4]Failed
1[[5, 3, 1], [4, 2, 0], 5, 3, 4, 0][[5, 3, 1], [4, 2, 0], 3, 3, 4, 0]Failed
2[[], [], 0, 2, None, None][[], [], 0, 2, None, None]Passed
3[[1], [0], 1, 0, 0, 0][[1], [0], 1, 0, 0, 0]Passed
4[[2, 4], [1, 3], 3, 7, 1, 3][[2, 4], [1, 3], 2, 7, 1, 3]Failed
5[[4, 3, 2], [3, 2, 1], 3, 1, 3, 1][[4, 3, 2], [3, 2, 1], 3, 1, 3, 1]Passed

SHA-256 / f3446cbb43671a49b84717c5cc8cf5ec4224976569841ca0a1f16474c0266486

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,step,epoch=x
    indices=list(range(start,stop,step))
    values=[a[i] for i in indices]
    length=len(indices)
    version=epoch
    first=indices[0] if indices else None
    last=indices[-1] if indices else None
    return [values,indices,length,version,first,last]
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],0,5,2,4]), {1: [[1, 3, 5], [0, 2, 4], 3, 4, 0, 4], 2: [[2, 4, 6], [0, 2, 4], 3, 4, 0, 4], 3: [[3, 5, 7], [0, 2, 4], 3, 4, 0, 4], 4: [[4, 6, 8], [0, 2, 4], 3, 4, 0, 4], 5: [[5, 7, 9], [0, 2, 4], 3, 4, 0, 4]}[N])
check('1', solve([[N,N+1,N+2,N+3,N+4],4,-1,-2,3]), {1: [[5, 3, 1], [4, 2, 0], 3, 3, 4, 0], 2: [[6, 4, 2], [4, 2, 0], 3, 3, 4, 0], 3: [[7, 5, 3], [4, 2, 0], 3, 3, 4, 0], 4: [[8, 6, 4], [4, 2, 0], 3, 3, 4, 0], 5: [[9, 7, 5], [4, 2, 0], 3, 3, 4, 0]}[N])
check('2', solve([[N,N+1,N+2],1,1,1,2]), {1: [[], [], 0, 2, None, None], 2: [[], [], 0, 2, None, None], 3: [[], [], 0, 2, None, None], 4: [[], [], 0, 2, None, None], 5: [[], [], 0, 2, None, None]}[N])
check('3', solve([[N],0,1,1,0]), {1: [[1], [0], 1, 0, 0, 0], 2: [[2], [0], 1, 0, 0, 0], 3: [[3], [0], 1, 0, 0, 0], 4: [[4], [0], 1, 0, 0, 0], 5: [[5], [0], 1, 0, 0, 0]}[N])
check('4', solve([[N,N+1,N+2,N+3],1,4,2,7]), {1: [[2, 4], [1, 3], 2, 7, 1, 3], 2: [[3, 5], [1, 3], 2, 7, 1, 3], 3: [[4, 6], [1, 3], 2, 7, 1, 3], 4: [[5, 7], [1, 3], 2, 7, 1, 3], 5: [[6, 8], [1, 3], 2, 7, 1, 3]}[N])
check('5', solve([[N,N+1,N+2,N+3],3,0,-1,1]), {1: [[4, 3, 2], [3, 2, 1], 3, 1, 3, 1], 2: [[5, 4, 3], [3, 2, 1], 3, 1, 3, 1], 3: [[6, 5, 4], [3, 2, 1], 3, 1, 3, 1], 4: [[7, 6, 5], [3, 2, 1], 3, 1, 3, 1], 5: [[8, 7, 6], [3, 2, 1], 3, 1, 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 fixtureActualExpectedOutcome
0[[1, 3, 5], [0, 2, 4], 3, 4, 0, 4][[1, 3, 5], [0, 2, 4], 3, 4, 0, 4]Passed
1[[5, 3, 1], [4, 2, 0], 3, 3, 4, 0][[5, 3, 1], [4, 2, 0], 3, 3, 4, 0]Passed
2[[], [], 0, 2, None, None][[], [], 0, 2, None, None]Passed
3[[1], [0], 1, 0, 0, 0][[1], [0], 1, 0, 0, 0]Passed
4[[2, 4], [1, 3], 2, 7, 1, 3][[2, 4], [1, 3], 2, 7, 1, 3]Passed
5[[4, 3, 2], [3, 2, 1], 3, 1, 3, 1][[4, 3, 2], [3, 2, 1], 3, 1, 3, 1]Passed

SHA-256 / 024a162e41d572a256d0e395aa985a068579d6c95912c79b542587fa6136ef5c

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

Case digest / 6c130517f3799ba4074b3eff7677110ee501ac770576fa22ae8d2d7f07eca38f