From 34619892e49a0f1a3119bb14137fb17380c64e9f Mon Sep 17 00:00:00 2001 From: bong-water-water-bong <277547417+bong-water-water-bong@users.noreply.github.com> Date: Tue, 10 Nov 2026 23:50:23 -0400 Subject: [PATCH 1/2] tests: register the last baseline entry, so the unreferenced-test sweep is zero-tolerance (Fixes #2018) The baseline recorded tests/hyperloom_benchmark_test.py as one that needs the benchmark harness. It does not: it stubs llama-bench and runs stdlib-only (hashlib, importlib.util, json, pathlib, platform, sys) -- 'hyperloom_benchmark_test: OK', rc=0, in under a second. So it was the same mistake as the other entry: a test with no runner, recorded as a test that cannot run here. With this registered the baseline list is empty and the sweep stops being a record of known gaps: any future tests/*.py referenced by nothing that can run it now fails on the spot. --- CMakeLists.txt | 5 +++++ tools/ci/unreferenced_py_tests.txt | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 610142905..cb2fdfaba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,11 @@ add_python_test(ci_targets_self ${CMAKE_SOURCE_DIR}/tools/ci/ci_targets_check.py # baseline records a test as never-run, which for a passing test is the wrong outcome -- so it is registered and the line # is removed, which is the shrink the baseline's own comment asks for. add_python_test(moe_expert_chunks_accum_test ${CMAKE_SOURCE_DIR}/tests/moe_expert_chunks_accum_test.py) +# engine#2018: the last baseline entry. The file recorded it as "needs the benchmark harness", but the test stubs +# llama-bench (stdlib only: hashlib/importlib.util/json/pathlib/platform/sys) and passes on a plain interpreter, so it is a +# test with no runner rather than a test that cannot run here. Registered, and the baseline is now empty: from here the +# sweep is zero-tolerance instead of a record of known gaps. +add_python_test(hyperloom_benchmark_test ${CMAKE_SOURCE_DIR}/tests/hyperloom_benchmark_test.py) # engine#1820: the other half of ci_targets_check -- a standalone shell test that nothing references cannot fail. # `need` is every tests/*.sh, `have` is every file that mentions its basename somewhere that can run it, and # tools/ci/unreferenced_tests.txt carries the deliberate exclusions WITH their reasons, so the list can shrink. diff --git a/tools/ci/unreferenced_py_tests.txt b/tools/ci/unreferenced_py_tests.txt index e27a98d88..742700096 100644 --- a/tools/ci/unreferenced_py_tests.txt +++ b/tools/ci/unreferenced_py_tests.txt @@ -24,8 +24,8 @@ # A SET baseline, not an allow-list: `tools/ci/tests_referenced_check.py` FAILS when a name appears here that is not in # the tree's current set, and REPORTS a line whose file is registered now, so this can only shrink. # -# The number is 1 (was 2: moe_expert_chunks_accum_test.py is portable and passing, so it is registered rather than -# baselined -- engine#2018), and getting it right took a correction worth recording: the first version of the rule scanned +# The number is 0. Both original entries were portable tests with no runner, not tests that cannot run here, so both are +# registered (moe_expert_chunks_accum_test.py, then hyperloom_benchmark_test.py -- engine#2018), and getting it right took a correction worth recording: the first version of the rule scanned # `RUNNERS`, which contains one FILE (CMakeLists.txt) and two directories, and tested `is_dir()` on all three -- so every # `add_python_test(...)` registration in CMakeLists.txt was invisible and 35 of 42 tests looked unregistered. The arm # "a cleared baseline entry is reported" caught it: registering a test in CMakeLists.txt did not clear its line. The true @@ -33,4 +33,3 @@ # # Each line is a real test whose runner was never added; the fix per file is one `add_python_test(...)`. # -tests/hyperloom_benchmark_test.py From cef7015b62ea09535ba637cf6cd408af8267bd40 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Wed, 11 Nov 2026 00:53:38 -0400 Subject: [PATCH 2/2] tests: hyperloom_benchmark_test checks GTT only where amdgpu exposes it (onto #2115, engine#2018) #2115 registers this test, and CI's build job then fails it at line 205: the job runs in a GPU-less ubuntu:26.04 container, box_conditions() reads no /sys/class/drm/card0/device/mem_info_gtt_*, and the test asserted they were not None. That is also why the test never had a ctest row. The real-value asserts now run where the counters exist. Where they do not, the test asserts the script's own contract ("absent is a null, never a zero"). A faked GPU_SYSFS root exercises the GPU-less branch on every box. Co-authored-by: bong-water-water-bong Co-Authored-By: Claude Opus 5.5 --- tests/hyperloom_benchmark_test.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/hyperloom_benchmark_test.py b/tests/hyperloom_benchmark_test.py index d477ab535..d1dca7482 100644 --- a/tests/hyperloom_benchmark_test.py +++ b/tests/hyperloom_benchmark_test.py @@ -202,8 +202,22 @@ def main(): # below stands in for a box that exposes nothing. box = bench.box_conditions() assert box["tctl_c"] is None or 20.0 < box["tctl_c"] < 120.0, box - assert box["gtt_used_gib"] is not None and box["gtt_total_gib"] is not None, box - assert 0.0 <= box["gtt_used_gib"] <= box["gtt_total_gib"], box + # The GTT counters exist only where amdgpu does. On such a box every one must come back a number; CI's build job + # runs in a GPU-less container (engine#2018: this is why the test had no ctest row), where they must be null. + if (bench.GPU_SYSFS / "mem_info_gtt_used").exists(): + assert box["gtt_used_gib"] is not None and box["gtt_total_gib"] is not None, box + assert 0.0 <= box["gtt_used_gib"] <= box["gtt_total_gib"], box + else: + assert box["gtt_used_gib"] is None and box["gtt_total_gib"] is None, box + # ...and the GPU-less branch runs everywhere, not only in CI: a root with no counters is a null, never a zero. + real_sysfs = bench.GPU_SYSFS + try: + with tempfile.TemporaryDirectory() as tmp: + bench.GPU_SYSFS = pathlib.Path(tmp) + nogpu = bench.box_conditions() + assert nogpu["gtt_used_gib"] is None and nogpu["gtt_total_gib"] is None, nogpu + finally: + bench.GPU_SYSFS = real_sysfs assert box["mem_available_gib"] is not None and box["mem_available_gib"] > 0, box # The hwmon channel is found by label, not by a hardcoded index: the k10temp Tctl has come back as # hwmon2 and as hwmon4 across six reboots in three days. A root with no Tctl label yields null.