FA-10391 / Caching / Open access
Shrinking cache capacity evicts only one excess entry · case 01
Shrinking cache capacity evicts only one excess entry.
ROOT CAUSE
A capacity reduction is handled as a single insertion overflow.
VERIFIED REPAIR
Preserve the cache-state invariant: Capacity is a nonnegative integer. Retain at most capacity keys from the most-recent end of the ordered cache.
Unsuccessful approach: Keeping the prefix retains the least recent entries instead of the most recent.
Case contract
Capacity is a nonnegative integer. Retain at most capacity keys from the most-recent end of the ordered cache.
Why this case matters
A deterministic cache state transformation. Inputs are copied or treated as immutable; no remote storage, real clock, or concurrent interleaving is simulated.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(order, capacity):
return order[1:] if len(order)>capacity else list(order)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(['a', 'b', 'c', 'd'], 1)), ['d'])
check('fixture 2', solve(*(['a', 'b', 'c'], 2)), ['b', 'c'])
check('fixture 3', solve(*(['a'], 0)), [])
check('fixture 4', solve(*(['a', 'b'], 5)), ['a', 'b'])
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 |
|---|---|---|---|
| fixture 1 | ['b', 'c', 'd'] | ['d'] | Failed |
| fixture 2 | ['b', 'c'] | ['b', 'c'] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | ['a', 'b'] | ['a', 'b'] | Passed |
SHA-256 / 06b7b2d4a169450c91fe42217b0bb2e4096e6c8362beaab6b19f5a1748d9e724
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(order, capacity):
return list(order[:capacity])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(['a', 'b', 'c', 'd'], 1)), ['d'])
check('fixture 2', solve(*(['a', 'b', 'c'], 2)), ['b', 'c'])
check('fixture 3', solve(*(['a'], 0)), [])
check('fixture 4', solve(*(['a', 'b'], 5)), ['a', 'b'])
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 |
|---|---|---|---|
| fixture 1 | ['a'] | ['d'] | Failed |
| fixture 2 | ['a', 'b'] | ['b', 'c'] | Failed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | ['a', 'b'] | ['a', 'b'] | Passed |
SHA-256 / c7c5767f091c465e688a9b93bd9242e55f5fc99fe51946c83599b12bd05c1ae2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(order, capacity):
return list(order[-capacity:]) if capacity else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(['a', 'b', 'c', 'd'], 1)), ['d'])
check('fixture 2', solve(*(['a', 'b', 'c'], 2)), ['b', 'c'])
check('fixture 3', solve(*(['a'], 0)), [])
check('fixture 4', solve(*(['a', 'b'], 5)), ['a', 'b'])
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 |
|---|---|---|---|
| fixture 1 | ['d'] | ['d'] | Passed |
| fixture 2 | ['b', 'c'] | ['b', 'c'] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | ['a', 'b'] | ['a', 'b'] | Passed |
SHA-256 / d7eb55881303d126512ec8bb6a1f1f5bf21eb65150114b2ccf8e5d6f0e630274
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:38:38.632910+00:00.
Case digest / d66b4b857cf8be554345ef9ae16ebe3b6e21ff098e894b0a085741a1a02efb81