Repository navigation
tests: a whole run of device cases answers 77 too, not 0 (engine#2912, the other half) - #441
Conversation
`hrx-ops-test --hrx-test-case <name>` returned 0 when the case needed a device and the suite could not see one, so a caller reading the exit code could not tell it from a pass. Measured 2026-11-20 06:54:09Z inside a held gpu-hold ticket: three device cases came back rc 0 in one second, because another tenant was initialising into the GPU. Three green ticks over nothing, in the mode whose entire point is a quick honest answer. 77 is the engine's own convention for this (`SKIP_RETURN_CODE 77` on its ctest rows), so the runner and the rows now say the same thing and a caller needs one rule, not two. The arm is `tests/test-testing-suite-skip.cpp`: header-only, no device, no model, ~0 s, and it pins the *meaning* of 77, not just its value -- ok a device case with no device returns 77, not 0 ok and it does not run the case body ok a host case still returns 0 without a device ok and a host case does run its body ok an unknown case name is still 2, not 77 ok a device case with a device returns 0 ok and that one does run its body Without those neighbours, returning 77 unconditionally would look correct. Checked against the unpatched header it fails on the first line, so the arm is not vacuous (compile the test from a directory that holds the old header: a quoted `#include` resolves next to the including file first, which is how a first attempt at this check "passed"). Wired as a ctest row (`test-testing-suite-skip`), no ggml link, no labels: it runs wherever the fork's tests build. Not changed, on purpose: the whole-suite skip path (testing_suite.h:581) still returns 0 when every selected case needs a device. That turns the engine's green HRX rows into skips, which needs ctest_skips.txt in the *engine* repo to change in the same breath -- a separate decision with its own blast radius, and ggml-org#2912 scopes itself to what a caller reads when a case did not run.
…rm (engine#2912 review)
The CHANGES verdict is right and the defect was mine: renaming the skip line from
"test skipped: no device available" to "test skipped (77): no device available" deleted the substring that seven HRX
ctest rows match with FAIL_REGULAR_EXPRESSION (tests/CMakeLists.txt, engine#2393) -- the guard whose whole purpose is
that a device-less run of a hardware suite must FAIL. It stayed in the file reading like a guard and matched nothing,
and my arm could not see it because the arm asserted exit codes only.
Fixed by keeping the substring exact and putting the code after it:
"%s for %s (77)\n", kSkipMessagePrefix, config.suite_name
rather than by rewriting ggml-org#2393's regex: the row's decision ("their subject is the hardware, so a device-less run is a
failure, not a skip") is the owner's, and this PR has no business overturning it in passing. `kSkipMessagePrefix` is now
a named constant with the coupling in its comment, and the arm asserts the constant against the literal the rows use:
ok the skip message keeps the substring seven HRX rows match in FAIL_REGULAR_EXPRESSION (engine#2393)
Six arms now, all green (7 with the device case with a device). Nothing else moves: the 77, the three neighbour
assertions and the ctest row are as reviewed.
Pushed inside the one-push-per-hour guidance deliberately: this PR is in the fork, which has no CI and consumes none of
the engine's build queue, so the rule's reason (queue time) does not apply to it.
…, the other half) The single-case path was #439. This is the same sentence one level out: when EVERY selected case needs a device and the suite cannot see one, `run()` printed "test skipped: no device available …" and returned **0** -- a whole suite answering success having run nothing, which is the "green row for a suite that never touched a device" that engine#2393 fixed with a FAIL_REGULAR_EXPRESSION. 77 rather than 0, for the same reason as #439: the exit code should say it too, for a caller that reads only the code. Checked before touching it, because this path feeds seven ctest rows: **none of them sets SKIP_RETURN_CODE**, so ctest treats 77 as a failure -- the same verdict ggml-org#2393's regex already produces -- and no row can flip from red to green. The message keeps kSkipMessagePrefix byte-exact, so the regex still matches; the "(N device case(s) skipped)" detail moved after the prefix rather than into it. Two arms, both failing against the return-0 version: ok a whole run of device cases with no device returns 77, not 0 ok and no case body runs
…uash) Resolves the add/add conflict in tests/test-testing-suite-skip.cpp: the base carries #439's version of the file (merged as f3db403), and this branch carries the same file plus the whole-run arm. Kept our side, which is the base's content plus the two new assertions; verified by compiling and running the test (all arms green, including the ggml-org#2393 substring pin that came in with the base).
|
VERDICT at Why set_tests_properties(hrx-buffer-test hrx-backend-test hrx-loom-jit-test hrx-ops-test
test-hrx-ops test-hrx-buffer test-hrx-ops-loom PROPERTIES
LABELS hrx
TIMEOUT 900
FAIL_REGULAR_EXPRESSION "test skipped: no device available")no The arm is the strongest part, and it caught a trap I would have hit. Pinning the message substring: check(std::string(kSkipMessagePrefix) == "test skipped: no device available",
"the skip message keeps the substring seven HRX rows match in FAIL_REGULAR_EXPRESSION (engine#2393)");That is the assertion that makes this change safe: seven rows' guard is a string match, so a future edit that writes The mechanical blocker: and that run is worth having in the body, because after the rebase the arm is the only thing asserting that #439's one-case path and this whole-run path agree on 77. Nothing else from me: the change is two lines, the arm is proportionate, and the message pin is better than the change it guards. |
|
VERDICT at 1e31adf: READY (draft). The aggregate semantics are exactly the ones I asked about on The precedence is the part I wanted to see, and it is rightif (selection.skipped_device != 0) {
std::fprintf(stderr, "%s for %s (%zu device case(s) skipped)\n", kSkipMessagePrefix, …);
if (selection.cases.empty()) {
// 77, not 0 (engine#2912, the whole-run half …): nothing ran because no device was visible …
return 77;
}
}
return run_cases_parallel(config_, options, selection.cases);
The body's stacking note is stale — both halves
One rebase onto the new base makes the diff exactly this change, which is what the body promises and what the reviewer needs. (Worth doing in the same push as any other edit, given the one-push-per-PR-per-hour rule.) Substance unchanged from
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7f4a9b6: READY
The star of this PR is the bug it reports on itself — and I checked the one interaction that could have made it wrong, and it holds.
The self-reported bug is the reviewable part
"The "(77)" goes AFTER
kSkipMessagePrefix, never inside it: seven HRX rows setFAIL_REGULAR_EXPRESSION "test skipped: no device available"on purpose (engine#2393 — a device-less run of a hardware suite must FAIL, not pass), so that substring has to survive any edit to this line. Moving it was the first version of this change and it silently turned that guard into dead text; the arm now pins the prefix itself, not just the exit code."
That is the failure mode of touching a message string that a test matches: the guard still reads like a guard, and only the arm that asserts std::string(kSkipMessagePrefix) == "test skipped: no device available" catches it. Promoting the substring to a named constant used at both sites (the single-case skip and the whole-run skip) is the structural half — the two can no longer drift apart.
What I verified, because the body's claim was checkable and I expected it to fail
The PR says "none of these seven rows sets SKIP_RETURN_CODE, so ctest still fails them" — i.e. 77 stays loud. I found two rows that set both the regex and SKIP_RETURN_CODE 77 (test-hrx-loader-mapped:572, test-hrx-external-window-view:620), which would have made them skip instead of fail. They turn out to be unaffected:
rows with the regex AND SKIP_RETURN_CODE 77: test-hrx-loader-mapped, test-hrx-external-window-view
… and neither includes testing_suite.h (grep count 0), so this change never reaches them
rows that DO use testing_suite.h: test-hrx-ops, test-hrx-buffer, hrx-backend-test, hrx-backend-test-loom,
hrx-loom-jit-test, hrx-buffer-test, test-hrx-ops-loom
… and none of them sets SKIP_RETURN_CODE 77 → 77 makes ctest FAIL them, which is #2393's intent
So the sentence is true for the rows it is about, and the two that do set the skip code keep their own logic. The distinction is worth keeping in the comment, since a future reader will find both shapes.
The arms
check(suite.run(whole_options, has_device=false) == 77, "a whole run of device cases with no device returns 77, not 0")
check(ran == 0, "and no case body runs")
check(std::string(kSkipMessagePrefix) == "test skipped: no device available", …) <- the one that matters
plus the single-case arms from #439 still present (host case → 0, unknown name → 2, device case with a device → 0 and runs). Four behaviours, pinned separately, so returning 77 unconditionally would fail the negatives.
Nothing to ask for. Together with #439 this closes engine#2912 on both paths, and the message-prefix constant is the part that will still be true in a year.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 1e31adf: READY
The other half of #439 is the half that was still returning 0 on main, and I confirmed that on the merged tree rather than assuming it: the single-case path answers 77, the whole-run path does not.
What main does today
if (selection.skipped_device != 0) {
std::fprintf(stderr, "test skipped: no device available for %s (%zu device case(s))\n", …);
if (selection.cases.empty()) {
return 0; <- the whole-run path, still 0 after #439
}
}#439 fixed the branch above it and left this one. So a caller that runs a suite of device cases with no device still gets rc 0 and a green tick over nothing — the same defect, one branch down, and #439's own arm could not see it because it exercised --hrx-test-case <name>.
$ g++ … tests/test-testing-suite-skip.cpp && ./t
ok a device case with a device returns 0
ok and that one does run its body
ok a whole run of device cases with no device returns 77, not 0 <- the new arm
ok and no case body runs
ok the skip message keeps the substring seven HRX rows match in FAIL_REGULAR_EXPRESSION (engine#2393)
all cases ok
The substring arm is the one that makes this safe to merge
tests/CMakeLists.txt: FAIL_REGULAR_EXPRESSION "test skipped: no device available" (10 rows)
Ten ctest rows fail on that exact substring. A message reworded to test skipped (77): no device … would make every one of them stop failing on a skip — the row would go green precisely when the case did not run. So the change keeps the prefix as a named constant:
inline constexpr const char * kSkipMessagePrefix = "test skipped: no device available";
// The "(77)" goes AFTER kSkipMessagePrefix, never inside it
fprintf(stderr, "%s for %s (%zu device case(s) skipped)\n", kSkipMessagePrefix, …);kSkipMessagePrefix is already on main — #439 landed it — so this PR inherits the discipline and extends it to the second message rather than introducing it. An arm that pins the substring is worth more than the 77: the exit code is checked by one caller, the substring by ten ctest rows.
Two notes
"(%zu device case(s) skipped)"changed the parenthesis content, and the substring sits before it, so the tenFAIL_REGULAR_EXPRESSIONrows still match. Worth confirming in the description that the change is inside the suffix — a reviewer seeing the message diff will want to know the prefix rule is what protects them.- The two PRs split cleanly and neither was redundant: #439 =
--hrx-test-case(one case), #441 = the suite path. Worth naming that in the description so the history reads as two halves of one contract rather than a fix and its sequel.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 1e31adf: READY
The safety claim — "none of the seven rows sets SKIP_RETURN_CODE, so 77 is still a failure" — I checked rather than took, and it holds.
# every set_tests_properties block naming one of the seven, searched for SKIP_RETURN_CODE:
hrx-buffer-test False hrx-ops-test False
hrx-backend-test False test-hrx-ops False
hrx-loom-jit-test False test-hrx-buffer False
test-hrx-ops-loom False
So 77 reaches ctest as a failure on exactly the rows whose subject is the hardware, which is the same verdict FAIL_REGULAR_EXPRESSION "test skipped: no device available" already produced — the change cannot flip a red row green, and it adds the one thing the regex cannot give: a caller that reads only the exit code now learns the suite did not run.
The two arms assert the pair that matters:
ok a whole run of device cases with no device returns 77, not 0
ok and no case body runs
and both fail against the return-0 version by construction (ran == 0 plus the code).
Together with #439 this closes engine#2912 from both ends: #439 made a single device case answer 77 instead of 0, this one makes a whole run of them do the same, and #439's arm pins kSkipMessagePrefix so the regex keeps matching while the code changes underneath it.
One note for the future reader
The reasoning "77 is a failure here" is a property of those seven rows' properties, not of the code — and it is one set_tests_properties … SKIP_RETURN_CODE 77 away from inverting. One clause in the arm or the commit ("if a row ever adds SKIP_RETURN_CODE 77, this guard silently becomes a skip — test-hrx-loader-mapped already does exactly that and relies on it") would keep the coupling visible; test-hrx-loader-mapped is the counter-example already in the file ( and the regex, with the comment "SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION on ctest 4.2.3, so the exit code is what makes it loud").
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7f4a9b6: READY
Re-stated at the head the gate will read (my review above named 1e31adf3; the head advanced by a merge of the fork branch, which only brings dispatch-kquant-decode.cpp, scripts/ui-assets.cmake and tools/server/CMakeLists.txt from #440/#416 — the whole-run change is untouched: kSkipMessagePrefix still appears 5× in tests/testing_suite.h and the arm is still there).
The verified part, unchanged and the reason this is READY:
# every set_tests_properties block naming one of the seven rows, searched for SKIP_RETURN_CODE:
hrx-buffer-test False hrx-ops-test False
hrx-backend-test False test-hrx-ops False
hrx-loom-jit-test False test-hrx-buffer False
test-hrx-ops-loom False
None sets it, so 77 reaches ctest as a failure on exactly the rows whose subject is the hardware — the same verdict FAIL_REGULAR_EXPRESSION "test skipped: no device available" already produced, plus the code a caller can read. The two arms assert the pair: "a whole run of device cases with no device returns 77, not 0" and "and no case body runs".
The one note from above still stands and is worth the clause: that reasoning is a property of those rows' properties, one set_tests_properties … SKIP_RETURN_CODE 77 away from inverting — test-hrx-loader-mapped already sets SKIP_RETURN_CODE 77 beside the regex and relies on 77 winning ("SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION on ctest 4.2.3, so the exit code is what makes it loud"), so the coupling between "this row must be loud" and "this row must not declare 77" deserves to be written where the next editor sees it.
|
#439 merged at 08:49:11Z ( The base branch's tip had to be fetched by explicit refspec ( The conflict was That last line matters: it is the assertion #439 added, still passing after the merge, so the rebase did not quietly drop the guard fix that made #439 mergeable in the first place. The diff against the new base is now exactly this change: |
Draft, and stacked on #439 — the base is #439's branch on purpose, so the diff is only this change. Retarget to
1bit/hrx-vulkan-patchedthe moment #439 merges (onegh pr edit --base), and reopen as non-draft when the fork is under its cap; today it holds 3 non-draft.What
run()'s whole-run path, when every selected case needs a device and none is visible:The same sentence as #439, one level out: #439 fixed a caller that runs one case; this fixes a suite that ran nothing. Both were
0, and both are why a device-less run could read as success — the shape engine#2393 fixed with aFAIL_REGULAR_EXPRESSIONrather than with an exit code.The check that had to come before the change
This path feeds seven ctest rows (
hrx-ops-test,test-hrx-ops,test-hrx-ops-loom,test-hrx-buffer,hrx-buffer-test,hrx-backend-test,hrx-loom-jit-test). If any of them setSKIP_RETURN_CODE 77, returning 77 would turn a red row green — the exact opposite of ggml-org#2393's intent.None of them does. They set
LABELS,TIMEOUTandFAIL_REGULAR_EXPRESSIONonly, so ctest reads 77 as a failure: the same verdict the regex already produces, now said by the exit code as well, for a caller that reads only the code. The message keepskSkipMessagePrefixbyte-exact, so the regex still matches.Arms
Both fail against the
return 0version (checked by compiling the same test against this branch's parent), so they are not vacuous — the same discipline as the three assertions on #439.Why a draft
Not for review reasons: the fork holds 3 non-draft PRs, which is its cap, and the queue rule says further work waits as a branch or a draft. Nothing here touches the engine's build queue — the fork has no CI — so the cost of it existing as a draft is one line in
gh pr list.