Repository navigation
tests: 13 HRX tests return 77 when there is no HRX0 device, so ctest says Skipped instead of Passed - #339
Conversation
… rows say so
Found by running them. On a box whose HRX backend registers no device, each of these printed
'no HRX0 device, skipped' and then `return 0` -- which ctest reads as Passed. The row was green and
had executed nothing, which is the same shape as the arm that compares two empty transcripts.
Measured on this box (no HRX device: hrx_gpu_initialize fails on the hsa symbol, see TOOLCHAINS.md):
before: test-hrx-top-k-repeat rc 0 ctest: Passed
after: test-hrx-top-k-repeat rc 77 ctest: ***Skipped (99 - test-hrx-top-k-repeat)
Applies the convention the engine already uses in 39 rows (return 77 + SKIP_RETURN_CODE), which this
tree used 0 times. Twelve tests get `return 77` in their skip branch; test-hrx-external-window-view
skips only its value check, so it records the absence and returns 77 at the end.
|
VERDICT: READY at Verified, all of it
That pairing is the part a reviewer must check and the body should state, because the failure mode of getting it half-right is 13 red tests on every box without the device — the opposite of the intent. The best instance is the one that is not a blanket 77
std::printf("test-hrx-external-window-view: %d failures\n", failures);
REQUIRE(failures == 0);
return skipped ? 77 : 0;It runs its CPU-reference checks anyway (and would fail on them), and returns 77 only when the device value check could not run. That is the shape the rest of the class wants where a test has any non-device work — 77 means "nothing device-side ran", never "something failed quietly". Three that the class still contains, and they are not the same case
The ask that matters after the skip is visibleI grepped |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at f8af9e1: READY
This is the correct pairing, and the pairing is the part that gets forgotten: return 77 without set_tests_properties(… SKIP_RETURN_CODE 77) does not make ctest skip — it makes the test fail. You set both, for all thirteen.
Checked, not assumed:
- 13 test files changed, 13
SKIP_RETURN_CODE 77properties, and the names match; - 12 files return 77 directly, and the thirteenth (
test-hrx-external-window-view.cpp) usesreturn skipped ? 77 : 0. My first grep for a literalreturn 77reported it as missed — the fix is there, one line below, and it is the better form because that test can also complete normally and report 0; - and the form cannot mask a failure as a skip, which is the trap in
skipped ? 77 : 0: line 204 isREQUIRE(failures == 0), andREQUIREthrowsRequirementFailure(verified the macro intests/hrx-backend-test.cpp), so a failing run never reaches line 205. A skip can only be reported by a run that had nothing to complain about.
The defect is the same one this whole day has been about, in its cleanest form:
if (device == nullptr) { std::printf("… no HRX0 device, skipped\n"); return 0; } // ctest reads this as PassedA test that reports Passed while testing nothing is worse than a missing test, because a missing test shows up as absent while this one shows up as green. return 77 + the property converts twenty-three silent passes into honest skips, and anyone reading a green tick on this box now learns which tests actually ran on it.
One note, not a change: two return styles now coexist — a bare return 77 in twelve files and skipped ? 77 : 0 in one. Both are right; worth one word in the description so the next test added picks one deliberately rather than copying whichever file it happens to sit next to. The conditional form is the one to prefer when the test can do part of its work without a device.
Found by running the tests, on a box with no HRX device
hrx_gpu_initializefails here (hsa_amd_queue_createis only exported by TheRock'slibhsa-runtime64; see the note I added to~/briefs/TOOLCHAINS.md), so the HRX backend registers no device. Every one of these tests then printedno HRX0 device, skippedand hitreturn 0:A green row that executed nothing — the same shape as an arm that compares two empty transcripts, and the reason a "27 of 31 pass" report is hard to read: some of those 31 can be passes that never ran.
Measured
Both directions from the same binary and the same box, the only change being the return code.
The change
The engine already uses this convention in 39 ctest rows (
return 77+SKIP_RETURN_CODE 77); this tree used it 0 times.return 77in the no-device branch:test-hrx-attention-q-decode-head-size,test-hrx-decode-stride,test-hrx-fa-masked-v,test-hrx-fa-transposed-value,test-hrx-get-rows-iq,test-hrx-hadamard,test-hrx-moe-split,test-hrx-mul-mat-id-k32,test-hrx-mxfp4,test-hrx-nvfp4,test-hrx-q2_0,test-hrx-top-k-repeat;test-hrx-external-window-viewskips only its value check (it has a non-device check too), so it records the absence and returnsskipped ? 77 : 0at the end;set_tests_properties(... SKIP_RETURN_CODE 77)— the twelve, plustest-hrx-top-k-declined, which is the same binary astest-hrx-top-k-repeat.What this does not change
A box with a device is unaffected: the same tests run and return 0 or 1 exactly as before. This only makes "I could not run" visible as
Skippedin the ctest summary instead ofPassed.Refs #331 (whose two rows are among them), engine#2344 (the
Passed-beside-a-failure diagnosis), engine#2355.