Repository navigation
fix(examine): make --json the equal of the human report - #217
Merged
Merged
Conversation
This was referenced Aug 12, 2026
Collaborator
|
I read through this against the current code (checked it out on top of
CI is green across the board here, including the GPU and Strix Halo lanes, so the MI300X-only GPU-detection fix already got the hardware proof the PR text says it couldn't get locally. One thing to flag for the merge process rather than the code: this is stacked on #216, and GitHub currently reports the merge state as blocked, presumably because #216 needs to land first. Nothing to act on in this diff itself. Looks safe to approve pending final validation, no code issues found in a diff-level review. |
juhovainio
approved these changes
Aug 12, 2026
Two defects, one theme: the machine-readable form was the weaker of the two, and tooling reads that one. It withheld what the readable form states. `examine --json` answered before the CLI had discovered its paths or loaded config, so eleven facts the text report prints had no field at all -- among them which engine this host will serve on, whether an existing ROCm install was found, and where the CLI keeps its files. A caller had to scrape the text to learn them. Those facts now travel under a `summary` key. The top level is untouched on purpose: its field names mirror examine.py's dataclass so the catalog and anything written against it consume the document unchanged, and moving them to flatten the new fields in would break that for cosmetics. `gather` is called rather than `examine_human_report`, whose first act is to write -- asking a machine a question should not change it, least of all in the form tooling calls in a loop. It also disagreed with the human report about the GPU. `Examination` enumerates through lspci and rocminfo; where neither is reachable -- ROCm's bin off PATH, no pciutils installed -- it concluded there was no AMD GPU on a machine that has one. That is the MI300X runner, and it is why the e2e harness scrapes the human text instead of this form, as capability.rs says in so many words. The human report never had the problem: it asks the kernel. So ask the kernel here too, but only after the shell-outs, because lspci carries the PCI id, the marketing name and the APU/discrete split that the topology does not. The topology read gains a directory argument so it can be driven against a planted tree, the same seam discover_rocm_installs_in uses -- the hosts where this matters are the ones a test cannot run on. It also sorts nodes now: read_dir order is filesystem-defined, so a multi-node box could name a different GPU run to run, and node9 must not beat node10. Both e2e rows are removed. The `--json` scenario passes locally; the GPU one can only be proven on Instinct, so the MI300X lane is the check. Signed-off-by: Eugene Volen <Eugene.Volen@amd.com>
The new `detect_kfd_gfx_target_in` was left un-gated so its tests would run on every platform, but it calls `parse_linux_kfd_gfx_target`, which is `cfg(any(target_os = "linux", test))`. A Windows release build therefore had a function calling one that did not exist, and windows-build-and-test said so. Both it and `natural_node_order` now carry the same gate as the helper they depend on: present on Linux, present under cfg(test) everywhere, absent from a Windows release build that could never reach them. The only non-test caller is already Linux-only. Signed-off-by: Eugene Volen <Eugene.Volen@amd.com>
volen-silo
force-pushed
the
fix/examine-json-parity
branch
from
August 12, 2026 12:07
1aa8fed to
f9d6d3f
Compare
volen-silo
enabled auto-merge
August 12, 2026 12:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/e2e-cucumber/expectations.tomlfor the fixed ticket ID and removed/narrowed any now-stale xfail rows. Both rows for this defect are removed here.Summary
Two defects, one theme: the machine-readable form was the weaker of the two, and tooling is what reads it.
It withheld what the readable form states
examine --jsonanswered before the CLI had discovered its paths or loaded config, so eleven facts the text report prints had no field at all — including which engine this host will serve on, whether an existing ROCm install was found, and where the CLI keeps its files. A caller had to scrape the text.Those facts now travel under a
summarykey. The top level is deliberately untouched: its field names mirrorexamine.py's dataclass so the catalog and anything written against it consume the document unchanged. Flattening the new fields in would have read better and broken that — and the two structs already spell the same facts differently (os_family/os_versionagainstos/arch), so the document would have carried both.gatheris called rather thanexamine_human_report, whose first act isrecover_setup_runtime_registration— a write. Asking a machine a question should not change it, least of all in the form tooling calls in a loop.It disagreed with the human report about the GPU
Examinationenumerates GPUs by shelling out tolspciandrocminfo. Where neither is reachable — ROCm'sbinoff PATH, no pciutils — it concluded there was no AMD GPU on a machine that plainly has one. That is the MI300X runner, and it is why the e2e harness scrapes the human text rather than this form;capability.rs:325says so in as many words.The human report never had the problem, because it asks the kernel. So this asks the kernel too — but only after the shell-outs, since
lspcicarries the PCI id, marketing name and APU/discrete split that the topology does not. A topology-sourced entry leavesis_apuunset rather than guessing, sohas_amd_gpumoves and the APU/discrete tallies stay put.Test plan
The topology read gains a directory argument so it can be driven against a planted tree — the same seam
discover_rocm_installs_inuses, and necessary here because the hosts where this matters are the ones a test cannot run on. Six new unit tests:read_dirorder, andnode9does not beatnode10gfx0lspcienumeration aloneSorting is not incidental:
read_dirorder is filesystem-defined, so a multi-node box could name a different GPU run to run.Locally on WSL2:
cargo xtask e2egives 41 scenarios, 4 xfail, 0 XPASS, 0 unexpected failures — down from 5 xfail, because the--jsonscenario now passes.cargo fmt --all --check, workspaceclippy --all-targets -D warnings, andclippy -p e2e-cucumber --test e2eare clean.What cannot be verified here. The GPU half only reproduces on Instinct: this box is WSL2 and the mock lane has no GPU, so neither can exercise it. The MI300X lane is the only proof, and the check is that its scenario now passes rather than xfails. If it does not, the fallback is not firing there and this PR is not done.
Unrelated:
providers::tests::local_provider_*flakes on this box at roughly the same rate with and without these changes (3/4 vs 2/4 runs) — pre-existing, and still unticketed.🤖 Generated with Claude Code