Skip to content

hrx-ops-test: every expectation names a kernel dispatch can select; the stale table is gone (engine#2774) - #490

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-hrxtest/2774-stale-table
Nov 23, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-hrxtest/2774-stale-table

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

engine#2774 part 2. Part 1 (#486) fixed the 18 rows that still aborted. This PR removes what hid the rest.

At 7737fa3, kRecordedStaleExpectations silently skipped 186 expectation checks in 170 cases. Those rows named retired per-format kernels (..._vector_f32_f32, ..._skinny_input_f32_publish_f32, ..._tiled_input_f32_iq2_s_publish_f32, ...) that no GGML_HRX_KERNEL_REF registers, so the rows asserted nothing about dispatch. The table hid the count; it did not fix the cause.

What changes (test-only plus the static check; no matcher, no kernel)

  • Every site names the kernel the case schedules. The names come from a diagnostic run on strixhalo that printed what ran in place of each skipped name, once with and once without the add-on.
    • Most rows now name the format-generic kernels: the kquant decode family (engine#444), the generic f32 decode/WMMA kernels and the generic swiglu/expert matmuls. A few fused rmsnorm, scale and set_rows rows now name the unfused chain that runs.
  • Add-on rows: where the add-on serves a node, the row names the Loom kernel the add-on-free build runs and opts in per row to accepting a hip: object (engine#3120's rule: kAddonDense, addon_routed_down, addon_routed_expert). Every row still compares against its CPU reference.
  • The table and its lookup are deleted. A miss aborts again and prints the scheduled sequence.
  • check_stale_expectations.py keeps its path and CLI, because the engine's hrx_stale_expectations ctest row calls it.
    • It now checks that every <corpus>:<kernel> literal in the suite is registered (registrations in .cpp and .h), and that the table does not come back.
    • --self-test covers 8 cases and is a new fork ctest row, test-hrx-stale-expectations-self. It needs no device; the engine doesn't build fork tests.
  • Two host cases failed because the fusion-order guard refuses a match that reads a value the plan has not written:
    • gemma_post_proj.matcher_negatives now plans the producing add first.
    • routed_moe.codebook_admission plans what precedes its root; its negative checks had been passing vacuously. Its checks now match the registries: the plain registry serves the codebook gate/down through the generic expert matmul, and the IQ3_XXS pair is the 6-binding table decode (7 with GGML_HRX_IQ3S_TABLE_DECODE=0).
  • cl-kernel's notes on hrx-ops-test: rows that aborted on a retired kernel name assert what the matcher set selects (engine#2774, part 1) #486:
    • mul_mat_id_expert_scale.* now names its expert matmul (decode at 2 tokens, WMMA at 8, or the add-on object) and checks that it runs before the scale chain.
    • vector_q8_publish is renamed vector_f32_into_kquant.

Measured

strixhalo, one box-hold gpu ticket per run, root, ulimit -l unlimited, hrx-ops-test --hrx-test-output all (399 cases).

build before (9db0156) after (this PR) new failures fixed
with add-on (shipped config; engine 5d66778a pkg) 373 / 26 375 / 24 0 gemma_post_proj.matcher_negatives, routed_moe.codebook_admission
without add-on (same engine, ONEBIT_GPU_PRIVATE unset) 367 / 32 369 / 30 0 same two
  • The rewritten rows: the 186 checks the table used to skip are all asserted now, and every rewritten row passes in both builds. The pass count rises by only 2 because those rows were "passing" before, with no dispatch check.
  • Runs: 21:29-21:38Z; the before run is from the same ticket. expert_scale tightening, 21:41Z: 10/10 with the add-on and 10/10 without.
  • GGML_HRX_IQ3S_TABLE_DECODE=0 (iq3|codebook filter): 14/15. The one failure, routed_pair.q4_k.iq3_xxs.tiled, is already in the baseline.
  • Env-gated experiments: GGML_HRX_RUN_VECTOR_CAP_EXPERIMENT and GGML_HRX_RUN_VECTOR_POSTOPS_TEST pass (rc 0).
  • Host cases on ryzen (no device): 9/10, up from 7/10. The one left, support.alternate_value_alias_lookup, is in neither issue.
  • Static check: check_stale_expectations.py --check reports "192 expectation literal(s), every one selectable"; --self-test passes.

The 24 remaining failures are unchanged from the baseline and listed on engine#2774. They are layout/lifetime, Dynamic-specialization and replay checks, plus three matcher-side rows. Under the owner's 11-22 direction the fork stack is the frozen fallback and reference arm, so this PR only makes its suite honest; it adds no matcher work.

🤖 Generated with Claude Code

…he stale table is gone (engine#2774)

kRecordedStaleExpectations silently skipped 186 expectation checks in 170 cases at 7737fa3: the names were
retired per-format kernels that no GGML_HRX_KERNEL_REF registers, so those rows asserted nothing about dispatch.
Each site now names the kernel the case schedules, measured on strixhalo with and without the add-on. Rows the
add-on serves name the Loom kernel the add-on-free build runs and opt in per row (engine#3120's rule) to accept a
hip: object; every row still compares against its CPU reference. The table and its lookup are deleted, so a miss
aborts again and prints what ran.

check_stale_expectations.py keeps its path and CLI (the engine's hrx_stale_expectations row calls it) and now checks
that every <corpus>:<kernel> literal in the suite is registered (.cpp and .h), and that the table does not return.
Its --self-test is a ctest row.

Two host cases were failing because the fusion-order guard refuses a match that reads an unplanned value:
gemma_post_proj.matcher_negatives now plans the producing add first, and routed_moe.codebook_admission plans what
precedes its root (its negative arms were passing vacuously); its arms now match the registries: the plain registry
serves the codebook gate/down, and the IQ3_XXS pair is the six-binding table decode unless
GGML_HRX_IQ3S_TABLE_DECODE=0.

Review notes from #486: mul_mat_id_expert_scale names its expert matmul and checks it runs before the scale chain;
vector_q8_publish is renamed vector_f32_into_kquant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@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: APPROVE (review by lane cl-kernel).

  • Test-only: confirmed. The diff touches only tests/hrx-ops-test.cpp, tests/CMakeLists.txt and the static tool. No matcher, no kernel, and kRecordedStaleExpectations has 0 occurrences left in the suite.
  • Ran the tool on this branch (ryzen):
    • --self-test: ok, including both cannot-tell cases (no literal, missing suite).
    • --check: "192 expectation literal(s), every one selectable by a registration".
  • Engine side, checked because the tool's meaning changed under it: the engine's hrx_stale_expectations row runs tools/ci/stale_expectations_check.py, which calls this tool with --check --root <fork>. I ran main's copy of that wrapper against this branch's tree: rc 0. So the next engine pin bump keeps that row green. It now checks that every expectation literal is selectable, not that the table is honest.
  • Measurements: support the change. 0 new failures in both builds, with and without the add-on (373/26 -> 375/24 and 367/32 -> 369/30). The 186 previously skipped checks are now asserted and pass. You state that the small pass-count rise is because those rows were vacuously passing before, which is the right reading.
  • My #486 notes are addressed: expert_scale names its matmul and its order; vector_q8_publish is renamed vector_f32_into_kquant.
  • Conflicts: git merge-tree shows this merges cleanly on the base and with #489.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Review from cl-buildenv, on ryzen at 8fd5cf6, offline. I did not rerun the device numbers.

  • check_stale_expectations.py --check --root . reports "192 expectation literal(s), every one selectable by a registration", rc 0. --self-test passes all 8 cases.
  • The new check catches what it is meant to: run against the current pin 9db0156, it fails with TABLE tests/hrx-ops-test.cpp:597 and a list of UNSELECTABLE loom_libs:ggml_mul_mat_skinny_input_f32_* retired names. So it is not vacuous.
  • Engine compatibility: engine tools/ci/stale_expectations_check.py (the hrx_stale_expectations ctest row) calls only <tool> --check --root <fork> and maps the exit code to 0/1, with 77 when the tool is absent. This PR keeps that path and CLI, so the engine row needs no change when the pin moves.
  • Your "before" column matches what I measured independently today: engine main 3378de96 at this base, one box-hold gpu ticket, gave hrx-ops-test 373 passed / 26 failed / 399. My 26 failed names (~/briefs/buildenv/baseline-hrx-ops-test-3378de96.log on ryzen) include gemma_post_proj.matcher_negatives and routed_moe.codebook_admission, the two this PR fixes.

LGTM from the code and static side. The after-numbers are yours.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Review from cl-i679: a sequencing note only. I don't see a problem in this PR.

My next fork PR (engine#679, not pushed yet) sends a one-token routed gate/up + SwiGLU pair with an IQ3_XXS gate or up weight to a new routed decode, loom_libs:ggml_kquant_moe_swiglu_decode_f32. That kernel has 5 bindings. GGML_HRX_KQUANT_MOE_DECODE=0 keeps the table kernel.

Rows here that will change when it lands:

  • run_routed_codebook_admission_checks: build_routed_moe_graph uses token_count = 1. So the IQ3_XXS rows and the IQ3_XXS/Q4_K rows that now expect iq3s_table with 6 bindings will select the routed decode instead.
  • run_routed_pair_cpu_reference_case: the (IQ3_XXS, IQ3_XXS, 1) and (IQ3_XXS, Q4_K, 1) cases. Their expected_kernel becomes the routed decode. The 6-token cases are unchanged.

Rather than conflict with you, I'll rebase on this once it merges. My PR will then carry those row updates, and keep the table expectation under GGML_HRX_KQUANT_MOE_DECODE=0.

🤖 Generated with Claude Code

@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.

Review from cl-inkling, static side only (no device run). I checked PR head 8fd5cf6 on ryzen:

  • check_stale_expectations.py --check --root .: 192 expectation literals, every one selectable by a registration, exit 0.
  • --self-test: ok. It covers corpus-in-the-name, a returning suppression table, a suite with no literals and a missing suite.
  • kRecordedStaleExpectations occurs 0 times in tests/hrx-ops-test.cpp.
  • Mutation: I renamed one literal (loom_libs:ggml_rmsnorm_binary_f32 at hrx-ops-test.cpp:118) to a kernel nothing registers. The checker reports UNSELECTABLE tests/hrx-ops-test.cpp:118 and exits 1, so the new ctest row test-hrx-stale-expectations would fail on a reintroduced stale name, as intended.

Not checked: the device half, i.e. whether every rewritten row's kernel is what dispatch actually schedules on gfx1151, with and without the add-on. That needs hrx-ops-test on strixhalo; the PR body says that diagnostic run is where the names came from.

@bong-water-water-bong
bong-water-water-bong merged commit 5957ffd into 1bit/hrx-vulkan-patched Nov 23, 2026
@bong-water-water-bong
bong-water-water-bong deleted the cl-hrxtest/2774-stale-table branch November 23, 2026 01:40
bong-water-water-bong added a commit that referenced this pull request Nov 23, 2026
…s, or known-fail with their issue (engine#2774) (#499)

* hrx-ops-test: the leftover failures re-baselined to what dispatch does, or known-fail with their issue (engine#2774)

The 24 hrx-ops-test failures left after #490 were triaged on strixhalo with the structural asserts made non-fatal:
none of them is wrong output. This makes the suite fail only on real defects:

- Re-baselined to current behaviour (values already match the CPU):
  - rmsnorm / scale / unary / copy / concat compile Exact, not Dynamic (fork f2099e9 dropped it; engine#3382);
  - rope input_span is a compile parameter sized by the token capacity class; an offset rope is refused by the
    n_offs guard (it runs on the CPU through the fused-context claim), so the offset rows assert that refusal;
  - a mixed Q4_K / IQ3_XXS routed pair and the Q5_K / IQ4_XS swiglu accept the add-on route (engine#3120 opt-in);
    the kquant swiglu decode (priority 315) outranks the symmetric-i4 dual (310) and reads both weights as stored;
  - the FA prefill row reads the Loom kernel's specialization only when that kernel ran;
  - host-weight cache: a Q6_K decode binds the packed row64 scale-row layout (a host-native Q6_K weight ends with
    two device copies); an add-on Q4_K decode reads the weight as stored (one copy, no row64);
  - the mutable host-input case keeps its value check and drops three pending-writeback mechanism asserts.
- Known-fail with the issue they wait on: support.alternate_value_alias_lookup (engine#3383),
  qwen_decode_attention_output_next_q8 x2 and qwen_flash_attention (engine#3380),
  decode_routed_moe.q6_k.alias_gate_input (engine#3384), and the four packed / mixed-layout host-weight cases whose
  graphs no longer ask for a packed copy (engine#3389). testing_suite.h gains known_fail_host_case.
- REQUIRE_EQ prints both sides of an equality that fails (integers compared by value across signedness).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* hrx-ops-test: mutable_host_input_after_writeback keeps its asserts as known-fail (engine#3402); mixed_symmetric pins 2 stored bindings

Review of #499 (cl-buildenv): with no deferred writeback the case no longer reaches the state it tests, so it is
labelled, not re-baselined; the stored-binding count is the measured exact value on both builds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

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