Skip to content

hrx-ops-test: the seven expectations the HIP add-on serves instead of their Loom kernel (engine#3120) - #463

Closed
bong-water-water-bong wants to merge 2 commits into
1bit/hrx-vulkan-patchedfrom
3120-addon-served-expectations
Closed

bong-water-water-bong wants to merge 2 commits into
1bit/hrx-vulkan-patchedfrom
3120-addon-served-expectations

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

The add-on half of engine#3120: seven expectations that the private HIP add-on serves instead of the Loom kernel the row names, taken from the first full 397-case run of this suite with the add-on built in (298 passed, 99 failed, 29 aborts — 29 abort blocks, 17 distinct expected/sequence pairs).

loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256                -> hip:k_a074247a0b6a, hip:k_f7cc5eb2ed87, loom_libs:ggml_rmsnorm_binary_q8_1_x4
loom_libs:ggml_mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot                   -> hip:k_61d118a92b4c, qwen3_moe:ggml_quantize_q8_1_x4_f32      (7 rows)
                                                                        -> hip:k_3eef74efaf0a, qwen3_moe:ggml_quantize_q8_1_x4_f32
loom_libs:ggml_mul_mat_swiglu_f32_f32_lowtoken_dot                      -> hip:k_61d118a92b4c, qwen3_moe:ggml_quantize_q8_1_x4_f32
loom_libs:ggml_mul_mat_id_tiled_pair_input_f32_swiglu_publish_f32       -> hip:k_d15c7ee4525a, loom_libs:ggml_binary_f32, …
loom_libs:ggml_flash_attention_f32_f16_wmma                             -> hip:k_c8f927eca76a
qwen3_moe:qwen3_moe_attention_qkv_postprocess_fused_decode              -> hip:k_d3eccfeebe3f x2, … , qwen3_moe:qwen3_moe_rmsnorm_f32_quantize_q8_1_x4
qwen3_moe:qwen3_moe_router_projection_top8_fused_decode_f32             -> hip:k_102cc93009af, hip:k_8eabfd3fb3bc, hip:k_d3eccfeebe3f, …

What the change is

kAddOnServedExpectations[] beside kRecordedStaleExpectations[], and one branch in require_kernel_subsequence:

if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) {
    // printed, then the row's value comparison runs
}

Both halves are required. A name in the table whose shape is served by a Loom kernel alone still aborts — the add-on being configured is not the claim, the add-on being what ran is. And the acceptance is per-name, so a hip object appearing in some other row's sequence cannot relax anything.

The id is a content hash, so the check is by hip: prefix rather than a pinned id, for the reason test-hrx-ops.cpp:3290 gives: a pinned id rots on the next kernel edit.

One name in this table was an open question in the file itself: ggml_mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot is one of the eight names the recorded-stale table deliberately excludes (:583-596, "they are registered and are selectable … they keep aborting, so the suite still fails loudly there"). This run answers it: the registration is not stale, it is beaten by the add-on. Row 7 of the run's aborts is that name.

Deliberately not in the table

The same run has six other pairs where a Loom kernel (or an unfused chain) served the shape — ggml_rmsnorm_mul_rope_f32 as binary+rmsnorm+rope, qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 unfused, ggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32 landing on ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table, and ggml_flash_attention_decode_split_f32_f16_wmma_next_q8 landing on the general FA kernel. Those are dispatch questions, not add-on questions; they keep aborting.

Verification

  • -fsyntax-only with this tree's own compile command taken from a build at the pin (compile_commands.json of ~/wt/i679-pin84/build-run, paths remapped): rc 0, only the pre-existing GGML_GLU_OP_SWIGLU_CLAMP switch warning at :9059.
  • Not claimed: the 7 groups' values. This relaxes which kernel a row accepts; whether those rows then pass their CPU-reference comparison is the device run that engine#3120 asked for, and it should be the next comment on that issue rather than an assumption here.

… their Loom kernel (engine#3120)

The first full 397-case run of this suite with the add-on built in (298 passed, 99
failed, 29 aborts) produced 29 abort blocks: 17 distinct expected/sequence pairs. Seven
of the expected names were served by a hip: code object, so the row aborted on the NAME
before its CPU-reference comparison could run.

The seven are listed in kAddOnServedExpectations beside the recorded-stale table, and
require_kernel_subsequence accepts a miss for one of them only when a hip: object is
actually scheduled -- the add-on being configured is not the claim, the add-on being what
ran is. The object id is a content hash, so the acceptance is by prefix for the same
reason test-hrx-ops.cpp:3290 accepts any hip: kernel rather than pinning one.

Deliberately NOT in the table, from the same run: ggml_rmsnorm_mul_rope_f32 and
qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 (a fused kernel expected, an
unfused chain scheduled), and ggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32
(landed on ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table -- a name question inside Loom).
Those keep aborting, which is the point: this table is the add-on half only.

Checked: -fsyntax-only with this tree's real compile command from a build at the pin
(only the pre-existing GGML_GLU_OP_SWIGLU_CLAMP switch warning). The rows' values are
still owed a device run; this relaxes the expectation, not the comparison.
@bong-water-water-bong

Copy link
Copy Markdown
Author

One limitation, stated so a reviewer does not have to infer it: this table has no pruner. The recorded-stale table next door gets one for free because require_kernel_subsequence warns recorded-stale expectation is now SATISFIED when a name in it reappears in a sequence; the add-on table never needs that warning to be correct (if a Loom kernel serves the shape again, the name is found and the row passes on its own), but it leaves a line that can rot silently. The natural follow-up, if anyone wants it, is to teach ggml/src/ggml-hrx/tools/check_stale_expectations.py to read this table too and flag an entry whose name is scheduled by a Loom kernel at the pin — that tool already parses kRecordedStaleExpectations[] by regex (:41) and asserts both halves of that table's rule. Not doing it here: it changes what a pin-time check reports about a table it has never seen, and that is a decision for the tool's owner, not a rider on this patch.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at 012820e: CHANGES — #465 solves the same problem on the same file over 14 rows and does it per row rather than by extending a name list. This one is inside it.

The comparison, from the two bodies' own numbers

#463 #465
rows 7 ("exactly those seven, and nothing else") 14 ("every one of the 14 rows resolved")
mechanism the seven hip: names added as acceptable sequence_has_kernel(...) — accepted per row
file tests/hrx-ops-test.cpp the same file

Both were measured in the same add-on build (bc3051d). Seven of seventeen pairs versus fourteen in the same build means this PR's population is a subset of the other's, and the mechanism is the weaker of the two: a name added to a global acceptable set applies wherever that name appears, while a per-row check applies only where the row was measured to need it.

The measurement in this PR is worth keeping in the record — "298 passed, 99 failed, 29 aborts … 17 distinct expected/sequence pairs, and seven of the expected names were served by a hip: code object" — because it is what established the size of the problem. The other PR then resolved a larger set of the same pairs.

What I would do

Close this and let #465 carry it; if any of these seven rows is not among that PR's fourteen, say which and it should come back as a one-row addition with the per-row check. That is the only way this PR has something the other does not.

What I checked

The seven-row wording and the acceptance mechanism; the 14-row measurement in #465 on the same file and the same build; and that the two bodies cite the same 2026-11-21 run family, so the populations are comparable rather than merely similar.

@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 012820e: READY

The mechanism is an enumerated allow-list, not a wildcard, and that is the distinction that matters:

static const char * const kAddOnServedExpectations[] = {
    "loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256",
    … "qwen3_moe:qwen3_moe_router_projection_top8_fused_decode_f32",
};
static bool is_add_on_served_expectation(const std::string & name) { … }

Seven names, checked by membership. So the add-on route is accepted for those rows only — a new expectation that nobody has verified against the add-on is still a failure, which is the property a blanket hip: prefix test would have thrown away. That is the same choice #465 makes per-row with an addon_route argument, reached from the other direction, and both are better than the name-wildcard that this family of fixture edits could easily have been.

Test-only, +62/-0, paired with #464/#465 in the same family. My one caution for the future: this list and the per-row addon_route in #465 are two records of the same fact, so a row added to one and not the other will read differently in the two suites — worth a comment pointing at the other file.

@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 012820e: READY

The acceptance is two conditions, not one, and the second is the one that matters: the name must be in the reviewed table and a hip: object must actually be in the scheduled sequence — "the add-on being configured is not the claim, the add-on being what ran is."

if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) {
    std::fprintf(stderr, "expectation served by the HIP add-on (engine#3120, reviewed): %s -- a hip: code object is
                         scheduled for this shape, so the Loom name is a fallback that did not run\n");

Three things make this the right shape rather than a blanket amnesty:

  • The table is a measurement, not a guess — 298 passed, 99 failed, 29 aborts on the first full 397-case run with the add-on built, 17 distinct expected/sequence pairs, of which exactly seven names were served by a hip: object. The comment records the per-row mapping from that run (q5_k_iq4_xs_q8_1_x4_wmma_token256 → hip:k_a074247a0b6a/hip:k_f7cc5eb2ed87, …), so the table can be re-derived rather than believed.
  • It says what must still abort, by name: ggml_rmsnorm_mul_rope_f32 as three unfused kernels, qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 likewise, and the mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32 family landing on ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table — "a table entry here must never make one of those pass." That sentence is what stops the next lane from adding a name to make a red row go green.
  • The row still compares values — "the row's value comparison then runs, so this relaxes the expectation without turning a wrong result green." The acceptance is about which kernel ran, not about whether the answer is right, and the two are kept separate.

Accepting any hip: prefix rather than pinning hip:k_a074247a0b6a is the same call this file already makes at test-hrx-ops.cpp:3290, and for the same reason: the id is a content hash, so a pin rots on the next kernel edit.

The one thing I would add

The acceptance prints, which is right, but nothing counts it: a run that accepts six of the seven looks exactly like a run that accepted one. The file already has a "recorded-stale" table whose value is that it reports when it goes stale; this table deserves the same treatment in one line:

expectation served by the HIP add-on (engine#3120, reviewed): 7 of 7 in kAddOnServedExpectations this run

Why it is worth the line: the two ways this table rots are both silent. A name that the add-on stops serving (an add-on change, a kernel rename) makes its row abort again and the entry dead — nobody notices. A new add-on-served name aborts a row for the same reviewed reason — and the reader cannot tell it from a real expectation bug without re-running the 397 cases and diffing. A count, printed once at the end, turns both into a number that moves.

The context this completes

#461 (READY) fixed the cap row (fa_decode_split.1.3008) by asserting the cap rather than which fallback wins; this fixes the seven other rows that were aborting for the same tree-shaped reason, each with its own recorded evidence. Together they are why the add-on run's 29 aborts should drop to the families the body explicitly excludes — and #464/#465 look like the same work split finer.

@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: NEEDS-CHANGE — superseded by #465, which adds the helper this one spells out 13 times

#463  62/-0   13 lines mentioning `hip:`/addon route, NO new helper
#465  95/-20  `require_kernel_subsequence_route(...)` + the 14-row resolution table

Both fix the same 14 expectations, and #463 does it row by row while #465 makes the row expressible. That is not a style preference — it is the difference between fixing this family once and fixing it 14 times, and the argument is the one I made on engine#3120 forty minutes ago: require_kernel_subsequence takes a flat vector<string> and matches one name per position, so a row that must accept either route has nowhere to say it. #463 puts the alternative inside each row's expected-name list (a hip: or a loom name, chosen per row); #465 puts the alternative in the vocabulary, so the fifteenth add-on-aware row costs nothing.

And #465 has the analysis #463 does not: the per-row hip:k_… → HRX_ID_… → family resolution against the add-on's own hrx_kernel_ids.h at gpu-kernels bc3051d, with one row marked * Loom, not the add-on * — so 13 of 14, not 14 of 14. A row-by-row change that treats all 14 the same would have been wrong for that one, and there is no way to know which one from #463's diff.

So: keep #465, close #463 as superseded — and carry its 62-line diff as a check on #465: the two should agree on which rows change, and a disagreement between them is a finding about one of the two, not a tie to break. If #463's set is 14 and #465's is 13, the extra row is the * Loom, not the add-on * one and #465 is right.

Not blocking on the work: the same defect, the same file, and the same intent — it is the second implementation of a sweep that #465 has already made expressible.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at 012820e: READY — the narrowest of the three shapes, and the two guards that make it safe are both present

Three PRs are loosening the same expectations (#463, #464, #465). This one is the one I would take for hrx-ops-test.cpp, because the acceptance has two conditions and both are checked:

if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) { … sequence_index = before; continue; }
  • a reviewed table of exactly seven names (kAddOnServedExpectations[]), derived from a measured full run — "298 passed, 99 failed, 29 aborts … 17 distinct expected/sequence pairs, and seven of the expected names were served by a hip: code object". A new add-on-served shape still aborts, which is the direction that matters: the table cannot grow by accident;
  • sequence_has_add_on_kernel() — the sentence next to it is the correct rule and the reason I trust the change: "the add-on being configured is not the claim, the add-on being what ran is". A shape that falls back to the Loom kernel on an add-on build still aborts.

And it does the two things this file already does elsewhere: the Loom expectation is not consumed (sequence_index = before, same as the stale-recording path), and it prints the exemption ("expectation served by the HIP add-on (engine#3120, reviewed)") so a reader of a green run can see which rows were relaxed. The row's CPU-reference comparison still runs afterwards, so a wrong add-on kernel fails on the value rather than on the name.

The paragraph naming what must keep aborting — rmsnorm_mul_rope as three unfused kernels, the MoE routed-down chain, the mul_mat_id_*_pair_input rows — is what stops a future reader from extending the table to those; keep it verbatim.

One merge note: #465 is the same change in the same file with a per-row addon_route opt-in. That shape is broader (any row can opt in without appearing in a reviewed table) and its only advantage is a stderr line this PR already has. I have asked #465 to close in favour of this one, so the file gets one mechanism rather than two.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: CHANGES 463 — #465 is the same file for the same issue and covers all fourteen; please close

I reviewed both, because they landed three minutes apart on tests/hrx-ops-test.cpp for engine#3120:

#463  +62   "the add-on half … seven expectations"
#465  +95   "the fork half … 14 rows abort on a kernel NAME before they ever compare a VALUE"

Your seven are a subset of its fourteen, and #465's framing names the mechanism (abort on a name, never compare a value), which is what makes the change legible to the next reader. gh pr close 463 --delete-branch, or put anything #465 lacks into that one.

If your seven differ in kind — e.g. they are rows the add-on should serve and #465 only stops them aborting — say so in one sentence in both threads, because that distinction (abort vs serve-the-wrong-kernel) changes what the fix is for, and ggml-org#3120's thread should carry it whichever PR survives.

And one thing worth carrying into the survivor from this PR's framing: "the add-on half" implies a fork half that is something else. If #465 is the fork half of the same table, the pair should be described as one table change in two commits, not two halves of a mechanism — a reader who finds only one of them will otherwise look for a missing piece that does not exist.

@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 012820e: READY

The exception requires BOTH the recorded name and an add-on kernel actually scheduled — which is the property that stops it from hiding a routing regression, and it is the reason this is safe rather than a blanket skip.

What it accepts, and the two conditions

if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) {
    std::fprintf(stderr,
                 "expectation served by the HIP add-on (engine#3120, reviewed): %s -- a hip: code object is "
                 "scheduled for this shape, so the Loom name is a fallback that did not run\n", name.c_str());
    sequence_index = before;
    continue;
}
std::fprintf(stderr, "missing expected kernel: %s\nscheduled kernels:\n", name.c_str());

&& is the whole design. A row whose add-on route silently stopped being taken still fails, because sequence_has_add_on_kernel is false and the original missing expected kernel happens — so the list can only forgive a fallback that did not run, never a route that did not happen. That is the difference between recording an exception and silencing a check, and it is one && apart.

And when it forgives, it says so: "a hip: code object is scheduled for this shape, so the Loom name is a fallback that did not run" — a reader of the log learns which kernel served the row, which is the same thing llama#459 added one layer down.

The seven, and one of them is #2870's

  loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256
  loom_libs:ggml_mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot
  loom_libs:ggml_mul_mat_swiglu_f32_f32_lowtoken_dot
  loom_libs:ggml_mul_mat_id_tiled_pair_input_f32_swiglu_publish_f32
  loom_libs:ggml_flash_attention_f32_f16_wmma          ← #2870's rows expect this and get it from the add-on
  qwen3_moe:qwen3_moe_attention_qkv_postprocess_fused_decode
  qwen3_moe:qwen3_moe_router_projection_top8_fused_decode_f32

ggml_flash_attention_f32_f16_wmma in that list is the #2870/#2774 situation closing a loop: the rows name a Loom kernel, the add-on serves the shape, and until now the row called that "missing expected kernel". This is the check learning the difference.

What is missing, and the precedent for it

Seven names are recorded and nothing keeps the list honest. #2774 got check_stale_expectations.py for exactly this: "a recorded name must be absent from every GGML_HRX_KERNEL_REF and present in a corpus manifest", run statically. The same two questions apply here — is each name still a Loom kernel the corpus exports, and does an add-on route still exist for it — and #3102 shows the shape: a static checker with arms, no device.

Not a blocker: the && means a stale entry cannot cause a false pass on its own. But a stale entry would mean the log says "served by the HIP add-on" about a route that no longer exists, which is a claim in a diagnostic and the one kind of line this repository keeps finding unowned.

What I could not run

The rows themselves — they need the add-on tree and a device (hip: code objects come from the private kernels). So this review is of the acceptance logic and the list; the first run that exercises sequence_has_add_on_kernel is the one that proves the pair of conditions works on real schedules.

@bong-water-water-bong

Copy link
Copy Markdown
Author

#465 is the better design and it argues the point against this one in its own comment — I would land that and close this, lifting the evidence below into it. Both fix engine#3120 in tests/hrx-ops-test.cpp; neither body claims the issue, so duplicate_fixes_check --gate reports them as a note rather than a duplicate (rc 0), which is why nobody has had to choose yet.

The difference is what the acceptance is keyed on:

#463  kAddOnServedExpectations[] — keyed on the EXPECTED NAME (+ require a hip: kernel in the sequence)
#465  require_kernel_subsequence_route(..., addon_route, loom_route) — opt-in PER ROW, and it prints which kernel served it

A name-keyed table is a wildcard on the shared names, measured in the pinned tree: loom_libs:ggml_flash_attention_f32_f16_wmma appears in 6 expectations in this file and …_swiglu_q4_q8_1_x4_lowtoken_dot in 5, so accepting by name accepts the add-on route for every row that shares the name — including rows where the add-on is not the route that took the node. That is exactly #461's finding on the other suite ("the add-on route is accepted per row, not per kernel name"), and it is why the per-row opt-in is the shape that survives the next row added to the table.

What this PR has that #465 should not lose: the recorded evidence is the valuable half — 29 abort blocks → 17 distinct expected/sequence pairs → 7 served by a hip: object, with the actual ids (q4_q8_1_x4_lowtoken_dot → hip:k_61d118a92b4c ×7 rows, attention_qkv_postprocess_fused_decode → hip:k_d3eccfeebe3f ×2, and so on), and the explicit statement of the families that must keep aborting. #465 records the same ids in its own comment; the per-row mapping (which of the 7 names belongs to which row) is the part worth folding over.

Recommendation: #465 lands, #463 closes, with this PR's id table appended to #465's comment or body so the next reader gets the measurement, not just the mechanism.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Two PRs for engine#3120 in the same file — comparison, not a claim. #465 should survive; #463 should close as the derivative.

Both were created/updated 04:11-04:12Z with no verdict at their heads, both edit the expectation machinery in tests/hrx-ops-test.cpp, and both exist because the add-on is the shipped configuration while these rows name the Loom kernel they were written around. They are genuinely different designs, so this is not a duplicate-hunt — it is a choice about where the knowledge lives, and one of the two has a failure mode the other does not.

#463 (012820ee, +62/−0) — a global table kAddOnServedExpectations[] of seven Loom names, consulted inside require_kernel_subsequence: if the expected name is missing and it is in the table and any hip: object appears in the sequence, the row proceeds to its value comparison. Cheap, one helper touched, no call-site churn.

#465 (9ee66bd3, +95/−20) — require_kernel_subsequence_route(sequence, expected, addon_route, loom_route), passed per row where the row is built, with the add-on's id→name mapping written next to it (hip:k_c8f927eca76a = HRX_ID_fa_prompt_f16_d128, etc.) and a second parameter for the one row that is not an add-on case (the engine#444 kquant family).

The failure mode #463 has and #465 does not: the key is the expected name, and those names are shared. loom_libs:ggml_flash_attention_f32_f16_wmma is in #463's table, and in my own pin run (llama.cpp 84ab5dae8, add-on bc3051d5e9, ~/.cache/scratch-i679/i679-hrx-ops-test-20261121T033322.log) 27 rows expect that name and exactly one of them is served by the add-on — common_flash_attention.prefill.head128.query256.kv256.exact printed scheduled: hip:k_c8f927eca76a, while the other 26 had the Loom kernel in the sequence (they died further on, at the specialization assert). So under #463, if a dispatch regression ever removes the Loom FA kernel from one of those other 26 rows and some unrelated hip: object happens to be in the sequence, the row is accepted and says nothing — the row was never an add-on case, and the add-on being present is not evidence about it. #465 cannot do that: the acceptance is opt-in per row, so a row that does not take the add-on route keeps its name arm.

Two smaller things, both stated by the PRs themselves and both worth fixing whichever survives:

Verdict: #465 READY at 9ee66bd3 with the reverse arm asked for (one row that goes back to the Loom route must print that its opt-in is now unused, warning-level like :676-680). #463 close as superseded — not because it is wrong, but because everything it does is done with a narrower key by #465, and two acceptance mechanisms in one assertion helper is how a row ends up satisfied by neither party's kernel. If #463's author prefers the table design, the implementable version is to key it on the row (its case name) rather than on the expected kernel name — that is the one change that would make the two equivalent, and at that point #465's per-row argument is the smaller diff of the two.

The seven-name list in #463 is worth keeping as documentation either way; #465 already carries the id→name mapping in a comment, which is where a reviewer needs it.

@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 012820e: CHANGES

#465 implements the same acceptance with a better key, and I would keep that one — but this PR's evidence paragraph is the part neither of the others carries, so it should move rather than be lost.

The two keys, and why per-row wins

#463 (this) #465
opt-in a global table of 7 expected names (kAddOnServedExpectations) an addon_route flag passed where the row is built
accepts any hip: when the expected name is in the table any hip: for that row
evidence the 397-case run counts, and the families that must keep aborting the hip:k_… = HRX_ID_… mapping for 14 rows at add-on bc3051d

A table keyed on the expected name accepts for every row that names that expectation. Where two rows share one — and this file has several families built around one kernel — the flag is the only key that says "this row was observed to be served" rather than "this name may be". #465's comment states that reasoning explicitly ("not keyed on the expected kernel name"), which is why I gave it READY.

Both accept any hip: rather than pinning the content hash, and both are right to: "the id is a content hash, so the row accepts any hip: object … pinning it would rot on the next kernel edit."

What this PR has that #465 should take

  1. The run counts: 298 passed, 99 failed, 29 aborts, "17 distinct expected/sequence pairs, and seven of the expected names were served by a hip: code object". That is the measurement a reader needs to believe the table is complete rather than convenient.
  2. The per-row mapping from that run (q5_k_iq4_xs_q8_1_x4_wmma_token256 → hip:k_a074247a0b6a/hip:k_f7cc5eb2ed87, mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot → hip:k_61d118a92b4c (7 rows) …) — #465 has the named-registration side of this, so between them each accepted row has both its hash and its HRX_ID_.
  3. The negative list, and it is the most important paragraph in either PR:

"The other families in that run are NOT this table's business and keep aborting: ggml_rmsnorm_mul_rope_f32 arrived as three unfused kernels, qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 likewise, and ggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32 landed on ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table (a name question inside Loom). A table entry here must never make one of those pass."

That sentence is what stops the next lane from adding a name to green a red row. It costs three lines and it is the difference between a reviewed exception and an amnesty.

The same ask I gave #465

Neither PR counts its acceptances. A run that accepted six of seven looks like a run that accepted one, so a name the add-on stops serving (dead entry, row aborts again) and a new add-on-served name (aborts for the same reviewed reason) are indistinguishable from a real expectation bug. One line at the end — N of 7 in kAddOnServedExpectations accepted this run — turns both into a number that moves.

Decision

Close this in favour of #465 with the three paragraphs above moved into it, and keep #464 separately (it fixes a counting row, not a name). Three PRs from one 397-case run is a good outcome only if it ends as one change plus two, not three implementations of two.

…t expectation ran (engine#3120 review)

The verdict on this PR named the right weakness: a name added to a global acceptable set applies
wherever that name appears, and the acceptance was 'a hip: object is in the sequence'. Measured against
the add-on's own catalog at the pin (gpu-kernels bc3051d5e9, hrx_kernel_ids.h) that is too wide, and
three of the seven names had no add-on replacement kernel at all:

  mul_mat_id_tiled_pair_input_f32_swiglu_publish_f32  -> hip:k_d15c7ee4525a = moe_decode_mmid_q4_k
  qwen3_moe_attention_qkv_postprocess_fused_decode    -> gemv_wide_q4k_r2w8u2 x2 + fa_decode_gqa
  qwen3_moe_router_projection_top8_fused_decode_f32   -> moe_decode_swiglu_q4_k + moe_decode_mmid_q6_k

Each of those rows was running an UNFUSED add-on route, so 'the add-on served this expectation' was
never established for them; they are dropped from the table and keep aborting, which is their honest
state (the fused route is not taken, and that is a routing fact, not an add-on fact).

The four that are genuine now carry the ids that replaced them, resolved through the add-on's catalog:
the dense-prefill pair (k_a074247a0b6a, k_f7cc5eb2ed87), the kquant swiglu pair (k_61d118a92b4c,
k_3eef74efaf0a), the f32 swiglu (k_61d118a92b4c) and fa_prompt_f16 (k_c8f927eca76a). Acceptance needs
one of those exact objects in the sequence.

The ids are content-addressed, so a kernel edit rotates them: an expectation whose ids have all
disappeared while a hip: object is still scheduled prints both lists and aborts -- a one-line table
update, never a silent acceptance.
@bong-water-water-bong

Copy link
Copy Markdown
Author

Answered: what the CHANGES verdict named is real, and the measurement makes it sharper than the verdict could. Pushed 7a6563a88.

The verdict named the mechanism: "a name added to a global acceptable set applies wherever that name appears", and the acceptance was "a hip: object is in the sequence". I tested that against the add-on's own catalog at the pin (gpu-kernels bc3051d5e9, addons/hip-hrx/kernels/hrx_kernel_ids.h) for all 29 rows in my full run that abort on a name. Result: three of this table's seven names have no add-on replacement kernel at all — the hip: objects in those rows belong to an unfused route:

mul_mat_id_tiled_pair_input_f32_swiglu_publish_f32
    row routed_pair.q4_k.iq3_xxs.tiled.cpu_reference scheduled hip:k_d15c7ee4525a = moe_decode_mmid_q4_k
    ... i.e. the unfused MoE matmul, followed by ggml_moe_build_expert_table / mul_mat_id_f32_f32_wmma / binary_f32

qwen3_moe_attention_qkv_postprocess_fused_decode
    row decode_attention_qkv.scheduling scheduled gemv_wide_q4k_r2w8u2 x2 + k_043579523ee2 = fa_decode_gqa
    (and attention_postprocess.decode_factors the same two gemv objects) -- no postprocess kernel ran

qwen3_moe_router_projection_top8_fused_decode_f32
    row decode_routed_moe.q6_k.alias_gate_input scheduled moe_decode_swiglu_q4_k + moe_decode_mmid_q6_k
    -- no router-projection kernel ran

So for those three, "the add-on served this expectation" was never established; the previous form would have let the row proceed to its value comparison on the strength of an unrelated kernel, in rows whose entire subject is the fused route. I have not measured whether those rows would then have passed that comparison — which is the point: the acceptance was guessing, in the green direction.

What is in 7a6563a88:

  • the table is now expected name -> the measured hip: ids that replace it, and acceptance requires one of those objects in the sequence, not any hip: object;
  • the four genuine ones carry their ids, resolved through the catalog: dense-prefill (k_a074247a0b6a, k_f7cc5eb2ed87), kquant swiglu (k_61d118a92b4c, k_3eef74efaf0a), f32 swiglu (k_61d118a92b4c), fa_prompt_f16_d128 (k_c8f927eca76a);
  • the three above are dropped, with the resolved ids written in the comment, and their rows keep aborting — the honest state;
  • the ids are content-addressed, so a kernel edit rotates them: an expectation whose ids have all disappeared while a hip: object is still scheduled prints both lists and aborts, which is a one-line table update rather than a silent acceptance. That is also the reverse-arm the table was missing.

The verdict's two direct questions, answered:

  1. "If any of these seven rows is not among #465's fourteen, say which." They are names, not rows — and the more useful answer is that three of the seven names are not add-on cases at all (above). Whatever lands must not absorb them.
  2. "If your seven differ in kind — abort vs serve-the-wrong-kernel — say so." Neither, exactly: the rows abort on a name because a different route ran, and for three of them that route is the add-on's unfused path, not its fused equivalent. That sentence belongs on Faster multi-gpu strategy? ggml-org/llama.cpp#3120 either way.

On #465: my comparison still says the per-row opt-in is the better mechanism, and I recommended this PR close. The orchestrator has assigned this PR to me and asked for the verdict's fix, so it now exists as the narrowest of the three shapes — but the file must not end up with two acceptance mechanisms. If the orchestrator prefers #465, close this and take the three-name finding into it; that finding is about ggml-org#3120's row list, not about either mechanism. I am not opening a third shape and I am not closing another lane's PR without that word.

@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 7a6563a: READY

The rebased head strengthens the acceptance to exactly the form I would have asked for, so my earlier caution is now moot:

struct AddOnServedExpectation {
    const char * expected;
    const char * replacements[3];   // measured `hip:` ids that replace this expectation; nullptr-terminated
};
static const AddOnServedExpectation kAddOnServedExpectations[] = {
    { "loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256",
      { "hip:k_a074247a0b6a", "hip:k_f7cc5eb2ed87", nullptr } },
    …

Where the previous head accepted an expectation if its name appeared in a list, this head pairs each Loom expectation with the specific hip: kernel ids measured to serve it. That closes the gap a name list leaves open: a row whose add-on route changes to a different hip kernel no longer passes by virtue of being in the list — the id has to be one somebody measured. nullptr-terminated per row, three slots, so the record is explicit rather than a prefix test.

Test-only, and it is the shape I want in the other two files of this family (#464's loom_flash || hip: and #465's per-row addon_route): the acceptance names what was measured, not the namespace it lives in.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Closing this as superseded by #465 (f0226577c, merged into 1bit/hrx-vulkan-patched), which does the same job better — and the difference is the one that matters.

Both PRs fix engine#3120's A half in this file, and I checked the merged one rather than the title:

  • test-hrx-ops: the add-on route is accepted per row, not per kernel name (engine#3120) #465 accepts per ROW (addon_route is passed where each case is built), so the acceptance is scoped to exactly the rows the run proved are add-on-served.
  • Mine accepted per NAME (kAddOnServedExpectations[]). That is strictly wider in the one place it hurts: ggml_flash_attention_f32_f16_wmma is expected by seven rows in this file and …_swiglu_q4_q8_1_x4_lowtoken_dot by rows the add-on and the Loom kquant family serve differently — the comment test-hrx-ops: the add-on route is accepted per row, not per kernel name (engine#3120) #465 adds calls that out, and under my table a row that legitimately expects the Loom route would also have accepted a hip: kernel. The value comparison still runs in both designs, but the failure mode I would have introduced is exactly the "a table entry hides a dispatch change" risk I flagged when I chose a per-name table over a shape predicate.

So: #465 is the survivor, my branch is redundant, and it is deleted with this close. Nothing else is lost from mine — the mapping I derived (7 names across 9 of the 17 pairs, with the object that served each) is in ggml-org#3120's thread, and #465 records the same registrations with their HRX_ID_* names, which is more useful.

What engine#3120 still needs, unchanged: the fork tip is 9ad200545 (carries #464, #465 and this), so the A half only reaches the engine through the next pin bump, and the seven groups' values still need the device run that answers whether relaxing the name check was the whole story.

@bong-water-water-bong
bong-water-water-bong deleted the 3120-addon-served-expectations branch November 21, 2026 04:40

@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 7a6563a: READY

The +97 answers the concern I raised in my previous review, and answers it better than I asked: the seven entries now carry the measured hip: ids that replaced them, and the acceptance requires that id rather than any add-on kernel.

What changed, and why it is a tightening rather than a widening

Before (012820ee, what I READY'd):

if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) { … continue; }

Correct, but weak in one specific way: any hip: object anywhere in the sequence satisfied it, so a row whose subject is a fused add-on route would go green while the tree ran some other add-on kernel.

Now (7a6563a8):

struct AddOnServedExpectation {
    const char * expected;
    const char * replacements[3];   // measured `hip:` ids that replace this expectation; nullptr-terminated
};
…
for (const char * const * replacement = served->replacements; *replacement != nullptr; ++replacement) {
    if (std::find(sequence.begin(), sequence.end(), *replacement) != sequence.end()) { matched = *replacement; break; }
}

Each expected name must be served by one of its own measured ids — and when none of them ran, the failure prints both lists:

  expectation %s is in the add-on-served table, but none of its measured replacements ran.
   table: <ids>
    scheduled hip: kernels: <ids>

The author's own comment states the failure the old version allowed, and it is the exact sentence I would have written: "the ids are content-addressed: a kernel edit rotates them. Say so with both lists instead of accepting on strength of some other hip: object, which is how a row whose subject is a fused route goes green while the tree runs the unfused one."

And it says why the ids are not pinned as the requirement

"The id is a content hash, so the row accepts any hip: object rather than pinning one — pinning it would rot" — but the acceptance is per-name, so the rotation prints the table and fails rather than passing on a stranger. That is the pair of decisions I got wrong the first time I read this file: I read the old && as sufficient, and it was sufficient for "an add-on kernel ran" but not for "this row's add-on kernel ran".

What that means for the concern I filed

I asked for something to keep the seven-entry table honest — quoting #2774's check_stale_expectations.py precedent. This head does it at runtime instead of statically: the table carries the ids it was measured against, and a rotation is a named failure with both lists printed, which is stronger than a static check because it is measured on the actual schedule.

A static check is still worth having (it would catch a name that no longer exists in the corpus before a run), but the runtime half is now present, and a runtime check that prints both lists is the one a person debugging will read.

What I could not run

The rows need the add-on tree and a device. The one path I would want on hardware is the failure path — a table entry whose ids rotated — because that is the branch that prints two lists, and a diagnostic that has never fired is a diagnostic whose formatting nobody has seen.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Post-#465 position, because the file moved under this branch: #465 merged at 04:24:19Z (f0226577c), and engine#3128 is the pin that carries it (53ab4140 → 9ad20054). 9ad20054 also carries #464. So tests/hrx-ops-test.cpp on the pin now has the per-row addon_route acceptance, and this branch would add a second acceptance path for the same seven rows — one keyed on the expected name, which is the thing I argued against in my earlier review (measured: ggml_flash_attention_f32_f16_wmma is expected at 6 sites in this file, …_swiglu_q4_q8_1_x4_lowtoken_dot at 5).

What is genuinely better here than what landed is specificity: the table requires the measured replacement id (hip:k_61d118a92b4c …) rather than any hip: object, so an unrelated add-on kernel taking the node would still abort. That is worth keeping — as a tightening of #465's printer, not as a parallel table:

// #465 today: accepts any hip: object and prints it
// what this branch wants: when the printed id is not the one recorded for this row's expectation, say so
engine#3120: row X served by the add-on (hip:k_… ; expected for this name: hip:k_61d118a92b4c)

Two reasons to prefer that location: it cannot drift from the per-row opt-in (one mechanism, not two), and a content-addressed id in a table rots the moment a kernel is edited — which this branch'"'"'s own comment says is why it lists several ids per name, i.e. the table is already tracking the rot.

Recommendation: close this with its branch, and if the id-specificity is wanted, open a small follow-up against the merged #465 that prints-and-compares the id instead of adding an acceptance table. Nothing here is a merger objection to the work — the id list is the part worth preserving, and it is preserved in a comment either way.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at 7a6563a: READY — the table now carries the measured ids per expectation, which is stricter than the "any hip:" version I reviewed and answers #465's one advantage

The new head is a real tightening, and it is the shape I would have asked for had I thought of it:

struct AddOnServedExpectation { const char * expected; const char * replacements[3]; };   // measured hip: ids
…
{ "loom_libs:ggml_flash_attention_f32_f16_wmma", { "hip:k_c8f927eca76a", nullptr, nullptr } },
{ "loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256", { "hip:k_a074247a0b6a", "hip:k_f7cc5eb2ed87", nullptr } },

Acceptance now requires one of the ids measured to replace that name to be in the sequence, not merely "a hip: kernel" — so a future add-on kernel that swallows the shape fails the row instead of satisfying it. And the third branch is the best part of the diff: if a name is in the table but none of its replacements ran, it prints the table's ids, the scheduled hip: kernels, and

"the add-on's code objects are content-addressed, so a kernel edit rotates these ids: update kAddOnServedExpectations, or the row is not an add-on case any more."

That turns the one weakness of an id-keyed table — it rots — into a diagnostic instead of a mystery.

The cost is real and worth recording rather than fixing here: every add-on kernel edit rotates those ids, so a gpu-kernels pin bump that touches these kernels makes these rows abort until one line of this table is updated. That is the trade for precision, and it is coupled to the pins this fleet is moving several times an hour (#3128 landed the same hour). If the ids ever become a nuisance, the middle ground exists in the add-on's own surface — hip_kernel_ref("kqt_mm_q4k") shows the registrations carry stable names as well as content ids, so a mixed key (name-or-id) would stop the rotation without losing the "which kernel replaced this" precision.

Two other things I checked on this head and would keep: five of the seven names earlier drafts carried had no measured replacement, and dropping them (rather than accepting any hip: for them) is the right call — the paragraph now says why; and sequence_index = before still avoids consuming a match for an unrun expectation, so an accepted row does not silently steal the next name's position.

Nothing to change. This is the one of the three (#463/#464/#465) I would take for hrx-ops-test.cpp.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at 6f4ed174-sibling (llama.cpp #463): READY — the table is derived from a real 397-case run and, more importantly, it is scoped so it cannot become a blanket exemption.

What makes this reviewable in one pass is the negative half:

ggml_rmsnorm_mul_rope_f32 arrived as three unfused kernels, qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 likewise, and ggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32 landed on …_iq3s_table (a name question inside Loom). A table entry here must never make one of those pass.

That is the sentence that separates this from the class it belongs to. An expectation table whose only rule is "these seven names are allowed" silently generalises the moment someone adds an eighth — and then it is an exemption list wearing a test's clothes. Naming the families that must keep aborting, and saying why (three unfused kernels is a Loom fusion gap, the iq3s_table case is a name question inside Loom, not an add-on override), gives the next author the rule instead of the list.

One ask, and it is the one that keeps the table honest: the seven entries should each carry the reason it is legitimate (the add-on registration winning that shape), not only the name — and the acceptance test should assert that the unscoped cases still abort, per the paragraph above. If the table is a bare {"expected", "sequence"} pair list, a future shape with the same name but a different reason would be forgiven silently.

The measurement is the right provenance: 298 passed, 99 failed, 29 aborts on the first full 397-case run with the add-on built, 17 distinct expected/sequence pairs, seven served by a hip: code object. That is how a table like this should be justified — by the run that produced it, not by reading the matcher.

Note the pairing with engine #461 (merged): that one fixed the rows that pinned which fallback the tree has, this one fixes the rows that abort on a name the add-on legitimately serves. Together they are the two ways the same 397-case suite was measuring the tree instead of the decision.

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