FAILURE MAP
← Case archive

FA-98586 / KV cache position mapping / Open access

Sliding eviction retains one stale position · case 01

A key just outside the trailing window remains in the cache.

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

ROOT CAUSE

The cutoff is set to current_position - window and that boundary is included.

THE FAILURE

The cutoff is set to current_position - window and that boundary is included.

Unsuccessful approach: Using a strict comparison against current_position - window + 1 drops the oldest visible token.

Case contract

Filter (position,value) entries to the inclusive trailing window ending at current_position. Window is positive.

Why this case matters

A small in-memory model makes the cache address contract explicit for a serving component.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(entries, current_position, window):
    return [(p,v) for p,v in entries if current_position-window <= p <= current_position]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
entries=[(p,str(p)) for p in range(N+5)]
check('inclusive lower edge',solve(entries,N+3,3),[(N+1,str(N+1)),(N+2,str(N+2)),(N+3,str(N+3))])
check('window one',solve(entries,N,1),[(N,str(N))])
check('future ignored',solve([(N+1,'future'),(N,'now')],N,2),[(N,'now')])
check('older ignored',solve([(0,'old'),(N+2,'new')],N+2,1),[(N+2,'new')])
check('empty',solve([],N,4),[])
check('out of order input',solve([(N+1,'b'),(N,'a')],N+1,2),[(N+1,'b'),(N,'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 fixtureActualExpectedOutcome
inclusive lower edge[[1, '1'], [2, '2'], [3, '3'], [4, '4']][[2, '2'], [3, '3'], [4, '4']]Failed
window one[[0, '0'], [1, '1']][[1, '1']]Failed
future ignored[[1, 'now']][[1, 'now']]Passed
older ignored[[3, 'new']][[3, 'new']]Passed
empty[][]Passed
out of order input[[2, 'b'], [1, 'a']][[2, 'b'], [1, 'a']]Passed

SHA-256 / 81c3c6d384ba5b00ae8e5b3740044fab89b9faede31f99b2be49bfec4839b067

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(entries, current_position, window):
    return [(p,v) for p,v in entries if current_position-window+1 < p <= current_position]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
entries=[(p,str(p)) for p in range(N+5)]
check('inclusive lower edge',solve(entries,N+3,3),[(N+1,str(N+1)),(N+2,str(N+2)),(N+3,str(N+3))])
check('window one',solve(entries,N,1),[(N,str(N))])
check('future ignored',solve([(N+1,'future'),(N,'now')],N,2),[(N,'now')])
check('older ignored',solve([(0,'old'),(N+2,'new')],N+2,1),[(N+2,'new')])
check('empty',solve([],N,4),[])
check('out of order input',solve([(N+1,'b'),(N,'a')],N+1,2),[(N+1,'b'),(N,'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 fixtureActualExpectedOutcome
inclusive lower edge[[3, '3'], [4, '4']][[2, '2'], [3, '3'], [4, '4']]Failed
window one[][[1, '1']]Failed
future ignored[[1, 'now']][[1, 'now']]Passed
older ignored[][[3, 'new']]Failed
empty[][]Passed
out of order input[[2, 'b']][[2, 'b'], [1, 'a']]Failed

SHA-256 / f671702aa19f39652d5de81a86cf2017e185acc915cc9f04fc6004fdcb3ef454

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

These toy integer maps omit tensor layout, concurrency, device memory, and model-specific cache formats. 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-30T16:48:14.544827+00:00.

Case digest / ebe6bf22bcaae05fe8cb84b8135405f48b5409e411d51166cf65a82ba0bca47c