From b07fb036c0a9a679019e472beb525b1c1ad0f0fe Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sun, 15 Nov 2026 07:52:51 -0400 Subject: [PATCH 1/2] tests: a loader-mapped run without an HRX device fails, not skips test-hrx-loader-mapped returned 77 for both skips, and ctests --- tests/CMakeLists.txt | 5 ++++- tests/test-hrx-loader-mapped.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 488be1fee2f3..c39bcd685d95 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -519,7 +519,10 @@ if (TARGET ggml-hrx) --hrx-buffer-test-jobs 1 --hrx-buffer-test-output all --hrx-buffer-test-filter ".*") # engine #2500: the loader's mapping becomes HRX0_Mapped weight buffers (skips without LLAMACPP_TEST_MODELFILE) llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx") - set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77) + # 77 stays for the model skip; the device skip exits 1 and prints this string (test-hrx-ops' convention). + # SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION on ctest 4.2.3, so the exit code is what makes it loud. + set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77 + FAIL_REGULAR_EXPRESSION "test skipped: no device available") add_executable(hrx-backend-test hrx-backend-test.cpp) target_link_libraries(hrx-backend-test PRIVATE ggml-hrx ggml hrx::hrx loomc::loomc) diff --git a/tests/test-hrx-loader-mapped.cpp b/tests/test-hrx-loader-mapped.cpp index 3d7f9ad72ba3..d3a5ba605a32 100644 --- a/tests/test-hrx-loader-mapped.cpp +++ b/tests/test-hrx-loader-mapped.cpp @@ -37,9 +37,12 @@ int main(int argc, char ** argv) { } } if (hrx == nullptr) { - std::printf("skipped: no HRX device\n"); + // ctest's FAIL_REGULAR_EXPRESSION cannot see this if the exit code is SKIP_RETURN_CODE 77: measured on + // ctest 4.2.3, rc 77 + this string is reported Skipped and the row is green. Exit 1 so a device runner + // fails loudly; 77 stays for the model skip, which a CI runner legitimately cannot judge. + std::printf("test skipped: no device available\n"); llama_backend_free(); - return 77; + return 1; } llama_log_set(collect, nullptr); llama_model_params params = llama_model_default_params(); From 21feb80853be8ccbb9326bbdbae7d112c27b19a5 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sun, 15 Nov 2026 08:12:43 -0400 Subject: [PATCH 2/2] tests: a missing HRX device fails the twelve device-skip rows, not skips them Audit: 20 ctest rows in tests/CMakeLists.txt set SKIP_RETURN_CODE 77 and four use FAIL_REGULAR_EXPRESSION, but the two cannot combine -- measured on ctest 4.2.3, rc 77 wins and the row is reported Skipped, i.e. green for a required check. Twelve binaries printed ": no HRX0 device, skipped" and returned 77, so the whole HRX device surface reported pass on a machine with no HRX device. Each now prints "test skipped: no device available" (test-hrx-ops' string, the one #375's group matches) and returns 1. Model and add-on skips keep 77, because a CI runner without a model or without the add-on genuinely cannot judge a row. test-hrx-external-window-view keeps its own skip: it sets a flag and still runs its host cases, so it is not a silent row. --- tests/test-hrx-attention-q-decode-head-size.cpp | 6 ++++-- tests/test-hrx-decode-stride.cpp | 6 ++++-- tests/test-hrx-fa-masked-v.cpp | 6 ++++-- tests/test-hrx-fa-transposed-value.cpp | 6 ++++-- tests/test-hrx-get-rows-iq.cpp | 6 ++++-- tests/test-hrx-hadamard.cpp | 6 ++++-- tests/test-hrx-moe-split.cpp | 6 ++++-- tests/test-hrx-mul-mat-id-k32.cpp | 6 ++++-- tests/test-hrx-mxfp4.cpp | 6 ++++-- tests/test-hrx-nvfp4.cpp | 6 ++++-- tests/test-hrx-q2_0.cpp | 6 ++++-- tests/test-hrx-routed-down-hip.cpp | 6 ++++-- tests/test-hrx-top-k-repeat.cpp | 6 ++++-- 13 files changed, 52 insertions(+), 26 deletions(-) diff --git a/tests/test-hrx-attention-q-decode-head-size.cpp b/tests/test-hrx-attention-q-decode-head-size.cpp index 0dcd1571d401..ab8127f82c3a 100644 --- a/tests/test-hrx-attention-q-decode-head-size.cpp +++ b/tests/test-hrx-attention-q-decode-head-size.cpp @@ -156,8 +156,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-attention-q-decode-head-size: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-decode-stride.cpp b/tests/test-hrx-decode-stride.cpp index 7a8f9565abcc..224154f325b9 100644 --- a/tests/test-hrx-decode-stride.cpp +++ b/tests/test-hrx-decode-stride.cpp @@ -178,8 +178,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-decode-stride: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-fa-masked-v.cpp b/tests/test-hrx-fa-masked-v.cpp index 6f1408b4bb34..9b7b0b12e532 100644 --- a/tests/test-hrx-fa-masked-v.cpp +++ b/tests/test-hrx-fa-masked-v.cpp @@ -153,8 +153,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-fa-masked-v: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-fa-transposed-value.cpp b/tests/test-hrx-fa-transposed-value.cpp index 7b7b872741dd..3a769396a481 100644 --- a/tests/test-hrx-fa-transposed-value.cpp +++ b/tests/test-hrx-fa-transposed-value.cpp @@ -163,8 +163,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-fa-transposed-value: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-get-rows-iq.cpp b/tests/test-hrx-get-rows-iq.cpp index 3d5e774761e0..fea3bf84fc8f 100644 --- a/tests/test-hrx-get-rows-iq.cpp +++ b/tests/test-hrx-get-rows-iq.cpp @@ -95,8 +95,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-get-rows-iq: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t backend = ggml_backend_dev_init(device, nullptr); REQUIRE(backend != nullptr); diff --git a/tests/test-hrx-hadamard.cpp b/tests/test-hrx-hadamard.cpp index 56a5d345c3da..493043cc32ec 100644 --- a/tests/test-hrx-hadamard.cpp +++ b/tests/test-hrx-hadamard.cpp @@ -88,8 +88,10 @@ double max_rel_error(const std::vector & got, const std::vector & int main() { ggml_backend_dev_t dev = ggml_backend_dev_by_name("HRX0"); if (dev == nullptr) { - printf("test-hrx-hadamard: no HRX0 device, skipped\n"); - return 77; + printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(dev, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-moe-split.cpp b/tests/test-hrx-moe-split.cpp index 3761bdcd1d91..da774a61b868 100644 --- a/tests/test-hrx-moe-split.cpp +++ b/tests/test-hrx-moe-split.cpp @@ -199,8 +199,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-moe-split: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-mul-mat-id-k32.cpp b/tests/test-hrx-mul-mat-id-k32.cpp index c817d4677bbe..506af0bd02ff 100644 --- a/tests/test-hrx-mul-mat-id-k32.cpp +++ b/tests/test-hrx-mul-mat-id-k32.cpp @@ -158,8 +158,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-mul-mat-id-k32: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-mxfp4.cpp b/tests/test-hrx-mxfp4.cpp index 5331b3f919a0..d6a55a725dda 100644 --- a/tests/test-hrx-mxfp4.cpp +++ b/tests/test-hrx-mxfp4.cpp @@ -100,8 +100,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-mxfp4: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t backend = ggml_backend_dev_init(device, nullptr); REQUIRE(backend != nullptr); diff --git a/tests/test-hrx-nvfp4.cpp b/tests/test-hrx-nvfp4.cpp index f79d5efe4d0f..498f4ff07eb1 100644 --- a/tests/test-hrx-nvfp4.cpp +++ b/tests/test-hrx-nvfp4.cpp @@ -101,8 +101,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-nvfp4: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t backend = ggml_backend_dev_init(device, nullptr); REQUIRE(backend != nullptr); diff --git a/tests/test-hrx-q2_0.cpp b/tests/test-hrx-q2_0.cpp index f47698c7c567..298cd48192f9 100644 --- a/tests/test-hrx-q2_0.cpp +++ b/tests/test-hrx-q2_0.cpp @@ -96,8 +96,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-q2_0: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t backend = ggml_backend_dev_init(device, nullptr); REQUIRE(backend != nullptr); diff --git a/tests/test-hrx-routed-down-hip.cpp b/tests/test-hrx-routed-down-hip.cpp index ca537e202c44..0f74aa777804 100644 --- a/tests/test-hrx-routed-down-hip.cpp +++ b/tests/test-hrx-routed-down-hip.cpp @@ -691,8 +691,10 @@ int main(int argc, char ** argv) { } if (device == nullptr) { REQUIRE(failures == 0); - std::printf("test-hrx-routed-down-hip: plan cases OK; no HRX0 device, the device cases are skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init(); diff --git a/tests/test-hrx-top-k-repeat.cpp b/tests/test-hrx-top-k-repeat.cpp index e1023ccc4ae9..8a8f4527b2e0 100644 --- a/tests/test-hrx-top-k-repeat.cpp +++ b/tests/test-hrx-top-k-repeat.cpp @@ -132,8 +132,10 @@ int main() { device = ggml_backend_dev_by_name("HRX0"); } if (device == nullptr) { - std::printf("test-hrx-top-k-repeat: no HRX0 device, skipped\n"); - return 77; + std::printf("test skipped: no device available\n"); + // ctest 4.2.3: SKIP_RETURN_CODE wins over FAIL_REGULAR_EXPRESSION, and a skipped + // row is green for a required check, so a missing device is a failure here. + return 1; } ggml_backend_t hrx = ggml_backend_dev_init(device, nullptr); ggml_backend_t cpu = ggml_backend_cpu_init();