From 1772a214723d5da96ab06c7df7a8c4936d76417c Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Tue, 10 Nov 2026 03:24:10 -0400 Subject: [PATCH] q4nx_tail_head: report SKIPPED, not a pass, when the onnx arms cannot run (#1747 review) The block-32 refusal and the undeclared-tie arm need onnx, and they are the reason the test is registered. Without onnx the test printed 'skip' and exited 0, so ctest showed a pass. It now exits 77 after the synthetic checks pass, and SKIP_RETURN_CODE 77 makes ctest print Skipped. A failing synthetic check still exits 1. Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 2 ++ tests/q4nx_tail_head_test.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b184a24a..4959c1dae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -774,6 +774,8 @@ if(Python3_Interpreter_FOUND) # three refusals a real pack needed -- a block-32 head refused by name, an untied head given no false oracle, the # trailing zeros counted. It was never registered, so nothing ran it after #1710. add_test(NAME q4nx_tail_head COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/q4nx_tail_head_test.py) + # Without onnx its two refusal arms cannot run: it exits 77, so ctest shows SKIPPED rather than a pass (#1747 review). + set_tests_properties(q4nx_tail_head PROPERTIES SKIP_RETURN_CODE 77) # A member declared in npu/forward/include/q4nx_forward.h and never defined keeps `main` green while a full # `cmake --build` fails at link time (engine#1573: the 3-argument step_batch_embeds). CI cannot catch it -- # .github/workflows/ci.yml builds `--target onebit` only, because a full build wants the private NPU runtime -- diff --git a/tests/q4nx_tail_head_test.py b/tests/q4nx_tail_head_test.py index 787c5bd58..c7691470c 100755 --- a/tests/q4nx_tail_head_test.py +++ b/tests/q4nx_tail_head_test.py @@ -280,8 +280,17 @@ def main(): synthetic() - print("all q4nx_tail_head checks passed" if not failures else "%d check(s) failed" % failures) - return 1 if failures else 0 + if failures: + print("%d check(s) failed" % failures) + return 1 + # engine#1747 review: the block-32 refusal and the undeclared-tie arm need onnx, and they are the reason this test is + # registered. Without onnx a pass would hide that they never ran, so report SKIPPED to ctest (SKIP_RETURN_CODE 77 in + # CMakeLists.txt) instead. A failing synthetic check still returns 1 above, in either environment. + if not HAVE_ONNX: + print("SKIPPED: the synthetic checks passed, but the two onnx arms (block-32 refusal, undeclared tie) did not run") + return 77 + print("all q4nx_tail_head checks passed") + return 0 if __name__ == "__main__":