tests (#264 follow-up): iq_parity skips (exit 3) when no fixture was generated, as its generator does; a partly missing set still fails; the open handle of a half-present fixture is closed

This commit is contained in:
Niko1221 committed 2026-10-01 02:27:40 +02:00
1 parent aa0777f7aa
commit a37491ede4
2 files changed
+10 -2

No files matched your search

+1 -1
View File
@@ -486,7 +486,7 @@ if(STRATA_ENABLE_CUDA OR STRATA_ENABLE_HIP)
# exit 3: numpy or the vendored gguf-py is missing (a trimmed third_party) - a skip, not a failure
set_tests_properties(iq_parity_fixtures PROPERTIES FIXTURES_SETUP iq_fixture_data SKIP_RETURN_CODE 3)
add_test(NAME iq_parity COMMAND iq_parity ${CMAKE_CURRENT_BINARY_DIR}/iq_fixture)
set_tests_properties(iq_parity PROPERTIES FIXTURES_REQUIRED iq_fixture_data)
set_tests_properties(iq_parity PROPERTIES FIXTURES_REQUIRED iq_fixture_data SKIP_RETURN_CODE 3)
else()
message(STATUS "STRATA tests: no python3 with numpy was found (the configured interpreter and .venv "
"were probed) - the iq_parity fixtures and its test are not registered; the fixtures "
+9 -1
View File
@@ -27,7 +27,7 @@
int main(int argc, char** argv) {
const std::string dir = argc > 1 ? argv[1] : "logs/iq_fixture";
const char* names[] = {"IQ2_XXS", "IQ2_XS", "IQ2_S", "IQ3_XXS", "IQ3_S", "IQ1_M", "IQ4_NL", "IQ4_XS", "Q2_0", "Q3_K"};
int failures = 0;
int failures = 0, missing = 0;
cudaStream_t s;
cudaStreamCreate(&s);
for (const char* nm : names) {
@@ -37,7 +37,10 @@ int main(int argc, char** argv) {
std::printf("%-8s missing fixture: %s/%s.bin or %s/%s.f32 - generate the fixtures first with "
"python tools/iq_fixture.py --out %s (deterministic; see the tool's --help)\n",
nm, dir.c_str(), nm, dir.c_str(), nm, dir.c_str());
if (f) std::fclose(f);
if (g) std::fclose(g);
++failures;
++missing;
continue;
}
int hdr[3];
@@ -113,5 +116,10 @@ int main(int argc, char** argv) {
cudaFree(dw); cudaFree(dq); cudaFree(dx); cudaFree(xq); cudaFree(dy);
}
std::printf("iq_parity: %d failures\n", failures);
// no fixture at all: the generator was skipped (no numpy / vendored gguf-py) - a skip (3), not a failure
if (missing == (int) (sizeof names / sizeof names[0])) {
std::printf("iq_parity: no fixtures in %s - skipped\n", dir.c_str());
return 3;
}
return failures ? 1 : 0;
}