FAILURE MAP
← Case archive

FA-98551 / KV cache position mapping / Open access

Ring slots are read in logical order · case 01

Physical slot order is returned as if it were chronological order.

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

ROOT CAUSE

The ring start pointer is ignored when reading wrapped contents.

THE FAILURE

The ring start pointer is ignored when reading wrapped contents.

Unsuccessful approach: Sorting physical slot numbers preserves a deterministic result but reverses wrapped history.

Case contract

Given slot values, oldest_slot, and count, return values for count consecutive occupied slots starting at oldest_slot with wraparound. count is between zero and capacity.

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(slots, oldest_slot, count):
    return [slots[i] for i in range(count)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('wrapped sequence',solve(['a','b','c','d'],3,3),['d','a','b'])
check('unwrapped',solve(['a','b','c'],1,2),['b','c'])
check('all slots',solve([0,1,2,3],2,4),[2,3,0,1])
check('empty read',solve(['x','y'],1,0),[])
check('single slot',solve([N],0,1),[N])
check('wrap twice',solve([4,5,6],2,3),[6,4,5])
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
wrapped sequence['a', 'b', 'c']['d', 'a', 'b']Failed
unwrapped['a', 'b']['b', 'c']Failed
all slots[0, 1, 2, 3][2, 3, 0, 1]Failed
empty read[][]Passed
single slot[1][1]Passed
wrap twice[4, 5, 6][6, 4, 5]Failed

SHA-256 / bb7c3f9fafb4b3afd3dd4eb6b9631d63bbc33bec80bcf57ee842ff577dd028d2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(slots, oldest_slot, count):
    return [slots[i] for i in sorted((oldest_slot+j)%len(slots) for j in range(count))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('wrapped sequence',solve(['a','b','c','d'],3,3),['d','a','b'])
check('unwrapped',solve(['a','b','c'],1,2),['b','c'])
check('all slots',solve([0,1,2,3],2,4),[2,3,0,1])
check('empty read',solve(['x','y'],1,0),[])
check('single slot',solve([N],0,1),[N])
check('wrap twice',solve([4,5,6],2,3),[6,4,5])
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
wrapped sequence['a', 'b', 'd']['d', 'a', 'b']Failed
unwrapped['b', 'c']['b', 'c']Passed
all slots[0, 1, 2, 3][2, 3, 0, 1]Failed
empty read[][]Passed
single slot[1][1]Passed
wrap twice[4, 5, 6][6, 4, 5]Failed

SHA-256 / 5c60a7d56fbe770d04eac7fd8ef4b40ae918c33bd8ac41649377bae95b9b6ad8

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

Case digest / 0cc5c0eab6d55bbc99a9cfbe1a9cc199651cf3b80550f73e44bbbb4c65760644