FAILURE MAP
← Case archive

FA-98176 / Attention mask construction / Open access

Cached rectangular attention uses local instead of absolute positions · case 01

Cached rectangular attention uses local instead of absolute positions.

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

ROOT CAUSE

The query row index is compared directly to key positions.

THE FAILURE

The query row index is compared directly to key positions.

Unsuccessful approach: Shifting by the whole key length works only when the cache is full.

Case contract

Queries occupy absolute positions [query_start, query_start+Q); keys are absolute [0,K).

Why this case matters

A small explicit visibility matrix makes sequence-attention boundary behavior reviewable.

1 / The failure

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

N = 1
observations = []
def solve(key_count, query_count, query_start):
    return [[j<=i for j in range(key_count)] for i in range(query_count)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('partial cache offset',solve(N+3,2,N),[[j<=N+i for j in range(N+3)] for i in range(2)])
check('zero offset',solve(3,2,0),[[j<=i for j in range(3)] for i in range(2)])
check('empty queries',solve(3,0,2),[])
check('empty keys',solve(0,2,0),[[],[]])
check('one query',solve(4,1,2),[[True,True,True,False]])
check('last cached query',solve(5,2,3)[1],[True,True,True,True,True])
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
partial cache offset[[True, False, False, False], [True, True, False, False]][[True, True, False, False], [True, True, True, False]]Failed
zero offset[[True, False, False], [True, True, False]][[True, False, False], [True, True, False]]Passed
empty queries[][]Passed
empty keys[[], []][[], []]Passed
one query[[True, False, False, False]][[True, True, True, False]]Failed
last cached query[True, True, False, False, False][True, True, True, True, True]Failed

SHA-256 / 1424425697c7c5b15cf7e04c0820f2f7800fb4ba3e81fb62c0d44fb9191976f3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(key_count, query_count, query_start):
    return [[j<=key_count-query_count+i for j in range(key_count)] for i in range(query_count)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('partial cache offset',solve(N+3,2,N),[[j<=N+i for j in range(N+3)] for i in range(2)])
check('zero offset',solve(3,2,0),[[j<=i for j in range(3)] for i in range(2)])
check('empty queries',solve(3,0,2),[])
check('empty keys',solve(0,2,0),[[],[]])
check('one query',solve(4,1,2),[[True,True,True,False]])
check('last cached query',solve(5,2,3)[1],[True,True,True,True,True])
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
partial cache offset[[True, True, True, False], [True, True, True, True]][[True, True, False, False], [True, True, True, False]]Failed
zero offset[[True, True, False], [True, True, True]][[True, False, False], [True, True, False]]Failed
empty queries[][]Passed
empty keys[[], []][[], []]Passed
one query[[True, True, True, True]][[True, True, True, False]]Failed
last cached query[True, True, True, True, True][True, True, True, True, True]Passed

SHA-256 / 8cb640083acb71fe27dadd6fac3a36cb1cd1073c175fc6f0af2a135f58b802e1

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 are toy Boolean matrix contracts; they do not define a production model architecture or tensor library behavior. 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:10.193787+00:00.

Case digest / e7a3a0b086b340eff50da25cbea6e8521abf73f5cc230652df3851c58c26d942