From c941ad4224f5aab1941a8e13a84acdb442eb78dd Mon Sep 17 00:00:00 2001 From: pi-hrx-sched Date: Tue, 10 Nov 2026 03:30:55 -0400 Subject: [PATCH] tests: register #1813's batch-check oracle, which merged with no add_test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1813 changed the oracle behind `NPU_BATCH_CHECK=1` from "one argmax at the last row" to "every drafted position's logits, compared bitwise" — the right question for a speculative decoder, where the accept rule consumes the target's probability at the drafted token. It shipped with `tests/batch_check_compare_test.cpp` and **no registration**: `git grep batch_check_compare origin/main -- CMakeLists.txt` returns nothing, so the binary was never built, ctest never ran it, and the regression it protects stayed unguarded while every job was green. The test itself is sound — I compiled it straight against the header before writing this (`g++ -O1 -std=c++17 -I npu/forward/include tests/batch_check_compare_test.cpp`, 0 failures), including the two arms that decide whether the instrument is trustworthy at all: ok and two NaNs in the same place agree (a bitwise compare must not call NaN != NaN) ok a null side counts every row as differing (the honest direction) Four lines: `add_executable`, the `npu/forward/include` include dir (header-only, so no link libraries), `add_test`, and the direction-B hook: add_dependencies(onebit batch_check_compare_test) That last one matters because `ci.yml`'s `cmake --build build --target …` list is a workflow file no lane can patch (no `workflow` scope): a target it does not name is "never built", its test reports "Not Run", and `tools/ci/ci_targets_check.py` direction B reds. The tree documents `add_dependencies(onebit )` for exactly this — `onebit_npu_forward_syntax` uses it — and the checker follows it. Verified here, not by pushing and hoping: python3 tools/ci/ci_targets_check.py --check --root . -> 9 target(s) whose test never reaches ctest under ci.yml (baseline 9), and none new cmake --build /tmp/b1799 --target batch_check_compare_test -> links ctest -R '^batch_check_compare$' -> Passed 0.00 sec --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b184a24a..3917a6da3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1281,6 +1281,16 @@ add_executable(npu_design_grid_test tests/npu_design_grid_test.c npu/forward/src npu/forward/src/q4nx_pack_blocked.cpp npu/forward/src/q4nx_head_image.c) target_include_directories(npu_design_grid_test PRIVATE npu/forward/include) target_link_libraries(npu_design_grid_test PRIVATE m) +# engine#1781's oracle (merged in #1813) arrived with its test file but no registration, so the comparator behind +# NPU_BATCH_CHECK -- "every drafted position's logits, bitwise" instead of one argmax at the last row -- was neither +# built nor run while every job stayed green. Header-only, so the test needs no link libraries; host-only, so it needs no +# model and no device. +add_executable(batch_check_compare_test tests/batch_check_compare_test.cpp) +target_include_directories(batch_check_compare_test PRIVATE npu/forward/include) +add_test(NAME batch_check_compare COMMAND batch_check_compare_test) +# direction B (tools/ci/ci_targets_check.py): a target ci.yml's --target list does not name is "never built", and ci.yml +# is a workflow file no lane can patch. The documented hook is the one onebit_npu_forward_syntax uses. +add_dependencies(onebit batch_check_compare_test) add_test(NAME npu_design_grid COMMAND npu_design_grid_test) # The plan's `designs` section against the engine's own derivation (engine#803 A2a): the generator and # q4nx_derive_designs() must state the same kernels, because a section that disagreed would be refused at