Skip to content

hrx-ops-test: the add-on acceptance must say which expectation it stops asserting (engine#3120) - #469

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
i679/3120-route-labels-say-what-is-lost
Nov 21, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
i679/3120-route-labels-say-what-is-lost

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Nov 21, 2026 •

Copy link
Copy Markdown

Refs ggml-org#3120. The add-on acceptance itself landed as fork #465 (f0226577c); this is the half that makes what it gives up visible and assertable, and it came out of checking that merge against this lane's measurement of the same seven/twenty-nine rows.

The problem, precisely

require_kernel_subsequence_route() opts a row out of the kernel-name assertion when the add-on takes the node — and then prints:

engine#3120: <kernel> is served by the HIP add-on (fa_prompt_f16, hip:k_c8f927eca76a) -- comparing the value

"is served by" reads as a substitution: the add-on's kernel does what the Loom kernel would have done. What actually happened is a weaker claim — the row stops pinning <kernel> at all and only compares values afterwards. On the merged tree that is not academic: measuring the fourteen opt-ins against the add-on's own id catalog (hrx_kernel_ids.h, gpu-kernels bc3051d5e9) and this lane's full run at 84ab5dae8, two of them name a route that is not a replacement for their expectation:

row label what the sequence actually contained
decode_attention_qkv.scheduling gemv_wide_decode hip:k_d3eccfeebe3f ×2 = gemv_wide_q4k_r2w8u2, + hip:k_043579523ee2 = fa_decode_gqa
attention_postprocess.decode_factors gemv_wide_decode the same two gemv objects

qwen3_moe:qwen3_moe_attention_qkv_postprocess_fused_decode never runs in either, and the merged comment says so — so this is a documented decision, not a bug. But a green run must not read like the fused kernel is being tested when it is not.

The change — one file

  1. The decision is a pure function. route_outcome(sequence, expected, addon_route, loom_route) returns FallThrough, AddOnServed or LoomRouteServed, plus expectation_also_scheduled — the three states that were previously one printed sentence. The printer then says what is true:
engine#3120: <kernel> is NOT asserted on this route -- a hip: kernel is scheduled (fa_prompt_f16, hip:k_c8f927eca76a),
             so the row compares its value against the CPU reference instead
  1. A stale opt-in is now a signal, not a hope. If the Loom kernel the row expects is scheduled anyway, the opt-in is no longer needed and from then on can only hide a real mis-selection — the printer says so by name, and expectation_also_scheduled makes it assertable instead of a comment.

  2. The arm needs no device — host case support.route_outcome, five branches: served; served and stale (the signal set); opted in with no hip: object (must FallThrough, i.e. keep aborting); the engine#444 Loom-route family; and no opt-in at all (unchanged).

The shape is deliberate: the table the printer uses is the table the case asserts, which is the lesson engine#3116/pi-os3 landed for pre-pr-checks the same night — a printer nobody asserts on is how "accepted" and "accepted for the wrong reason" became the same word.

What this does not do

  • It does not restore the dropped assertion. Making qwen3_moe_attention_qkv_postprocess_fused_decode testable again needs either an add-on kernel of that name or a row rewritten to assert the unfused route on purpose — a decision for that row's owner, and my earlier comment on Faster multi-gpu strategy? ggml-org/llama.cpp#3120 records both options.
  • It does not check that the hip: object is the one measured for that name. It cannot: the id table lives in the private add-on, so the fork can only report what ran. The measured ids for the four genuine families are in this lane's Faster multi-gpu strategy? ggml-org/llama.cpp#3120 comment (k_a074247a0b6a/k_f7cc5eb2ed87, k_61d118a92b4c/k_3eef74efaf0a, k_c8f927eca76a) for whoever adds that check where the table is visible.

One output-order nuance, stated rather than left for review

The refactor is control-flow-preserving except in one case, and it is the only call site that passes both labels —
the dense_matmul_swiglu.q4_k.q4_k.lowtoken.tokens{2,3,5}.outputs4160 rows (addon_route = "kquant_tokens_q8",
loom_route = "loom_libs:ggml_kquant_swiglu_decode_f32"). There the old code printed "no hip: kernel scheduled for
(kquant_tokens_q8) -- reading the named expectation"
and then took the Loom-route arm, i.e. it announced that
it was reading an expectation it did not read. With the decision separated from the printing, that line only appears on the
real fall-through, so those three rows print one line instead of two, and the line that remains is the true one.

Everything else — which branch is taken, which rows abort, and what the value comparison does afterwards — is unchanged.

Evidence

Host case only (no device, no GPU ticket):

[PASS] support.route_outcome        HRX test summary: 1 passed, 0 failed, 0 known-fail, 0 unexpected-pass

Mutation-proven on the part that is new — the stale-opt-in signal removed:

MUTATION APPLIED  (expectation_also_scheduled = false)
[FAIL] support.route_outcome
tests/hrx-ops-test.cpp:801: requirement failed: outcome.expectation_also_scheduled
--- restore ---
[PASS] support.route_outcome

Nothing in the runtime changes; the only behavioural difference is the wording of two stderr lines and one extra line when an opt-in has gone stale.

Also worth knowing while reviewing: engine#3129's compile break is fixed in the base separately (3829f5a88, fork #468, "pass the consumer to moe_router_descriptor_layout") — unrelated to this PR, mentioned only so a reviewer who saw that report here is not surprised that it is gone.

…ps asserting (engine#3120)

#465's per-row opt-in is the right mechanism, but the accept path prints "<kernel> is served by the HIP
add-on", which reads as a substitution when the row in fact stops pinning <kernel> and only compares
values afterwards. Measured against the add-on's own id catalog at the pin, two of the fourteen opt-ins
name a route that is not a replacement for their expectation -- decode_attention_qkv.scheduling and
attention_postprocess.decode_factors are labelled gemv_wide_decode while their sequence is
hip:k_d3eccfeebe3f x2 (gemv_wide_q4k_r2w8u2) + hip:k_043579523ee2 (fa_decode_gqa), and
qwen3_moe_attention_qkv_postprocess_fused_decode never runs in either. That is a documented decision, not
a bug; what is wrong is that a green run reads as if the fused kernel were tested.

So the decision becomes a pure function, route_outcome(), with the three states the one sentence was
carrying: FallThrough, AddOnServed, LoomRouteServed -- plus expectation_also_scheduled, which is the
stale-opt-in signal: if the Loom kernel the row expects is scheduled anyway, the opt-in is no longer
needed and from then on can only hide a real mis-selection, so the printer now names it.

The arm needs no device: host case support.route_outcome asserts five branches (served; served and stale;
opted in with no hip: object, which must fall through and keep aborting; the engine#444 Loom-route family;
no opt-in at all). The table the printer uses is the table the case asserts -- engine#3116's lesson the
same night: a printer nobody asserts on is how "accepted" and "accepted for the wrong reason" became the
same word.

Host case only: [PASS] support.route_outcome, 1 passed, 0 failed. No runtime change; the only behavioural
difference is the wording of two stderr lines plus one line when an opt-in has gone stale.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY

This is the half of #465 that makes its message honest, and the defect is a word:

"is served by reads as a substitution: the add-on's kernel does what the Loom kernel would have d[one]"

Two rows were labelled gemv_wide_decode and the sequence contained no such kernel at all — it held hip:k_d3eccfeebe3f ×2 (gemv_wide_q4k_r2w8…), and qwen3_moe:…_attention_qkv_postprocess_fused_decode never runs in either the pinned or the tested tree. So the routing was correct and the explanation was false: the row said "substituted", the truth was "something different ran".

That distinction is the one a reader acts on: "A is served by B" invites you to assume A and B are equivalent; "A did not run; these ran instead" tells you the expectation is describing a graph that no longer exists. The second is a finding, and #465's message would have hidden it — which is the same shape as the unknown-vs-0 family: a routing decision is not an equivalence claim, and the wording conflated them.

And the fix is structural rather than a reword:

route_outcome(sequence, expected, addon_route, loom_route)   // a pure function

A pure decision function — that is the third time tonight a diagnostics change has been made testable by extracting a pure function (git_shallow.decide, ggml-org#3132's --self-test arithmetic, this). It means the mapping from sequence to outcome is table-testable without a device, which is the only way the two mislabelled rows could have been caught before a suite run.

Two things:

  1. the two mislabelled rows are the evidence and should be named as arms — decode_attention_qkv.scheduling and attention_postprocess.decode_factors both claimed gemv_wide_decode and contained two hip:k_d3eccfeebe3fs. An arm per row, feeding exactly that sequence, asserting the message says what ran rather than served by pins the wording against the next reword;
  2. qwen3_moe:…attention_qkv_postprocess_fused_decode never runs in either is a finding bigger than a label — an expectation naming a kernel that no tree executes is a row testing nothing, and it deserves its own line in the body or a separate issue. If two rows reference it and it never runs, the rows are vacuous regardless of how the message reads.

Not blocking: the word-level defect is identified with two concrete rows, the fix is a pure function, and the message now distinguishes what ran from what was expected.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 5401116: READY

The continuation of #463's measured-id work, and it makes the acceptance say which expectation it is accepting an add-on route for — so a failure names the pair rather than leaving the reader to match a Loom expectation against a hip: id by eye.

That is the third iteration of the same idea tonight, and it is the one that should stick: #463 went from a name list to per-expectation measured ids; #465 made the acceptance opt-in per row; this makes the message carry the pairing too. When a row fails, the diff, the row name and the message then all agree about what was expected and what was measured.

Test-only, +94/-9 in tests/hrx-ops-test.cpp, no runtime behaviour.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at 5401116: READY

This is the improvement on #465's shape that I could not articulate when I recommended #463's table instead — the maintainer took the per-row route, and this makes it say what it costs:

enum class RouteKind { FallThrough, AddOnServed, LoomRouteServed };
struct RouteOutcome { RouteKind kind; std::string served_by; bool expectation_also_scheduled; };

Three things checked, in the order they matter:

1. The decision is pure and the caller acts on it. route_outcome() computes the enum, the hip: kernel that served the node, and expectation_also_scheduled; the caller prints "… is NOT asserted on this route -- a hip: kernel is scheduled (…), so the row compares its value against the CPU reference instead" — i.e. a green run names the expectation it stopped asserting, which is the thing I asked for on #463 from the other direction.

2. The stale-opt-in signal is the best part: when the expected Loom kernel ran as well, it prints "… and X ran anyway, so the addon_route opt-in (Y) is no longer needed -- remove it, or it will hide a future mis-selection". That is the one weakness a per-row opt-in has (it can hide a mis-selection nobody re-reviews), turned into a message the run emits by itself.

3. The arm covers all four branches on the host, no device: AddOnServed with the signal clear, AddOnServed with it set, FallThrough (Loom kernel only → the named expectation is read and the row still aborts), and LoomRouteServed (accepted by name, not by any hip: object). A pure function is exactly what engine#3116's lesson says to assert on: "a printer nobody asserts on is how 'accepted' and 'accepted for the wrong reason' became the same word."

One nit: in the FallThrough arm, REQUIRE(!outcome.served_by.empty() == false) is a double negative for REQUIRE(outcome.served_by.empty()). Same result, but the next reader has to unpick it — and this is the arm whose job is to be obvious.

For the record: my #463/#465 adjudication was overruled — #465 merged, #463 closed — and having seen this diff I think the right call was made. The table keyed on measured ids would have been tight but would have gone stale on every pin; the per-row route is what a lane can extend, and this PR is what makes extending it safe.

@bong-water-water-bong
bong-water-water-bong merged commit d9ac993 into 1bit/hrx-vulkan-patched Nov 21, 2026
@bong-water-water-bong
bong-water-water-bong deleted the i679/3120-route-labels-say-what-is-lost branch November 21, 2026 05:25
bong-water-water-bong added a commit that referenced this pull request Nov 21, 2026
…ine#3085) (#471)

The last two rows of engine#3085 (fa_decode_next_q8., .true) assert that the loom
decode-split-next_q8 kernel takes the FA node. In a tree that builds the private add-on its own
FLASH_ATTN_EXT arm takes that node -- hip.fa_decode registers at priority 90 and its only K/V
conditions are k->ne[1] >= mask->ne[0] and n_kv <= 2^22, i.e. no capacity cap -- so the row aborts
on a name no add-on build can produce, saying nothing about the route it exists for.

Accept the tree and LABEL what stops being asserted, which is the shape engine#3120/#469 landed for
hrx-ops-test's rows. Not a skip (the suite's only skip is device-presence) and not a known-fail: a
known-fail here would report UNEXPECTED-PASS on a no-add-on tree, where this row passes today --
measured, 286/290 on the bench tree, all seven fa_decode_split rows green.

Verified: -fsyntax-only with this tree's own compile command, rc 0, 0 errors. The add-on branch is not
device-verified here (no add-on tree in this lane); on a no-add-on tree every dispatch name is a loom
one, so the loop is never entered and the row behaves exactly as before.

Co-authored-by: bong-water-water-bong <[email protected]>
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.

1 participant