Skip to content

fix(KERNEL-ATTN-DENSE-FLASH): a model on the naive attention kernel now says why, and AttentionDenseFlash advertises the head_dim it can launch (#1544) - #1578

Merged
localai-bot merged 20 commits into
mainfrom
row/KERNEL-ATTN-DENSE-FLASH
Aug 22, 2026
Merged

fix(KERNEL-ATTN-DENSE-FLASH): a model on the naive attention kernel now says why, and AttentionDenseFlash advertises the head_dim it can launch (#1544)#1578
localai-bot merged 20 commits into
mainfrom
row/KERNEL-ATTN-DENSE-FLASH

Conversation

@localai-bot

@localai-bot localai-bot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Two additive changes from #1544's ## Owed. Neither moves a single existing
caller's numerics, and that constraint shaped the whole design.

The naive rung stops being a silent default

vt::Attention resolves OpId::kAttention straight to the correctness-grade
kernel, and nothing in the tree ever routes it up: the rung is whichever C++
function name the author typed. That is deliberate for six of the nine call
sites, and invisible to everyone else, which is how one LTX-2.5 DiT forward came
to cost 47.84 s. A token gate cannot see the difference by construction — every
rung is bit-identical or inside the bf16 envelope, so the goldens pass either
way.

A selector that auto-routes was rejected, and not on taste. Three of the six
sites are reference arms a gate compares against (nemotron_h.cpp,
nemotron_h_device.cpp, qwen3_5.cpp), two are the VT_*_EAGER rungs of a
same-binary A/B (whisper_audio.cpp, qwen3_vl_vision.cpp), and one is a
measured-negative device path behind VT_KIMI_DEVICE_MLA. Rerouting any of them
changes what the reference computes, which deletes the comparison the gate
performs rather than fixing anything — the "widen the assertion until the gate
passes" failure AGENTS.md names. kAttention and vt::Attention are untouched
here.

scripts/check-attention-rung-consistency.py requires the CHOICE to be recorded
instead: a // VT-ATTN-NAIVE: reason on the call line or within 20 lines above
it. The six deliberate sites now carry one, and an author who never heard of the
fast rungs gets a red instead of a silent 500x. The scan runs over
checker_text.normalize_source, so a commented-out, #if 0-ed or
if (false)-ed call is a deletion to it exactly as it is to nvcc, and the
reported file:line still describes the original file.

The record is per-site and in-file, so an ordinary change writes no shared
record at all. scripts/attention-rung-allowlist.txt holds only the three stems
whose naive call another row is currently deleting — muse_glimmer_vision
(#1545) and the two LTX-2.5 files — because editing the very lines those changes
replace would conflict for no gain. A stale entry there is reported and is not
fatal, so the removing row owes this file nothing.

AttentionDenseFlash advertises the head_dim it can launch

It claimed head_dim <= 256 while asking the driver for
2*kFlashBc*d*sizeof(Tin) bytes of dynamic shared memory, with no
cudaFuncSetAttribute anywhere in src/vt/cuda/. The default 48 KiB cap made
the real ceiling 192 in bf16 and 96 in f32, so Kimi at 192 f32 or Qwen3.5 at 256
would have received a bare launch error from the cudaGetLastError at the
bottom of the launcher, naming nothing they could do instead.

The bound now lives in include/vt/ops.h as AttentionDenseFlashSmemBytes and
AttentionDenseFlashMaxHeadDim — pure host arithmetic, so a box with no GPU can
execute it — tied to the kernel by two static_asserts on the tile width and
the register blocking. The launcher refuses above it naming
vt::AttentionDenseFast, which uses no shared memory and does serve those
widths.

Narrowing beats opting in to a larger cap here, and that is now a measurement
rather than a preference. GB10's queried opt-in ceiling is 101,376 bytes
(measured during #1557's review), while head_dim 256 in f32 wants 131,072. So
cudaFuncSetAttribute cannot make the widest advertised width true on the part
this project gates on — the raise buys nothing at the width that motivated it,
and a caller there would have gone on falling back silently without ever
launching. The bound is INCLUSIVE, which matters in one direction: head_dim 192
in bf16 lands exactly on 49152 and launches today, so an exclusive bound would
refuse work that currently runs. Opting in stays available later as a widening
for bf16 above 192, owned by nobody today.

This mirrors vLLM's own polarity rather than inventing one:
vllm/model_executor/models/vision.py:99 selects an encoder backend by shape,
and vllm/v1/attention/backend.py:155-163 consults supports_head_size BEFORE
dispatch instead of discovering the domain by launching. Both read at the pinned
oracle 555967922.

Evidence

RED first, on the unmodified tree: the checker reported all six deliberate sites
at the exact lines #1544 names (kimi_linear_device.cpp:598,
nemotron_h.cpp:671, nemotron_h_device.cpp:330, qwen3_5.cpp:5279,
qwen3_vl_vision.cpp:527, whisper_audio.cpp:324) and correctly excluded the
three allowlisted ones. GREEN after the markers: 9 sites, 6 marked, 3
allowlisted.

tests/scripts/test_check_attention_rung_consistency.py 34/34, including six
mutations that must go RED — a new unmarked model, a new unmarked call in a
HEADER, a deleted marker, a second unmarked call inside an already-marked file, a
stub reason, and a widened regex that would swallow the fast rungs. It also pins
that the scanned population is not empty, which is the guard against the way a
structural checker usually goes green: by matching nothing at all, and that every
allowlisted stem names a model source that exists, which is what catches a typo.

tests/vt/test_ops_attention.cpp gains the head_dim contract cases: the tile
arithmetic at both element sizes, both honest bounds, that 256 is outside both,
and the inclusive edge in both directions. 11 cases / 39 assertions, SUCCESS.

MUTATED, because a green suite over new arithmetic proves only that the
arithmetic agrees with itself. Making AttentionDenseFlashMaxHeadDim return
kAttentionDenseMaxHeadDim — the exact contract this change repairs — turns the
new case RED on 6 of its assertions, each printing the wrong value it now
carries (256 == 192, 256 == 96, 65536 <= 49152, 131072 <= 49152), so the
mutation demonstrably applied and demonstrably compiled. include/vt/ops.h
restored and verified by sha256 against its pre-mutation snapshot; rebuilt; 39/39
green again.

Proof that no caller's numerics moved: the checker executes no model code; the
head_dim guard fires only where the launch already failed; no marker changes a
statement; and git diff touches no kernel arithmetic, no dtype and no default.

What the fresh review changed

Six findings, repaired here. None of them moves a kernel's arithmetic either.

pr-size was RED, and this branch caused it. A checker created inside the range
has no BASE version for the red-before half of the evidence run, so it has to
register the disabled stub its own suite must reject; about twenty checkers do,
and this one did not, so the gate could not classify the change at all. Measured
rather than asserted: under the stub every case goes red — re-measured after the
repairs below, FAILED (errors=34) — because the suite loads the checker as a
module and every case calls into it. agent-preflight.sh does
not run check-pr-size, which is why a local green said nothing about it.

The second static_assert beside the kernel was a tautology. It read
8 * 32 == kAttentionDenseMaxHeadDim while the real kMaxPerLane was a
function-local constexpr inside the kernel body, invisible at file scope, so
setting that local to 4 — precisely the drift the message claims to catch — left
the assert reading 256 == 256. The register blocking is now kFlashMaxPerLane
at file scope; the kernel's register arrays and unrolled loops read it, and so
does the assert. The same mutation now reads 128 == 256 and fails to compile.
There is no nvcc on this box, so the tie was measured by extracting that constant
block from cuda_ops.cu VERBATIM and compiling it against the shipped
include/vt/ops.h under g++ -fsyntax-only: clean before, static assertion failed after, cuda_ops.cu restored and verified by sha256. The first assert
(kFlashBc == kAttentionDenseFlashTileCols) was already a real tie and is
untouched.

Two comments claimed more than the code delivers. The launcher said its guard and
its shared-memory request came from "the SAME function … cannot disagree"; they
are two functions, and AttentionDenseFlashMaxHeadDim re-derives the division
instead of inverting AttentionDenseFlashSmemBytes. The guarantee holds and is
tested: mutating the 2 * in SmemBytes to 3 * reds 9 assertions of the
shipped contract case, both inclusive-edge checks among them, while
MaxHeadDim(2) == 192 stays green — which is the re-derivation made visible. The
comment now describes that. The AttentionDenseFa2 fall-through comment promised
"the best available kernel for their shape rather than a hard refusal", which
stopped being true for an over-cap head_dim the moment this branch added the
refusal; it now names the domain and records that every caller today is far
inside it (max head_dim 80).

The checker claimed "the population is what makes a green meaningful" and named
no limits. Four spellings reach the same kernel undetected — a using
declaration, a namespace alias, a #define, and a call through &vt::Attention
— each verified during review to leave the checker green with a live unmarked
call. None exists in this tree, and widening the regex would make every fast rung
a site, which is D1's rejected failure mode again; closing it needs a
compiler-side population, not a longer pattern. The docstring and spec D6 state
the bound, so a green reads as "no unmarked vt::Attention( call" and never as
"no model is naive".

The OK line reported total and marked sites but never the number a reader needs:
sites carrying no reason that pass only because their stem is allowlisted. It is
not sites - marked, since a marked call inside an allowlisted file counts in
marked. Two cases now pin the line; dropping the count from it reds them.

Two records were wrong. scripts/attention-rung-allowlist.txt told a removing row
to delete its stem without saying that test_allowlist_holds_only_the_in_flight_stems
pins the set in another file and reds on the deletion; the allowlist header, the
checker docstring and spec D7 now say so. The kernel-matrix cell stored this
suite's case count — a measurement of one file inside another, which AGENTS.md
names as a drift lock — so the count is gone rather than corrected.

Two drift locks in the new suite, both repaired here

Found while landing this change against #1579, by checking the interaction
instead of assuming the two pull requests were independent. Each was green on its
own; main went red only once both landed, which is why nothing on either branch
caught it.

The first was the population floor. test_the_population_is_not_empty
asserted the scanned population was >= 9 against a tree of EXACTLY 9 sites. Its
own name says "is not empty" and its assertion pinned a count: the name was right.
A raw total is a measurement of the model tree stored in a test file, which
AGENTS.md ## Records forbids, and it reds on any row that legitimately REMOVES a
naive call — every stem on scripts/attention-rung-allowlist.txt, which is to say
the rows that allowlist exists to unblock. It runs in the required agent-record
job, so #1545 alone would have turned main red.

The second was assertGreater(excused, 0) in
test_the_ok_line_reports_the_excused_sites. Same shape, one case down: excused
counts unmarked calls in allowlisted files, so it reaches 0 when the LAST stem is
cleaned up, redding the case while the checker is green at rc=0. It does not fire
for any of the three rows individually, so it would have sat latent until the
LTX-2.5 reroute tripped it.

Both are repaired here rather than deferred, because none of this has landed:
scripts/check-attention-rung-consistency.py, its allowlist and its suite are all
CREATED by this pull request, so correcting a defective assertion in them is
repairing the change, not amending a gate that ## Changing the rules or a checker governs.

The floor is now genuine non-emptiness (>= 1). One new case asserts every
allowlisted stem NAMES AN EXISTING model source — keyed on file existence and
deliberately never on scan membership, because a stem stops having a call site the
moment its removing row lands, which is the state the allowlist is built to
survive and which stale_allowlist_entries already promises in its own docstring
("Reported, never fatal"); asserting scan membership would have rebuilt the
identical lock one line over. The excused > 0 floor is gone, its shipped-tree
half kept because it RE-DERIVES the count instead of pinning it and so holds at 0
as well as at 3, and the coverage it was standing in for moved onto two cases
driven over a constructed scan and a temporary allowlist, which the model tree
cannot switch off.

RED first, each mutation proven applied and restored by sha256. Stubbing
scan_models to {} reds the floor at 0 not greater than or equal to 1, and
independently so does renaming the checker's regex. A typo'd muse_glimmer_vison
entry reds the new case naming that stem while the CHECKER stays green — which is
the point, since a bogus stem is reported only as STALE and never fails. For the
second lock the control is sharper: with the checker's excused count broken AND
the tree in its end state, the retained shipped-tree case goes GREEN over the
defective checker and only the constructed case catches it, so the replacement is
real coverage rather than a deletion in disguise.

Composed green, measured on this head with #1579's muse_glimmer_vision.cpp
copied in: with the allowlist stem left in place the suite is Ran 34 tests ... OK
and the checker prints STALE (not a failure) at rc=0, where before the repair it
read 8 not greater than or equal to 9. With the stem also deleted, only
test_allowlist_holds_only_the_in_flight_stems reds, which is the by-design pin
on the set, and updating that set in the same change returns it to green — so both
removal routes now have one.

A fresh review of the repair returned one finding, repaired here, and repairing
it turned up a second of the same kind. The new case's comment claimed it also
caught a checker printing sites - marked. It does not, and no constructed scan
could make it: main() reaches the OK line only when drift_sites is empty, and
then every unmarked site is excused, so the two quantities coincide identically —
1000 reachable green states enumerated, 0 where they differ. Substituting
sites - marked into the checker leaves all 34 cases green. Nearby,
test_the_excused_count_is_not_sites_minus_marked claimed that dropping the
allowlisted file's marked site made the two diverge; it does not, because that
lowers sites and marked together. Both comments now state what is actually
pinned and why the rest cannot be, which is the same "a comment claimed more than
the code delivers" class this branch already repaired twice. The fix is
comment-only, and that is proven rather than asserted: ast.dump is byte-identical
across the change, so no assertion, fixture or docstring moved.

Five rounds of comment repair were needed, because each of the first three
removed a false claim by writing a NEW causal explanation that the next fresh
review then measured false. From the third round on the rule was to DELETE rather
than re-explain, and to run every clause left standing. Comment lines go down, not
up. ast.dump is byte-identical across rounds three and four, so no assertion or
fixture moved; round five changes exactly one assertTrue MESSAGE string, with the
assertion condition's own ast.dump hash shown identical either side.

Two findings from those reviews were REFUTED by measurement rather than applied.
test_widening_the_regex_to_the_fast_rungs_is_visible was reported dead because it
survives a drift_sites break and a \b removal — but neither is the widening it
names, and mutating _NAIVE_CALL to \bvt::Attention\w*\s*\( reds it along with
five others. The spec's "six mutations that must go RED" was reported as five; there
are six, and each reds under the mutation it names. Applying either would have
renamed a working test and made an accurate record false.

Knowingly shipped, and recorded rather than hidden. Three comments in
scripts/check-attention-rung-consistency.py (:58-61, :93-96, :252-255
anchors measured, not estimated) are MEASURED FALSE and are NOT repaired here. All
three are now enumerated in the test file beside the case that pins the real
behaviour, so a reader of the suite can find every one. They claim the \b in
r"\bvt::Attention\s*\(" is what stops the pattern matching the fast rungs. It
is not: the trailing \( does that, vt::AttentionDenseFlash( matches with
neither, and the two patterns differ on exactly the 63 identifier characters —
xyvt::Attention( alone. With the \b removed the suite stays green at
Ran 34 tests ... OK, so the companion claim that the widening "is caught in this
suite" is false too. The equivalent claims in the TEST file ARE repaired, because
tests/scripts/test_*.py is not a governance checker. The tree therefore
contradicts itself between the test and the checker beside it, and that is
deliberate
: scripts/check-pr-size.py:170 classifies every
scripts/check-*.py as a governance_checker and demands executable red-before
evidence, which a comment-only diff cannot produce. Attempting the repair returns
ERROR: BASE checker stayed green ... changed test is not semantic evidence at
rc=1. The prepared patch was deliberately not committed rather than land a red
pr-size.

#1629 records both drift locks. #1631 records the comment freeze, and it is not
one file: the pattern covers all 43 scripts/check-*.py checkers plus the .sh
ones, so a false comment in any checker in this repository cannot be corrected on
its own today.

Both are linked in the three places AGENTS.md requires rather than in this body
alone: .agents/issue-index.md gains one appended row each, and ## Owed in
.agents/specs/attention-rung-visibility.md records #1629 as DISCHARGED HERE and
#1631 as owed with the reason it cannot be. No gate would have caught their
absence, because check-agent-record.py counts index rows that name no owner and
there was no row at all.

Owed, and named rather than skipped

Nothing on a CPU-only box executes LaunchAttentionDenseFlash, so the
pure-arithmetic cases stay green over a launcher that lost the bound. The
on-device refusal case emits a loud PENDING message and returns, and #1573 owns
running it plus the reachability mutation that proves the case reaches the
guard. No lease was taken: dgx:gpu0 was unavailable for the whole branch. The
101,376-byte GB10 ceiling above does NOT discharge #1573 — it bounds what an
opt-in could buy and says nothing about whether the launcher's refusal executes.

Owed and filed rather than left to be discovered: #1629. The new
test_the_population_is_not_empty case asserts the scanned vt::Attention
population is >= 9, and the shipped tree has exactly 9 sites, so the floor has
ZERO headroom and any row that deletes a naive call reds it. That is every stem
on scripts/attention-rung-allowlist.txtmuse_glimmer_vision (#1545) and the
two LTX-2.5 files — which is to say the rows the allowlist exists to unblock.
Measured while landing this change, with #1579's muse_glimmer_vision.cpp copied
onto this head: leaving the stem reds that case at 8 not greater than or equal to 9, and deleting the stem reds it AND
test_allowlist_holds_only_the_in_flight_stems, so a removing row has no green
path. The tree was restored byte-for-byte after each and the suite returns to
31 tests ... OK. This is the same drift-lock shape the kernel-matrix cell above
was corrected for, retained one file away, and it is NOT repaired here because
changing the floor changes what the gate accepts and AGENTS.md routes that to its
own row, spec and red-before evidence. #1629 carries the evidence and two
candidate directions, and #1579 is held on it.

Inherited red, not introduced here: test_cpu_x86_llamacpp_floor fails in
agent-preflight.sh on this box. It is the known load-dependent case of #618
at high loadavg the harness exits NO_QUIET_WINDOW (4) where the case expects
GIVING_UP (2) — and both the case and scripts/cpu-x86-llamacpp-floor.sh are
byte-identical to origin/main on this branch, which is how it was established
as inherited rather than assumed to be.

FIVE CI jobs are red on the head, every one of them inherited from main with a
named owner, and each was verified per-job against a main baseline rather than
asserted. windows-msvc-cpu and windows-msvc-vulkan are the standing PR-only
red (#584, #965). build-test-cpu and both sanitize-cpu arms fail on ONE
shared doctest case, test_runner.cpp:1557; that case landed on main in
e2a9e035d (#1273) and is owned by #1608 and #1602. Inheritance was established
by comparing the failing ASSERTION and not the job name: the scheduled main
baseline at e2a9e035d fails the identical
CHECK_THROWS_WITH_AS( make_runner(), "Block size must be a multiple of 16", std::invalid_argument )
at the same test_runner.cpp:1557, with the same "No valid attention backend for
device type 0" text, in all three jobs, and with zero sanitizer findings in either
sanitized arm. test_runner.cpp is not touched by this branch.

build-newest-gcc was the sixth red when this body was first written and is
GREEN here. #1581 and #1618 landed the ::getpid repair on main, and this branch
was re-merged onto 2e7f3bee7 to pick it up, so the job now compiles and reports
on this change. Every job that can see this change is green, including pr-size
and agent-record, which is the job that runs this row's new checker.

Closes #1544.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]

mudler added 7 commits August 21, 2026 09:39
…, and the honest head_dim bound (#1544)

#1544 owes two things and gives a choice on the first. This spec picks a
checker over a selector, and picks narrowing the advertised head_dim over
opting in to a larger shared-memory cap, and it argues both rather than
recording them.

The selector is rejected because six of the nine `vt::Attention` call sites
exist BECAUSE they are the naive kernel: three are reference arms a gate
compares against, and two are the `VT_*_EAGER` rungs of a same-binary A/B.
Auto-routing them changes what the reference computes, which deletes the
comparison rather than fixing anything. A checker cannot do that, because it
runs no model code.

The opt-in is rejected because head_dim 256 in f32 wants 128 KiB, above the
opt-in per-block cap of the consumer Blackwell parts this project gates on, so
it would leave the widest advertised width a lie AND could not be verified
without a device this row has no lease for. Narrowing is arithmetic, provable
on a CPU box, and strictly additive: a head_dim that launches today still
launches.

The spec is committed before the implementation so the order proves it, and it
names the one leg that a CPU box cannot execute instead of letting a quiet skip
read as coverage.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…ow says why, and AttentionDenseFlash advertises the head_dim it can launch (#1544)

Two additive changes. Neither moves a single existing caller's numerics, and
that is the constraint the whole design is shaped around.

`vt::Attention` resolves `OpId::kAttention` straight to the correctness-grade
kernel, and nothing in the tree ever routes it up: the rung is whichever C++
function name the author typed. That is deliberate for the six sites that mean
it — three reference arms a gate compares against, two `VT_*_EAGER` rungs of a
same-binary A/B, one measured-negative device path — and invisible to everyone
else, which is how one LTX-2.5 DiT forward came to cost 47.84 s. A token gate
cannot see the difference, because every rung is bit-identical or inside the
bf16 envelope.

So the fix is not a selector. Auto-routing those six would change what the
reference computes and delete the comparison the gate performs, which is the
"widen the assertion until the gate passes" failure AGENTS.md names. Instead
`scripts/check-attention-rung-consistency.py` requires the CHOICE to be
recorded: a `// VT-ATTN-NAIVE:` reason beside the call. The six deliberate
sites now carry one, and an author who never heard of the fast rungs gets a red
instead of a silent 500x. The record is per-site and in-file, so the ordinary
change writes no shared record at all; the allowlist holds only the three stems
whose naive call another row is currently deleting, and a stale entry there is
reported rather than fatal so that row owes this file nothing.

`AttentionDenseFlash` separately claimed `head_dim <= 256` while asking the
driver for `2*kFlashBc*d*sizeof(Tin)` bytes of dynamic shared memory with no
`cudaFuncSetAttribute` anywhere in `src/vt/cuda/`. The default 48 KiB cap made
the real ceiling 192 in bf16 and 96 in f32, so Kimi at 192 f32 or Qwen3.5 at 256
would have received a bare launch error naming nothing they could do instead.
The bound now lives in `include/vt/ops.h` as pure host arithmetic, tied to the
kernel by two static_asserts, and the launcher refuses above it naming
`vt::AttentionDenseFast`, which uses no shared memory and does serve those
widths. Narrowing beats opting in to a larger cap here: head_dim 256 in f32
wants 128 KiB, over the opt-in per-block cap of the consumer Blackwell parts
this project gates on, so the opt-in would leave the widest advertised width a
lie and could not be verified without a device. The bound is inclusive, so
head_dim 192 in bf16 lands exactly on 49152 and still launches.

One leg is PENDING rather than skipped quietly. Nothing on a CPU-only box
executes the launcher, so #1573 owns running the on-device refusal case and
mutating the guard away to prove the case reaches it.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
Bring the branch up to date so the trailer and commit-style gates run against a
HEAD that has origin/main as an ancestor; they SKIPPED on the previous run for
exactly that reason, and a skipped gate reports nothing about this tree. The
incoming change is the MUSIC3 DiT profile and touches no file this row edits, so
the merge is textually clean and the record surfaces need no key-by-key
reconciliation.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…ation result (#1544)

The claim row was written before the pull request existed and before the
contract test had been mutated, so it named neither. Both are the parts a reader
of a live claim actually needs: where the change is, and whether its guarantee
was proven rather than only asserted. The suite count is corrected from 27 to 29
as well, which is what it became when the checker grew its header scan.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…w checker, and the register-bound assert could not fail (#1544)

Repairs from the fresh scoped review of #1578. Nothing here changes what any
kernel computes.

`pr-size` was RED on this branch and this branch caused it. A checker created in
the range has no BASE version for the red-before half of the evidence run, so it
must register the disabled stub its own suite has to reject; ~20 checkers do, and
this one did not, so the gate could not classify the change at all. Measured, not
assumed: under the stub 31 of 31 cases in
`tests/scripts/test_check_attention_rung_consistency.py` go red, because the suite
loads the checker as a module and every case calls into it.

The second `static_assert` beside `AttentionDenseFlashKernel` was a tautology. It
read `8 * 32 == kAttentionDenseMaxHeadDim` while the real `kMaxPerLane` was a
function-local `constexpr` inside the kernel body, invisible at file scope. Setting
that local to 4 -- exactly the drift the assert's message claims to catch -- left
it reading `256 == 256`. The register blocking is now `kFlashMaxPerLane` at file
scope, the kernel's register arrays and unrolled loops read it, and the assert
reads the same object: the same mutation now reads `128 == 256` and fails to
compile. No nvcc on this box, so the tie was measured by extracting the file-scope
constant block from `cuda_ops.cu` verbatim and compiling it against the shipped
`include/vt/ops.h` with `g++ -fsyntax-only`, before and after the mutation.
`cuda_ops.cu` restored and verified by sha256.

Two comments overstated what the code guarantees. The launcher said its guard and
its shared-memory request came from "the SAME function ... cannot disagree"; they
are two functions, and `AttentionDenseFlashMaxHeadDim` re-derives the division
rather than inverting `AttentionDenseFlashSmemBytes`. The guarantee holds and is
tested -- mutating the `2 *` in `SmemBytes` to `3 *` reds 9 assertions of the
shipped contract case, including both inclusive-edge checks, while
`MaxHeadDim(2) == 192` stays green, which is the re-derivation made visible -- so
the comment now says that instead. The `AttentionDenseFa2` fall-through comment
promised "the best available kernel for their shape rather than a hard refusal",
which stopped being true for an over-cap head_dim when this branch added the
refusal; it now names the domain and says every caller today is far inside it.

The checker claimed "the population is what makes a green meaningful" and named no
limits. Four spellings reach the same kernel undetected -- a `using` declaration, a
namespace alias, a `#define`, and a call through `&vt::Attention` -- each verified
green with a live unmarked call. None exists in this tree and widening the regex
would make every fast rung a site, so the docstring and spec D6 state the bound
rather than implying its absence.

The OK line reported total and marked sites but never the number a reader needs:
sites carrying no reason that pass only because their stem is allowlisted. It is
not `sites - marked`, since a marked call inside an allowlisted file counts in
`marked`. Two cases now pin the line, red-before confirmed by dropping the count.

The allowlist told a removing row to delete its stem without saying that
`test_allowlist_holds_only_the_in_flight_stems` pins the set in another file; the
allowlist header, the checker docstring and spec D7 now say so. The kernel-matrix
cell stored this suite's case count, which is a measurement of one file inside
another; the count is gone rather than corrected.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
Bring the branch up to origin/main so the trailer and commit-style gates run
against an ancestor tip instead of skipping. No conflicts and no content change
on either side.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…ion-mutation registration (#1544)

`check-pr-size.py` demands semantic mutation evidence for any change to itself,
and registering a creation mutation is a change to itself. The registered set is
asserted exactly in `test_check_pr_size.py`, so the new entry belongs there too:
with the BASE checker swapped in, that assertion fails because the set is missing
`scripts/check-attention-rung-consistency.py`, which is the red-before half the
evidence run performs.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot pushed a commit that referenced this pull request Aug 21, 2026
…d the reachability case restores its own instrument

Three review findings, all in the same two files plus their test.

TWO ANCHORS WERE WRONG, and one of them is load-bearing. The reachability
case's ENTRY POINT paragraph and the spec's §6 both cited
`src/vllm/multimodal/ltx2_video.cpp:4055-4059` as the production call to
`Ltx2DitForwardDevice`. At HEAD and at this row's base that region is prose
about the res_2s step counter; the call is at `:4246`. That is the citation the
whole reachability argument rests on. The second, `cpu_ops.cpp:3551-3562`, is
`FusedLoad`/`FusedStore`; the registrations it meant are at `:3750-3761`. The
claim there was true and only the anchor was wrong.

THE CASE LEAKED PROCESS STATE ON ANY UNWIND. It enables
`vt::EnableOpProviderCallStats` and sets `VLLM_LTX2_DIT_FLASH_ATTN`, both
per-process, and it contains `REQUIRE`s. A failed `REQUIRE` or a throw from
either forward left the counting instrument enabled and the knob set for the
other 21 cases in the binary, so an unrelated case's result would depend on
which case failed first. Two scope guards now hold both. Measured rather than
asserted: with a scratch `REQUIRE(false)` after the `SetEnv` and an observer
case appended after it, the observer without the guards reads the knob still
set and counts 8 leaked `kAttention` selections; with them it reads neither.
Tree restored byte-for-byte and re-gated 22/22, 652/652.

BOTH NAIVE `vt::Attention` CALL SITES NOW RECORD THEIR REASON IN THE FILE, in
the `// VT-ATTN-NAIVE:` form #1578's allowlist defines for a deliberate one.
This change ADDS one (the A/B knob's off arm in `ltx2_device.cpp`) and leaves
`ltx2.cpp`'s host arm in place, while that allowlist exempts both stems on the
ground that "another row is removing" their naive call. This row does not
remove either, so without the markers both files would be permanently and
silently exempt from the checker that row lands.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot pushed a commit that referenced this pull request Aug 21, 2026
…x carried two confounds, and neither was disclosed (#1549)

Review findings against the records, all of them narrowing a claim.

f32 HEAD_DIM 256 WAS NEVER REPAIRED, and three surfaces said it was. That tile
is `2 * 64 * 256 * 4` = 131,072 B against GB10's queried 101,376 B, so it never
fitted; the launcher fell back to `AttentionDenseFast`, which is BIT-IDENTICAL
to the flash kernel by contract, and all 20,480 of that arm's assertions passed
with flash never launching at 256 once. A numeric comparison cannot separate the
two -- that IS the contract -- so the case measured a fallback and reported it
as a launch. head_dim 128 (65,536 B) is genuinely repaired and that claim stands.

THE RATIO IS ~6.0x, NOT 6.23x, and the correction is named rather than quietly
applied. Two confounds, both inflating it, neither disclosed:

  * The denominator ran under `runguard.py --stack-period 12`, which `eu-stack`s
    the process and so ptrace-stops every thread. Its own `stacks.txt` prices
    that: 523 samples, median inter-sample delta 12.40 s against a 12.0 s
    period, so ~0.40 s median and 1.50 s max of stopped process per sample.
    ~3.9 samples land inside each 47.84 s forward, ~1.54 s, ~3.2%. Correcting
    only the denominator: 46.3 s / 7.680 s = 6.03x. The flash arm had no sampler.
  * The two arms used different prompts. The denominator's `render.log:1` has a
    ~70-word prompt and the harness has one short sentence, and
    `ltx2_video.cpp:2253` sets `context_tokens = encoded.seq` UNPADDED, so the
    DiT's cross-attentions see a different number of keys. Corroborated:
    `conditioning.tower` 45.013 s against 28.426 s. Same sign, not quantified.

The defensible statement is the range 6.03-6.23x with the sampler correction
named and the prompt confound uncorrected and pushing the same way. `~6.0x` is
what the pages now quote.

WHAT ELSE IS RECORDED: the runtime-derived bound and why neither #1578's 192/96
nor this branch's earlier 256 is it, with the note that #1578 must reconcile
onto it and that this row does not edit that branch; the two corrected anchors;
the scope-guard mutation and its counter-proof; the flash arm's missing
invocation and the committed harness that replaces it; and the
`documentation-checkpoint` red, which was this branch's own and not inherited,
together with the side effect that its `set -eu` step stopped
`check-now-current.py` and `check-role-discipline.py` from running in CI at all.

NEWLY OWED, filed as [#1612](#1612):
there is no numeric or pixel comparison at production geometry. The only numeric
gate is the reduced-dimension host-vs-device case, which bounds the arithmetic
change and not the change at head_dim 128 with 2352 keys over 48 layers; a
diffusion render has no token gate; and the flash arm was interrupted before
writing any frames, so no pixel A/B exists even against the completed 49-frame
baseline render already on the NAS.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
mudler added 3 commits August 21, 2026 17:03
… measurement, not a convenience (#1544)

D2 rejected `cudaFuncSetAttribute` partly because "it cannot be verified without
a device, and this row has no lease". That reads as a preference. The number is
now available from #1557's review: GB10's queried opt-in ceiling is 101,376
bytes, and head_dim 256 in f32 wants 131,072. The raise therefore cannot make the
advertised 256 true for f32 on the part this project gates on, which is the exact
width that motivated it, so narrowing beats raising on measured grounds.

#1573 stays owed and says why the new number does not discharge it: 101,376 is a
device value that bounds what an opt-in could buy, and it proves nothing about
whether the launcher's refusal executes. That still needs a lease.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
Bring the branch up to origin/main at f4ccabb before the landing gate, so the
gate runs on the tree that will become the merge commit rather than on a base
main has moved past twice.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
Bring the branch up to origin/main at 2e7f3be before the landing gate. The
previous re-merge stopped at f4ccabb and main has advanced eleven commits
since, so the gate would otherwise run on a base the squash commit will not
have.

The only file both sides touch is .agents/issue-index.md. Its union driver
merged the two appended regions, and the result was checked the way AGENTS.md
requires rather than trusted: `git diff --numstat` against origin/main reads
`2 0`, so main's rows are preserved byte-for-byte and only this branch's two
rows are added, and no issue id appears twice in the 536 rows. Every other path
in the delta is disjoint from this branch.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot pushed a commit that referenced this pull request Aug 21, 2026
… needed

LTX-2.5's DiT renders at the stream dtype, and in production that is bf16
(`ltx2_device.cpp:1166`). At head_dim 128 the flash op's K/V tile is
`2 * kFlashBc(64) * 128 * sizeof(bf16)` = 32,768 B, and the audio stream's
head_dim 64 asks 16,384 B. Both are inside the 49,152 B of dynamic shared memory
every CUDA architecture gives a launch WITHOUT an opt-in, so the routing this row
exists for never needed `cudaFuncSetAttribute` at all.

What the raise was actually serving was f32: head_dim 128 at 65,536 B, and
head_dim 256 at 131,072 B against GB10's queried ceiling of 101,376 B
(`cuda_device_caps.h:46`) -- which does not fit even WITH the opt-in, and was
being answered by the bit-identical `AttentionDenseFast` while the case reported
a launch. So the raise bought one shape this row does not run, and paid for it by
moving a shared helper across two files and colliding with #1578 on the same
lines of `cuda_ops.cu` and `test_ops_attention.cpp`.

#1578 is the correct treatment and it merges first: instead of raising the cap it
narrows the ADVERTISED head_dim domain to what the code can launch and refuses
above it, which is a property of the code rather than of whichever device is
under it. After it, bf16 head_dim 128 is inside the declared bound and this row's
swap is untouched.

Reverted in full. `src/vt/cuda/cuda_ops.cu`, `cuda_device_caps.h`,
`cuda_arch_tactics.cu`, `cuda_paged_attn.cu` and `tests/vt/test_ops_attention.cpp`
are byte-identical to `main`, so there is nothing left to conflict.

The measurement survives the revert, and that is arithmetic rather than
assertion: the binary that produced 7.680 s carried the opt-in call, but the
helper returns immediately below 49,152 B, so it was a no-op on every launch
those numbers came from. The withdrawn evidence is the `test_ops_attention` run,
which measured code no longer in the tree; it is marked WITHDRAWN in
`.agents/benchmark-record.md` rather than deleted.

One consequence is disclosed rather than left to be found: the f32 L2 parity arm
at production geometry now refuses instead of running slowly. It fails loud in
both worlds -- a `cudaGetLastError` throw at `cuda_ops.cu:3352` today, a
`VT_CHECK` naming the head_dim once #1578 lands -- and nothing gated reaches it,
since production is bf16 and the f32 arm is exercised at the fixture's reduced
dimensions. Filed under `## Owed` against #1612.

Also in this commit, because they are the same edit to the same records:

- The corrected ratio reads **~6.0x** everywhere. 6.23x survives only as the
  uncorrected upper end of the 6.03-6.23x range, never on its own.
- Two anchors were wrong at this row's declared base `6b48edb2c` as well as at
  HEAD. `ltx2_video.cpp:4055-4059` pointed at prose about the res_2s step
  counter -- and it is the citation the whole reachability argument rests on; the
  production call site is `:4246`. `cpu_ops.cpp:3551-3562` pointed at
  `FusedStore`; the three CPU attention registrations are at `:3750-3761`. Every
  other anchor in the spec was re-read against the base rather than carried
  forward, and eight more were corrected.
- The committed A/B harness had a third precondition that grepped for
  `FlashTileSmemOptIn`, a spelling no revision of this change ever used, so it
  counted 0 and would have `exit 42`-ed on a correct tree. It is removed with the
  cap-raise it guarded, and the comment says why a precondition that cannot pass
  is not a stricter one.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot pushed a commit that referenced this pull request Aug 21, 2026
…ranch

Clean automatic merge. `.agents/issue-index.md` union-merged at `4 0` -- four
appended rows, no deletion, no duplicated id -- and this branch's diff against
the merged main is confined to the ten files the row owns. In particular nothing
under `src/vt/cuda/` or `tests/vt/` appears in it, which is the check that the
reverted shared-memory cap-raise left no residue behind to conflict with #1578.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot pushed a commit that referenced this pull request Aug 21, 2026
…worlds

The comment said "refuses, loudly and by name". Only half of that is true today:
`Check(cudaGetLastError(), "attention-dense-flash launch")` at `cuda_ops.cu:3352`
names the OP but not the head_dim, and it is #1578's `VT_CHECK` that will name
the head_dim too. Both are loud and neither is silent, which is the property that
makes this a disclosure rather than a blocker -- so the comment now states the
two cases separately instead of claiming the stronger one for both.

Anchors resynced to the lines this edit moved.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…the model tree, and the three rows it would have redded (#1629)

`test_the_population_is_not_empty` was named for one guarantee and asserted
another. The name promises non-emptiness; the assertion pinned
`>= 9`, today's incidental number of `vt::Attention` call sites. The shipped
tree has exactly 9, so the floor carried zero headroom and any row that
legitimately REMOVED a naive-attention call turned the case red.

Those rows are not hypothetical, and they are not strangers to this file: they
are the three stems on scripts/attention-rung-allowlist.txt. The allowlist
exists precisely so #1545 (muse_glimmer_vision) and the LTX-2.5 routing row
(ltx2, ltx2_device) can reroute their calls without editing the lines they
replace, and the checker backs that by reporting a cleaned-up stem as STALE
rather than failing on it. The test then undid it. Composing this tree with
#1579's muse_glimmer_vision.cpp, which routes that call to
`vt::AttentionDenseFlash`, reds the case with `8 not greater than or equal to
9` - and the case runs in the required agent-record CI job, so `main` would
have gone red on a change that did exactly what the allowlist invited.

This is the shape AGENTS.md `## Records` names: never store a measurement of
one file inside another file. A raw site total is a measurement of the model
tree living in a test, and it couples every routing row to a line it does not
own.

The floor becomes `>= 1`, which is the guarantee the name always claimed and
the one that actually matters - a scanner whose regex stops matching after a
rename reports zero drift, and an empty scan and a clean tree file the same
green. That is #1544's defect, and it stays covered.

What the count was standing in for is covered without the coupling. The six
deliberate sites are already pinned BY NAME, not by arithmetic, in
`test_the_six_deliberate_sites_carry_a_marker`. The real risk a total never
addressed is a bogus allowlist entry, so a new case asserts that every
allowlisted stem names an existing model source under MODEL_DIRS. A typo is
silent in both directions today: it excuses nothing, so the file it meant to
cover goes on drifting unguarded, and the checker reports it only as STALE and
exits 0. Verified - `muse_glimmer_vison` appended to the allowlist leaves
`check-attention-rung-consistency.py` green at rc=0 and reds only the new case.

The new case asserts FILE EXISTENCE, deliberately, and never scan membership.
A stem stops having a call site the moment its removing row lands, which is the
state the allowlist is built to survive and which the checker's own
`stale_allowlist_entries` docstring states. Asserting the stem is still in
`scanned` would rebuild the very lock this change removes.

Nothing else moves. The checker's behaviour, the allowlist's stem set, and
`test_shipped_tree_is_green`, `test_the_six_deliberate_sites_carry_a_marker`
and `test_allowlist_holds_only_the_in_flight_stems` are untouched, so growth of
the allowlist stays a review decision. Spec D7 still describes the tree
accurately and needs no edit.

Evidence, each mutation proven applied and restored by sha256: stubbing
`scan_models` to `{}` reds the population case at `0 not greater than or equal
to 1`; the typo'd stem reds the new case naming it while the checker stays
green; and #1579's file composed over this tree runs 32/32 green with the
checker at rc=0 printing `STALE (not a failure)` and the allowlist stem left in
place, which is the point of the whole change. Preflight is green apart from
`test_cpu_x86_llamacpp_floor`, the known load-dependent flake (#618); this box
sat at load average 57.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
mudler added 9 commits August 21, 2026 19:53
…te size, and three neighbouring 31s are past measurements that stay

cab0b57 repaired the population floor in
tests/scripts/test_check_attention_rung_consistency.py and added
test_every_allowlisted_stem_names_a_real_model_source, growing the suite from
31 cases to 32. Four places in this tree say 31. Only one of them was made
wrong by that growth, and this commit repairs that one. A record edit rides in
the pull request whose change made the record stale, so it rides here.

Re-measured rather than taken on report. Overwriting
scripts/check-attention-rung-consistency.py with the two-line disabled stub and
running the suite gives "Ran 32 tests" / "FAILED (errors=32)". git diff --stat
was printed under the stub so the mutation cannot read as passing by never
having applied, and the checker was restored byte-for-byte with the restore
proven by sha256
(098b50255c8353aa798b1334bfd6be4e29013392deecf7e62fcca33aa41d17f6) and a clean
tree.

The repaired site is the Last update cell of
.agents/claims/CLAIM-ATTN-RUNG-VISIBLE.md, which read "GREEN after the markers;
31/31 in the mutation suite". That sits in a current-state cell, names no
experiment and carries no SHA, so it reads as "the suite is 31 cases and it is
green". The suite is 32, so the cell under-reported the population.

It is repaired count-free, to "the mutation suite green", and deliberately NOT
bumped to 32. AGENTS.md "Records" forbids storing a measurement of one file
inside another file, because a number that changes after each edit couples
every pull request to lines it does not own -- which is the coupling that
created this task. Bumping 31 to 32 would satisfy the letter of the rule while
re-arming the trap for the next case addition. This row has already ruled on
this exact shape once: the same cell lists "the stored case count in the
kernel-matrix cell" among the review findings it REMOVED.

The other three 31s were considered and are left alone, because each names the
stub experiment and therefore dates itself. Adding a 32nd case does not
falsify a past measurement.

- .agents/claims/CLAIM-ATTN-RUNG-VISIBLE.md, later on the same line: "(the
  creation-mutation stub, 31/31 red under it)". Names the stub, so it reports
  what that mutation produced rather than how large the suite is now.
- .agents/specs/attention-rung-visibility.md "## Now": "(measured 31 of 31
  cases red under the stub)". The verb is "measured" and the condition is the
  stub, so it is an observation of a run, not a claim about today's
  population.
- scripts/check-pr-size.py, in the CREATION_MUTATIONS registration: "Measured:
  31 of 31 red under the stub". Same shape, and what carries the
  classification is the following clause -- that no case passes without
  calling into the checker -- which the 32-case re-measurement confirms rather
  than contradicts.

Leaving the check-pr-size.py comment is additionally forced, not merely
preferred, and this is worth recording for whoever next wants to de-number it.
scripts/check-pr-size.py classifies itself as a governance_checker, so
change_errors demands a paired change in tests/scripts/test_check_pr_size.py
that executable_evidence proves RED against the BASE checker. A comment-only
edit cannot make any test fail against BASE, because BASE and HEAD are
semantically identical. Measured: with the comment reworded, "python3
scripts/check-pr-size.py --base 89925ad --head
<that commit>" exits 1 with "checker change 'scripts/check-pr-size.py'
requires semantic mutation evidence in tests/scripts/test_check_pr_size.py",
while the same invocation against cab0b57 exits 0. The required pr-size CI
job runs exactly that invocation. So that comment can only ever be reworded by
a change that also alters the checker's behaviour, and de-numbering it in a
records-only pull request is not available.

Records only. No test, checker or product file is touched, and the allowlist
stem set is unchanged.

Refs #1629.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
… the row that removes the LAST allowlisted stem (#1629)

`test_the_ok_line_reports_the_excused_sites` did two jobs and stored a
measurement of the model tree to do the first one.

Its `assertGreater(excused, 0, "the shipped tree must exercise this branch")`
was a live count of how many unmarked `vt::Attention` sites currently sit in
files that scripts/attention-rung-allowlist.txt parks. That number is 3 today
only because three rows are still in flight: #1545 (muse_glimmer_vision, PR
#1579) and the LTX-2.5 routing row (ltx2, ltx2_device). Each of them exists to
delete its own naive call, and the allowlist exists to let them do it without
editing the lines they replace. When the LAST of the three lands the allowlist
holds no stem, `excused` becomes 0, and this case reds while
`check-attention-rung-consistency.py` is perfectly green at rc=0. It runs in
the required agent-record CI job, so `main` would go red on a change that did
exactly what the allowlist invited.

That is the shape AGENTS.md `## Records` forbids -- never store a measurement of
one file inside another file -- and it is the same shape as the `>= 9`
population floor cab0b57 removed for this row, in the same not-yet-landed
file. It is worth naming why it survived that repair: it does not fire for any
of the three rows individually. With only #1579 landed the suite is 32/32
green. Only the third one trips it, which is the worst kind of lock to leave in
a tree, because no in-flight change can find it.

The two jobs are separated instead of weakened.

The guard -- proving the checker's OK line actually EXERCISES the "unmarked and
excused" branch with a non-zero count -- moves onto a tree this file
constructs, so it holds forever regardless of what the model tree does. The
mechanism is the smallest one that reaches `main()`: `mock.patch.object` over
the two module-level names the report reads, `scan_models` and `ALLOWLIST`. The
scan becomes a dict built by hand, exactly as every `MutationTests` case in
this file already builds one, and the allowlist becomes a temporary file. A
fixture directory of real .cpp sources was the alternative and is strictly more
machinery for the same reach: `scan_models` computes `path.relative_to(ROOT)`,
so a tempdir outside the repository raises, and a fixture dir inside it adds
model sources to the tree the other cases scan. The constructed scan carries an
unmarked site beside a marked one in the SAME allowlisted file, which is the
case `sites - marked` cannot distinguish, and the assertion pins the whole OK
line rather than a substring.

A second constructed case pins the report at zero excused sites -- the state
the allowlist exists to REACH. The checker prints the count even when it is
zero, and its comment says so; nothing asserted it, and that is precisely the
gap the floor was hiding.

The shipped-tree job is kept as it was. `excused` is still RE-DERIVED from the
tree and never pinned, so `assertIn(f"{excused} unmarked and excused by", ...)`
holds at 3 today and at 0 after the last stem is cleaned up. Only the
`assertGreater` line is gone.

Nothing else moves: the checker, the allowlist, and every case this row's
previous commit repaired are untouched.

Evidence, each mutation proven applied by a diff and restored by sha256.
RED BEFORE, simulating the end state on the unmodified tree -- the three naive
calls routed to `vt::AttentionDenseFlash`, the allowlist emptied of stems, the
pinned set in `test_allowlist_holds_only_the_in_flight_stems` set to `set()` as
the landing row would -- the checker prints `0 unmarked and excused by 0
allowlisted in-flight stem(s)` at rc=0 while the case fails with `0 not greater
than 0`. GREEN AFTER, that identical simulation with this change in place runs
34/34 with the checker still at rc=0.

The guard still bites. Making the checker print `{0}` for `excused` reds the
constructed case at `0 unmarked and excused by 1` against the expected `1`, and
dropping the "unmarked and excused by" clause reds the zero case. The load-
bearing run is the two composed: in the END STATE, with the checker's count
broken, the shipped-tree case PASSES -- its recomputed `excused` is 0 and the
broken line still says 0 -- and only the constructed case catches it. That is
the coverage the deleted floor was standing in for, now held by something the
model tree cannot switch off.

Unmutated tree: 34 cases green, checker rc=0 printing `9 vt::Attention call
site(s) in 9 model source file(s); 6 carry a recorded reason, 3 unmarked and
excused by 3 allowlisted in-flight stem(s)`. Preflight is green apart from
`test_cpu_x86_llamacpp_floor`, the known load-dependent flake (#618); this box
sat at load average 44 on 20 cores. commit-trailers and commit-style SKIP
because this base is behind origin/main, and were run directly over the range
instead.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
… cannot catch (#1629)

The comment on `test_the_ok_line_counts_the_sites_an_allowlist_excuses` named
three defects it claimed the case rejects: a checker that prints
`sites - marked`, one that drops the `unmarked and excused by` clause, and one
that hard-codes the number. Two of them are real. Both were mutated into
`scripts/check-attention-rung-consistency.py` for this change and both turn the
case red. The `sites - marked` one is not, and substituting it left all 34 cases
green.

It is not a weak scan, and no better scan exists. `main()` reaches the OK line
only when `drift_sites` is empty, and `drift_sites` is empty exactly when no
unmarked site sits outside an allowlisted file. Every unmarked site on a green
is therefore excused, and `excused` and `sites - marked` take the same value
identically. Enumerating the constructible space of three files, zero to two
sites each, marked or unmarked, against every allowlist subset gives 1000 states
that reach the OK line and zero on which the two numbers differ. The quantities
stay distinct by definition, because a marked call inside an allowlisted file
counts in `marked`, but they can only differ in value on a scan the checker
exits 1 on.

The comment now states the two guarantees the case carries and records why the
subtraction is absent, so the next reader does not repair a gap that cannot be
closed from this file. `test_the_excused_count_is_not_sites_minus_marked` gets
the same note: it never calls the checker and derives both numbers itself, so it
documents the definitions rather than gating the OK line. Its closing note also
claimed the two diverge once the allowlisted file's marked site is dropped. They
do not, because that drops `sites` and `marked` together; the note now names the
condition that does separate them.

Comments only. `ast.dump` of the file before and after this change is identical,
so no assertion, fixture or executable line moved.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…them

Round three of comment repairs on the attention-rung suite. Rounds one and two
each removed a false claim by writing a new causal explanation, and the next
reviewer measured the new explanation and found it false as well. This round
deletes instead of re-explaining. The comment and docstring lines this file
carries go from 121 to 115, and every clause left standing is one I ran.

`excused` and `sites - marked` were said to stay different quantities because a
marked call inside an allowlisted file counts in `marked`. That names a
non-cause. Enumerated over 19208 constructed scans, adding such a call raises
`sites` and `marked` together and leaves `excused` alone, so it changed
`(sites - marked) - excused` in 0 of 32928 probes. The sentence stood in the
GreenReportTests docstring and in the OK-line case, and is gone from both. The
conclusion it was attached to survives, because on all 5800 green scans in that
enumeration the two took the same value, so the substitution stays unpinnable.

`test_the_excused_count_is_not_sites_minus_marked` said the subtraction
under-reports the debt. In the same enumeration `sites - marked` was never below
`excused`: equal on all 5800 greens, higher on all 13408 reds. The same case also
said it never calls the checker, while it does call `drift_sites`. It never calls
`main()`, which is what the line meant.

Two comments credited the word boundary in `_NAIVE_CALL` with excluding the fast
rungs. The trailing `\(` does that, and `vt::AttentionDenseFlash(` matches
neither pattern. Removing the `\b` leaves the whole suite green at 34 tests and
the shipped tree green at 9 sites, so the promise that this suite catches the
widening was false.

The same false claim sits in a comment beside `_NAIVE_CALL` in
scripts/check-attention-rung-consistency.py, and in that file's module docstring
as a claim that `\bAttention\s*\(` matches every fast rung's suffix-free form,
which it matches none of. Neither is repaired here. Any edit to a
scripts/check-*.py path classifies as a governance checker in
scripts/check-pr-size.py, which then demands a red-before result from this test
module against the base checker, and a comment-only edit cannot produce one. The
repair is therefore blocked rather than skipped, and this commit records where it
is owed. The pinning case now says in the tree that the checker's comment is
wrong, so the contradiction between the two files is deliberate and readable.

Comment and docstring text only. The AST of this file with docstring nodes
blanked is byte-identical before and after, and a node-by-node walk over its 2059
nodes finds exactly one changed node, the GreenReportTests docstring constant.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…o over-claiming docstrings

Round four of comment repairs on tests/scripts/test_check_attention_rung_consistency.py.
Three items, all comments and docstrings. The docstring-blanked AST dumps before and
after are byte-identical, so no assertion, fixture, or executable line moved.

The justification on test_every_allowlisted_stem_names_a_real_model_source said a
misspelt allowlist stem is silent in both directions. Measured otherwise: replacing
the stem `muse_glimmer_vision` with `muse_glimmer_vison` in
scripts/attention-rung-allowlist.txt exits the checker at rc=1 and names
src/vllm/model_executor/models/muse_glimmer_vision.cpp:639 beside the STALE line.
Three earlier rounds each replaced that justification with another claim that did not
survive measurement, so this round deletes it and states only what the case pins.

The note beside test_widening_the_regex_to_the_fast_rungs_is_visible named one checker
comment whose cause measurement refutes. Two more carry the same shape, so the note now
enumerates all three with line anchors: the module docstring's widening paragraph
(:58-61), the comment beside _NAIVE_CALL (:93-96), and the `sites - marked` cause beside
`excused` (:252-255). None is repairable in this commit, because scripts/check-pr-size.py
classifies every scripts/check-*.py as a governance checker and refuses a comment-only
edit with "BASE checker stayed green" at rc=1 (#1631). That refusal was measured here on
a throwaway commit, which was then discarded.

The module and MutationTests docstrings said every MutationTests case makes the tree
carry the regression. Two of the six build no tree: they assert on _NAIVE_CALL and on
has_marker directly. Both docstrings now say less rather than list the cases.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
… not have

`test_every_allowlisted_stem_names_a_real_model_source` told its reader that a
stem matching no file "is reported only as STALE, so the typo never surfaces on
its own". That was the last copy of a cause this branch already deleted from
every comment, and it is false.

Measured on this tree: replacing `muse_glimmer_vision` with `muse_glimmer_vison`
in scripts/attention-rung-allowlist.txt -- what a real typo does, as against the
earlier round that APPENDED the typo and kept the correct stem -- makes
scripts/check-attention-rung-consistency.py exit 1 and print both
`ERROR: model forward(s) call vt::Attention ... -
src/vllm/model_executor/models/muse_glimmer_vision.cpp:639` and
`STALE (not a failure): muse_glimmer_vison ...`. The typo is loud.

The message now states what those two lines are: the checker reports the
mismatch only indirectly, as an unexcused call site in the file the stem was
meant to cover, or as a STALE line naming the misspelling. Only the second
argument of the assertTrue changed. The condition and the `sources`
comprehension are byte-identical under `ast.dump` across the two revisions.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…he one it did not fix (#1629, #1631)

This row filed #1629 and #1631 during its flow and linked neither in the index
or in its spec. AGENTS.md `## Every change starts from an issue` wants three
places to agree -- `.agents/issue-index.md`, the row's spec, and the pull
request body -- and only the pull request body carried them. No gate caught it:
`check-agent-record.py` counts index rows that name no owner, and an issue with
no index row at all is invisible to that count. The record edit therefore rides
in the pull request whose change made it stale, which is the only shape
`## Work happens in a worktree` allows for it.

#1629 is the drift lock this row repaired. Its index row records what the lock
was (a `>= 9` population floor over a tree holding exactly 9 sites, and an
`assertGreater(excused, 0)` that required the shipped allowlist to stay
non-empty), which rows it blocked, and that the repair did not lower a number
but removed the stored count. It names `KERNEL-ATTN-DENSE-FLASH` as its owner
and the spec entry marks it discharged, so a reader who finds the open issue on
GitHub learns from the record where it went.

#1631 is filed and not fixed, so it needs an owner by the same section. It has
no row yet, so its index row carries the dash and points at this spec's
`## Owed`, where the entry states the mechanism and why the fix cannot ride
here: `check-pr-size.py` classifies every `scripts/check-*.py` as a governance
checker and demands mutation evidence red against the BASE checker, which a
comment-only diff cannot produce by construction. Teaching it to tell the two
apart changes what the gate accepts, and `## Changing the rules or a checker`
routes that to its own row, spec and red-before evidence. The three measurably
false comments in `scripts/check-attention-rung-consistency.py` that the lock
freezes are named in both places, so the contradiction between the repaired
suite and the checker beside it is on the record rather than left for the next
reader to rediscover.

Both rows are appended at the true end of the file. `.agents/issue-index.md`
carries `merge=union`, and two branches that each append before a trailing
anchor rather than at the end concatenate into a silent duplicate that no gate
reports.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
Bring the branch up to origin/main at 5453e57 before the landing gate. The
previous re-merge stopped at 2e7f3be and main has advanced seven commits since,
so the gate would otherwise run on a base the squash commit will not have.

Two files both sides touch, and neither was trusted to a clean automatic merge.
`.agents/issue-index.md` merged through its union driver: `git diff --numstat`
against origin/main reads `4 0`, so main's rows are preserved byte-for-byte and
the four added are exactly this row's own -- #1544, #1573, #1629 and #1631 -- with
no issue id appearing twice in the 552 rows. `include/vt/ops.h` is the one product
file in the overlap; main's change there is a comment inside `PagedAttentionArgs`
recording that the fp8 KV-cache read is now implemented on CUDA as well as CPU,
which is disjoint from the head_dim bound this row adds. Both
`AttentionDenseFlashSmemBytes` and `AttentionDenseFlashMaxHeadDim` survive the
merge, and the header compiles clean under `g++ -std=c++17 -fsyntax-only`, because
a merge that applies without conflict is not the same as one that builds.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
…row drifted inside the pull request that wrote it

The #1631 index row cited an unread `SELF_CHECKER` constant at
`scripts/check-pr-size.py:378`, which is where issue #1631's body puts it. At this
head it is `:376`. The issue was filed earlier in this same flow and the file has
gained lines since, so the anchor the issue records went stale inside the pull
request that created it -- the drift AGENTS.md warns about for recorded line
anchors, arriving over a few hours rather than a few releases.

The row now names the measured line and says what the issue body records, so a
reader who follows the link and finds a different number knows which one was
measured and why they differ, instead of treating one of the two as an error.

Taken verbatim from the fresh implementer's final revision. An intermediate
revision of that commit was carried onto this branch before the implementer had
finished, and this restores the difference rather than re-deriving it.

The four rows this branch appends are unchanged in count and identity: `git diff
--numstat` against origin/main still reads `4 0`, no issue id appears twice in the
552 rows, and `check-issue-index-append-only` stays green because the edited row is
one this branch itself added and does not exist on main.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
@localai-bot
localai-bot merged commit 063133e into main Aug 22, 2026
20 of 25 checks passed
localai-bot pushed a commit that referenced this pull request Aug 22, 2026
…h is #1578, and keep both sides' index appends

GitHub reported this pull request CONFLICTING while `git merge-tree` against the
same `origin/main` returned rc 0. The two disagree because `.agents/issue-index.md`
carries `merge=union` in `.gitattributes`: local git honours the driver and unions
the two appends, and the forge does not, so it sees two branches writing the file's
last lines and calls it a conflict. #1578 appended four rows and this row appends
two, which is exactly the shape that triggers it. Nothing else overlaps -- the merge
reports `Auto-merging .agents/issue-index.md` and no other path.

The union result is verified rather than trusted, because a union merge is precisely
how a duplicated row gets in without a gate noticing. Against `origin/main` the file
reads `2 0` in `git diff --numstat`: this row's #1545 and #1566 and nothing else, no
deletions. No issue id appears twice in the 560 rows. `check-issue-index-append-only`
is green on the committed merge.

The rung interaction that held this row is settled and re-measured here. #1578 landed
the #1629 repair, so `test_the_population_is_not_empty` asserts `>= 1` rather than the
`>= 9` floor that a shipped tree of exactly nine sites left with no headroom. On the
merged content `tests/scripts/test_check_attention_rung_consistency.py` runs 34 of 34
green and `scripts/check-attention-rung-consistency.py` exits 0, reporting
`muse_glimmer_vision` as `STALE (not a failure)`. That stale entry is the designed
outcome, not an oversight: `scripts/attention-rung-allowlist.txt` says the removing
row may leave the deletion to whoever runs preflight next, and deleting the stem here
would red `test_allowlist_holds_only_the_in_flight_stems` unless its expected set moved
in the same change.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot pushed a commit that referenced this pull request Aug 22, 2026
…this row's record sections at the file's TRUE end

Two record files collided, and both are the shape AGENTS.md `## Records` names as a
lock: a shared surface that every pull request writes. Neither collision is a
disagreement about a fact, so neither is resolved by choosing a side.

`.agents/benchmark-record.md` is a tail-append collision. This row appended its
`LTX25-DIT-ATTN-FLASH` section and `origin/main` appended `SPEC-DFLASH2 W6` at the
same place. Both are kept: main's section stays where main put it and this row's 173
lines are re-appended after it, at the file's true end. Against `origin/main` the
file reads `173 0` in `git diff --numstat` with zero deleted lines, so nothing of
main's was traded away to make room.

`docs/STATUS.md` is a keyed record and was resolved as one, by taking the complete
target-branch row and applying this row's scoped edit again rather than accepting
either side whole. Two rows conflicted. `Speculative decoding` is main's alone -- this
branch never touched it, verified byte-for-byte against the merge base `c020347a7` --
so main's text is taken unchanged. `Image, video, audio, speech, music, and diffusion
models` was edited by BOTH: main rewrote the MiniMax-Music3 clause (595.9 s to
449.969 s, the DiT falling from 62.4 % to 50.2 %, citation gaining #1555) while this
row appends the LTX-2.5 DiT sentence after it. Composing main's row with this row's
addition leaves `docs/STATUS.md` reading `1 1` against `origin/main`: exactly the one
row this change owns, with every other row byte-for-byte main's.

The #1578 interaction was re-measured here rather than assumed, because this row
removes two more allowlisted `vt::Attention` sites. On the merged content
`tests/scripts/test_check_attention_rung_consistency.py` runs 34 of 34 green and
`scripts/check-attention-rung-consistency.py` exits 0, reporting `ltx2` and
`ltx2_device` as `STALE (not a failure)` -- the outcome
`scripts/attention-rung-allowlist.txt` documents for a removing row, since deleting
the stems here would red `test_allowlist_holds_only_the_in_flight_stems` unless its
expected set moved in the same change.

`.agents/issue-index.md` unioned cleanly: `4 0` against `origin/main`, no issue id
twice in the file.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]
localai-bot added a commit that referenced this pull request Aug 22, 2026
…de kernel, and one forward cost 47.84 s (#1557)

One LTX-2.5 DiT forward at `768x448/49f` measured **47.84 s** on GB10 --
n=119, median 47.91 s, spread 5.8%, from the engine's own `last=`
samples -- and first-order arithmetic says it should take well under a
second.

The DiT self-attention called `vt::Attention`, which on CUDA resolves to
the kernel whose own header calls itself "Correctness-grade (M0.9)": one
256-thread block per (query, head), a 256-wide shared-memory tree
reduction per key, and no K/V tiling, so K and V are re-read from global
once per (query, head). At that geometry the video stream is 2352 tokens
x 32 heads = 75,264 blocks each looping 2352 keys, over 48 layers.

The attribution is arithmetic rather than assertion.
`.agents/specs/multimodal-speed.md` measures that same kernel on that
same box at **5.70 ns per block-key iteration**, and 1.77e8 x 5.70 ns x
48 = **48.4 s** against the measured 47.84 s. A 1% match, which leaves
the other 1% for 48 blocks of GEMMs, norms, RoPE, gating and six
attentions each.

**After this change one forward is 7.680 s** (n=19, median,
`768x448/49f`, GB10). The ratio is **~6.0x**, and it is **not** an A/B.
Both qualifications are load-bearing and both are under "The A/B" below.

## Why nobody saw it, which is the part worth keeping

`kAttention` is deliberately frozen on the naive kernel so that text
decode stays byte-identical. That decision is correct and this change
does not touch it.

The consequence is the defect. The fast kernels are **separate ops that
each caller must opt into by name** -- `kAttentionDenseFast`,
`kAttentionDenseFlash`, `kAttentionDenseFa2`. There is no automatic
selection, no shape routing, and no fallback notice. A model that never
opts in gets **correct output at roughly 500x the cost, with no warning
anywhere**.

Nothing in this tree can detect that. The output is right, so every
golden passes. The op is registered, so no refusal fires.
`GetOpProviderStats` counts the naive selection and reports it as a
success, because it is one. The only symptom is a wall clock, and a
diffusion render has no reference wall clock to be held to. That is why
the gate for this change is a dispatch observation and not a number.

## What changed

**`ltx2_device.cpp` calls `vt::AttentionDenseFlash` in the
self-attention branch.** That is the whole of the product change. The
dispatch RULE is unchanged: the branch is still chosen by `context ==
nullptr && a.bias == nullptr`, upstream's own self-attention marker,
never by what the numbers happen to be. Only the op it calls moves. Its
square-problem contract holds by construction, because that branch is
entered only when `s == tq`.

**`VLLM_LTX2_DIT_FLASH_ATTN=0` restores the old op**, so both arms of
the measurement run from one binary. Same shape as `VT_FA2_DENSE`,
documented in `docs/ENVIRONMENT.md` as a measurement lane and never a
configuration. Both remaining naive `vt::Attention` call sites -- that
one, and `ltx2.cpp`'s CPU-only host arm -- carry a `// VT-ATTN-NAIVE:`
line saying why, the form #1578's checker defines for a deliberate site.

**The host arm at `ltx2.cpp` is deliberately NOT moved.** It computes
into `std::vector<float>` and is CPU-only by construction, and on CPU
both ops are the same registered function
(`src/vt/cpu/cpu_ops.cpp:3750-3761`), so the swap would be a
byte-identical no-op that moves the L2 parity reference off the
reference op.

## The shared-memory cap-raise is REVERTED, and that is the change since
the review

An earlier version of this branch also raised
`LaunchAttentionDenseFlash`'s dynamic shared-memory cap through
`cudaFuncSetAttribute`, moved `SetDynamicSmemOptIn` onto a shared seam,
and added head_dim contract cases to `tests/vt/test_ops_attention.cpp`.
**All of it is gone.** `src/vt/cuda/cuda_ops.cu`, `cuda_device_caps.h`,
`cuda_arch_tactics.cu`, `cuda_paged_attn.cu` and
`tests/vt/test_ops_attention.cpp` are byte-identical to `main`.

**The swap never needed it.** LTX renders at the stream dtype, and in
production that is bf16 (`ltx2_device.cpp:1183`). The flash op's K/V
tile is `2 * kFlashBc(64) * head_dim * sizeof(Tin)`, so the video
stream's head_dim 128 asks **32,768 B** and the audio stream's head_dim
64 asks 16,384 B. Both are inside the **49,152 B** every CUDA
architecture gives a launch without any opt-in at all.

**What the raise was actually serving does not fit.** The shapes over 48
KiB here are f32: head_dim 128 at 65,536 B, and head_dim 256 at 131,072
B against GB10's queried ceiling of **101,376 B**
(`cuda_device_caps.h:46`). The 256 shape therefore does not fit *even
with the opt-in* -- it was falling back to the bit-identical
`AttentionDenseFast` while the case reported a launch. So the raise
bought this row one shape it does not run, and paid for it by moving a
shared helper across two files and colliding with #1578 on the same
lines.

**#1578 owns the bound and takes the opposite, better approach.** Rather
than raising the cap it makes the ADVERTISED domain honest:
`AttentionDenseFlash` declares `head_dim <= 256` while it can only
launch bf16 192 / f32 96, and #1578 narrows the declaration to what the
code can do and refuses above it. That is a property of the code rather
than of whichever device is underneath, and it is the
`supports_head_size()` polarity vLLM already has. **#1578 merges
first**, and after it bf16 head_dim 128 is inside the declared bound, so
this change is unaffected. There is now nothing left to conflict.

**One consequence is disclosed rather than left to be found.** With the
raise gone, the f32 L2 parity arm at production geometry (head_dim 128,
65,536 B) reaches `AttentionDenseFlash` and cannot launch: a
`cudaGetLastError` throw at `cuda_ops.cu:3352` today, a `VT_CHECK`
naming the head_dim once #1578 lands. **It fails loud in both worlds and
never silently**, and nothing gated reaches it -- production is bf16,
and the f32 arm is a parity reference exercised at the fixture's reduced
dimensions. Filed under `## Owed`.

## Numerics, measured rather than asserted

**On CPU: byte-identical.** `kAttention` and `kAttentionDenseFlash` are
the same registered function pointer, and the goldens are unmoved --
`test_ltx2_device` **22/22, 652/652**; `test_ltx2` **43/43, 4581/4581**;
`test_ltx2_video` **102/102, 4194/4194**; `test_ops_attention_cross`
**9/9, 32/32**.

**On CUDA: NOT bit-identical, and here is the number.** The warp kernel
groups the head_dim partial sums across 32 lanes instead of a 256-thread
block, so the same f32 online softmax associates differently. On
`dgx:gpu0` the host-vs-device parity case measures **video 8.9407e-08,
audio 4.47035e-08** against its committed `2e-5`, and bf16
CUDA-vs-CPU-backend at **0**. That is f32 round-off scale, 224x inside
the gate, and **the gate was not widened**.

**That is the only numeric evidence there is, and it bounds less than it
looks like it bounds.** The case runs the fixture's reduced dimensions,
so it bounds the ARITHMETIC change -- a length-D sum reassociated -- and
not the change at head_dim 128 with 2352 keys over 48 layers. A
diffusion render has no token gate to fall back on, and the flash arm
was interrupted before writing any frames, so **no pixel comparison
exists** either, not even against the completed 49-frame baseline render
already on the NAS. Filed as **#1612** and listed under `## Owed`.

**The `test_ops_attention` evidence is WITHDRAWN, not restated.** The
GB10 lease ran it at 10/10 and 88,439 assertions, and this change claims
nothing from that run: it measured the head_dim cases that came with the
cap-raise, and those are no longer in the tree. Two of its three arms
would not have supported the claim anyway, for the reason above. The
`test_ltx2_device` rows and the render below DO survive the revert, and
that is arithmetic rather than assertion -- the measured binary carried
the opt-in call, but the helper returns immediately below 49,152 B, so
it was a **no-op on every launch those numbers came from**.

## Reachability, twice

**Unit.** A new case drives the production entry point
`Ltx2DitForwardDevice` -- called from the denoise loop at
`ltx2_video.cpp:4246` -- and asserts the dispatch **two-sidedly**
through `GetOpProviderStats`: `kAttentionDenseFlash` selected exactly
**8** times (two self-attentions x two blocks x two batch rows) and
`kAttention` selected **0**. The negative half is what makes it a
routing proof rather than an addition proof. The case scope-guards its
own process state, because it enables a counting instrument and sets an
env var and contains `REQUIRE`s; measured with a scratch
`REQUIRE(false)` and an appended observer, **without the guards the
observer reads the knob still set and 8 leaked selections, and with them
it reads neither**.

That `:4246` is itself a repair. This branch and its spec both cited
`ltx2_video.cpp:4055-4059`, which points at prose about the res_2s step
counter -- at the row's declared base `6b48edb2c` and at HEAD alike, so
re-reading it at either revision would have caught it. It is the
citation the whole reachability argument rests on.
`cpu_ops.cpp:3551-3562` was wrong the same way and pointed at
`FusedStore`. Every other anchor in the spec has been re-read against
the base rather than carried forward, and eight more were corrected.

**Mutation M1**: restore `vt::Attention` at the call site, +1/-1,
compile rc 0. Both halves went red -- `CHECK( 0 == 8 )` and `CHECK( 8 ==
0 )`, exit 1 -- while every golden case in the same binary stayed green.
That contrast is the finding: no numerical gate in this tree can see a
500x slower kernel that computes the right answer. Tree restored and
re-gated green.

**Production, on the real model.** With `VT_OP_PROVIDER_STATS=1` the
full 21.00B render at `768x448/49f` on GB10 announces `op=21 device=1`
(`kAttentionDenseFlash` on CUDA) and announces `op=18 device=1`
(`kAttention` on CUDA) **zero times**. Same two-sided claim, taken
through `--device cuda` at full scale rather than on a fixture.

## The A/B: one arm measured, the pair still PENDING

Lease `6c724dfd` on `dgx:gpu0`, source `30dce3a1d`, one binary built
in-lease with cutlass-nvfp4, cutlass-fp8 and FA-2 all `ENABLED for
[121a]`. Correctness cleared before any speed number was read.

**Flash arm**, per DiT forward at `768x448/49f` = 2352 tokens, from the
engine's own `last=` lines:

| n | median | mean | min | max | spread |
|---|---|---|---|---|---|
| 19 | **7.680 s** | 7.633 s | 7.109 s | 8.196 s | 14.2% |

**The naive arm did not run, so this is not an A/B.** At forward 20 the
`rc` worker was lost and `dgx:gpu0` read `unhealthy (no contact)`. The
cause is UNPROVEN and this change does not name one: no memory trace was
taken and the box did not return to be asked. What is established is
that the harness as first written carried no memory guard and no sample
cap, which is a defect in this row's harness rather than a finding about
the change.

**The 47.84 s denominator carries two confounds this arm does not, and
both inflate the ratio.** Neither was disclosed before:

- **A stack sampler.** The denominator ran under `runguard.py
--stack-period 12` (`render.log:1`), which `eu-stack`s the process and
so `ptrace`-stops every thread. Its own `stacks.txt` prices that: **523
samples, median inter-sample delta 12.40 s against a 12.0 s period**, so
~0.40 s median and 1.50 s max of stopped process per sample. About 3.9
samples land inside each 47.84 s forward, ~1.54 s, **~3.2%**. Correcting
only the denominator gives **46.3 s / 7.680 s = 6.03x**.
- **A different prompt.** `render.log:1` carries a ~70-word prompt; the
harness uses one short sentence, and `ltx2_video.cpp:2253` sets
`context_tokens = encoded.seq` **unpadded**, so the DiT's
cross-attentions see a different number of keys in each arm.
Corroborated rather than inferred: `conditioning.tower` is **45.013 s**
against **28.426 s**. Same sign, and not quantified.

So the defensible statement is the range **6.03x to 6.23x**, quoted as
**~6.0x**, with the sampler correction named and the prompt confound
uncorrected and pushing the same way. `6.23x` survives in the records
only as the uncorrected upper end of that range, never on its own. The
A/B gate reads `PENDING` and this change does not claim otherwise.

**The flash arm's artifacts do not record what it ran**, which is why
those confounds had to be established from a phase duration.
`arm-flash.log` opens at `[render] + load` with no command line,
`wd-flash/` is empty, no `phase-log.json` was written, and the only
description of the run was a mutable NAS path edited 25 minutes after it
finished. Both halves are repaired: the harness is committed as
**`scripts/ltx25-dit-attn-flash-ab.sh`**, and every arm now writes its
own invocation -- harness sha256, binary sha256, source SHA, geometry,
seed, prompt, resolved command line -- to line 1 of its own log. It also
caps each arm at 13 samples, holds a 12 GiB `MemAvailable` floor, caches
the build on the source SHA, and runs the **naive arm first**.

That harness also had a precondition that could never pass. It grepped
`cuda_ops.cu` for `FlashTileSmemOptIn`, a spelling no revision of this
change ever used, so it counted 0 and would have `exit 42`-ed on a
correct tree as readily as on a wrong one. It is removed with the
cap-raise it guarded.

## CI

- **`documentation-checkpoint` was RED and it was THIS BRANCH's, not
inherited.** `2aa78c69b` and `2f39a9426` each recorded a measurement in
`.agents/benchmark-record.md` without writing `docs/STATUS.md` (and
`docs/BENCHMARKS.md` for the second); the control on the main-only range
`4c193bd55..5d548d0` is rc 0. Neither commit is in this branch's
history any more, and the checker is **re-run at this head** rather than
trusted to have stayed fixed -- a job that has stopped appearing in a
failing set is not the same fact as a job that passes. Local rc 0 over
the branch range. A side effect worth recording: that job runs `set -eu`
and this checker is the FIRST of three commands, so
**`check-now-current.py` and `check-role-discipline.py` never ran in CI
on this branch at all**. Both are rc 0 locally, so nothing hides behind
it.
- **`build-newest-gcc` is now GREEN on `main`** since #1581 landed, and
this branch carries that fix through the merge. Earlier runs of this PR
predate it. A red here now would be this branch's, not inherited.
- `build-test-cpu` and both `sanitize-cpu` lanes: **inherited**, and
verified from this head's own logs rather than from the issue numbers.
All three fail on exactly one case out of 585 -- `test_runner.cpp:1557`,
`CHECK_THROWS_WITH_AS(make_runner(), "Block size must be a multiple of
16", ...)` receiving `No valid attention backend for device type 0`
instead -- with byte-identical text in all three, and `main`'s own
newest baseline run fails the same case. `test_ltx2_device` passes in
all three, so this change's own cases are green on the lanes that run
them. From #1273; owned by #1602 and #1608.
- `windows-msvc-cpu` / `windows-msvc-vulkan`: **inherited**,
baseline-less lane. A markdown-only control PR (#1295) fails the
identical step. #584/#965 own them.
- The full set: **16 pass, 5 fail**, and the five are a strict SUBSET of
`main`'s newest baseline at `503e459005d7`. `scripts/main-baseline.py`
was the instrument, not the push runs, which are all cancelled (#274).

## Owed, filed and not folded in

- **#1612** -- there is no numeric or pixel comparison at production
geometry. The only numeric gate is the reduced-dimension one above; the
flash arm wrote no frames, so no pixel A/B exists. The f32 parity arm's
refusal at production geometry is recorded against the same issue.
- **#1551** -- `vt::AttentionDenseFa2` still refuses head_dim 128, so
LTX cannot reach tensor cores. Everything here is still a scalar
warp-per-query recurrence.
- **#1552** -- the same opt-in-by-name defect reaches every other
`vt::Attention` caller, and nobody will be told there either.

All three are listed under `## Owed` in
`.agents/specs/ltx25-dit-attn-flash.md`, together with the two
`scripts/attention-rung-allowlist.txt` stems that #1578's checker will
report `STALE` once the markers here meet it.

Closes #1549

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [claude-code]

---------

Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vt::Attention is opt-in-by-name with no selector, no warning and no gate: a model that never names a fast kernel silently pays up to 500x

2 participants