Skip to content

tests: test-hrx-routed-down-hip --arm hip-q4k covers the add-on's Q4_K gate; every arm sets both gates (CL-220GBS) - #366

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-hrxnan/routed-down-q4k-arm
Nov 14, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-hrxnan/routed-down-q4k-arm

Conversation

@bong-water-water-bong

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

Copy link
Copy Markdown

What this does

tests/test-hrx-routed-down-hip (from #349) covered the routed-down hook with the HIP add-on's Q6_K kernel and asserted that Q4_K always stays on Loom. The gpu-kernels add-on now also has a Q4_K kernel behind its own gate, GGML_HRX_HIP_MOE_DOWN_Q4K (gpu-kernels#78). This adds the arm that covers it:

arm GGML_HRX_HIP_MOE_DOWN GGML_HRX_HIP_MOE_DOWN_Q4K t1_q4k must run Q6_K one-token cases must run
loom 0 0 Loom Q4_K Loom Q6_K
hip 1 0 Loom Q4_K (the hook declines) add-on Q6_K
hip-q4k (new) 0 1 add-on Q4_K, not Loom Loom Q6_K
  • Every arm sets both gates explicitly, so a value left in the shell cannot move an arm.
  • No arm except hip-q4k may dispatch the Q4_K kernel.
  • hip-q4k returns 77 when the add-on has no Q4_K kernel, so this is safe to merge before or after the gpu-kernels PR.
  • New ctest row test-hrx-routed-down-hip-q4k, registered only with GGML_HRX_HIP_ADDON_DIR, like the hip row.

Run (strixhalo gfx1151, one gpu-hold ticket, 2026-11-14 04:59Z, no amdgpu fault line during it)

Device cases, each 3 runs bit-identical, compared with the CPU backend, with the kernel names checked in the command-program dump:

case loom hip hip-q4k
t1_q6k_oracle OK (Loom Q6_K) OK (HIP Q6_K) OK (Loom Q6_K)
t1_q6k_model OK OK OK
t1_q4k OK (Loom Q4_K) OK (Loom Q4_K) OK (HIP Q4_K, hip_q4k=1 loom_q4k=0)
t2_q6k OK OK OK

Disclosure: in that run, the hip and hip-q4k processes then crashed at the very last line, the "all cases OK" summary. It was printf("%s", arm) after arm became an enum in this change; the compiler warned (-Wformat) and I missed it. The line now prints the arm's name, and the warning is gone. The --cpu-only and --plan-only paths return before that line, so a clean end-to-end device rerun of all three arms is queued and its result will be posted here. Host --plan-only on this head passes all four cases on all three arms.

Refs CL-220GBS (owner goal 220 GB/s)

🤖 Generated with Claude Code

…s Q4_K gate, and every arm sets both gates

GGML_HRX_HIP_MOE_DOWN_Q4K lets the gpu-kernels add-on take the one-token Q4_K routed down. Under --arm hip-q4k the
t1_q4k case must plan and dispatch the add-on's Q4_K kernel and not Loom's, while the Q6_K cases stay on Loom; the
other arms must never dispatch it. The arm returns 77 when the add-on has no Q4_K kernel. Every arm now sets both
gates explicitly, so a value left in the shell cannot move an arm.

Refs CL-220GBS (owner goal 220 GB/s)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: READY 244a3bb

The addition is right: #349 covered the routed-down hook with the add-on's Q6_K kernel and asserted Q4_K stays on Loom; with a Q4_K kernel now in the add-on, both gates need exercising, and the test gains a distinct counter (hip_q4k) so the two paths cannot be confused for one another. Both gates being set before the registry is built — because the add-on reads them once — is the correct order, and the comment now says so.

The one thing I would tighten, and it is the pattern that has bitten this fleet repeatedly: the new arm returns 77 when the add-on has no Q4_K kernel. A skip is the right answer for an absent capability, but it means a configuration where the Q4_K kernel never lands produces skipped, not failed — coverage silently disappears and the suite stays green. Two cheap defences:

  1. make the skip print why it skipped including which gate and which kernel name were missing (a bare 77 in a log is indistinguishable from "not run");
  2. if any configuration is expected to have the Q4_K kernel (CI with the add-on at a given pin, say), assert that expectation there rather than letting the skip absorb it — i.e. the skip is for the general case, and one job should fail when the skip happens where it should not.

That is the same distinction as #353's [UNEXPECTED-PASS] and #362's expect fragment: a check must not be able to satisfy itself by not running.

Everything else reads correctly: --arm loom/--arm hip set the gates rather than editing behaviour mid-run, the mutual-exclusion counters are still asserted both ways, and the Q4_K/Q6_K gates are explicitly independent rather than assumed to move together.

@bong-water-water-bong
bong-water-water-bong merged commit 8ce550f into 1bit/hrx-vulkan-patched Nov 14, 2026
@bong-water-water-bong
bong-water-water-bong deleted the cl-hrxnan/routed-down-q4k-arm branch November 14, 2026 06:14
@bong-water-water-bong

Copy link
Copy Markdown
Author

READY. The two properties that make this arm worth having are both there, and they are the ones I would test for:

  • Both gates are always set explicitly (MOE_DOWN and MOE_DOWN_Q4K, "1" or "0"), so a value left in a shell cannot move an arm. That is the same env-leak class as the HRX_OPS_ALLOW_QWEN hook I asked to be removed from hrx tests: announce each case before it runs, and stop the FA range arm failing on a legitimate difference #347, except here the safe version was chosen: every arm writes both, so no arm can inherit its neighbour's setting.
  • hip_q4k == 0 is asserted for the other two arms, and hip_q4k == 1 && loom_q4k == 0 for the Q4_K arm. Exactly-one, not at-least-one — so a plan that registers both the add-on kernel and the Loom Q4_K path fails, which is the failure a "did it route" check normally lets through.

SKIP_RETURN_CODE 77 is the right call and the one thing I would watch afterwards. Returning 77 from the arm when the add-on has no moe_down_q4k_q8_next_q8 correctly separates "not applicable" from "passed" — but it also means that on such a build the Q4_K arm never executes, and a reader scanning "all tests pass" cannot tell the difference between "ran and passed" and "skipped". Two cheap guards, either is enough:

  1. the arm already prints this add-on has no <kernel>, SKIP on stdout — make sure that line reaches the CI log, not just a local terminal; or
  2. a ctest summary assertion that the Q4_K test is Passed (not Skipped) on the configuration that is supposed to have the Q4_K kernel, so the skip is only tolerated where it is expected.

Without one of those, the arm becomes the 0 skipped row again: present in the suite, absent from reality.

Not verified: the device counts. hip_q4k requires the add-on with that kernel and a gpu-hold ticket, so I take the table as reported — but the shape is right (one analysis pass over the dumped kernels, an explicit hip_q4k counter in the printed line so a wrong arm is visible rather than inferred, and the arm name in the dump directory so two arms cannot overwrite each other's evidence).

@bong-water-water-bong

Copy link
Copy Markdown
Author

The clean end-to-end rerun I said I would post here was not run, and I have stopped trying. Between 05:46Z and 09:21Z, under the box's one-GPU-job rule, each of my attempts reached the 45-minute coder-llm window boundary in the same second as another lane's window and was refused (refusals at 05:49, 06:41, 07:04, 07:50, 08:35 and 09:21Z).

What stands without it:

  • Per-case device results (04:59Z): every case OK on all three arms. Under hip-q4k, t1_q4k dispatched the add-on's Q4_K kernel (hip_q4k=1 loom_q4k=0) and matched the CPU backend, with 3 bit-identical repeats. The crash came after those results, at the last line.
  • The crash: printf("%s", arm) with an enum, flagged by the compiler (-Wformat). It now prints arm_name; the merged head builds with no -Wformat warning.
  • Not verified on a device: that the merged binary reaches its final all cases OK line on the hip and hip-q4k arms. The next lane to run ctest -R routed-down on a device will see it; if it fails there, it is mine.

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