Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,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 --
Expand Down
13 changes: 11 additions & 2 deletions tests/q4nx_tail_head_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,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__":
Expand Down
Loading