FA-4766 / Bounded deques / Open access
Bounded deque appendleft evicts right · case 01
The operation returns a result or retained state that violates this contract: Prepend to a bounded deque and evict from the right on overflow.
ROOT CAUSE
Appending at the opposite end reverses both insertion and eviction policy.
THE FAILURE
Appending at the opposite end reverses both insertion and eviction policy.
Unsuccessful approach: Keeping the suffix evicts the newly prepended side.
Case contract
Prepend to a bounded deque and evict from the right on overflow. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.
Why this case matters
A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
a=deque(x,maxlen=y[0]); a.append(y[1]); return list(a)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('full evicts right', solve(['a', 'b'], [2, 'c']), ['c', 'a'])
check('zero capacity', solve([], [0, 'a']), [])
check('room remains', solve(['a'], [3, 'b']), ['b', 'a'])
check('empty accepts', solve([], [2, 'a']), ['a'])
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 |
|---|---|---|---|
| full evicts right | ['b', 'c'] | ['c', 'a'] | Failed |
| zero capacity | [] | [] | Passed |
| room remains | ['a', 'b'] | ['b', 'a'] | Failed |
| empty accepts | ['a'] | ['a'] | Passed |
SHA-256 / 0c628576a54fed92cf39e9d3b6dbe6ebe42d2441c9ac0cfcb80d672de376af1f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
return ([y[1]]+list(x))[-y[0]:] if y[0] else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('full evicts right', solve(['a', 'b'], [2, 'c']), ['c', 'a'])
check('zero capacity', solve([], [0, 'a']), [])
check('room remains', solve(['a'], [3, 'b']), ['b', 'a'])
check('empty accepts', solve([], [2, 'a']), ['a'])
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 |
|---|---|---|---|
| full evicts right | ['a', 'b'] | ['c', 'a'] | Failed |
| zero capacity | [] | [] | Passed |
| room remains | ['b', 'a'] | ['b', 'a'] | Passed |
| empty accepts | ['a'] | ['a'] | Passed |
SHA-256 / c357f5de3582a155f5391559d3572e9e06f416f5ae8a5c9c84da18be65f9cc3b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 4 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
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:37:42.683713+00:00.
Case digest / 7f99fda26c9c4f36f0fd67d0e6db51520b7cf7c2099b7310280b053c724401c3