Repository navigation
Description
The harness is tests/test-backend-ops.cpp in the 1bit-MONSTER/llama.cpp fork at the pin the engine
builds against (third_party/llama.cpp = 40c4ccb76); issues are disabled on the fork, so this is tracked
here.
A test-backend-ops run that executes zero test cases prints OK and exits 0, so a green result can mean "nothing was measured". Two of the three paths below are exactly what a device verification run looks like when it goes wrong.
1. -b is an exact device-name match, so a family name silently skips every device
tests/test-backend-ops.cpp:10635-10639 at the engine's pin third_party/llama.cpp = 40c4ccb76 (10719 on 1bit/528-pad-nan, where the test case below was added):
if (backend_filter != NULL && strcmp(backend_filter, ggml_backend_dev_name(dev)) != 0) {
output_printer->print_backend_init(
backend_init_info(i, ggml_backend_dev_count(), ggml_backend_dev_name(dev), true, "Skipping"));
n_ok++;
continue;
}ggml_backend_dev_name() is HRX0, CPU, CUDA0, ... so -b HRX matches nothing, every device is "Skipping", the skip counts as a pass, and the summary is 2/2 backends passed + OK:
$ ./test-backend-ops test -b HRX -o FLASH_ATTN_EXT -p pad_nan
Testing 2 devices
Backend 1/2: HRX0
Skipping
Backend 2/2: CPU
Skipping
2/2 backends passed
OK
$ echo $?
0
2. A params regex or an op filter that matches nothing is also a green no-op
$ ./test-backend-ops test -b CPU -o FLASH_ATTN_EXT -p zzz_no_such_param
0/0 tests passed
Backend CPU: OK
1/1 backends passed
OK
$ echo $?
0
$ ./test-backend-ops test -b CPU -o NO_SUCH_OP
0/0 tests passed
Backend CPU: OK
1/1 backends passed
OK
$ echo $?
0
See filter_test_cases() (tests/test-backend-ops.cpp:10242-10276 at that pin): the case list is regex-filtered down to nothing, and nothing downstream distinguishes "0 of 0 passed" from "all passed". The exit code comes from the backend count only (n_ok != ggml_backend_dev_count() at the end of main).
3. Why this matters for the HRX lane
The HRX backend registers an empty device list when hrx_gpu_initialize() fails (ggml/src/ggml-hrx/ggml-hrx.cpp:1300-1313), which is what happens in a plain llama.cpp build without IREE_HAL_AMDGPU_LIBHSA_PATH pointing at TheRock's libhsa-runtime64.so.1. The run then says Testing 1 devices, tests the CPU only, and exits 0. Combined with (1), two separate real attempts to verify a flash-attention change on the device produced green runs that had tested nothing at all, before the command was finally corrected to -b HRX0 with the HSA path set (2/2 tests passed / Backend HRX0: OK).
Proposed guard
Fail loudly instead of passing when nothing ran. In rough order of value:
- Zero-case check, per backend and overall.
test_backend()'s result already knows the case count (n_test); if a backend that was selected (not skipped) executes 0 cases, mark it failed with a message naming the filters that emptied it, and make the overall runreturn 1. An explicit--allow-emptyopt-out for the rare scripted case that only wants a load check. -bnames nothing: if noggml_backend_dev_name()equals the filter, print the valid names and exit 1 instead of skipping everything. (Accepting a comma list of exact names, or treating the filter as a regex/prefix, would also fix the footgun — but the guard is the part that cannot be forgotten.)- Same treatment for
-o: if no op in the registry matches, say so and exit 1 rather than0/0 tests passed.
Nothing here depends on HRX; it is generic test-backend-ops behaviour, so the fix is worth upstreaming to ggml-org/llama.cpp once it is settled here.
Activity
bong-water-water-bong commentedon Oct 31, 2026
Triage:
bug, and I am taking it (single-file fix candidate). Re-verified at the pin the engine builds today —third_party/llama.cpp=5e6388a5a, carried onto main by#672(31d52e1) — both halves still hold, onefile, test harness only:
Line numbers moved from the report (
10635/10242at40c4ccb); the behaviour did not.What I will raise, as one PR against the fork:
tests_totalover the backends that actually ran and return non-zero when it is zero, printing thereason (
no test case matched -b/-o/-p) — this is the exit-code half, three lines plus the summary line,and it makes the two verifications in this issue's §1 and §2 impossible to mistake for green.
-b NO_SUCH_DEVICEand-o NO_SUCH_OPand assert non-zero exit.Deliberately not in the same PR: making
-b HRXmatch theHRX0family. That is a behaviour change foranything that passes
-b, including the hardware gate, and it deserves its own diff and its own reviewer. Ifyou want it, say so here and I will open it as a follow-up with the gate's invocations as the test corpus.
This issue stays open until the fix merges; the PR number lands here and on
~/briefs/TISSUES-BOARD.md.bong-water-water-bong commentedon Oct 31, 2026
Merged. fork PR #162 → merge commit
20f958478on1bit/hrx-vulkan-patched(23:31:11Z). What thatcommit carries, from the PR's own measured table on this pin (
4a58da9b0, same binary, patch stashed/re-applied):test -b NO_SUCH_DEVICE -o MUL_MAT1/1 backends passed OKerror: no test case ran (check -b/-o/-p and --test-file): refusing to report a passtest -b CPU -o NO_SUCH_OP0/0 tests passedtest -b CPU -o MUL_MAT -p zzz_no_such_param0/0 tests passedtest -b CPU -o DUP -p "",-o MUL_MAT -p m=16(controls)This issue stays open on purpose: the engine still pins
4a58da9b0, so the fix is not in any engine build yet.Closes when the next pin bump moves
third_party/llama.cppto a commit containing20f958478— that bump alsocarries fork #163 (kv share), so it is a two-item bump, and the acceptance I will check is the same three
commands above run against the engine's built
test-backend-opsat the new pin, plus the controls unchanged.Not in the merged diff, deliberately (both stated in the PR body):
-bis still an exact device-name match(
-b HRXmatches nothing and is now loud instead of green), andsupport/perfmodes still return 0 when an opfilter matches nothing. Say the word if the
-bfamily-prefix change should be its own issue.bong-water-water-bong commentedon Nov 1, 2026
Measured at the fork tip
199165047(the commit the pending bump would pin), before/after on one tree, and it also corrects a control I reported wrong on 10-31.Method:
--depth 1clone of1bit/hrx-vulkan-patched@199165047,-DLLAMA_BUILD_TESTS=ON,-j8, CPU only — no device, nogpu-hold, no env trio. BEFORE = the pin's (4a58da9b0)tests/test-backend-ops.cppcompiled into that tree; AFTER = the tip's.diffof the two files is exactly this fix (+30/−2) and nothing else, so the flip is attributable to it and not to #164–#168.-b NO_SUCH_DEVICEOKerror: no test case ran (check -b/-o/-p and --test-file): refusing to report a pass-o NO_SUCH_OPOK-p zzz_no_such_paramOK-b CPU -o DUP(control)-b CPU -o MUL_MAT -p m=16(control)-o DUP(bare, no-b)OKCorrection to my own 10-31 numbers, because it matters for the acceptance: bare
-o DUPwas never a valid control.tests/test-backend-ops.cpp:10747-10753skips the CPU backend by design when no-bis given (CPU is the reference), so that invocation runs zero cases — pre-fix it reportedOKat exit 0, which is this very bug in its purest form, and post-fix it is refused like any other empty run. The valid controls carry-b CPU, and both are unchanged (10/10 and 776/776). The PR body's "controls 0 → 0" line was right about the exit codes and wrong about why.Caller check for the bump (the one thing that could have made this fix a regression): every
test-backend-opsinvocation in the tree passes-b—scripts/hw-gate.sh:449(test -b HRX0 -o "$OPS" -j "$JOBS") and its retry at:471,docs/hw-gate.md:57,KNOWN-ISSUES.md:25,docs/hrx.md's several rows. No in-tree caller uses the bare-oform, so nothing breaks when the pin moves — stated as a residual risk rather than assumed.Still open on the bump, not on this fix: the acceptance in the body is "at new pin, from the engine's build". The engine still pins
4a58da9b0(fork tip is 8 commits ahead; no bump PR open — #759 was closed as superseded). When it lands I run the same six commands against the engine's owntest-backend-opsat the new pin and close this with those numbers.bong-water-water-bong commentedon Nov 1, 2026
Closed on the bump: verified from the engine's build at the new pin, which is what this issue's acceptance asked for.
Pin: engine
main7ba14cde9(HRX bump #786);third_party/llama.cpp=1d32c22609d6. I built in a worktree of~/1bit-engineat7ba14cde9with the submodule at the pin, and checked the two agree rather than assuming:TREE PIN: 1d32c22609d6eb2…==ENGINE PIN (recorded in the superproject): 1d32c22609d6eb2…. The fix is fork #162 →20f958478, which is in this pin (git merge-base --is-ancestordistance: the pin is 10 commits past the old4a58da9b0, this is one of them).Build:
cmake -DLLAMA_BUILD_TESTS=ON -DGGML_HRX=OFF -DCMAKE_BUILD_TYPE=Release,-j8, CPU only — no device, nogpu-hold, no no-SVM trio needed. The zero-case paths are CPU-side by construction, which is the point: they are the paths that used to report a green on nothing.1d32c22609d6test-backend-ops -b NO_SUCH_DEVICEerror: no test case ran (check -b/-o/-p and --test-file): refusing to report a passtest-backend-ops -o NO_SUCH_OPtest-backend-ops -p zzz_no_such_paramtest-backend-ops -b CPU -o DUP(control)OK— 10/10 passedtest-backend-ops -b CPU -o MUL_MAT -p m=16(control)OK— 776/776 passedAll three zero-case paths that used to exit 0 and print
OKnow refuse, and both controls still pass. Before/after on one tree at the same source (pin'stests/test-backend-ops.cppvs the patched one, the only diff in that file) is in the comment above, so the flip is attributable to this fix and not to the other nine commits the bump carries.Callers checked, not assumed: every
test-backend-opsinvocation in the tree passes-b—scripts/hw-gate.sh:449and its retry at:471,docs/hw-gate.md:57,KNOWN-ISSUES.md:25— so nothing in the repo depended on the old false green.One residual worth keeping in the record: a bare
-o <op>with no-balso exits 1 now, becausetests/test-backend-ops.cpp:10747-10753skips the CPU backend by design when no backend is named (CPU is the reference) — that invocation runs zero cases, so refusing it is correct. Any future CI job that wants a filtered run must say-b CPU(or the real device). That is the whole behavioural surface of this change.