FAILURE MAP
← Case archive

FA-98621 / KV cache position mapping / Open access

Cache trimming includes the exclusive end position · case 01

The first position beyond the requested half-open span remains in the cache.

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

ROOT CAUSE

The trimming predicate includes the end position even though the span is half-open.

THE FAILURE

The trimming predicate includes the end position even though the span is half-open.

Unsuccessful approach: Making the end exclusive still drops the required entry at the inclusive start.

Case contract

Return ordered (position,value) entries in the half-open logical span [start,end).

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, start, end):
    return [(p,v) for p,v in entries if start<=p<=end]
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+4)]
check('middle span',solve(entries,N,N+3),[(N,str(N)),(N+1,str(N+1)),(N+2,str(N+2))])
check('empty span',solve(entries,N,N),[])
check('single position',solve(entries,N,N+1),[(N,str(N))])
check('before all entries',solve(entries,N+9,N+10),[])
check('from zero',solve(entries,0,2),[(0,'0'),(1,'1')])
check('input order kept',solve([(2,'b'),(1,'a')],1,3),[(2,'b'),(1,'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
middle span[[1, '1'], [2, '2'], [3, '3'], [4, '4']][[1, '1'], [2, '2'], [3, '3']]Failed
empty span[[1, '1']][]Failed
single position[[1, '1'], [2, '2']][[1, '1']]Failed
before all entries[][]Passed
from zero[[0, '0'], [1, '1'], [2, '2']][[0, '0'], [1, '1']]Failed
input order kept[[2, 'b'], [1, 'a']][[2, 'b'], [1, 'a']]Passed

SHA-256 / c3f0ac90ea4021430403c1e8097d2a7347f933c00962e86f348b46ac4ca384ae

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(entries, start, end):
    return [(p,v) for p,v in entries if start<p<end]
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+4)]
check('middle span',solve(entries,N,N+3),[(N,str(N)),(N+1,str(N+1)),(N+2,str(N+2))])
check('empty span',solve(entries,N,N),[])
check('single position',solve(entries,N,N+1),[(N,str(N))])
check('before all entries',solve(entries,N+9,N+10),[])
check('from zero',solve(entries,0,2),[(0,'0'),(1,'1')])
check('input order kept',solve([(2,'b'),(1,'a')],1,3),[(2,'b'),(1,'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
middle span[[2, '2'], [3, '3']][[1, '1'], [2, '2'], [3, '3']]Failed
empty span[][]Passed
single position[][[1, '1']]Failed
before all entries[][]Passed
from zero[[1, '1']][[0, '0'], [1, '1']]Failed
input order kept[[2, 'b']][[2, 'b'], [1, 'a']]Failed

SHA-256 / 21db05d3a601deb155c8025be8a7c4f97fa0ec83b89d479cad69e30c1eaec7e8

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

Case digest / 547ec490bd4cb6761ae498f39c8ee24bac7062648d4d146e5cd10f4e157e46e2