FAILURE MAP
← Case archive

FA-98561 / KV cache position mapping / Open access

Paged cache resolves through the sequence block table · case 01

A logical page is represented by its local offset instead of the physical slot in that page.

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

ROOT CAUSE

The lookup computes a page-local offset but returns it without resolving the logical page through the block table.

THE FAILURE

The lookup computes a page-local offset but returns it without resolving the logical page through the block table.

Unsuccessful approach: The first table entry works, but using only the page offset loses the selected block.

Case contract

block_table maps logical page number to physical block base. Return base + (position modulo page_size). Missing page returns -1.

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(block_table, position, page_size):
    return position%page_size if position//page_size in block_table else -1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
table={0:12,1:28,5:40}
check('second page offset',solve(table,5,4),29)
check('page zero',solve(table,3,4),15)
check('missing page',solve(table,8,4),-1)
check('mapped later page',solve(table,22,4),42)
check('boundary next page',solve(table,4,4),28)
check('empty table',solve({},0,4),-1)
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
second page offset129Failed
page zero315Failed
missing page-1-1Passed
mapped later page242Failed
boundary next page028Failed
empty table-1-1Passed

SHA-256 / 1b1f4908f7a79d4b00d563eeafcff621c6c80508f8e70750c4412d5f301608b2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(block_table, position, page_size):
    return block_table.get(position//page_size,-1) + position if position//page_size in block_table else -1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
table={0:12,1:28,5:40}
check('second page offset',solve(table,5,4),29)
check('page zero',solve(table,3,4),15)
check('missing page',solve(table,8,4),-1)
check('mapped later page',solve(table,22,4),42)
check('boundary next page',solve(table,4,4),28)
check('empty table',solve({},0,4),-1)
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
second page offset3329Failed
page zero1515Passed
missing page-1-1Passed
mapped later page6242Failed
boundary next page3228Failed
empty table-1-1Passed

SHA-256 / 044e41b02620a171463e839d140cfd6b44db428f83185a755558802017691d4a

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

Case digest / 847d1f0cacb978035a44eb811b4ab5599cd06534098dfff8a6592ec6a718e77c