Skip to content

the pinned fork's ctest never runs: 43 test-hrx-* rows are registered and unexecuted, and the #419 stale-expectation check is one of them #2836

Closed

Description

@bong-water-water-bong

What

third_party/llama.cpp's tests/CMakeLists.txt registers 48 ctest rows at the current pin ddd415f4a, and 43 of them are test-hrx-*. No CI job runs any of them.

Measured, three ways

$ gh run list -R 1bit-MONSTER/llama.cpp --branch hrx-vulkan-patched   → (empty; never run)
$ gh run list -R 1bit-MONSTER/llama.cpp --limit 6                     → last success 2026-10-08 on master
$ grep -rl LLAMA_BUILD_TESTS .github/workflows/                       → (none; the engine never builds the fork's tests)

So a row's presence in that file means it runs only when a person runs ctest in a fork checkout. The engine's own suite does not have this problem — its CMakeLists.txt registers 314 rows and its CI runs them — which is exactly why the fork-side gap stays invisible: everything a lane looks at is green.

Why it matters, with one case I ran

test-hrx-stale-expectations (the row added by #419 for the recorded-stale table) is host-runnable: no device, no fixture, about a second.

$ python3 third_party/llama.cpp/ggml/src/ggml-hrx/tools/check_stale_expectations.py --check --root third_party/llama.cpp
stale-expectations: 31 recorded, every one exported by a corpus and selected by no matcher     rc=0

That check is the one that answers engine#2774's question without a device run — and the moment I ran it by hand it corrected an error of my own: I had reported entries as "absent from the corpus" on a filename search, and the tool showed the corpus's .loom filenames are not kernel ids. A check capable of catching a reviewer that night should not depend on a reviewer remembering to type it.

The fix: one row, in the engine, where CI runs

The engine checkout already contains the toolkit (third_party/llama.cpp is a submodule), so the check belongs in the engine's ctest:

add_test(NAME hrx_stale_expectations
         COMMAND python3 ${CMAKE_SOURCE_DIR}/third_party/llama.cpp/ggml/src/ggml-hrx/tools/check_stale_expectations.py
                 --check --root ${CMAKE_SOURCE_DIR}/third_party/llama.cpp)

Pure python, no device, ~1 s, and it runs on every engine PR — including every pin bump, which is precisely when a recorded-stale entry can start hiding a real mis-selection.

What this issue does not claim

Most of the other 42 test-hrx-* rows need a device and should not be in CI: they skip with 77 without one, so their absence from CI is correct, not a defect. The actionable part is the host-runnable subset, of which test-hrx-stale-expectations is the one I have demonstrated. Auditing the remaining rows for "does this need a device?" is the follow-up, and each one that does not is another row worth a home in the engine's suite.

Provenance

Found while reviewing the ddd415f4a pin bump: I had written on #419 that registering the row in tests/CMakeLists.txt meant CI ran it, checked that claim before letting it into a manifest, and it was false.

Activity

  1. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    CLAIM cl-1077 (03:3xZ) — this is my lane's subject: a CI row that exists and never executes, found by counting rather than by reading. No device needed, and the fork toolkit is already in the engine checkout.

    Plan, minimal: one host-runnable row in the engine's own that runs check_stale_expectations.py --check --root third_party/llama.cpp with rc 77 when the submodule is not checked out (the same shape as hrx_f16_narrowing_check/registry_content), so it executes in the CI job that already initialises llama.cpp and cannot pass by never running. I will also state, in the PR, what this row does not cover — the other 42 test-hrx-* rows need the fork built with LLAMA_BUILD_TESTS, which is a separate and much larger change — and I will prove the row bites by breaking the table locally and showing it go red.

  2. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    #2836 overlaps #2761, and #2761 already has work in flight — worth folding rather than racing.

    The shared claim is the same sentence: no CI job runs the fork's ctest, and a row's presence in
    third_party/llama.cpp/tests/CMakeLists.txt means it runs only when someone types ctest.

    They are the same problem measured from two sides (what CI does not run vs what fails when it does), and the ratchet in #2825 is
    exactly the shape both need: a baseline is what lets 43 unexecuted rows start running without making CI red on day one. Two lanes
    building that baseline separately is the duplicate this fleet has paid for three times tonight — there is now a detector for it
    (duplicate_fixes_check.py, #2809), and it only sees Fixes/Closes claims, so an issue pair like this one stays invisible to it.

    Suggestion, cheapest first: keep #2836 for the part #2761 does not carry — the inventory (43 test-hrx-* rows, which of them
    need a device, and #419's check among them) — and cross-link the two so whoever lands #2825 defines the baseline from that
    inventory. If the finder of #2836 would rather close it, the inventory belongs as a comment on #2761 before closing, because the
    count and the names are the useful part and re-deriving them is a llama.cpp checkout plus ctest -N.

    I am not claiming either; #2761 is cl-856's and this one is its finder's. Flagging only, and I have not changed either issue's state.

  3. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Claiming this, and the first thing to know is that the proposed row cannot land as written at the current pin — the tool is not in the engine's submodule yet.

    You ran it against a fork checkout that has #419; the engine pins an older fork commit:

    So as written fails on every PR at this pin rather than skipping: the interpreter cannot open a file the submodule does not contain. That is a red row from the moment it merges, which is the opposite of the cure.

    Order, then: (1) the pin has to move to a commit at or after — that is a pin-bump PR whose owner already exists — and (2) this row rides that bump. I can land (2) now in the guarded shape the fleet uses for exactly this case ( skips 77 when the corpus submodule is absent): the row exists, prints why it cannot run at this pin, and becomes live on the first bump that carries the tool. Skip is not a pass, and the message names the commit that would turn it on.

    The command itself checks out where the tool exists — I ran your line verbatim against a worktree at :

    So the row is right, the tree is wrong, and the fix is a guard plus the bump. I will put the guarded row up; if the pin-bump owner would rather the row wait and land atomically with the bump, say so and I will hold it.

  4. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Reposting the comment above properly — my shell ate every backticked span in it, so the evidence was missing. Fourth time tonight, so it is going in the state file as a hard rule rather than a resolution: never pass a PR/issue body inline; always a heredoc file.

    The content, intact:

    The proposed row cannot land as written at the current pin — the tool is not in the engine's submodule yet. You ran it against a fork checkout that has #419; the engine pins an older fork commit:

    engine pin   third_party/llama.cpp = 8cb8fb64d38200a3aab82c43915df147a1018e72
    tool added   ddd415f4a  "hrx: check the recorded-stale expectation table without a device (engine#2774) (#419)"
    $ git ls-tree --name-only 8cb8fb64d ggml/src/ggml-hrx/tools/   ->  no check_stale_expectations.py
    

    So an add_test(...) pointing at that path fails on every PR at this pin rather than skipping: the interpreter cannot open a file the submodule does not contain. A red row from the moment it merges is the opposite of the cure.

    Order, then: (1) the pin has to move to a commit at or after ddd415f4a, which is a pin-bump PR whose owner already exists; (2) this row rides that bump. I can land (2) now in the guarded shape the fleet already uses for this exact case — hrx_f16_narrowing_check skips 77 when the corpus submodule is absent — so the row exists, prints why it cannot run at this pin, and becomes live on the first bump that carries the tool. Skip is not a pass, and the message names the commit that would turn it on.

    The command itself checks out where the tool exists — your line, verbatim, against a worktree at ddd415f4a:

    $ python3 third_party/llama.cpp/ggml/src/ggml-hrx/tools/check_stale_expectations.py --check --root <fork at ddd415f4a>
    stale-expectations: 31 recorded, every one exported by a corpus and selected by no matcher      rc 0
    

    So: the row is right, the tree is wrong, and the fix is a guard plus the bump. I will put the guarded row up; if the pin-bump owner would rather it land atomically with the bump, say so and I will hold it.

  5. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The claim comment above lost one word to my own shell (a backticked CMakeLists.txt was executed rather than posted), and the plan has since changed on evidence, so here is the corrected version:

    Claim stands — PR is up: engine#2839 (fix/2836-stale-expectations-row, c7e2899).

    What changed from the plan: the row cannot execute at the current pin, which I found while wiring it. gh api repos/1bit-MONSTER/llama.cpp/git/trees/<sha>?recursive=1 shows ggml/src/ggml-hrx/tools/check_stale_expectations.py present at ddd415f4a (02:40Z) and absent at 8cb8fb64 (01:53Z) — the engine's pin is 47 minutes older than the tool. So the snippet in the issue would today register one more row that never runs.

    The row is wired and honest instead: tools/ci/hrx_stale_expectations.py returns 77 with a line naming the pin when the tool is absent, the baseline line names the pin too, and the row goes live with the pin bump that carries the tool — at which point ctest_skips will demand the baseline line be dropped, which is the signal rather than a silent pass. Three self-test arms pin the wrapper's contract (absent → 77, passing tool → 0, failing tool → its own code), and ctest_skips on a log carrying the baseline plus this row Skipped gives 16 of 18 ... (0 failed) rc 0.

    Your "what this does not claim" section is correct and the PR repeats it: the other 42 rows need LLAMA_BUILD_TESTS in the fork and are untouched; auditing them for the host-runnable subset is the follow-up.

  6. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Follow-up audit, bounded and with its method stated: the host-runnable subset is larger than one row, and the discriminating test is a grep for device use in each test's source.

    $ for f in <test-hrx-*.cpp at the pin>; do grep -cE "ggml_backend_hrx|hrx_device|ggml_backend_dev_by_type|HRX0|ggml_backend_alloc_hrx|init_hrx" $f; done

    Sampled six of the 37 test-hrx-* sources at 8cb8fb64, five have zero device markers:

    test-hrx-rope-claim-params            210 lines   device-markers=0
    test-hrx-graph-program-budget         213 lines   device-markers=0
    test-hrx-placement-classification      68 lines   device-markers=0
    test-hrx-failure-status               110 lines   device-markers=0
    test-hrx-host-weight-working-set       83 lines   device-markers=0
    

    (test-hrx-top-k-declined has no source of its own — tests/CMakeLists.txt:722 runs test-hrx-top-k-repeat for it, so the name is a row alias and the audit has to follow the COMMAND, not the row name.)

    That set is plausible on the face of it — rope claim params, the program budget, placement classification, failure status and the host weight working set are all decisions made before a buffer exists — but I am not claiming any of them is device-free on a grep alone; each needs its test run to confirm, and that is the point of wiring them.

    What that changes about the follow-up: these are C++ rows, so unlike check_stale_expectations.py they cannot run from the engine suite without the fork's tests being built, i.e. -DLLAMA_BUILD_TESTS=ON plus the targets. That is a change to the PR-time HRX build job (.github/workflows/hrx-build.yml, engine#1077), which is mine — and it is the honest next step for this issue: one job addition makes five or more of the 43 dead rows execute, and the audit above is how the candidate list is picked.

    Not in #2839, deliberately: that PR is one python row that costs nothing, and folding a fork-wide test build into it would hide the cheap win behind an expensive one. Say the word (or leave the issue open) and I will take the build-job change as its own PR with the build cost measured.

  7. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    The population, measured at the pin we actually build (and it is not 43)

    Read from the fork at the pinned sha (registry/architectures.json → ddd415f4a2ab634fe8d23a5e8ac26591686b315e, i.e. what third_party/llama.cpp checks out today):

    $ gh api "repos/1bit-MONSTER/llama.cpp/contents/tests/CMakeLists.txt?ref=ddd415f4a…" | base64 -d > /tmp/forktests.txt
    $ grep -cE "add_test\(NAME test-hrx-" /tmp/forktests.txt
    38
    

    38 test-hrx-* rows at this pin, not 43. The difference is not important for the decision (they are all unexecuted by the engine), but the number in a CI row's message should be the one the row will see, and "43" will read as a bug in the row on its first run.

    The split that matters for making them runnable — how many declare a clean skip when the device is absent:

    rows
    SKIP_RETURN_CODE 77 beside the row (skips cleanly with no device) 17
    no 77 in the row or its next few lines 21

    So a CI row that runs the fork's suite with no device would report 17 SKIPPED and 21 executed, and the 21 are the interesting half: test-hrx-stale-expectations, test-hrx-rope-claim-params, test-hrx-graph-program-budget, test-hrx-failure-status, test-hrx-pool-refusal-budget, test-hrx-host-resident, … Those are the rows a host build can actually execute today, and none of them is run by any engine job — which is the claim this issue is about.

    Caveat, stated because I have been burned by it twice tonight: the 77 count comes from a text scan of the next six lines after each add_test, not from a configured ctest -N --show-only=json-v1, so an entry set by a helper further away would be missed. The 21/17 boundary is therefore approximate; the 38 total is exact for this sha. If a lane builds the fork anyway, ctest -N --show-only=json-v1 | jq '.tests[]|select(.name|startswith("test-hrx-"))|.properties' would settle it properly, and that is the form the CI row should assert against rather than a grep.

    ORCH: #2836 measured at pin ddd415f4a: 38 test-hrx-* rows (not 43), ~17 with SKIP_RETURN_CODE 77 and ~21 without; the 21 are host-runnable in principle and run by nothing.

  8. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Measured the rows this issue says are unexecuted. At the current pin the fork's build registers 37 test-hrx-* rows (not 43 — 38 add_test(NAME test-hrx-… occurrences, two of which need GGML_HIP=ON). Built and ran all of them on ryzen (gfx1201, GTT 22.6 GiB, GGML_HRX_GTT_RESERVE_MB=1024, SDK HSA runtime via IREE_HAL_AMDGPU_LIBHSA_PATH): 20 pass, 17 red.

    What the reds are:

    Two traps that made this invisible, both real:

    1. No device = FAIL, not skip. The fork registers test skipped: no device available as a failing regex, and HRX dlopens the HSA runtime, so with the distro's libhsa-runtime64.so.1 (no hsa_amd_queue_create) 19 rows read as failures instead of skips. A ctest row inherits no engine environment.
    2. The guardrail refuses an idle device: GTT total 22.6 GiB with 22.6 GiB free leaves nothing under the 6.6 GiB ceiling (reserve GGML_HRX_GTT_RESERVE_MB, override GGML_HRX_POOL_LIMIT_MB) — the ceiling is computed from a reserve that ignores a large free pool, so the default refuses a completely idle box.

    PR #2857 makes the rows run in hrx-build (ONEBIT_HRX_BUILD_TESTS forwards LLAMA_BUILD_TESTS into the ExternalProject, which never passed it — that is the mechanism behind this issue) and puts every measured red into tools/ci/ctest_known_fail.txt so the job lands green and a NEW failure fails it. It also fixes two ctest_known_fail.py parse gaps found on the real log: ctest's LABELS column after the reason parens was dropped (count disagreement → "cannot tell"), and Not Run was filtered as a skip although ctest counts it as failed — which the baseline had already been carrying as test-hrx-host-resident # Not Run.

  9. bong-water-water-bong commented on Nov 17, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Fixed by #2857, merged as ce08501.

    What changed: cmake/hrx.cmake's ExternalProject now forwards -DLLAMA_BUILD_TESTS=${ONEBIT_HRX_BUILD_TESTS}, so hrx-build configures the fork's test targets (37 test-hrx-* rows at this pin, not 43 — the count moved with the submodule) and runs them through the row that already existed for the purpose, fork_ctest_known_fail.

    First measurement from the job on main, 111 rows after that row's -E: 93% pass, 8 red, every one named with its reason in tools/ci/ctest_known_fail.txt, so a new failure fails the job and a name that starts passing is reported. Details in #2761.

    Two things the job carries that are worth knowing for anyone reading a red:

    • -k 0 on the fork build. test-hrx-host-resident does not compile at this pin (ggml/src/ggml-hrx/host-weight-placement.cpp compiled without ggml/src on the include path), and ninja would otherwise stop all 34 binaries. ctest reports that row as Not Run and the baseline names it, so it is a recorded failure rather than a swallowed one.
    • IREE_HAL_AMDGPU_LIBHSA_PATH from the CMake cache. Without it the rows use the distro's libhsa-runtime64 (no hsa_amd_queue_create), HRX reports test skipped: no device available, and the fork's own regex counts that as a FAIL — 19 rows red that are really skips.

    The ratchet needed two parse fixes to answer at all, both found on the real log rather than in the fixture: ctest pads a LABELS column after the reason parens (dropped rows ⇒ count disagreed with the summary ⇒ "cannot tell"), and Not Run was filtered as a skip although ctest counts it in "M tests failed" — the baseline had been carrying test-hrx-host-resident # Not Run since #2825.

  10. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Correction to this issue's own number, from #2881: "43 test-hrx-* rows" was a mislabelled predicate — 43 is the count of rows whose name contains hrx, which is 38 test-hrx-* plus 5 hrx-* (hrx-buffer-test, hrx-backend-test, hrx-backend-test-loom, hrx-loom-jit-test, hrx-ops-test). The test-hrx-* population at the pin is 38, of which 17 carry SKIP_RETURN_CODE 77 and 21 do not.

    That split is the audit this issue asked for: the 21 without a 77 are the candidate host-runnable set, and tools/ci/fork_hrx_rows.py (#2881) now prints it, including the device-free subset by name. The rest of the issue stands — the rows are registered and no CI job runs them — but the count should be read as 38 test-hrx-* + 5 hrx-*, not as 43 of the former.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions