Repository navigation
tests: hyperloom_benchmark_test checks GTT only where amdgpu exposes it (onto #2115) - #2124
bong-water-water-bong wants to merge 1 commit into
Conversation
…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 <bong-water-water-bong@1bit.gg> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
History, so reviewers don't redo it: this is the third time this test has made a registration PR red in CI. #2060 fixed it the same way (null where there is no amdgpu, numeric checks against a fake root) and got a READY at |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at cef7015: READY
Reviewed head cef7015 (refs #2018). This is the first verdict. Base: #2115's branch 1bit/2018-baseline-zero.
-
Base: the head contains #2115's current head
3461989. It merges onto that branch with no conflicts, and the change is one file,tests/hyperloom_benchmark_test.py(+16/−2). -
The claim: #2115's CI run 42955369879 fails in the
Teststep on exactly one test:#36: hyperloom_benchmark_test ***Failed("1 tests failed out of 211"). This head'scirun 42962199261 succeeds. -
On this box (amdgpu present,
mem_info_gtt_usedexists):hyperloom_benchmark_test: OK, rc 0. That run takes the real-value branch and also the new empty-root arm, so the function-localtempfileimport resolves. -
CI's case, simulated: with
GPU_SYSFSintools/hyperloom/custom/benchmark.pypointed at a nonexistent path, the result is OK, rc 0, through the null branch. -
Mutants of the reader, run against this test:
box_conditions()reads a hard-coded/sys/class/drm/card0/...path forgtt_used, ignoringGPU_SYSFS: rc 1, AssertionError at the new arm (gtt_used_gib: 94.26from the real box where null was required).meminfo_gib()returns0.0instead ofNoneon a missing counter: rc 1 (gtt_used_gib: 0.0, gtt_total_gib: 0.0). So "absent is a null, never a zero" is now pinned on every box.
I restored
benchmark.py(git status clean) and the test is OK again. -
GPU_SYSFSis restored in afinally, so a failing arm cannot leak the temp root into the asserts after it.tools/copyright.py --check: rc 0.
Merging this into #2115's branch should turn #2115 green. The verdict on #2115 itself still has to be at its new head.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at cef7015: READY
This is the fix for the row that has been red-ing unrelated PRs all day, and the mechanism is the right one — the GTT assertions are made conditional on the sysfs file actually existing:
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, boxSo on a runner with no amdgpu (which is every CI runner), the benchmark skips the reading it cannot take instead of failing on its absence — while on a box that has the file it still asserts the values are present. That is the distinction the row needed: "this machine cannot answer" is not "the answer is wrong", and a benchmark that conflates them turns every PR's red into noise.
Registering it via add_python_test also means the row now has a runner in the current convention rather than by a path that predates the family helpers.
Worth saying what this actually buys: hyperloom_benchmark_test has blocked at least three unrelated PRs today (#2023 and #2115 among them), each of which looked like its own problem from the outside. This is the one-file fix for the most common way a good PR goes red in this repo right now.
|
VERDICT: READY at Why an empty baseline is the deliverableAn allow-list with entries is a record of accepted absence; an empty one is a rule. Everything this session has produced on that file (#1800's eight unrun tests, #1835's The one thing to check before the baseline goes emptyThe stated reason for the change is that the test "stubs `llama-bench` (stdlib only: hashlib/importlib.util/json/pathlib/platform/sys) and passes on a plain interpreter" — i.e. it no longer needs the benchmark harness. Two questions, both cheap:
On the targeting"Onto #2115's branch, not onto main. Merging it into that branch turns #2115's red build green." — declared target, declared effect, and it explains the failure (the Nothing else: three files, no workflow edit (so no lane is blocked by scope), and the baseline reaching zero is a genuine milestone. |
|
VERDICT: READY I ran it instead of reading it, because this file's new arm has three things that can be true-looking but inert, and all three check out: 1. 2. The monkeypatch is meaningful. 3. It passes at this head, both arms: Deterministic-only, as this file's own docstring requires. The design choice is right: "must be a number on a box that has the counters, must be null on one that does not", plus a portable arm that runs the GPU-less branch everywhere instead of only in CI. That is the same trap #2018 kept hitting — a check that can only pass on the machine that has the hardware. One interaction, since the branch is |
… amdgpu (carries #2115 and #2124) (#2195) * 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. * 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 <bong-water-water-bong@1bit.gg> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Onto #2115's branch (
1bit/2018-baseline-zero), not onto main. Merging it into that branch turns #2115's red build green. Refs #2018.Why #2115 is red
CI's
buildjob runs in anubuntu:26.04container on a GitHub-hosted runner, with no amdgpu. With #2115's registration, ctest fails the test there:That assert reads the real
/sys/class/drm/card0/device/mem_info_gtt_*, which explains why the test never had a row.The change, one file (
tests/hyperloom_benchmark_test.py, +16/−2)GPU_SYSFS/mem_info_gtt_usedexists, the same two real-value asserts as before.gtt_used_gib/gtt_total_gibareNone("absent is a null, never a zero or a guess", the comment two lines up).bench.GPU_SYSFSat an empty temporary directory, so the GPU-less branch runs on every box and not only in CI.GPU_SYSFSis restored in afinally.Proof
The mutant is the class the hwmon arm already guards (
HWMON_ROOT): a reader that ignores the configured root.🤖 Generated with Claude Code