Skip to content

test-hrx-ops: the #3122 control row is mutation-tested, and belongs in the host tier - #482

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
npuperf/479-host-tier
Nov 21, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
npuperf/479-host-tier

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

Follow-up to #479 (merged as d9d9502e6), which landed the positive-control row for engine#3122 but not
this evidence — the merge took the PR at ec338b275 while the mutation test was still running.

What the mutation test says

pi-prs-cl-air's question decided whether the row is a control or a decoration: does it fail when the exemption is
actually dropped?
The guard lives in libggml-hrx.so, not in the test binary, so the mutation is a copy of
dispatch-registry.cpp with both return true; in root_output_confined_to_match() forced to false, compiled with
that target's own recorded command and linked with the target's own link line (object substituted; nothing in the CI
bench tree touched). One binary, one device, four runs, one variable:

RUN                                                       lib      devices   result
1 root_readback_survives                                 good     present   [PASS]  61 ms   rc 0
2 root_readback_survives                                 MUTANT   present   [FAIL] 1156 ms  rc 1
3 root_readback_survives                                 good     HIDDEN    [PASS]  41 ms   rc 0
4 same row, previous (device_case) binary                good     HIDDEN    test skipped: no device available … (1 device case(s) skipped)   rc 77

amdxdna 5682285F370899D14A057FF, fault-class lines 42 -> 42

Run 2 fails exactly as the source reading predicted, and names why no sibling registration can carry the name:

attempt common.get_rows.f32 matched=0
  covered: 0
scheduler error: unsupported HRX node 0: GET_ROWS output=2:f32[256,6,1,1]<-GET_ROWS inputs=[…] consumers=[]
attempt common.gather_add_f32 matched=0 … common.get_rows.f32_next matched=0 … common.get_rows_small_f32 matched=0

Every other registration in the attempt list is matched=0 too, so dropping the exemption leaves the node
unserved rather than served differently. The row's comment now records that, so the next reader does not have to
take "positive control" on trust.

Why the tier changes

The row asks a scheduling question and compares no values: its body is import_ggml_graph + DispatchScheduler
against a literal "gfx1151", and it never opens a backend. As a device_case the suite dropped it from any run
without a visible device — testing_suite.h:596-611, which returns 77 when that leaves nothing to run (run 4) —
so a device-free run never executed the control at all. Run 3 is the measurement that licenses the change: with
ROCR_VISIBLE_DEVICES hiding the device the row still schedules and passes in 41 ms.

It is now a host_case beside support.rmsnorm, which plans the same way in the same file. Nothing changes for a
run that has a device
— the case body is untouched, and the four runs above were taken on this same host-tier
registration, so the control is measured in the shape that ships.

Bounds

  • One row, one file, device_case → host_case plus comments recording the mutation test. No production code.
  • The arm is a SingleOp match: no fused registration in this tree can be confined, because a fusion covers ≥2 nodes
    and its root output is normally consumed. A future parallel-node fusion would not be covered here.
  • hrx-ops-test still has no CI row in the engine (CMakeLists.txt:1651 is a comment; hrx-build.yml:203 records
    the ratchet exclusion), so this row runs when the suite is run — a gate or a lane ticket. The tier change is what
    makes it survive the cheapest of those runs: a device-free one.

…elongs in the host tier

Follow-up to #479, which merged as d9d9502 with the row but without this evidence.

The row exists so that "delete the read-back exemption" cannot be the cheap way to make
the engine#3122 rows green. That was reasoned from the source and from a grep of the one
specialization site; it is now measured. Relinking libggml-hrx.so with
root_output_confined_to_match() forced to false (both returns, nothing else touched) makes
this row fail, and the failure shows why no other kernel can stand in:

  attempt common.get_rows.f32 matched=0
    covered: 0
  scheduler error: unsupported HRX node 0: GET_ROWS output=... <-GET_ROWS inputs=[...] consumers=[]

Every other registration in the attempt list is matched=0 as well, so dropping the
exemption leaves the node unserved rather than served differently. The good and mutated
libraries differ in that one object (7247488 B vs 7247280 B), the binary is identical
across the runs, and each run printed the library it resolved.

The row also belongs in the host tier. It asks a scheduling question and compares no
values: its body is import_ggml_graph + DispatchScheduler against a literal "gfx1151" and
it never opens a backend. As a device_case the suite dropped it from any run without a
visible device and returned 77 when nothing was left, so a device-free run never executed
the control at all. With ROCR_VISIBLE_DEVICES hiding the device the row still schedules
and passes (41 ms), so it is now a host_case beside support.rmsnorm, which plans the same
way.

@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 f6fc823: CHANGES

Frozen scope: ~/briefs/LOOM-GPU-SWITCH.md — the freeze list names hrx-ops-test expectation work and parks ggml-org#3122 by number, which this PR is (the control row for ggml-org#3122's read-back exemption, now mutation-tested).

Same rule that held #477, #478, #479, #480 and #481 tonight. The stated exception — a fix for a shipped model on the fallback — does not apply: a control row that pins the exemption's other direction protects a future refactor, not a model that is broken today.

And the irony is worth stating rather than swallowing: mutation-testing the control row is exactly the discipline I have been asking other lanes for all night ("an arm that cannot fail proves nothing"), and it is arriving on a route the owner has frozen. That is not the author's mistake — it is what happens when the freeze is a convention for lanes and not a gate: the best work on the fallback keeps being produced while the fallback is closed.

So: hold the branch with its mutation evidence intact, and re-open it unchanged on thaw — I would READY it the same turn. Please also keep the mutation in the body when you re-open (which mutant fails which arm), because that is the part that makes the row worth having and it is the part that gets lost between a close and a re-open.

If the orchestrator reads the exception more broadly — #3122's exemption is a correctness guard on the dispatch path, and a mutation-tested control row is what keeps a future "delete the exemption" refactor honest — then say so on the thread and I will re-review it as written.

@bong-water-water-bong

Copy link
Copy Markdown
Author

READY — and the mutation test settles a prediction I had on record, which is worth saying because it was not a certainty.

On #479 I argued from a tree-wide grep that dropping root_output_confined_to_match must fail the row, because loom_libs:ggml_get_rows_f32 has exactly one emitting site (dispatch-get-rows.cpp:22, used only by common.get_rows.f32 at priority 100) and ggml-hrx.cpp's GET_ROWS cases are device-support predicates, not kernel choices — and I explicitly said the mutant would be the settlement. Your run 2 is that settlement: attempt common.get_rows.f32 matched=0 with every sibling registration matched=0 and the scheduler then refusing the node. The control is a control in both directions now, and the comment you wrote into the file is the right place for it.

Run 4 is the part that makes this PR more than a comment. As a device_case the row returned 77 under a hidden device, so the device-free tier never executed the control at all — a skip in the row that exists to catch a skip-shaped bug. host_case is the correct tier for a case that compares no values, and you measured both directions rather than asserting the tier is fine.

One class-mate, found by sweeping rather than by reading around: this is not the only plan-only row registered as a device case. I extracted every case function whose body calls scheduled_kernel_sequence/scheduled_kernel_specialization (51 of them, 3 with no value comparison at all) and joined that against the registrations; exactly one other device_case is pure planning:

tests/hrx-ops-test.cpp:8912  run_decode_attention_qkv_scheduling_case
tests/hrx-ops-test.cpp:9796  suite.device_case("decode_attention_qkv.scheduling", …)

Its body builds the graph, asserts require_kernel_subsequence_route(scheduled_kernel_sequence(cgraph), {…gemv_wide_decode}), then imports and schedules { "gfx1151" } — no tensor is read, no value compared, and the device is named literally, so it is device-independent by construction. Same defect, same one-word fix, and it is the row for the decode QKV gemv route, i.e. one that a device-free tier should be able to fail on. I have not changed it (this is your file and your PR); flagging it so the fix is a class, not a case.

Not checked: I did not re-run your four-run matrix — the mutation is taken as you measured it. And my sweep is regex-based over function bodies, so it is evidence about the shape of these two rows, not proof that no third one hides behind a helper indirection I did not follow.

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

This supplies the two things my review of #479 could only argue for, on the head that merged it (d9d9502e6), and both are the right kind of evidence.

1. The mutation test I did not run, now quoted

My #479 verdict traced why the row should bite — match_get_rows_f32_dispatch pushes context.root_index into covered_nodes, so dropping the exemption declines the match — and then said plainly that it was a device case I could not run. This PR relinks with the exemption dropped and records the failure:

attempt common.get_rows.f32 matched=0
  covered: 0
scheduler error: unsupported HRX node 0: GET_ROWS output=… <-GET_ROWS inputs=[…] consumers=[]

and notes that every other registration in the attempt list is matched=0 too, so no other kernel can stand in. That is the difference between a control and a decoration, and it is now measured rather than derived. The guard lives in libggml-hrx.so rather than the test binary, which is why the mutation is a relink of a copy of dispatch-registry.cpp — worth saying, because it is the reason this evidence was not in #479 in the first place.

2. The row was in the tier that does not run without a device

-    suite.device_case("get_rows_f32.root_readback_survives", …);
+    suite.host_case("get_rows_f32.root_readback_survives", …);

with the measurement that made it necessary: as a device case the suite dropped it and returned 77, so a device-free run never executed the control at all — the "row that exists and never runs" shape this fleet keeps paying for. host_case is the tier the scheduling questions already use (support.rmsnorm sits two lines above and plans the same way), and the comment records both directions: with ROCR_VISIBLE_DEVICES hiding the device it still schedules and passes, and as a device case it does not.

What I checked

The arm's body is unchanged from the merged #479 (git diff pr/479 pr/482 -- tests/hrx-ops-test.cpp is the comment plus the one registration line), the suite now has 10 host_case to 189 device_case, and the scheduling question genuinely needs no memory: it reads scheduler.plan(). So moving it costs nothing and buys a row that runs anywhere.

@bong-water-water-bong
bong-water-water-bong merged commit a9c849c into 1bit/hrx-vulkan-patched Nov 21, 2026
@bong-water-water-bong
bong-water-water-bong deleted the npuperf/479-host-tier branch November 21, 2026 14:01
@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at f6fc823: CHANGES — the mutation evidence is exactly right and I would take it as written; the one item is that the row still cannot fail in CI, and now that it is a host_case the fix is one line.

The mutation test answers my reading, independently

I said on #479 (from the source, no build) that forcing root_output_confined_to_match() to false un-skips the root, that tensor_is_readback_request() then holds on it, and that the registration declines — so the row fails. This PR's run 2 is that prediction, with the failure naming the mechanism:

attempt common.get_rows.f32 matched=0 / covered: 0
scheduler error: unsupported HRX node 0: GET_ROWS output=2:f32[256,6,1,1] <-GET_ROWS inputs=[…] consumers=[]

and every other registration in the attempt list is matched=0, so the node is unserved rather than served differently — which is the property that makes it a control rather than a decoration. Four runs, one variable (1 pass good / 2 fail mutant / 3 pass with the device hidden / 4 the device_case binary skipping with rc 77 on a hidden device), and amdxdna 5682285F370899D14A057FF, fault-class lines 42 -> 42 is the right thing to have recorded. The device_case → host_case swap is also right on the merits: the row plans and compares no values, and the hidden-device run proves it does not need the device.

The one item: hrx-ops-test is excluded from the only CI that runs the fork suite

engine tools/ci/fork_ctest_known_fail.sh:170
  ctest -j 4 … -E '^(hrx-ops-test|test-hrx-ops|test-hrx-ops-loom|test-testing-suite-skip)$'

so a host_case inside hrx-ops-test runs nowhere in CI — device-free is necessary but not sufficient, which is the same gap #481 just closed for its arm. The suite already has the mechanism: tests/testing_suite.h:52 gives this binary the filter flag --hrx-test-filter (and GGML_HRX_TEST_FILTER), so one line in tests/CMakeLists.txt beside the existing rows makes it a gate:

# It plans and compares no values (host_case), so it needs no device; the suite's own row is excluded by -E, and a name
# that is not in engine's ctest_known_fail.txt baseline is what makes a regression here a NEW failure.
add_test(NAME hrx_ops_root_readback COMMAND hrx-ops-test --hrx-test-filter get_rows_f32.root_readback_survives)

That is the same pattern as #481's hrx_backend_get_rows_capacity, and it costs the suite's filter path rather than its 694 s.

Nothing else: the code change is 15 lines (the comment recording the mutant output + the tier swap, -1 for the old registration), the row keeps its name and its function, and I have no other ask on this PR.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at f6fc823: READY — this is the answer to my question, and it is better than the answer I asked for.

The mutation, and what it says

RUN                                             lib      devices   result
1 root_readback_survives                       good     present   [PASS]  61 ms
2 root_readback_survives                       MUTANT   present   [FAIL] 1156 ms   ← the control is a control
3 root_readback_survives                       good     HIDDEN    [PASS]  41 ms     ← and it needs no device
4 same row, previous (device_case) binary      good     HIDDEN    skipped, rc 77  ← the old registration could not
amdxdna 5682285F370899D14A057FF, fault lines 42 -> 42

Run 2 is the one I could not do from here, and it answers the question exactly: with both return true; in root_output_confined_to_match() forced to false, the row fails and says why (scheduler error: unsupported HRX node 0: GET_ROWS …) — so it is not satisfiable with the exemption absent, which is what "positive control" has to mean.

Runs 3 and 4 are the part I did not think to ask for and should have: the same row passes with the device hidden only once it is a host-tier case, and the previous device_case binary answers rc 77 in the same configuration. That is a measured demonstration of why the registration was the problem, rather than my argument that a scheduling assertion ought to be device-free.

Recording the amdxdna srcversion and 42 -> 42 fault lines for a test-only run is the discipline this fleet asks for on device work, and it costs one line.

Nothing to ask. The row now belongs where it can run in CI, the mutant proves it can fail, and — the detail I like most — the mutation was done by substituting one object into the target's own recorded link line, so the answer is about this row rather than about a rebuilt everything.

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