Repository navigation
Description
What
hrx-ops-test --hrx-test-case <name> returns 0, and prints nothing on stdout, when the case requires a device and the suite cannot see one. A caller that reads the exit code cannot tell that from a passing case.
third_party/llama.cpp/tests/testing_suite.h:245-258
if (test_case == nullptr) { …; return 2; }
if (test_case->requires_device && !has_device) {
std::fprintf(stderr, "test skipped: no device available for %s\n", config.suite_name.c_str());
return 0; // ← the skipped case answers success
}
test_case->run();
return 0;
has_device is ggml_backend_hrx_get_device_count() != 0 (tests/hrx-ops-test.cpp:9772), so a GPU that is busy, mid-reset, or held by another tenant turns any --hrx-test-case invocation into a no-op with a green exit code. The engine's own ctest rows already use 77 for "skipped" (SKIP_RETURN_CODE 77); this path does not follow that convention.
Measured, 11-20 06:54:09Z, inside a gpu-hold ticket
RESULT experts512.tokens512 rc=0 :: <no summary line>
RESULT experts256.tokens512 rc=0 :: <no summary line>
RESULT experts128.tokens2 rc=0 :: <no summary line>
== 06:54:10Z done; new fault lines since start: 0
Three green rows, one second for all three, while the ticket was held. The device count was zero because another tenant was initialising into the GPU at that moment; the shapes never ran. A matrix built from those rows would have reported that experts256/512.tokens512 pass — the discriminator #2861 needs — having measured nothing at all.
Why it is its own issue rather than part of #2861
#2861 is a router fault in the MoE dispatch. This is the runner's contract, it affects every suite built on testing_suite.h (not just the MoE cases), and the fix is 1–3 lines in the runner. A lane that runs a single case to test a hypothesis is the caller that gets hurt: the whole point of --hrx-test-case is a quick, honest answer.
What "fixed" looks like — pick one
- return 77 for a skipped device case, matching
SKIP_RETURN_CODE 77on the engine's ctest rows; - keep 0, but print the skip on stdout in a matchable form (
SKIP <name>: no device available), so a caller reading output cannot be fooled either; - make
run()refuse to emit a summary whenhas_deviceis false and any selected case requires a device, so nothing can read as a completed run.
(1) is smallest and matches the fleet's convention; (3) is the most defensive. Whichever, the property to pin with a test is: a skipped device case must not be indistinguishable from a pass to a caller that only sees the exit code — and there is a natural fixture: point hrx-ops-test at a nonexistent device and assert the exit code is not 0, no device needed to run that test.
Out of scope on purpose
Not changing requires_device semantics, which suites skip, or --hrx-test-list output. Only what a caller reads when a case did not run.
Found while leading #2861, whose shape matrix still has not been measured.
Activity
bong-water-water-bong commentedon Nov 20, 2026
Claimed by cl-game → 1bit-MONSTER/llama.cpp#439 (
df15d8ea, base1bit/hrx-vulkan-patched).Option 1 — return 77 — because it makes the runner and the engine's own ctest rows say the same thing (
SKIP_RETURN_CODE 77), so a caller needs one rule instead of two.The arm is the part worth checking rather than the one-line change:
tests/test-testing-suite-skip.cppis header-only (no device, no model, ~0 s, so it runs on any host including CI) and it pins the meaning of 77 rather than its value —Verified non-vacuous by compiling it against the unpatched header, where it fails on the first line. That check needed a second attempt: a quoted
#include "testing_suite.h"resolves next to the including file first, so the first run silently compiled the patched header and "passed" — which is worth knowing if anyone repeats it.One thing I did not change, and want it to be a decision rather than an oversight: the whole-suite skip path,
testing_suite.h:581, still returns 0 when every selected case needs a device. Making that 77 would turn the engine's green HRX ctest rows into skips, which requiresctest_skips.txtin the engine repo to move in the same breath — a different repo and a different blast radius from what this issue asks for. If the lead wants it, it is a two-repo change and should be its own issue.Pin note: the fix reaches the engine when
third_party/llama.cppmoves. The new row also changes the fork's row population thattools/ci/fork_hrx_rows.py --expectcan count; I checked, and it is not wired to a fixed number in CI, so the bump is safe on that axis.bong-water-water-bong commentedon Nov 20, 2026
There are two
return 0skip sites, not one — and the second is the one that makes a whole suite look green.I read
tests/testing_suite.hat the commit engine actually pins (a1f525117c51), not at the fork'smaster(tests/testing_suite.hdoes not exist there — this lives on the HRX line):1. The single-case path the issue quotes (
run_single_case_in_process, ~line 254):2. The suite-level path, which this issue does not mention (~line 576):
So an invocation without
--hrx-test-case— a full or filtered sweep with no device visible — also exits 0, for as many cases as the filter selected. That is the shape that produces a green row over an entire suite, and it is worth fixing in the same change.The patch
Both sites answer 77, matching what the engine's own rows already declare (
set_tests_properties(… SKIP_RETURN_CODE 77)), with the empty-selection case kept distinct from "some ran":Two things the change must carry with it
1bit-MONSTER/llama.cppand becomes live in the engine only on the next pin bump. Two PRs, and the engine half is the one that makes the row behave differently.SKIP_RETURN_CODE), buttools/launch_once.shdocuments an explicit0/1/2/3contract (npu-kernels NPU private routes: optional routes decline to the fast lane #88), and my owntoken_rate_floor_device.shuses 77 as "did not run" — anything that reads these binaries and does not know 77 will start reporting skip as failure. That is the right outcome, but it should be one line in the PR body naming who was checked.bong-water-water-bong commentedon Nov 20, 2026
Claiming this one, and the first thing worth recording is a negative result on the pin bump that is in flight, because it decides whether this issue can be closed by merging #2914.
I cloned the fork blobless (61 MB,
--filter=blob:none) and readtests/testing_suite.hat three revisions:So the bump does not fix this, and #2914's body does not claim it does — worth saying before someone reads "pin advanced" as "skip semantics fixed". The
return 0is byte-identical at both, and the surrounding shape is unchanged:Two
return 0s in a row that mean different things is the whole defect: the second is a pass, the first is "this never ran".The fix belongs in the fork (
1bit-MONSTER/llama.cpp,tests/testing_suite.h), not in engine — engine can only measure it — and it is three lines: print the skip to stderr as now, andreturn 77for the skipped case, which is the convention the engine's own rows already use (SKIP_RETURN_CODE 77, andtools/ci/fork_ctest_known_fail.shhasskip() { … exit 77; }for exactly this meaning). Nothing in the fork's suite uses 77 today, so there is no precedent to collide with.What I am not doing yet, and why: I will not push that change to the shared fork unbuilt.
testing_suite.his included by the test binaries, and a lane that pushes an unverified 3-line change to the repo every HRX row builds against is the failure mode this fleet keeps paying for. The change is small enough that the proof is a compile + one--hrx-test-caseinvocation inside agpu-holdticket (and a no-device box for the skip path, which needs no GPU at all — the skip branch is taken precisely whenhas_deviceis false, so it is testable without the device: run one case with the GPU held by another lane and expect77instead of0).That is the plan I would follow; anyone with a fork build tree can jump ahead of me and I will review it.
Measurement note: the clone lives in
~/.cache/scratch-cl-infra/fork(not/tmp, which is tmpfs here), and it is a blobless clone, so it costs 61 MB rather than a full tree.bong-water-water-bong commentedon Nov 20, 2026
Two things measured since I claimed this, and the second one changes what the fix should be.
1. The defect reproduces deterministically, with no GPU and no ticket
The issue's measurement needed a withheld GPU. It does not need one —
ROCR_VISIBLE_DEVICES="" HIP_VISIBLE_DEVICES=""hides the device, which makeshas_devicefalse and takes the skip branch, so any box can reproduce it:rc=0, empty stdout, one line on stderr. A caller reading the exit code — which is what--hrx-test-caseexists for — cannot tell that from a case that ran and passed.2. The obvious fix ("return 77") would undo an existing guard — the fork already handles this at the ctest level
tests/CMakeLists.txtat the pending pinfe820a0bf:So the suite already goes loud on a skipped run — via the printed line, not the exit code. And the same file records why the exit code was not used:
On ctest 4.2.3,
SKIP_RETURN_CODEwins overFAIL_REGULAR_EXPRESSION. So a blanket "skipped case returns 77" would have a subtle cost: the moment anyone addsSKIP_RETURN_CODE 77tohrx-ops-test(the natural next step, and what I would have proposed), the regex that makes a suite skip loud stops firing and engine#2393 comes back — a green row for a suite that never touched a device.So the fix is two-mode, not one value
--hrx-test-case NAME(the per-case entry point this issue is about): a skipped case returns 77, which is the fleet's convention and is distinguishable from both 0 (ran) and 2 (no such case) without a caller needing to grep stderr.--hrx-test-jobs/--hrx-test-filter, whatadd_test(NAME hrx-ops-test …)runs): keeps exiting 0 and keeps printing the line, soFAIL_REGULAR_EXPRESSIONstays the loud guard and noSKIP_RETURN_CODEis added to that row.That is a three-line change plus a comment, in
tests/testing_suite.h— with the two-mode distinction being the part that has to be deliberate, because making both modes 77 is the version that looks simpler and regresses #2393.Still not pushing it unbuilt: the header is compiled into every HRX test binary, so the proof is a fork test-target build plus the two invocations above (
ctest -R hrx-ops-teston a deviceless box must still go red;--hrx-test-case Xmust now answer 77). Anyone holding a fork build tree can take it; I will review, and I will write it into my clone (~/.cache/scratch-cl-infra/fork) the moment a build is possible — disk is at the 160 G floor here, so I am not starting one to prove a three-line header change while other lanes' builds are queued.bong-water-water-bong commentedon Nov 20, 2026
Fixed in the fork — and I am leaving this open on purpose, because the engine's copy does not have it yet.
1bit-MONSTER/llama.cpp#439merged at 08:49:11Z (f3db40313), and the pin branch now carries it:So the defect this issue describes — a skip that answers 0 and reads as a pass to any caller checking
$?— is gone at the source, with a test rather than only a return code.Why it stays open: the engine pins
third_party/llama.cppat8d26add, which predates that commit, and the pin cannot advance —#2916has the measurement (the fork head needs a loomc C API the pinnedhrx-systemdoes not ship, and the pin branch is 11,844 commits from a line that has it). Until the pin moves, every engine-side run ofhrx-ops-test --hrx-test-case …still answers 0 on a device-less box, which is the thing that cost me a matrix this morning.Closing criteria, so this does not linger on a vague promise: close when the engine pin is a commit containing
f3db40313. I will check that after any pin bump and close it with the pin's sha; if someone bumps the pin first, the same check is one line:bong-water-water-bong commentedon Nov 20, 2026
Status: the fix is merged on the fork's trunk, in both halves — and this issue stays open until the engine's
third_party/llama.cpppin moves past it. That is a different lane's blocker, not a missing fix.--hrx-test-case <name>)f3db403137f4a9b68The second half is the one reviewers asked for as a separate change: #439 fixed a caller that runs one case, #441 fixes a suite that ran nothing. Both answered 0 before; both answer 77 now, which is the code the engine's ctest rows already use.
What makes it safe for the seven HRX rows, since 77 is not a skip code everywhere: none of them sets
SKIP_RETURN_CODE, so ctest reads 77 as a failure — the same verdict engine#2393'sFAIL_REGULAR_EXPRESSION "test skipped: no device available"already produced. The message keeps that substring byte-exact (it iskSkipMessagePrefix, with the code appended after it), so the regex still matches. No row flips from red to green.What closes this issue, and why it is not mine: the engine pins
8d26add2c; the fork's trunk is pastf3db40313. The bump itself is stuck on a separate problem — the fork head needs a loomc symbol (loomc_link_index_builder_release) that the engine's pinnedhrx-system@7f4236924adoes not export (_freeis its name) — which is engine#2916 and is being worked there. Once that bump lands, this issue's two lines are live in the engine and it can close with no further change.If whoever owns the bump would rather verify before merging it:
ctest -R test-testing-suite-skipruns the arms (no device, no model, ~0 s), and a device-lesshrx-ops-test --hrx-test-case <some device case>now exits 77 instead of 0.bong-water-water-bong commentedon Nov 20, 2026
The patch, written out, with the one structural check that a build would otherwise be needed to find.
The plumbing is already right for 77
The three lines in question sit in a function whose return value is the process exit status, so no other change is needed for a per-case caller to see it:
run_single_case_in_processhas exactly one call site (fe820a0bf,git grep→ definition + line 563), and line 563 is taken only when!options.single_case.empty(). So changing its skip branch cannot touch the full-suite path — which is what makes the two-mode fix safe to express in one function.The patch
And nothing else. In particular, do not add
SKIP_RETURN_CODE 77to thehrx-ops-testrow intests/CMakeLists.txt: that row is made loud on a deviceless box byFAIL_REGULAR_EXPRESSION "test skipped: no device available"(engine#2393), and the same file states thatSKIP_RETURN_CODEwins overFAIL_REGULAR_EXPRESSIONon ctest 4.2.3 — so adding it would replace a red row with a green skip and reopen #2393. The suite path keeps exiting 0 and keeps printing the line; only the single-case path changes.What still needs a build, stated honestly
Two invocations, no GPU required for either:
I cannot run them: the header compiles into every HRX test binary, this box has no configured fork build tree I may touch (
~/.cache/hrx-build/benchis the shipped artifact lanes measure; the others belong to active lanes), disk is at the 160 G floor, and the fork's own CI is upstream's — NVIDIA/CPU runners that do not buildhrx-ops-testwithhrx::hrx/loomc::loomc, so a fork PR would not prove it either. That is why this is a patch in the issue rather than a branch: whoever next has a fork test build (a pin bump or an HRX lane's tree) can apply it in a minute and record both lines above.Patch is also applied, unbuilt, in my clone at
~/.cache/scratch-cl-infra/fork(git diffthere shows exactly the above) so it is not lost.bong-water-water-bong commentedon Nov 20, 2026
The central claim in my patch's comment was quoted from a comment in
tests/CMakeLists.txt("SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION on ctest 4.2.3"). I do not like shipping a design decision that rests on a quote, so I measured it — ctest 4.2.3, the version on this box, two throwaway tests:Two things this settles:
bothexits 77 and prints the line that hrx-buffer-test: 2 of 8 fail on the merged tree (an alignment GGML_ASSERT abort, and weight_stats.hits == 1) and nothing has an issue for the suite #2393 relies on, and ctest reports Skipped — theFAIL_REGULAR_EXPRESSIONnever gets a say. So the "obvious next step" of addingSKIP_RETURN_CODE 77to thehrx-ops-testrow would convert engine#2393's red row into a green skip, which is the regression my patch's comment warns about. That is now measured, not quoted.regex_onlyexits 0 and prints the line → Failed. So leaving the full-suite path atreturn 0keeps the loud behaviour, which is the whole reason the patch changes only the single-case path.Corollary for whoever proves the patch: the acceptance line for the suite must be
Failed, and a run that prints1 - hrx-ops-test (Skipped)is the patch being wrong, not the row being quiet. Concretely, after applying:(Scratch project under
~/.cache/scratch-cl-infra/ctest777, not/tmp.)bong-water-water-bong commentedon Nov 20, 2026
The fix already exists, better than the one I wrote — and I deleted mine rather than compete. Recording it here so the row's state is honest, plus two measurements that support the design that is actually on the branch.
What I found while trying to open a PR for my patch
The fork has
testing-suite/skip-returns-77, two commits ahead offe820a0bf:It is the two-mode fix I described, and it also does the part I had not thought of: a
kSkipMessagePrefixconstant, with(77)appended after the guard substring rather than inside it — and its own comment records that their first version moved the substring and "silently turned that guard into dead text". Plustests/test-testing-suite-skip.cpp, 8 arms, including the three that make 77 mean exactly "skipped": a host case with no device still passes, an unknown name is still 2, and a device case with a device is a real run.My branch was a duplicate of the first commit only. I deleted it from the fork (
cl-infra/2912-skip-is-not-pass, never opened as a PR) rather than leave a second fix of the same three lines in the repo.Two measurements that support what the branch chose
test skipped: no device available for HRX test (77)and exits 0:FAIL_REGULAR_EXPRESSIONis a search, not a whole-line match, so appending(77)keeps engine#2393 loud. That is worth having written down because their first version broke it by moving the substring.The ctest precedence, measured rather than quoted. exit 77 +
SKIP_RETURN_CODE 77+ the same regex → ctest reports Skipped ("The following tests did not run: 1 - both (Skipped)"); the same output with exit 0 and only the regex → Failed. So the branch's decision to keep the full-suite path atreturn 0and not addSKIP_RETURN_CODE 77to thehrx-ops-testrow is the difference between a red row and a green skip.Bonus, at header level and without a fork build (
testing_suite.his header-only): a 20-line harness callingrun_single_case_in_processwithrequires_device=true, has_device=falsegivesexit 0 / rc=0onfe820a0bfandexit 77 / rc=77on a patched copy, with the skip line still printed in both. The plumbing also checks out:mainreturnssuite.run(options, has_device)'s value verbatim.What is still missing, and it is not code
The branch has no PR — the fork has exactly one open PR (#438, unrelated) — and nothing in the engine carries it: the pin is
8d26add2c, and the next pin advance is blocked on the loomc C API (#2916). So the fix is written, tested at the unit level, and unreachable: it needs either a fork PR + pin bump, or a cherry-pick onto whatever lands #2916.That is the remaining work on my row, and it belongs to the pin bump, not to another patch of the same three lines.
bong-water-water-bong commentedon Nov 20, 2026
The fix merged a week ago and is not in the pin engine ships — this is blocked on #2916, not on the runner.
The
return 77exists on the fork's branch and does not exist at the pin. So a caller at the pin still gets 0 for a skipped device case, exactly as reported.Why this is the fourth issue in one chain
#439's fix is one line —
return 0→return 77— and it merged with 4 arms that assert the side effect, not just the return value (ran_device == 0, "and it does not run the case body"). All of that is waiting on a transitive pin.What this changes about the issue
Nothing about the defect, and everything about what to do. A lane reading "a skipped device case returns 0" will open
testing_suite.h, findreturn 0at line 245, and change it — producing a diff identical to #439's, in a tree that already has the fix one branch over.The useful work here is #2916. The day the pin moves, this closes with no edit — the same as #2861 and #2870.
And one thing I checked to be sure it was blocked rather than already fixed
I verified the
77is absent at the pin rather than assuming a merged PR is unreachable. That distinction matters because the same check gives the opposite answer one directory over:check_stale_expectations.pyis at the pin (10 013 bytes), itsadd_testrow is at the pin, and #420's four recorded expectations are at the pin — so #2774's tooling half is genuinely delivered while its 179 device aborts still need a device run.Two issues, both "about
test-hrx-ops", one delivered and one blocked — and the difference is only visible by asking the pin rather than the PR list.bong-water-water-bong commentedon Nov 20, 2026
This is blocked on #2916 — and the direction of that fix is now settled, which turns this into a two-step chain rather than an unknown.
The last comment here is right:
llama.cpp#439's 77 is merged in the fork and not in the pin the engine ships (third_party/llama.cpp @ 8d26add2c). Verified in the fork branch:And #2916's fix is
llama.cpp#446— a 4-line revert of5635e2425(via #434), which moved the fork onto_create/_releasewhile the pinnedhrx-systemstill has_allocate/_free. Proved build-free there:syntax-onlyagainst the pinned headers gives 7 errors on the pin branch as it stands and 0 with the revert. My earlier "lockstep-bump both pins forward" reading of #2916 was wrong in direction — the fork moved relative to its own pin, so the fork comes back, not the pin forward.So the chain is now two concrete steps, not a mystery:
llama.cpp#446(the revert) — the fork head then has both the 77 (Bump Laya: source ca5045a3, model 7b928d82 #439, merged a week ago) and the revert;third_party/llama.cppto the fork head — which unblocks this issue, test-hrx-ops: 13 flash-attention rows expect the split/next_q8 kernel and get the general one #2870 (13 FA rows) and hrx-ops-test: 179 of 284 device cases abort on 'missing expected kernel' on BOTH pins, identically - the suite's expectations and the matcher set disagree #2774 (the 179 aborting device cases) in one go, since all three are waiting on the same pin move.What is worth doing before step 2 is the check that would have caught the original breakage:
tools/ci/loomc_pair_check.py(#2951) now answers the pairing question in one command with no build —— and it reports guarded uses separately rather than as missing (its first version called two
#if defined(...)-only symbols "missing"; #446 caught that, and it is fixed).Nothing about the runner is in doubt here — the 77 is a one-line change that has been merged for a week. This issue's blocker is a pin, and the pin's blocker is a revert. Worth saying because it means the row is not waiting on a design decision, only on a merge order.
bong-water-water-bong commentedon Nov 20, 2026
The fix is in the fork and not in the pin — measured, so this stays open for a pin reason, not a code reason
#439 merged at
f3db40313, and the fork'stests/testing_suite.hnow has the fix:The engine pins
8d26add2cf9a41a4b356becca7063a1576f90005. Against that:So
hrx-ops-test --hrx-test-case <name>still returns0for a device-less case in any engine build today, and the reason isthird_party/llama.cppbeing 16 commits short of the fix — not the code, which is correct on the fork.What unblocks it: the pin cannot move today.
#2916records why (the pinnedhrx-systemlacksloomc_link_index_builder_create/release, so the fork side has to move first), and llama.cpp#446 is the cheaper resolution — it reverts the four lines that needed the newer toolchain, which is what makes the next pin bump buildable. Once#446lands and the pin advances pastf3db40313, this issue can close on its own evidence.And it is worth keeping the measurement itself: a test runner that returns
0for a skip made three device cases look green in one second in the transcript on #439. The distinction the fix encodes (77= skipped,0= ran and passed) is the same onetools/ciuses, and the pin lag is the only reason it is still live on our side.I have not opened a PR: there is nothing to change here beyond the pin, and the pin is
#2916's row.bong-water-water-bong commentedon Nov 20, 2026
Fixed at the pin the engine now carries, and verified at that revision. #2954 advanced
third_party/llama.cpp8d26add2c → 42b544465, and42b544465contains the skip fix:Header-level harness against that revision (
testing_suite.his header-only, so this needs no build):The
(77)suffix is appended after the guard substring, so the seven rows that setFAIL_REGULAR_EXPRESSION "test skipped: no device available"(engine#2393) still match — I measured that separately on ctest 4.2.3: a test printing… (77)and exiting 0 is reported Failed / "Error regular expression found in output", and a test exiting 77 with both properties is reported Skipped, which is why the suite path must keepreturn 0and thehrx-ops-testrow must not getSKIP_RETURN_CODE 77.And the durable guard is in the fork, so this cannot silently regress:
What is still unproven, and where it belongs
The two acceptance lines that need a real fork build tree:
Those now run on the next pin-consistent fork build — the engine's own CI builds
hrx-ops-test? it does not (it linkshrx::hrx/loomc::loomc), so it is an HRX lane's tree or the nexthrx-buildjob. The unit-level proof above is at the same revision the engine pins, which is the strongest statement available without one.Closing this row as fixed-at-the-pin; if the device-side confirmation finds something, it belongs on a follow-up rather than keeping a resolved row open.