Repository navigation
Conversation
`rocm diagnose --model` could not answer "will this model fit" on any AMD APU. An APU has no private VRAM: `amd-smi` and every Windows adapter query report the fixed BIOS carve-out as the device's memory -- 512 MiB measured on a Ryzen 7 4700U, ~4 GiB on a Strix Halo -- while the engine allocates out of system memory the GPU is given an aperture onto. Comparing a recipe minimum against the carve-out refuses nearly every curated model on machines that demonstrably serve them, so the classification answered `UnifiedMemoryUnreadable` and the verdict came back undetermined, on the stated grounds that the real pool "is not readable by anything in this binary today". It is readable. Linux exposes the kernel's own GTT aperture cap as `mem_info_gtt_total`, beside the `mem_info_vram_total` the carve-out comes from; Windows exposes the WDDM shared budget as `DXGI_ADAPTER_DESC1::SharedSystemMemory`, which nothing in the PowerShell/CIM surface the other probes use can report. Both are read by a new `host_gpu/unified_memory.rs` and carried as `AcceleratorMemory::Unified`. Neither is installed RAM nor a fraction of it: half of RAM is an assertion about driver policy, and BIOS settings and `amdgpu.gttsize` move the real figure. A fit against that figure yields `Degraded`, never `Ready`. The pool is shared with the operating system, so what was measured is a ceiling rather than an allocation, and nothing here measured how much of it is free. Below the ceiling the verdict still blocks, and says that freeing memory will not raise an aperture the driver will not hand out. `UnifiedMemoryUnreadable` survives, narrowed to its true meaning: an APU whose figure was absent or unparseable on this host. It keeps its distance from `AcceleratorMemoryUnknown`, whose "run `amd-smi` again" remediation would still be a dead end here. The aperture is consulted only on the APU branch. Both files exist on a discrete card too, and crediting one with the other would report an RX 7900 as having 24 + 64 GiB, after which everything fits; a unit test and scenario diagnose-61 pin that down. The Windows path cannot be compiled on either available machine and has unit coverage only; it was type-checked and clippy-checked against `x86_64-pc-windows-msvc` in isolation, since the workspace cannot cross-compile. Its DXGI vtables are hand-declared because `windows-sys` 0.61 carries no COM interfaces at all -- there is no `Win32_Graphics_Dxgi` feature to enable -- and `dxgi.dll` is loaded by absolute System32 path. The serve path's DRM read now goes through `host_path` like every other DRM read, so a simulated host root reaches it; `hardware_root`'s module doc already listed that path as re-rooted and this was the one caller naming it directly. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
`amd_shared_system_memory` took the largest `SharedSystemMemory` of every non-software AMD adapter DXGI enumerates. Its reasoning only ever covered a foreign iGPU beside an AMD card -- hence the vendor filter -- and never two real AMD adapters, which is an APU paired with a discrete Radeon. The budget is per-adapter and nothing at that point says which adapter is the integrated one, so the larger figure wins and the APU is credited with the discrete card's pool. That is the Windows spelling of the contamination `the_gtt_aperture_never_reaches_a_discrete_card` pins on Linux, and the reason `linux_drm_amdgpu_gtt_total_bytes_in` answers `None` above one DRM card rather than choosing between them. Two adapters is a figure that could not be attributed, not a figure to pick from. A software adapter is still dropped before the count rather than after, so WARP beside a real AMD part does not make it ambiguous. The new test asserts both enumeration orders: a rule that only holds when the larger adapter happens to enumerate second is not a rule. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
juhovainio
left a comment
There was a problem hiding this comment.
Thanks for the work here. No single blocker in the design, but a few things need addressing before this can merge.
Needs changes
- Windows adapter enumeration can silently break the "exactly one AMD adapter" rule. An
EnumAdapters1error other than NOT_FOUND ends the loop and returns a partial list as if complete; an adapter whoseGetDesc1fails is skipped. If the missing adapter is a second AMD part, the APU gets credited with one adapter's budget, which is the contamination the second commit set out to prevent. ReturnNoneon either path (inline comments). detect_host_unified_memory_gib()runs unconditionally fromhost_accelerator_memory, so every Windowsdiagnose --modeldoes a LoadLibrary + DXGI enumeration, discrete-only hosts included. Please compute it only on the APU branch, and confirm the call site is not on an async worker (blocking FFI rule).- The new GGUF behavior is untested.
estimate_fitnow givesUnifiedhosts a numeric estimate plus the shared-pool note, but nothing exercises it: deleting the note keeps everything green. Scenarios diagnose-59..61 only cover the curated-recipe path. Add a test that fails when the note is removed, and a scenario or a stated reason there isn't one.
Smaller
- diagnose-60's
!contains("offers 4.0 GiB")is vacuous if wording changes;measured_gpu_gib == Nonealready proves the point. cast_signedneeds Rust 1.87; please confirm MSRV.- Please grep README,
--helpanddocs/manual-testing.mdfor claims that an APU verdict is undetermined, and runcargo xtask check-module-sizeformodel_fit.rs/model_readiness.rs. - Check that nothing (serve gating, exit codes, chat tool) treats the new
Degradedas warn-or-refuse on every APU.
Scope / process
- The PR is currently CONFLICTING with main and only the docs build has reported, so it needs a rebase and a full CI run. Scenario ids 59-61 should be rechecked after the rebase.
- ROCMAI-912 asks for the GTT read plus carve-out/
gttsizeguidance and SVM detection; this does the read and defers the rest, which is fine as stated. The roughly 250-line Windows DXGI COM FFI path is beyond the ticket and has never been executed; consider splitting it into its own PR. The ticket also mentions #386 as overlapping work, so please check for duplication on rebase.
What looks good: the APU-only gating is pinned by tests, the single-adapter rule is applied on both OSes, the DLL loads by absolute path, and scenarios 59-61 assert message and state together.
| if hr == DXGI_ERROR_NOT_FOUND { | ||
| break; | ||
| } | ||
| if hr < 0 || adapter.is_null() { |
There was a problem hiding this comment.
An EnumAdapters1 error other than NOT_FOUND ends the loop and the partial list is returned as complete. If a second AMD adapter was not reached, the "exactly one AMD adapter" rule passes wrongly and the APU is credited with one adapter's budget. Return None from enumerate_adapters on this path.
| let hr = ((*vtbl).get_desc1)(adapter.cast(), &raw mut desc); | ||
| (hr >= 0).then_some(desc) | ||
| }; | ||
| if let Some(desc) = read { |
There was a problem hiding this comment.
An adapter whose GetDesc1 fails is dropped silently. That also defeats the single-adapter rule: an unreadable second AMD adapter makes the first look unique. Treat an unreadable description as not attributable (return None) instead of skipping.
| // classification below stays a pure function of its arguments. It is one | ||
| // file read on Linux and one DXGI enumeration on Windows -- no | ||
| // subprocess, nothing this path waits on. | ||
| rocm_core::detect_host_unified_memory_gib(), |
There was a problem hiding this comment.
This now runs a DXGI enumeration on every Windows diagnose --model, including discrete-only hosts, and the "nothing this path waits on" claim is unverified for DXGI. Consider computing it lazily only on the APU branch, and confirm this is not reached from an async worker (blocking FFI rule).
| // this at best" rather than "this much is waiting for it". Said on the | ||
| // estimate itself, because the figure is printed beside the totals with | ||
| // nothing else to tell the two kinds of number apart. | ||
| if memory.is_shared_pool() { |
There was a problem hiding this comment.
New user-visible behavior with no test: a Unified host now gets a numeric estimate plus this note. Add a test that fails when the note is removed, and a scenario or a stated reason there isn't one for the GGUF path.
| .expect("evidence is not an array") | ||
| .iter() | ||
| .filter_map(serde_json::Value::as_str) | ||
| .any(|line| line.contains("offers 4.0 GiB")), |
There was a problem hiding this comment.
This negative assertion passes vacuously if the wording ever changes; measured_gpu_gib(&model) == None above already proves no figure is claimed. Drop it or assert on the actual evidence line.
One conflict, in docs/architecture.md: main replaced the rocm-core module map's bullet list with a table carrying a Class column, and this branch had edited two of the bullets. Took main's table, then ported both edits into it rather than keeping either side whole. `unified_memory.rs` becomes its own `host_gpu/` row, which is how the table already lists every other child of that module, instead of the clause it was on this branch inside the `host_gpu.rs` bullet; the `model_readiness.rs` row gains the sentence about an APU being measured on its shared pool and so reaching `Degraded` but never `Ready`. Keeping our side would have reverted the table for the whole crate; taking theirs would have dropped the only citation of `unified_memory.rs`, which the architecture-doc hook requires and which is the module this branch adds. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
`an_apu_whose_pool_clears_the_minimum_is_degraded_not_ready` and `classify_accelerator_memory_reports_the_measured_unified_pool_for_an_apu` chose their recipe by GPU-memory minimum alone. The first builtin recipe above 8 GiB prefers vLLM, which the platform gate rules out on native Windows before memory is ever consulted, so the verdict came back `Blocked` for a reason that has nothing to do with the pool and both assertions failed there while passing everywhere else. The first Windows CI run on this branch is what caught it; the tests had been wrong since they were written. Selecting on the engine rather than on the host is deliberate. Filtering to "ungated here" reads as the obvious fix and is a worse one: it would pick a vLLM recipe on Linux and a Lemonade recipe on Windows, leaving neither lane able to catch a regression in what the other runs. Pinning the engine class keeps both lanes on the same recipe, so the memory arithmetic the tests are named for is the only thing that varies between them. The gate call is kept inside the predicate as a live guard rather than reduced to a comment: if Lemonade ever stops being ungated, the recipe search fails loudly at its `expect` instead of an assertion failing somewhere less obvious. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
Verification pass on this review — three items resolve, two confirmed standing@juhovainio — this review had not been answered. I have not changed code here (another working session holds this branch and I hit a non-fast-forward on it earlier today), so this is verification rather than fixes: facts for whoever picks it up, with the checkable claims actually checked. Resolved since the review was written
Confirmed, still standing
Not checkedThe Windows Leaving CHANGES_REQUESTED in place — items 1, 2 and 3 are all still open. |
nowycondro
left a comment
There was a problem hiding this comment.
Review — needs work
Full review of the whole change (13 files, +1567/-118).
Implements the APU-memory-measurement portion of ROCMAI-912 (reading the real GTT/WDDM shared-memory pool for APUs and capping the verdict at Degraded); the description itself scopes out free-memory measurement, BIOS/gttsize guidance, and SVM-mapping-failure detection as a separate concern. Ticket ROCMAI-912 named but not retrievable from here.
Blocking
-
A model that needs no GPU memory still gets forced to
Degradedwith GPU-specific remediation on a shared-memory host —crates/rocm-core/src/model_readiness.rs:658-681
The final block inassess()downgrades anyReady/Degradedverdict toDegradedwheneverhost.accelerator_memory.is_shared_pool()is true, with no check on whether this particular recipe'srequiredfigure (recipe.min_gpu_mem_gb) was everSome. A recipe withdevice_policy == "cpu_only"and no declared GPU-memory minimum falls into the(None, _)match arm (line 618), which leaves the verdict at its initialReady; the final block then still fires, appending "this host's integrated GPU has no dedicated VRAM..." evidence and a "close what else is using memory before serving" fix for a model that never touches the GPU.cpu_onlyis a schema-legaldevice_policyvalue and no shipped catalog recipe currently combines it with an absent GPU-memory minimum, so this isn't live today — but it's reachable through the public function and untested (the one new test exercising the downgrade,an_apu_with_a_readable_pool_is_degraded_never_ready, only uses a GPU-requiring recipe).
Confidence 85 · logic · Fix: gate the final block onrequires_gpu(recipe)(orrequired.is_some()) in addition tois_shared_pool(). -
The new "no dedicated VRAM" note in the GGUF size estimator has no test —
crates/rocm-core/src/gguf_fit.rs:850-857
estimate_fitpushes a new note ontoestimate.noteswhenevermemory.is_shared_pool(). No test in the file constructsAcceleratorMemory::Unified { .. }; the parallelUnifiedMemoryUnreadablecase has its own test but this one does not. The note is user-visible (read byapps/rocm/src/diagnose_model.rs), so it isn't dead code, but it ships unverified.
Confidence 85 · logic · Fix: add a test withAcceleratorMemory::Unified{..}asserting the note appears for a shared pool and not forDedicated/Unknown. -
An e2e assertion meant to catch the BIOS carve-out leaking into the verdict can never fail —
tests/e2e-cucumber/tests/e2e/diagnose_steps.rs:4316
assert_unreadable_shared_pool_claims_no_figurechecks that no evidence line contains"offers 4.0 GiB"(the planted 4 GiB carve-out).format_gibspecial-cases whole-GiB values and renders them without a decimal ("4 GiB", never"4.0 GiB"), so this substring can never appear regardless of whether the bug it's meant to catch is present. The scenario's other assertions (reason, no measured figure) still work; only this specific guard is vacuous.
Confidence 85 · logic · Fix: match"offers 4 GiB"(no decimal), or use a non-whole-GiB carve-out value in the fixture.
Non-blocking
None
Decisions for the author
vram_carveout_gibis currently write-only — non-blocking-improvement
AcceleratorMemory::Unified's doc comment says the carve-out is "kept only so a report can show the two side by side," but no rendering path currently reads the field (onlymeasured_gib()destructures it away via..). Either wire it into a report line, or reword the comment to describe it as reserved for a future report rather than something already shown.- Scenario diagnose-60 passes identically with the whole feature reverted — tradeoff
Pre-PR code already returnedUnifiedMemoryUnreadableunconditionally for any APU, so a host whose aperture is absent behaves the same before and after this change; diagnose-60 demonstrates two narrower in-PR regressions (no fabricated fallback figure, no reason collapse) rather than that the feature shipped. That proof is fully carried by diagnose-59 instead, so this isn't a coverage hole, just worth knowing diagnose-60 isn't where the feature's existence is pinned.
Positive signals
- The hand-written Windows DXGI/COM vtable layouts, the
IID_IDXGIFactory1GUID, and theLoadLibraryW-by-absolute-path loading were checked against external references (SDK IDL mirrors, docs.rs, a third-party Go DXGI binding) and matched; COM object release discipline traces clean on every path, including early returns. - The exact failure mode this module exists to avoid — crediting an APU with a discrete card's memory when two AMD adapters are present — was introduced, caught, and fixed within this same branch (commit
d16e5d3, after the initial9c3677f) before this review even started, and is now pinned by a test asserting both enumeration orders on both the Linux (DRM) and Windows (DXGI) sides. the_gtt_aperture_never_reaches_a_discrete_cardand its multi-GPU variant are genuinely adversarial: they guard the single most dangerous failure mode (summing or substituting the shared pool into a discrete card's VRAM) on both the single- and multi-adapter paths.docs/architecture.mdgot a correct new-file entry forunified_memory.rs, anddocs/testing.mdaccurately describes the new scenarios and explicitly states the Windows FFI coverage gap, rather than leaving it silent.- The e2e test fixture's planted sysfs layout (
vendor,mem_info_gtt_total,mem_info_vram_total, KFDproperties) was cross-checked field-by-field against the actual Linux readers and matches exactly, with no typo'd paths.
Deployment notes
None required. The change is additive (new enum variant, new function, serde-compatible via the existing snake_case renaming) and needs no migration. It does change rocm diagnose --model's output for APU hosts whose pool is readable: these now report a measured figure and Degraded (never Ready) instead of the previous Undetermined/unified_memory_unreadable — an intended, user-visible behavior change rather than a risk, but worth knowing if anything scripts against the old value.
What this covered
Full diff between 8f086ad9c0fe85e7bab2bd8272dc88638938e4fe and d6a44d2f69b7e65ff48da5d4f1fa63774103b42b (13 files, +1567/-118), read completely by three independent passes grouped by coupling (the Linux/Windows measurement layer and its FFI; the classification/verdict/estimator layer plus its docs; the e2e scenarios and step definitions), each also reading the surrounding callers/callees and cross-checking doc comments against behavior. Supplemented directly: git history of the touched files (confirming the in-branch self-correction in commit d16e5d3), the shipped model catalog (to confirm which device_policy/min_gpu_mem_gb combinations exist today), and the repository's own contribution guide for the subprocess/FFI, platform-gated-test, and architecture-doc rules applied above.
Did not run: a local build/test/clippy pass — relied on the PR's CI, which is green across every listed check, including a native Windows build-and-test job (consistent with the PR's own claim that the Windows FFI path has unit coverage but no integration run against real hardware). No prior review from this account exists at this head. Not reconciled against any other reviewer's comments or discussion on this PR.
The MI300X lane's 8 failures are a serving timeout, not the APU changeThis lane ran to completion, so it needs a real answer rather than an infrastructure note: The eight: One dominant symptom underneath almost all of them: The model never becomes ready. Everything downstream follows from that: no served model means no Why this is unlikely to be this PR. The diff is the APU unified-memory read ( Two things I checked rather than assumed:
Not re-run, not fixed. A 300-second readiness timeout that elapsed twice is not something a re-run clarifies, and spending MI300X time to watch it fail again would take GPU capacity from the lane-config work currently queued. What would settle it is a completed MI300X run on main; if the same eight fail there, this is a main-side or environment problem and should be tracked separately from this PR. |
MI300X: the 8 failures are a broken prewarmed vLLM runtime, not this PRI previously said the identical 8-failure set on #1036 and #1054 pointed upstream of both but that I had no main-side run to prove it. I now have the root cause from the logs themselves. Every one of the 8 scenarios fails the same way — the served endpoint never comes up — and the service log tail says why: raised while vLLM imports torch, inside the prewarmed wheel runtime: That is a torch/torchvision ABI mismatch in the prewarm tree on the runners, not anything either PR changes. Evidence it is environmental:
The two PRs have different bases (#1036 sits on the #678 stack, #1054 on main) and ran on different machines, yet fail the same 8 scenarios for the same reason against the same prewarmed runtime id. The failing set is exactly the vLLM-serving scenarios: Main-side baseline. Main's last E2E self-hosted run that reached a verdict is Fix is on the runners, not in these branches. The prewarm tree needs to be rebuilt with a torchvision matching the pinned torch. Nothing I can push to #1036 or #1054 will clear this, and re-running the lane will reproduce it as long as the cached runtime stays. |
Both sides appended three scenarios to diagnose.feature and both numbered them 59/60/61. main's --symptom-file scenarios (#1048) keep 59/60/61 since they are already merged and referenced elsewhere; this branch's APU memory scenarios become 62/63/64 in the same relative order, as tests/feature_naming.rs requires a scenario's number to equal its position in the file. The @id: tags are unchanged on both sets -- expectations.toml and the step bindings key on those, not on the numbers. References to this branch's renumbered scenarios updated in docs/testing.md (the ROCMAI-912 section) and in a comment in e2e/diagnose_steps.rs. The references to main's 59/60/61 in symptom_file_steps.rs, e2e.rs, docs/architecture.md and the docs/testing.md --symptom-file section are left alone. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
Merged
|
@id: |
was | now | from |
|---|---|---|---|
diagnose-a-piped-paste-is-diagnosed-as-pasted |
59 | 59 | main (#1048) |
diagnose-a-paste-at-the-terminal-is-explained-and-diagnosed |
60 | 60 | main (#1048) |
diagnose-an-unreadable-error-file-is-a-usage-error |
61 | 61 | main (#1048) |
diagnose-model-an-apu-is-measured-on-its-shared-pool |
59 | 62 | this PR (ROCMAI-912) |
diagnose-model-an-unreadable-shared-pool-is-said-not-guessed |
60 | 63 | this PR (ROCMAI-912) |
diagnose-model-a-discrete-card-is-never-credited-with-the-aperture |
61 | 64 | this PR (ROCMAI-912) |
The @id: tags are unchanged on both sets — expectations.toml and the step bindings key on those, not on the numbers, so nothing bound to a scenario had to move. The file now runs 01–64 with no gaps or duplicates. Against origin/main the feature file is a pure addition (54 insertions, 0 deletions): none of main's scenarios was dropped or reworded.
References updated
Only references to this branch's scenarios were renumbered:
docs/testing.md— the ROCMAI-912 APU memory pool section: "Scenariosdiagnose-59,diagnose-60anddiagnose-61plant a simulated host" →diagnose-62,diagnose-63,diagnose-64.tests/e2e-cucumber/tests/e2e/diagnose_steps.rs— the comment inassert_unmeasured_machine_is_told_whynoting that a readable APU pool never reaches that step:diagnose-59→diagnose-62.
References to main's 59/60/61 were deliberately left alone, since those scenarios kept their numbers: tests/e2e-cucumber/tests/e2e/symptom_file_steps.rs, tests/e2e-cucumber/tests/e2e.rs, docs/architecture.md, and the --symptom-file section of docs/testing.md (including its cargo xtask e2e -- -n 'diagnose-(59|60|61) ' filter).
Gates (Linux, x86_64)
| Gate | Result |
|---|---|
cargo fmt --all --check |
pass |
cargo clippy --workspace --all-targets -- -D warnings |
pass |
cargo clippy -p e2e-cucumber --test e2e -- -D warnings |
pass |
cargo test -p e2e-cucumber --test feature_naming |
pass (4/4 — the renumbering proof) |
cargo xtask check-architecture-doc |
pass |
cargo xtask check-crate-edges |
pass |
cargo xtask check-module-size |
pass |
cargo test -p rocm-core --lib |
pass (1512) |
cargo test -p rocm --bin rocm |
pass (1867) |
feature_naming is the gate that proves the renumbering: all four of its tests pass, including scenario_names_are_indexed_sequentially_per_feature and scenario_indexes_are_unique_across_the_suite.
One flake on the first -p rocm --bin rocm run: service_launch::spawn::tests::launch_releases_the_leased_port_before_spawning_the_child failed with Address already in use (os error 98) under concurrent load on the shared box. It passed in isolation and on two subsequent full-suite runs.
Review findings are NOT addressed
This is a merge only. No production code was changed, and the three blocking findings from the 2026-11-12 review remain open:
- A
cpu_onlyrecipe with no GPU-memory minimum is still forced toDegradedwith GPU-specific remediation, because the final block inassess()gates only onis_shared_pool(). - The new "no dedicated VRAM" note in
gguf_fit.rs'sestimate_fithas no test. - The e2e assertion
!contains("offers 4.0 GiB")is vacuous:format_gibrenders whole values without a decimal ("4 GiB"), so the assertion can never fail.
juhovainio
left a comment
There was a problem hiding this comment.
See full report above.
|
(Full text of review #1054 (review) — its body was unintentionally truncated by a tool error when submitting; this comment carries the actual content.) Review — needs workFull review of the whole change (13 files, +1567/-118), fanned out across four independent passes grouped by coupling. Blocking
Non-blocking
Decisions for the author
Positive signals
Deployment notesThis changes What this coveredFull diff between Did not run: a local build/test/clippy pass (relied on the PR's own CI, confirmed green above); no Windows cross-compile toolchain was available to execute the DXGI path, matching the PR's own disclosed gap. This repository's internal ticket tracker is not reachable from here, so ROCMAI-912 is reported as named-but-unretrievable rather than verified against its own acceptance criteria. Two earlier reviews exist on this PR, but both are anchored to earlier, now-superseded commits (not the current head), so nothing was narrowed against them; their text was read only to confirm they were superseded, never passed to the fan-out workers, and every finding above was independently re-derived and verified against the current source rather than carried over. Not reconciled against any reviewer's comments or discussion on this PR. 🤖 Automated by an AI agent |
Two conflicts, both from the same cause: main and this branch each appended to the end of `diagnose.feature` and `diagnose_steps.rs`, so the two sets of additions collided without overlapping in meaning. tests/e2e-cucumber/features/diagnose.feature: both sides added a `diagnose-62`, `-63` and `-64`. Main's six scenarios (62-67, the pasted-error-contribution and fix-plan ones) keep their numbers; this branch's three APU-memory scenarios become 68, 69 and 70 and move after them, so each number still equals its position in the file. Two references followed the renumber: `diagnose_steps.rs`'s note that an APU with a readable pool is covered elsewhere, and `docs/testing.md`'s ROCMAI-912 paragraph. The other five references to `diagnose-62/-63/-64` in the tree point at main's pasted-error scenarios and are deliberately left alone. tests/e2e-cucumber/tests/e2e/diagnose_steps.rs: two independent step-definition sections appended at the same place. Both are kept. Each side's final assertion was left unterminated by the split, sharing one `);`/`}` tail between them, so the tail is reproduced for each block rather than closing only the one that happened to come last. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
The last block of `assess()` downgraded any Ready/Degraded verdict to Degraded whenever the host's accelerator memory was a shared pool, gated on that alone. A recipe with `device_policy = "cpu_only"` and no GPU memory minimum takes the `(None, _)` arm and arrives there Ready with no GPU evidence at all, and was then told "this host's integrated GPU has no dedicated VRAM" and handed "close what else is using memory before serving" -- a remediation for a device the model never touches. Gate it on `requires_gpu(recipe)`, as the "no GPU is visible" check a few dozen lines above already is. `cpu_only` is a schema-validated device_policy, so this was reachable through the public `assess_model_readiness`; no shipped recipe pairs it with an absent minimum today, which is why it was untested. The new unit test synthesises the pair from a catalog recipe and asserts the GPU-requiring twin on the same host is still softened, so it cannot pass against a check that was simply deleted. Also reword two docs the same review flagged: `Unified::vram_carveout_gib` now says plainly that nothing reads it (no renderer, and the enum carries no Serialize, so it cannot reach --json either) and that it is reserved for a side-by-side report; and `EstimateOutcome::Fits`/`DoesNotFit` now say the comparison is against a shared pool's ceiling as well as a discrete card's VRAM, mirroring the `UnifiedMemoryUnreadable` wording already updated in that file. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
…card host
Two gaps the review found in the ROCMAI-912 coverage.
The guard in `assert_unreadable_shared_pool_claims_no_figure` asserted
that no evidence line contained "offers 4.0 GiB". `format_gib` renders a
whole-GiB figure with no decimal at all (its own
`format_gib_renders_a_whole_number_with_no_decimal` pins that), and the
branch this scenario drives does not use the "...and this host offers {}"
template in the first place, so the string was unmatchable twice over and
the assertion could not fail. It now anchors on the sentence the
`UnifiedMemoryUnreadable` branch really emits and derives the forbidden
figure from `CARVE_OUT_BYTES` through `as_rendered`, which mirrors both
of `format_gib`'s branches. `CARVE_OUT_BYTES` becomes 4.5 GiB so the
rendered form cannot collide with a recipe minimum of the same size, and
`carve_out_as_rendered` asserts it stays fractional.
Mutation evidence: with the production evidence line changed to quote the
carve-out, the old literal still passed while the new assertion failed
naming "4.5 GiB".
diagnose-71 covers the Linux multi-adapter invariant, which AGENTS.md
says needs a scenario and had only the unit test
`two_amd_cards_leave_the_gtt_aperture_unattributable`. It is not
reachable through `ROCM_CLI_TEST_HOST_ROOT` alone: the sysfs VRAM
fallback's own older ordinal-ambiguity guard withholds every row once a
second AMD card appears, so the host is classified "GPU memory
unmeasured" before the aperture rule is consulted, and a scenario planted
that way would pass while exercising nothing. The fixture therefore adds
a stub `amd-smi` reporting the single compute device -- the APU-beside-a-
non-enumerated-AMD-adapter shape where this rule is the one that decides
-- with `ROCM_E2E_KFD_DEVICE` (planted twice, since `kfd_readable`
requires the node to open both as written and re-rooted) and `HOME`
pointed at the scenario's own root, because `resolve_amd_smi_binary`
prefers `$HOME/.rocm/runtimes/registry` over PATH and the harness does
not isolate HOME. The step asserts the reason is
`unified_memory_unreadable`, not merely "undetermined", so a fixture that
silently stopped reaching the APU branch fails instead of passing.
Mutation evidence: dropping the `cards == 1` guard in
`linux_drm_amdgpu_gtt_total_bytes_in` turns the verdict into `degraded`
on 60 GiB -- one card's aperture attributed to the host -- and the
scenario goes red.
Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
Thanks @juhovainio — all three blocking findings are fixed, plus both non-blocking ones. Commits Finding 1 — a
|
juhovainio
left a comment
There was a problem hiding this comment.
Request changes. The APU shared-pool measurement itself looks sound: the aperture is only consulted on the APU branch, discrete and multi-GPU hosts are pinned by a test, and the scenarios assert the message together with the state. The blockers below are about docs, one remediation, and test/PR-text coverage.
Blocking
- User-facing docs still describe the old behavior. README.md (~l.1021 and ~l.1119: "the CLI can't yet read the memory pool... the answer stays undetermined"), docs/manual-testing.md (~l.1715: "an APU answers
undeterminedby design"), and the--context-size/--kv-cache-typehelp in apps/rocm/src/cli.rs (~l.148, l.172: "against the dedicated VRAM of the GPU") are all false now for an APU with a readable aperture. Please update them in this change. - The Degraded
fixon a Unified host ("close what else is using memory", then verify withrocm diagnose --model) can never clear its condition, because a Unified host is capped at Degraded by construction. No test asserts thefixeither. Drop it (evidence only) or reword it and assert it. - The new GGUF estimate behavior (shared-pool note and the
Unifiedarm in gguf_fit.rs) has no unit test and no scenario, and the PR text names neither. A Fits/DoesNotFit outcome against the ceiling is user-observable. - PR body: the mutation table cites diagnose-60/61, but the scenarios added are diagnose-68..71. It also doesn't mention the gguf_fit change or the
cpu_onlycarve-out inassess.
Non-blocking
- DXGI enumeration can return a partial list as complete (see inline), which defeats the "exactly one AMD adapter" rule.
vram_carveout_gibhas no reader and its mask filter is untested.- diagnose-70 asserts a strict
ready, which may depend on runner RAM. - "since this PR" in a doc comment.
CI is green at this head.
| .to_owned(), | ||
| ); | ||
| if was_ready { | ||
| readiness.fix = Some(Fix { |
There was a problem hiding this comment.
This fix tells the user to close apps and re-run rocm diagnose --model, but a Unified host can never leave Degraded, so the advice cannot clear the condition that printed it, and no test asserts fix here. Drop it (evidence-only) or reword and assert it.
| // this at best" rather than "this much is waiting for it". Said on the | ||
| // estimate itself, because the figure is printed beside the totals with | ||
| // nothing else to tell the two kinds of number apart. | ||
| if memory.is_shared_pool() { |
There was a problem hiding this comment.
The new shared-pool note and the Unified arm have no test (unit or scenario). Please add an estimate_fit test with Unified fits / does-not-fit asserting outcome and note, plus a scenario or a stated reason in the PR text.
| pub enum EstimateOutcome { | ||
| /// The estimated total is within the GPU's dedicated memory. The total | ||
| /// The estimated total is within the memory the host's engine would | ||
| /// allocate from: a discrete card's dedicated VRAM, or — since this PR — |
There was a problem hiding this comment.
"since this PR" has no meaning once merged; describe the behavior instead.
| if hr == DXGI_ERROR_NOT_FOUND { | ||
| break; | ||
| } | ||
| if hr < 0 || adapter.is_null() { |
There was a problem hiding this comment.
A failed EnumAdapters1 other than NOT_FOUND breaks here and returns a partial list as if complete. If the unreached adapter is a second AMD part, amd_shared_system_memory sees exactly one and attributes it, which is the contamination this module says it refuses. Return None on an enumeration error.
| let hr = ((*vtbl).get_desc1)(adapter.cast(), &raw mut desc); | ||
| (hr >= 0).then_some(desc) | ||
| }; | ||
| if let Some(desc) = read { |
There was a problem hiding this comment.
An adapter whose GetDesc1 fails is dropped silently, which can likewise hide a second AMD adapter. Treat an unreadable adapter as making the answer unattributable.
| /// [`ModelVerdict::Ready`] -- see `assess_model_readiness`. | ||
| Unified { | ||
| gtt_total_gib: f64, | ||
| vram_carveout_gib: Option<f64>, |
There was a problem hiding this comment.
vram_carveout_gib has no reader (the doc says so). Drop it until a renderer exists.
| .iter() | ||
| .filter(|usage| usable_indices.is_none_or(|indices| indices.contains(&usage.index))) | ||
| .map(|usage| usage.total_mb as f64 / 1024.0) | ||
| .reduce(f64::max), |
There was a problem hiding this comment.
The mask filter and reduce(f64::max) feeding the unused carve-out are not covered by a test: removing the filter or swapping max stays green. Test under a mask with two rows, or drop the field.
| ); | ||
| assert_eq!( | ||
| model_verdict(&model), | ||
| "ready", |
There was a problem hiding this comment.
Strict ready depends on runner system RAM; assert_fitting_model_is_ready in this file tolerates degraded for that reason. Accept ready|degraded and assert the shared-pool evidence is absent instead.
juhovainio
left a comment
There was a problem hiding this comment.
Full review of the current head (59d76384) against main (f15f9b4b), 13 files, +1984/-120. This implements the APU-shared-memory-measurement portion of ROCMAI-912 (reading the real GTT/WDDM aperture for AMD APUs and capping the verdict at Degraded); the description itself scopes out free-memory measurement, BIOS/gttsize guidance and SVM-mapping-failure detection as separate work.
The core measurement logic is sound: the aperture is only consulted on the APU branch, the "exactly one AMD adapter" rule is implemented and tested on both Linux and Windows, and the e2e scenarios plant realistic sysfs/DXGI fixtures. However, several things need addressing before merge — largely the same ground @juhovainio's latest review already covers, which I independently re-derived and confirm:
Blocking
- The branch currently conflicts with
main(crates/rocm-core/Cargo.toml, inline comment) — confirmed locally viagit merge-tree: awindows-sysfeature-list conflict between this PR'sWin32_System_LibraryLoaderaddition and aWin32_Security_Authorizationfeaturemainadded since this branch was cut. Needs a rebase with both features kept. - User-facing docs still describe the old "undetermined" behavior.
README.md(~1016-1021, ~1119-1121) anddocs/manual-testing.md(~1715) both say an APU's memory "can't yet be read" / "answers undetermined by design." That's no longer true for an APU with a readable aperture — these files aren't part of this diff and need updating. - CLI help text makes the same stale claim.
apps/rocm/src/cli.rs(the--modelflag's doc comment around line 148, and--context-sizearound line 172) describes the comparison as "against the dedicated VRAM of the GPU," which ignores the new shared-pool/Unifiedcase. - The
Degradedremediation text can never be satisfied (inline comment onmodel_readiness.rs:690) — re-running the suggested verify command reproduces the identical result forever, since only a ceiling is measured, never free memory. Untested. - The new GGUF shared-pool note has zero test coverage (inline comment on
gguf_fit.rs:859) — no unit test constructsAcceleratorMemory::Unifiedin this file, and no scenario exercises it. - The PR description is stale against its own branch. The mutation-evidence table cites
diagnose-60/diagnose-61, but amainmerge renumbered this branch's scenarios todiagnose-68-71(60/61 now belong to unrelated, pre-existing scenarios). The description also predates and doesn't mention the latercpu_only-recipe fix or the gguf_fit gap above.
Non-blocking
- DXGI partial-enumeration handling (inline comment on
unified_memory.rs:350) — a real, untested gap, but I agree with the existing call to treat it as non-blocking given how rarely a non-NOT_FOUNDEnumAdapters1error fires in practice and that the Windows path is unexecuted either way.
On CI: the failing MI300X/E2E-consolidated checks are a torch/ROCm version mismatch in the prewarmed runtime image (confirmed via job logs: "torch built for a different ROCm version than the installed SDK"), consistent with the extensive infra investigation already on this thread — not something this diff introduces. The merge conflict above is the actual blocker to mergeability right now.
What this covered: the full diff read across two independent passes (the Linux/Windows measurement + classification layer; the verdict/estimator/e2e layer), plus direct verification of CI logs, a local git merge-tree against current main, and the specific claims in the existing reviews on this PR. Not reconciled against discussion beyond confirming which prior findings still hold at this head.
🤖 Automated by an AI agent
| # There is no `Win32_Graphics_Dxgi` feature to use instead: windows-sys carries | ||
| # no COM interfaces at all, so the three vtable slots that read are declared in | ||
| # that module. | ||
| windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_LibraryLoader", "Win32_System_Registry", "Win32_System_SystemInformation", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging"] } |
There was a problem hiding this comment.
Blocking (mergeability): this branch currently conflicts with main right here. git merge-tree shows a content conflict on this windows-sys feature list — main has since added a Win32_Security_Authorization feature (for owner_only_file::owner_only_dacl_mismatch, per the comment above it on main), while this PR's version drops that feature and adds Win32_System_LibraryLoader. The resolution needs both features present: ["Win32_Foundation", "Win32_Security", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_LibraryLoader", "Win32_System_Registry", "Win32_System_SystemInformation", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging"]. Small, but it means the PR isn't mergeable as-is and needs a rebase.
| ); | ||
| if was_ready { | ||
| readiness.fix = Some(Fix { | ||
| summary: "close what else is using memory before serving; the engine, not this \ |
There was a problem hiding this comment.
Blocking: this remediation can never clear. verify re-runs rocm diagnose --model {model_ref}, but the Degraded verdict it's meant to verify away is forced by this very block whenever is_shared_pool() && requires_gpu(recipe) — unconditionally, since only the aperture ceiling is measured here, never actual free memory. Re-running the verify command after "closing what else is using memory" reproduces the identical Degraded result every time; there's no state the user can reach that clears it. No test in this file asserts on .fix for this path, so the dead-end isn't caught anywhere. Either drop the fix here (evidence-only, matching how the rest of the PR frames this as a hard ceiling) or reword it to not imply the check itself can be satisfied.
| // this at best" rather than "this much is waiting for it". Said on the | ||
| // estimate itself, because the figure is printed beside the totals with | ||
| // nothing else to tell the two kinds of number apart. | ||
| if memory.is_shared_pool() { |
There was a problem hiding this comment.
Blocking: this note has no test coverage. No test in this file's #[cfg(test)] mod tests constructs AcceleratorMemory::Unified (only UnifiedMemoryUnreadable is exercised), and no scenario in diagnose.feature drives a GGUF-backed estimate against a Unified host. This is user-visible text read by diagnose_model.rs, not dead code — deleting this block would currently leave every test green. Please add a unit test asserting the note appears for Unified and not for Dedicated/Unknown.
| if hr == DXGI_ERROR_NOT_FOUND { | ||
| break; | ||
| } | ||
| if hr < 0 || adapter.is_null() { |
There was a problem hiding this comment.
Non-blocking, but worth tracking: an EnumAdapters1 error other than DXGI_ERROR_NOT_FOUND breaks this loop identically to the clean end-of-list case (line 347), silently truncating the adapter list rather than signaling "enumeration was unreliable." If a second real AMD adapter sits past the index where a transient error occurs, this returns exactly one AMD adapter and confidently attributes its budget — the same contamination the single-adapter rule exists to prevent, reached via a failure path rather than a successful one. This was flagged as blocking in an earlier review on this PR and downgraded to non-blocking on the reasoning that EnumAdapters1 essentially only returns NOT_FOUND at the true end of the list in practice — I think that's a reasonable call given the Windows path is still unexecuted on real hardware either way, but since this is the one part of the file with zero test coverage (confirmed: no test drives a non-NOT_FOUND EnumAdapters1 error or a GetDesc1 failure through here), I'd still suggest returning None for the whole call on any error besides DXGI_ERROR_NOT_FOUND, rather than treating it as a complete answer, before this ships to real Windows APU+dGPU hardware.
Resolves the `windows-sys` feature-list conflict in `crates/rocm-core/Cargo.toml` as a strict union: `main` added `Win32_Security_Authorization` for `owner_only_file` while this branch added `Win32_System_LibraryLoader` for the DXGI shared-memory read. windows-sys features are additive, so keeping only one side would fail to compile on Windows. Signed-off-by: Roman Sirokov <roman@flowrl.com> Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
…r pass The `Degraded` an APU gets for a GPU recipe is forced by the host, not by anything the user is doing: the branch fires whenever the pool is shared and the recipe needs the GPU, because only the aperture is measured and free memory never is. Its plan carried `verify: rocm diagnose --model <model>`, which therefore reprints the identical verdict however much the user closes -- a loop with no exit, read as a check they failed to satisfy rather than one that cannot be. Say the limit out loud instead. The plan now names the one thing that does settle it (`rocm serve`), its note states that this check cannot read how much of the pool is free so re-asking reports the same thing, and it carries no `verify` at all -- the renderer omits an empty one, so nothing is promised that cannot be delivered. `the_shared_pool_plan_names_no_check_that_can_never_clear` pins it, running the premise rather than asserting it from the source: the same question asked twice of the same host gives the same answer. Restoring the old `verify` line fails that test and nothing else. Signed-off-by: Roman Sirokov <roman@flowrl.com> Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
The note was user-visible text with nothing holding it: no test in `gguf_fit` constructed `AcceleratorMemory::Unified` at all, so deleting the block outright left every test in the file green. `a_shared_pool_is_compared_against_its_ceiling_and_said_to_be_shared` pins the three things that can break separately -- that a readable pool is estimated rather than declined, that the figure compared against is the pool and not the carve-out beside it (the planted carve-out is below the model's own weights, so a `Fits` proves which was used), and that the note is present for `Unified` and absent for a dedicated card and an unreadable one. Mutation evidence: replacing the `is_shared_pool()` guard with `false` fails this test and no other; replacing it with `true` fails this test too, so the negative half is load-bearing rather than decoration. Signed-off-by: Roman Sirokov <roman@flowrl.com> Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
README, `docs/manual-testing.md` and the `--model`/`--context-size` help all still described the old behaviour: an integrated GPU's pool "can't yet be read", an APU answers "undetermined by design", the comparison is "against the dedicated VRAM of the GPU". None of that holds for an APU whose pool is readable, which is the case this branch added. Each now says what actually happens: the comparison is made against the shared memory pool the engine allocates from rather than the BIOS carve-out; the figure is a ceiling the operating system draws on too, so a model under it answers `degraded` rather than `ready` and one over it is `blocked` with the note that freeing memory will not raise it; and `undetermined` is now the narrower statement that the pool could not be read on this particular host. Signed-off-by: Roman Sirokov <roman@flowrl.com> Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
Replying to review 5935006825. All six blocking items addressed at 1. Conflict with One correction to the inline comment, which does not change the resolution: on 2. Stale user-facing docs — fixed. 3. CLI help — fixed. Both doc comments in 4. The Dropping the
The summary is now "nothing here is broken: serve it and let the engine answer, having closed what else is using memory" — the freeing advice survives, because it does improve the odds, but it is no longer framed as something this check will confirm. Pinned by 5. The GGUF shared-pool note — fixed. Confirmed: no test in Mutation evidence: replacing the I did the unit test you asked for and did not add a 6. PR description — fixed. Confirmed stale: Non-blocking — DXGI partial enumeration: acknowledged, not changed. I agree with your reasoning and with the earlier downgrade, and I have not touched it. It is now written into the PR description's non-goals rather than living only in review history, stated as what it is: a non- Gates. All green on a Linux ROCm box (MI300X, gfx942), each run on its own: Not verified. The Not re-requesting review; leaving that to the author. |
juhovainio
left a comment
There was a problem hiding this comment.
Review — needs work
Full review of the whole change (base 9101286a → head c8e0b2fb, 16 files, +2206/-135), read completely via three independent fan-out passes. Implements the APU-shared-memory-measurement portion of ROCMAI-912 (reading the real GTT/WDDM shared-memory aperture for AMD APUs and capping the verdict at Degraded); the description itself scopes out free-memory measurement, BIOS/gttsize guidance, and SVM-mapping-failure detection as separate work, and that boundary matches what the diff actually contains. Ticket ROCMAI-912 named but not retrievable from here (no tracker access).
This is a fresh review at the current head, after an earlier round reviewed an older commit (59d76384) on this same PR. Several commits since then (be444821, 71545456, 81788fa5, c8e0b2fb) directly answer that round's blocking points, and I independently re-verified each is actually fixed rather than taking that on faith: the windows-sys/Cargo.toml merge conflict is resolved (clean git merge-tree against current origin/main); the stale "undetermined by design" / "dedicated VRAM" claims in README.md, docs/manual-testing.md, and the --model/--context-size help in apps/rocm/src/cli.rs are gone, replaced with accurate shared-pool language; the Degraded plan's dead-end verify was removed (no verify printed, matched by a new test); and the GGUF estimator's shared-pool note now has a unit test checking both presence (Unified) and absence (Dedicated/Unknown). The four findings below are new ground, not repeats of what already landed.
Blocking
-
The shared-pool "forces
Degraded" gate checksrequires_gpu(recipe)but not whether a GPU-memory comparison actually happened, so agpu_required/gpu_preferredrecipe with no declaredmin_gpu_mem_gbis downgraded fromReadyon fabricated evidence —crates/rocm-core/src/model_readiness.rs:673-679(gate),:361-363(requires_gpu),:1872(the one new test, which doesn't cover this shape)
requires_gpuisrecipe.device_policy != "cpu_only". A recipe withdevice_policy: "gpu_required"andmin_gpu_mem_gb: Nonetakes the(None, _)match arm, leaves the verdict atReady, and then this gate still fires because it only checksrequires_gpu, notrequired.is_some(). The shipped catalog has exactly this shape today —openai/gpt-oss-20b,openai/gpt-oss-120b,zai-org/GLM-4.7,zai-org/GLM-5.2,MiniMaxAI/MiniMax-M3,meta-llama/Llama-3.1-405B-Instruct,deepseek-ai/DeepSeek-V4-Flash-0731(verified directly againstcrates/rocm-core/src/model_catalog.json) — so on an APU host with a readable shared pool, each is silently stampedDegradedwith the invented "this host's integrated GPU has no dedicated VRAM" evidence and a remediation for a comparison that was never made. Same bug class the PR's owncpu_onlyfix (commit8412853f) addressed; left open for the broader "no declared minimum" case.
Confidence 85 · logic · Fix: gate onrequired.is_some()in addition to/instead ofrequires_gpu(recipe). -
The
cpu_only-recipe-not-degraded-by-a-shared-pool behavior has no e2e scenario, only a unit test —crates/rocm-core/src/model_readiness.rs:1872,tests/e2e-cucumber/features/diagnose.feature(absent)
This is new, user-observable CLI behavior (whether the verdict is downgraded todegraded).AGENTS.md§3 is explicit that a unit test does not discharge this for user-observable CLI behavior, and requires a Gherkin scenario or a stated reason for its absence in the PR text. Neither exists: nocpu_onlymatch anywhere undertests/e2e-cucumber/, and the PR body's mutation table cites only the unit test's name for this row with no scenario id and no justification.
Confidence 78 · architectural (process/coverage) · Fix: add adiagnose.featurescenario covering this, or state in the PR text why one is impractical. -
The GGUF estimator's "shared pool is a ceiling, not free memory" note has no e2e scenario, only a unit test —
crates/rocm-core/src/gguf_fit.rs:1677,tests/e2e-cucumber/features/diagnose.feature(absent)
This note is printed, user-visible text for a shared-pool host and needs the sameAGENTS.md§3 coverage. A prior review round already flagged this as "no unit test and no scenario"; the unit test was added since, but the scenario side was not — this note's wording never appears indiagnose.feature/diagnose_steps.rs(only the unrelated curated-recipe evidence text, a different code path, is scenario-covered).
Confidence 78 · architectural (process/coverage) · Fix: add a scenario driving a GGUF-outside-catalog estimate on a shared-pool host and asserting the note appears. -
skills/rocm-doctor/reference.md's description ofavailable_gibis now stale for the case this PR adds —skills/rocm-doctor/reference.md:81(not part of this diff; could not be posted as an inline PR comment because GitHub only anchors review comments to lines inside the diff)
"available_gibis the total dedicated VRAM... not what is free" was accurate enough pre-PR, when an APU essentially never populated this field. This PR makes it populate with the shared-pool ceiling for a readable APU — which, per this PR's own evidence text elsewhere, explicitly is not "dedicated VRAM". Every other surface making this same claim (README.md,docs/manual-testing.md,apps/rocm/src/cli.rs) was correctly updated in this PR; this assistant-facing contract file, which feeds therocm-doctorLLM skill as ground truth, was missed.AGENTS.md§5 requires grepping the same claim's wording across all such surfaces when a behavior claim changes.
Confidence 78 · logic (doc accuracy) · Fix: add the same shared-pool/ceiling caveat here that README.md/cli.rs now carry.
Non-blocking
None.
Decisions for the author
- DXGI partial enumeration (a non-
NOT_FOUNDEnumAdapters1error, or aGetDesc1failure on an enumerated adapter) is treated as if the adapter list were complete, which could in principle defeat the "exactly one AMD adapter" safety invariant — answered-by-intent
PR body, Scope section: "AnEnumAdapters1error other thanDXGI_ERROR_NOT_FOUNDends the adapter loop the same way the clean end of the list does, so a second AMD adapter sitting past a transient error would be missed...NOT_FOUNDis what that call returns at the true end of the list in practice, and the Windows path is unexecuted either way, so this is left as known and untested rather than guessed at." The code's own doc comment makes the same call for theGetDesc1case: "Never fails as a whole: an adapter whose description cannot be read is skipped, because one uncooperative adapter must not hide the budget of the one the question is about." Would otherwise have been a blocking architectural finding (it is a real, confirmed gap in the module's central safety invariant under a low-probability but real failure mode); retired because the author already named and reasoned about it. Confirm this remains the intended tradeoff before the Windows path gets real execution coverage. vram_carveout_gibis currently write-only — non-blocking-improvement
The field's own doc comment says it is "kept only so a report can show the two side by side," and nothing renders or serializes it today (AcceleratorMemoryhas noSerialize, and every match onUnifieddestructures it away via..). The comment documents the gap with a reason, so this isn't blocking dead code, but either wire it into a report line now or make the "reserved for later" framing more prominent so the next reader doesn't mistake it for an oversight.- ~250 lines of hand-written Windows DXGI/COM FFI, entirely unexecuted by CI (type/clippy-checked cross-compiled only), ships in the same PR as the Linux path that CI does exercise — tradeoff
The PR body already raises and answers this itself ("the alternative was taking on thewindowscrate for three struct fields"), and the vtable layouts/GUID/release discipline were checked against external references with no mismatch found. Not a defect, but worth the author/maintainer explicitly confirming the scope call, since this is real, un-exercised FFI shipping without integration coverage.
Positive signals
- The "exactly one AMD adapter" invariant is applied, documented, and tested consistently on both the Linux (
mem_info_gtt_total/sysfs) and Windows (DXGI) sides, each citing the other's test by name in its own doc comments — a genuinely cross-platform-consistent safety design, not two independently-drifted implementations. - COM object lifetime discipline in the new
unified_memory.rs(factory/adapterRelease()on every path, including early returns andGetDesc1failure) was traced and found clean with no leaks or double-releases. docs/architecture.mdgot specific, accurate entries for the newhost_gpu/unified_memory.rsfile and the updatedmodel_readiness.rs, not boilerplate — each correctly states the ceiling/ never-Readybehavior.- User-facing prose updates (
README.md,docs/manual-testing.md,apps/rocm/src/cli.rshelp text) are thorough and consistent with the new shared-pool/ceiling language everywhere I checked except the one doc gap noted above.
Deployment notes
This changes rocm diagnose --model's observable output for APU hosts whose shared pool is readable: previously undetermined/unified_memory_unreadable, now a measured figure with the verdict capped at degraded (never ready). Anything scripting against the old undetermined value for these hosts will see different output. No migration needed; the change is additive (new enum variant, serde-compatible).
What this covered
Full diff between 9101286acfe1d071b2d1ae43739f937593589ad7 and c8e0b2fb43e09ff80858f2a6047006966e5686bf (16 files, +2206/-135), read completely across three independent fan-out passes grouped by coupling (the Linux/Windows measurement layer and its FFI; the classification/verdict/estimator layer plus its user-facing docs; the e2e scenarios and step definitions), each reading the full diff plus the surrounding callers/callees and doc comments. Supplemented directly, by me: the shipped model catalog JSON (to confirm which device_policy/min_gpu_mem_gb combinations exist today), commit history and message quality (12 commits, descriptive, no AI-attribution footers), a local git merge-tree against current origin/main (clean — the previously-flagged conflict is resolved), and docs/architecture.md/skills/rocm-doctor/reference.md outside the diff for impact analysis.
CI: 45 of 46 checks completed and green at this head; E2E tests (MI300X, current) was still queued at review time (a self-hosted/hardware-gated lane) — noted as unresolved rather than assumed fine, not treated as a failure.
Did not run: a local build/test/clippy pass (relied on CI). History and prior-changes were not run as fully separate dedicated passes beyond what's described above.
Disclosure: this PR's own claim-check step (confirming no other PENDING review existed at this head) required a get_reviews call that returned the full text of four prior reviews before my blind fan-out began; my three review passes themselves were never shown that content (each received only a file scope and explicit instructions not to read the PR description or discussion), but I did see it. Every finding above was independently verified against the code (and, for Finding 1, the shipped catalog) by me before inclusion, not carried over from that content. Reconciliation: the DXGI retirement above corroborates what a prior round already called non-blocking/accepted; the GGUF-scenario finding partially overlaps a prior round's point (the unit-test half of that gap has since been fixed, the scenario half has not); the other three findings are new.
🤖 Automated by an AI agent
| // no GPU minimum takes the `(None, _)` arm and reaches here `Ready` with no | ||
| // GPU figure at all). | ||
| if host.accelerator_memory.is_shared_pool() | ||
| && requires_gpu(recipe) |
There was a problem hiding this comment.
Blocking — the shared-pool "forces Degraded" gate checks requires_gpu(recipe) but not whether a GPU-memory comparison actually happened, so a recipe with device_policy other than cpu_only but no declared min_gpu_mem_gb is downgraded from Ready on evidence that was never produced.
requires_gpu (line 361-363) is recipe.device_policy != "cpu_only". A recipe with device_policy: "gpu_required" and min_gpu_mem_gb: None takes the (None, _) arm at line ~618 ("this recipe declares no GPU memory minimum"), leaves readiness.verdict at its initial Ready, and then this gate still fires because it only checks requires_gpu, not required.is_some(). The shipped catalog has exactly this shape today — openai/gpt-oss-20b, openai/gpt-oss-120b, zai-org/GLM-4.7, zai-org/GLM-5.2, MiniMaxAI/MiniMax-M3, meta-llama/Llama-3.1-405B-Instruct, deepseek-ai/DeepSeek-V4-Flash-0731 (verified directly against crates/rocm-core/src/model_catalog.json) — so on an APU host with a readable shared pool, each of these is silently stamped Degraded with the fabricated "this host's integrated GPU has no dedicated VRAM" evidence and a "free memory, then rocm serve" fix for a comparison that was never made. This is the same bug class the PR's own cpu_only fix (commit 8412853) addressed, left open for the broader "no declared minimum" case. The new test a_cpu_only_recipe_is_not_degraded_by_a_shared_pool_it_never_uses (line 1872) only constructs cpu_only vs. gpu_required-with-a-minimum recipes, so this gap is untested.
Confidence 85 · logic · Fix: gate the block on required.is_some() (or equivalently, only fire when the earlier match actually produced a GPU-memory comparison) in addition to/instead of requires_gpu(recipe).
| /// absent minimum today, which is why the recipe is synthesised from a real | ||
| /// one rather than looked up -- and why this was untested. | ||
| #[test] | ||
| fn a_cpu_only_recipe_is_not_degraded_by_a_shared_pool_it_never_uses() { |
There was a problem hiding this comment.
Blocking — the cpu_only-recipe-not-degraded-by-a-shared-pool behavior has no e2e scenario, only this unit test.
This is new, user-observable CLI behavior: whether rocm diagnose --model reports ready/blocked or forces degraded for a cpu_only recipe on an APU host differs by this fix. AGENTS.md §3 is explicit that "a unit test asserting the internal helper does NOT discharge this" for user-observable CLI behavior, and requires either a Gherkin scenario in tests/e2e-cucumber/features/ or a stated reason in the PR text for its absence. Neither exists here — grep -rn "cpu_only" over tests/e2e-cucumber/ at this head returns nothing, and the PR body's mutation-evidence table cites only this unit test's name for this row, with no scenario id and no stated justification for the gap.
Confidence 78 · architectural (process/coverage) · Fix: add a diagnose.feature scenario driving rocm diagnose --model against a cpu_only (or no-GPU-minimum) recipe on a host with a readable shared pool, asserting the verdict is not downgraded to degraded — or state in the PR text why one is impractical here.
| /// before this one existed, and a test that only asserted presence would | ||
| /// still pass against a block that pushed the note unconditionally. | ||
| #[test] | ||
| fn a_shared_pool_is_compared_against_its_ceiling_and_said_to_be_shared() { |
There was a problem hiding this comment.
Blocking — the GGUF estimator's "shared pool is a ceiling, not free memory" note has no e2e scenario, only this unit test.
This note is printed, user-visible text in rocm diagnose --model <gguf> output for a shared-pool host, so per AGENTS.md §3 it needs Gherkin coverage (or a stated reason it's impractical), not just this unit test. A prior review round on this PR already flagged this exact gap as "no unit test and no scenario"; the unit test was since added (this one), but the e2e scenario side was not — grep for this note's wording ("shares with the operating system", "no dedicated VRAM") across tests/e2e-cucumber/features/diagnose.feature and diagnose_steps.rs only matches the curated-recipe evidence text in model_readiness.rs (a different code path, already scenario-covered), never this estimator-specific note.
Confidence 78 · architectural (process/coverage) · Fix: add a scenario driving a GGUF-outside-catalog estimate against a shared-pool APU host and asserting this note appears in the output.
Main landed the fix-step timeout work (#1062), which took `diagnose-68` through `diagnose-70`. This branch's four APU-memory scenarios move to `diagnose-71` through `diagnose-74`, so each number still equals its position. Five references follow them: the ROCMAI-912 scenario list and the `diagnose-74` note in `docs/testing.md`, and three comments in `diagnose_steps.rs`. The other `diagnose-68`/`-69`/`-70` references in those same files -- the fix-4 helper, the one-minute timeout, fix-2 and fix-9 -- belong to main's new scenarios and are left alone. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
…ed against Review finding: the shared-pool gate asked `requires_gpu(recipe)` but not whether a GPU-memory comparison had actually been made. `requires_gpu` is only `device_policy != "cpu_only"`, so a `gpu_required` recipe that declares no `min_gpu_mem_gb` passes it, takes the `(None, _)` arm above, and arrives `Ready` with no GPU figure in the report -- and was then stamped `Degraded` with "this host's integrated GPU has no dedicated VRAM" and a remediation for a comparison nothing performed. Live, not latent: seven recipes in the shipped catalog have exactly that shape, so on an APU with a readable pool every one of them was mis-reported. The earlier `cpu_only` fix closed the neighbouring case and left this one. The gate now also requires `required.is_some()`. The two terms answer different questions -- "does it use the GPU" and "did we weigh it against the pool" -- and only the second licenses the verdict. Pinned by a test driven off the shipped catalog rather than a synthetic recipe, with an explicit premise assertion so it fails loudly if no such recipe remains rather than passing vacuously. Mutation-checked: dropping `required.is_some()` fails it, naming a real catalog model and the evidence line it was given. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
Thanks — this round found something live, and I verified it before fixing it. Blocking 1 — You were right, including the count. I checked The irony is that the code comment immediately above the gate already described this shape — "a recipe with no GPU minimum takes the The gate now also requires Pinned by Those two evidence lines sitting in one report is the defect stated plainly. Blocking 4 — Blocking 2 and 3 — no e2e scenario for the Decisions: the DXGI partial-enumeration tradeoff and the unexecuted Windows FFI scope call both stand as the PR body describes them — confirmed intended. So: one blocking item fixed with mutation evidence, three still open. Leaving CHANGES_REQUESTED standing. |
juhovainio
left a comment
There was a problem hiding this comment.
Review — needs work
Full review of the whole change (16 files, +2262/-135, base origin/main → head 60c29d57).
Implements the GTT/DXGI shared-memory-pool measurement portion of ROCMAI-912 (reading the real pool an AMD APU's engine allocates from and capping the verdict at Degraded). Ticket ROCMAI-912 retrieved directly: its own comments confirm the BIOS carve-out/amdgpu.gttsize recommendation and SVM mapping failed detection are deliberately deferred as separate work, and record a further Windows-adapter-disambiguation idea that was considered and explicitly rejected for now — both match what this diff actually contains, and the PR does not claim to close the ticket (correct: it remains "In Progress").
This is a fresh review at the current head, after four prior rounds on this PR (three by this account) found and closed several real issues across earlier commits — a merge conflict, stale "undetermined"/"dedicated VRAM" docs, a dead-end remediation, a vacuous e2e assertion, and (most recently, at c8e0b2fb) a gap in the shared-pool Degraded gate. The branch's very last commit (60c29d57, titled as a review finding) closes that last gap: the gate now requires required.is_some() in addition to requires_gpu(recipe), verified directly against the shipped catalog (exactly the 7 recipes the commit message names have this shape). I independently re-derived this rather than taking the commit message on faith. Three findings from that last round are still open at this head (confirmed independently, not carried over); one new defect was found that four prior rounds missed.
Blocking
-
A GGUF-outside-the-catalog estimate on an APU prints self-contradictory text in the same report —
crates/rocm-core/src/gguf_fit.rs:1151(evidence_lines, unchanged by this PR) vs:859-863(the new shared-pool note)
evidence_linesunconditionally renders "the GPU with the most dedicated VRAM that ROCm can see has {N} MiB..." wheneverestimate.available_gib.is_some(), which is also true for the newUnifiedcase.model_readiness.rs:992extendsreadiness.evidencewith this text, andrender_model_readiness_textprintsevidencebullets beforeestimate.notesin the same report. So on a shared-pool host the output reads "...has 24576 MiB of dedicated VRAM..." followed a few lines later by "...has no dedicated VRAM...". No test exercisesevidence_lineswithAcceleratorMemory::Unified(the new test only checks.notes).
Confidence 90 · logic · Fix: branchevidence_lines's wording onmemory.is_shared_pool(), the same way the note itself is gated. -
The GGUF estimator's shared-pool note has no Gherkin scenario, only a unit test —
crates/rocm-core/src/gguf_fit.rs:859(behavior),tests/e2e-cucumber/features/diagnose.feature(absent)
This is new, user-observable, serialized output (ContextEstimate.notes, reaches--json).AGENTS.md§3 is explicit a unit test does not discharge this. Verified independently: zero occurrences of this note's wording anywhere undertests/e2e-cucumber/; no existing scenario combines a GGUF model with an APU host. A prior round flagged "no unit test and no scenario" — the unit-test half has since been added, the scenario half has not.
Confidence 85 · architectural (process/coverage) · Fix: add a scenario, or state in the PR text why one is impractical. -
The
cpu_only-recipe immunity to the shared-pool downgrade has no Gherkin scenario, only a unit test —crates/rocm-core/src/model_readiness.rs:681(behavior),tests/e2e-cucumber/features/diagnose.feature(absent)
Covered only bya_cpu_only_recipe_is_not_degraded_by_a_shared_pool_it_never_uses. Verified independently: zero occurrences of "cpu_only"/"cpu-only" undertests/e2e-cucumber/; the PR body's mutation table names only this unit test for this row, with no scenario id and no stated reason for the gap.
Confidence 85 · architectural (process/coverage) · Fix: add a scenario, or state in the PR text why one is impractical. -
skills/rocm-doctor/reference.md's description ofavailable_gibis stale for the case this PR adds —skills/rocm-doctor/reference.md:81(not part of this diff; could not be posted as an inline comment for that reason)
"available_gibis the total dedicated VRAM of the GPU with the most of it that ROCm can see, not what is free" was accurate when an APU essentially never populated this field. This PR makes it populate with the shared-pool ceiling for a readable APU, which per this PR's own evidence text elsewhere explicitly is not dedicated VRAM. Every other surface making this same claim (README.md, docs/manual-testing.md, apps/rocm/src/cli.rs) was correctly updated in this PR; this assistant-facing contract file — which feeds therocm-doctorskill as ground truth — was missed. Confirmed directly: the lines between this file's state at the previous review round and now are unrelated (an unconnected exit-code-table edit), so this specific sentence is still untouched and still stale.
Confidence 85 · logic (doc accuracy) · Fix: add the same shared-pool/ceiling caveat here that README.md/cli.rs now carry.
Non-blocking
- Wrong scenario cross-reference in a feature-file comment —
tests/e2e-cucumber/features/diagnose.feature:1126(inline) docs/architecture.md'sgguf_fit.rsentry (line ~314) is stale, still describing the comparison as only "against VRAM" (inline, anchored nearby in the same hunk)
Decisions for the author
- DXGI partial enumeration (a non-
NOT_FOUNDEnumAdapters1error, or aGetDesc1failure) is treated as a complete adapter list, which could in principle defeat the "exactly one AMD adapter" invariant — answered-by-intent
PR body, Scope section: "AnEnumAdapters1error other thanDXGI_ERROR_NOT_FOUNDends the adapter loop the same way the clean end of the list does...NOT_FOUNDis what that call returns at the true end of the list in practice, and the Windows path is unexecuted either way, so this is left as known and untested rather than guessed at." Independently re-traced inunified_memory.rs'scollect(confidence 65-85 depending on how the gap is weighted) and confirmed real; retired here because the author already named and reasoned about it. Confirm this remains the intended tradeoff before the Windows path gets real execution coverage. vram_carveout_gibis currently write-only — non-blocking-improvement
Its own doc comment says it's "kept only so a report can show the two side by side," and nothing renders it today. Not blocking dead code since the gap is documented with a reason, but worth wiring in or re-framing as "reserved."requires_gpu()treatsgpu_preferredidentically togpu_required— tradeoff
If "preferred" is ever meant to allow a CPU-fallback path, the shared-pool ceiling would be irrelevant there; if GPU presence is effectively mandatory for both policies today, the logic is fine and this is just a naming note.
Positive signals
- The in-branch self-correction on
required.is_some()(above) is real engineering working as intended: caught by review, fixed with a test driven off the live catalog rather than a synthetic fixture. cpu_onlyexclusion is tested with genuine non-vacuity: acpu_onlyrecipe and agpu_requiredsibling are asserted on the same host in the same test.- The dead-end
Degradedremediation a prior round flagged is gone and stays gone: noverifyis offered when the downgrade is pool-forced, pinned bythe_shared_pool_plan_names_no_check_that_can_never_clear. - Windows DXGI/COM vtable layouts, the
DXGI_ADAPTER_DESC1struct layout, and COM reference-counting discipline (everyAddRef/CreateDXGIFactory1success matched by aRelease, including early-return paths) were traced and found correct;SharedSystemMemoryis read as a pointer-sizedSIZE_T, correctly avoiding the 32-bit WMI fields that saturate at 4 GiB. - The Linux GTT reader is a single-pass, no-early-exit design that is structurally immune to the Windows side's partial-enumeration gap (see Decisions above) — a more robust design for the same invariant.
format_gib's non-vacuity fix from a prior round is real and well-executed: the e2e fixture's carve-out value is deliberately non-whole-GiB so the "no fabricated figure" assertion can't vacuously pass.- Commit messages are clean and accurate at branch head, with proper DCO trailers and no AI-attribution footers.
Deployment notes
Changes rocm diagnose --model's observable output for APU hosts whose shared pool is readable: previously undetermined/unified_memory_unreadable, now a measured figure with the verdict capped at degraded (never ready). Anything scripting against the old undetermined value for these hosts will see different output. No migration needed; the change is additive (new enum variant, serde-compatible).
What this covered
Full diff origin/main...60c29d57 (16 files, +2262/-135), read completely across seven independent blind fan-out passes grouped by coupling: (1) the Linux/Windows measurement layer and its FFI (host_gpu.rs, host_gpu/linux.rs, host_gpu/unified_memory.rs, lib.rs, Cargo.toml, gpu_policy.rs); (2) the verdict/classification layer plus CLI help text (model_readiness.rs, cli.rs); (3) the GGUF/model-fit estimator (model_fit.rs, gguf_fit.rs); (4) user-facing docs (README.md, docs/architecture.md, docs/manual-testing.md, docs/testing.md), cross-checked against code via a repo-wide stale-claim grep sweep; (5) e2e scenarios and step definitions; (6) an AGENTS.md compliance sweep (module size, architecture-doc entries, FFI/subprocess checklist, scenario-coverage requirement, doc-claim accuracy, commit-message quality); (7) commit history (self-correction patterns, pre-existing bug-class recurrence, merge-commit sanity). Each pass read its files completely plus callers/callees; none were shown the PR description, ticket, or other reviews' content. I supplemented directly: the shipped model catalog (to confirm the required.is_some() fix's catalog claim), skills/rocm-doctor/reference.md (outside the diff, impact analysis), and the exact diff hunks available for each finding's location (to confirm which could and couldn't be posted inline).
CI: all 40 reported checks completed green at this head (build-and-test, clippy, both Windows jobs, both E2E lanes, all security scans, docs build) — no required check is red or pending.
Did not run: a local build/test/clippy pass (relied on CI, consistent with the PR's own disclosure that the Windows DXGI/FFI path has unit coverage only, no integration run against real hardware). To check for an existing marked review at this exact head before starting, I read the prior review bodies on this PR via the API; the seven blind fan-out passes above were never shown that content. Not reconciled against any discussion on this PR beyond that marker check.
🤖 Automated by an AI agent
| // nothing else to tell the two kinds of number apart. | ||
| if memory.is_shared_pool() { | ||
| estimate.notes.push( | ||
| "this host's integrated GPU has no dedicated VRAM: the memory compared against is \ |
There was a problem hiding this comment.
Blocking — self-contradictory output: this note says "no dedicated VRAM," but the evidence line printed just above it in the same report still says "the GPU with the most dedicated VRAM."
evidence_lines (this file, ~line 1145-1151, unchanged by this PR) unconditionally renders:
"the GPU with the most dedicated VRAM that ROCm can see has {offered} MiB ({}) in total; memory other processes already hold is not subtracted"
whenever estimate.available_gib.is_some() — which is also true for the new Unified case this note handles. model_readiness.rs:992 extends readiness.evidence with evidence_lines(&estimate), and render_model_readiness_text prints evidence bullets ( - …) before printing estimate.notes ( note: …) in the same report (verified by reading both call sites). So on an APU with a readable shared pool, a GGUF-outside-the-catalog estimate currently prints both:
- the GPU with the most dedicated VRAM that ROCm can see has 24576 MiB (24.0 GiB) in total; ...
note: this host's integrated GPU has no dedicated VRAM: the memory compared against is the ceiling on a pool it shares with the operating system, ...
— directly contradicting itself in the same output. No test exercises evidence_lines with AcceleratorMemory::Unified (the new unit test for this note only checks .notes, not .evidence).
Confidence 90 · logic · Fix: branch the wording in evidence_lines on memory.is_shared_pool() (or thread a flag through ContextEstimate alongside conservative_ceiling), the same way this note itself is gated.
| // this at best" rather than "this much is waiting for it". Said on the | ||
| // estimate itself, because the figure is printed beside the totals with | ||
| // nothing else to tell the two kinds of number apart. | ||
| if memory.is_shared_pool() { |
There was a problem hiding this comment.
Blocking — this user-visible note has no Gherkin scenario, only a unit test.
This "shared pool is a ceiling, not free memory" note is new, user-observable text (ContextEstimate.notes is a public, serialized field reaching --json), covered only by the new unit test a_shared_pool_is_compared_against_its_ceiling_and_said_to_be_shared. AGENTS.md §3 is explicit that a unit test does not discharge this for user-observable CLI behavior — it proves the function, not the behavior. Verified independently: zero occurrences of this note's wording ("shares with the operating system", "no dedicated VRAM... ceiling") anywhere under tests/e2e-cucumber/; the existing GGUF scenarios (diagnose-49/-50) never combine a GGUF-outside-the-catalog model with an APU/shared-pool host. No PR-text justification for the omission is present either.
Confidence 85 · architectural (process/coverage) · Fix: add a scenario driving a GGUF estimate on a shared-pool host and asserting this note appears, or state in the PR text why one is impractical.
| // terms answer different questions -- "does it use the GPU" and "did we | ||
| // weigh it against the pool" -- and only the second licenses this verdict. | ||
| if host.accelerator_memory.is_shared_pool() | ||
| && requires_gpu(recipe) |
There was a problem hiding this comment.
Blocking — the cpu_only-recipe immunity this gate grants has no Gherkin scenario, only a unit test.
This requires_gpu(recipe) condition (together with required.is_some(), added by the final commit on this branch to close the previous review round's finding) is what keeps a cpu_only recipe from being softened to Degraded on a shared-pool host — new, user-observable CLI behavior (whether the verdict is downgraded). It's covered only by the unit test a_cpu_only_recipe_is_not_degraded_by_a_shared_pool_it_never_uses. Per AGENTS.md §3, a unit test does not discharge the Gherkin-scenario requirement for user-observable behavior. Verified independently: zero occurrences of "cpu_only"/"cpu-only" anywhere under tests/e2e-cucumber/, and the PR body's mutation-evidence table cites only this unit test's name for this row, with no scenario id and no stated justification for its absence.
Confidence 85 · architectural (process/coverage) · Fix: add a diagnose.feature scenario covering this, or state in the PR text why one is impractical.
| # withholds every row first, and the answer is "GPU memory unmeasured" before | ||
| # the aperture is ever consulted -- so the scenario plants a stub `amd-smi` | ||
| # reporting the one compute device, alongside the two cards in sysfs. The | ||
| # premise it rests on is diagnose-68: the same APU with the same readable |
There was a problem hiding this comment.
Non-blocking — wrong scenario cross-reference: this says diagnose-68, but the scenario actually being described is diagnose-71.
diagnose-68 ("A fix whose helper command never finishes says the change may be partial...") is unrelated to APUs/memory. The scenario this comment means — "the same APU with the same readable 60 GiB aperture, alone, does get a figure" — is diagnose-71 ("An integrated GPU is judged on the pool it allocates from, not its carve-out"), confirmed at line 1074. The matching comment in diagnose_steps.rs (~line 532-535) correctly says diagnose-71. This is a copy/renumbering slip confined to this one comment; the scenario IDs themselves have no gaps or duplicates.
Confidence 95 · mechanical · Fix: change "diagnose-68" to "diagnose-71" here.
| | [`host_gpu/linux.rs`](../crates/rocm-core/src/host_gpu/linux.rs) | Linux sysfs, KFD and DRM probes: the KFD topology, the DRM ip-discovery gfx target, the amdgpu device and driver version, the primary GPU name. | domain | | ||
| | [`host_gpu/os_facts.rs`](../crates/rocm-core/src/host_gpu/os_facts.rs) | Kernel version, distro name, installed RAM, and the CPU model and vendor for the host summary. One reader returns the CPU model and vendor together for both the summary and `Examination::probe`: Linux from `/proc/cpuinfo`, Windows from the CPU row of the system inventory. `detect_kernel_version` is now the only `uname -r` reader; [`examine/host_env.rs`](../crates/rocm-core/src/examine/host_env.rs)'s `probe_os` calls it for the examination's `kernel_release`. | domain | | ||
| | [`host_gpu/render.rs`](../crates/rocm-core/src/host_gpu/render.rs) | The `rocm examine` text rendering of an `ExamineSummary`. | domain | | ||
| | [`host_gpu/unified_memory.rs`](../crates/rocm-core/src/host_gpu/unified_memory.rs) | The memory pool an APU's engine actually allocates a model from, which is neither the BIOS VRAM carve-out every adapter query reports nor installed RAM: `mem_info_gtt_total` from the amdgpu DRM device directory on Linux, `DXGI_ADAPTER_DESC1::SharedSystemMemory` on Windows — read through hand-written DXGI vtable declarations, because `windows-sys` carries no COM interfaces — behind `detect_host_unified_memory_gib`. The adapter choice and the "a reading too small to be a pool is a failed measurement" rule are pure functions tested on every platform. | domain | |
There was a problem hiding this comment.
Non-blocking — the gguf_fit.rs entry a few lines above this hunk (line ~314, unchanged by this PR) is now stale.
It still reads "Pure arithmetic on whether a GGUF model fits in GPU memory at a context size: weights, KV cache, compute buffer and reserve against VRAM." This PR's own updated doc comments inside gguf_fit.rs now describe the comparison as being against "the memory the host's engine would allocate from: a discrete card's dedicated VRAM, or — since this PR — the ceiling on the shared pool an APU draws on." The architecture.md row wasn't updated to match, unlike the model_readiness.rs entry in this same hunk, which was. cargo xtask check-architecture-doc only checks presence of an entry for a file, not that its description stays true (AGENTS.md §6 notes this explicitly is still on the author).
Confidence 72 · mechanical · Fix: append something like "...against VRAM, or an APU's shared-pool ceiling" to the gguf_fit.rs row.
Review finding, and one four earlier rounds missed: `evidence_lines`
rendered "the GPU with the most dedicated VRAM that ROCm can see has {N}
MiB" whenever `available_gib` was set, which is also true for the new
`Unified` case. `model_readiness` prints evidence bullets above the
estimate's notes in one report, so an APU got that line a few lines above
"this host's integrated GPU has no dedicated VRAM".
The two renderers were deriving the same fact separately and only one of them
had been taught about shared pools. `ContextEstimate` now carries
`available_is_shared_pool`, set where the note is pushed, so both describe
the figure from one source rather than two. The evidence line says "the pool
this host's integrated GPU allocates from ... a ceiling it shares with the
operating system" in that case.
Pinned by `the_evidence_line_and_the_note_cannot_disagree_about_what_the_
figure_is`, which asserts the relation between the two renderers across both
memory kinds rather than two literal strings, so rewording either cannot
restore the contradiction. Mutation-checked: neutering the branch reproduces
it verbatim.
Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
The new finding is real and I have fixed it ( Blocking 1 — the self-contradicting report — fixed. The root of it is that the two renderers were deriving the same fact independently and only one had been taught about shared pools. Rather than branch the wording in a second place and leave the same trap for the next renderer, Pinned by Blocking 2 and 3 — the two missing Gherkin scenarios — still open, and still the honest answer. The GGUF shared-pool note and the Blocking 4 — Non-blocking: the wrong scenario cross-reference in Decisions: DXGI partial enumeration remains the intended tradeoff, as the PR body states. One fixed, four open. CHANGES_REQUESTED stands. |
… claimed Three stale descriptions of the figure this change made shared-pool-capable, all flagged across earlier review rounds and all deferred behind the code findings until now. skills/rocm-doctor/reference.md: `available_gib` was described as "the total dedicated VRAM of the GPU with the most of it". It now also carries an integrated GPU's shared-pool ceiling, which by this change's own evidence text is explicitly not dedicated VRAM. This file is the rocm-doctor skill's ground truth, so a wrong claim here is one an assistant repeats. It now names both cases and points at `available_is_shared_pool` as the only way to tell them apart from the number alone. docs/architecture.md: the `gguf_fit.rs` row still said the comparison is "against VRAM". tests/e2e-cucumber/features/diagnose.feature: a comment named diagnose-68 as the premise its two-card scenario rests on; after the merge that scenario is diagnose-71, and diagnose-68 is main's unrelated fix-timeout scenario. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
Closing the three doc items I had been deferring ( Blocking 4 — Non-blocking — Non-blocking — the scenario cross-reference — fixed. The comment named Verified on Linux: Still open, and these are the real remainder: the two missing Gherkin scenarios — the GGUF shared-pool note and the CHANGES_REQUESTED stands. |
…note as behaviour Both were new user-observable behaviour with only a unit test behind them, which proves the function and not the behaviour. Neither was impractical to simulate: the APU scenarios beside them already plant a host through ROCM_CLI_TEST_HOST_ROOT. diagnose-75 needs a cpu_only recipe and the shipped catalog has none -- all 49 entries are gpu_required or gpu_preferred -- so it plants a signed recipe index holding the smallest curated recipe twice, once as shipped and once with its device policy and GPU minimum removed, and asks about both on one planted APU. The second half is the premise: the same host must still soften a recipe that does need the GPU, or the first half would pass against a check someone had deleted outright. diagnose-76 is the same planted APU and diagnose-49's tiny GGUF. It asserts the aperture is the figure compared against before it looks for the note: a host that fell back to cannot_estimate carries no figure at all, and a scenario that only looked for a wording would pass against that while exercising nothing. Writing them turned up a trap in the harness. scenario_command takes command_env rather than borrowing it, so a Given's fixture reaches exactly one child process; a scenario that asks two questions of the same host gets the runner's real machine for the second. The first draft of diagnose-75 answered about a dev box's 191.9 GiB MI300X out of the built-in catalog while reading as though it answered about the planted APU. ask_again_on_the_same_planted_machine restores the environment between questions, and the first half now asserts the planted 60 GiB aperture so a leak fails loudly instead of changing the subject. Mutation-tested: dropping the requires_gpu/required.is_some() gate turns diagnose-75 red (degraded, expected ready); dropping the estimator's is_shared_pool note turns diagnose-76 red, both when the whole block goes and when only the notes.push does, leaving the flag set. The signed-index keygen/sign dance is factored out of the RAM-degraded fixture rather than copied a third time. ROCMAI-912 Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
Both findings are closed with scenarios rather than a stated reason. You were right that a justification would have been dodging — nothing made either impractical to simulate. Finding A — the The shipped catalog has no Mutation: dropping Finding B — the GGUF estimator's shared-pool note. It asserts the 60 GiB aperture is the figure compared against before it looks for the note, for the reason Mutation, twice: removing the whole One thing the work turned up that is worth flagging beyond this PR. Also folded in: the signed-index keygen/sign dance is factored out of the RAM-degraded fixture rather than copied a third time, and the mutation-evidence table in the PR body now names Gates, all on a Linux ROCm box: One pre-existing red on that box I did not cause and did not touch: |
|
One correction to my previous comment, before it misleads anyone. I reported
The check that settles it: this PR's CI reports no failures, and Worth recording as a trap, since The two new scenarios and their mutation evidence are unaffected by this correction. |
|
Every finding from the latest round is now addressed, so I am re-requesting review. Verified each against the code rather than against my own commit messages:
Both new scenarios are Two things worth flagging rather than burying: No shipped recipe is A trap we hit and fixed in the first draft: The decisions you raised stand as answered: DXGI partial enumeration remains the intended tradeoff, |
juhovainio
left a comment
There was a problem hiding this comment.
Review — needs work
Full review of the whole change (17 files, +2653/-194, base ca170c9965cdafacf5ded70b9c85265bd3c25910 → head 97afa1ff2cc4bd0c9b668eadb59ddaaf4b084b11), read completely across six fan-out passes.
Implements the GTT/DXGI shared-memory-pool measurement portion of ROCMAI-912 (reading the real pool an AMD APU's engine allocates from and capping the verdict at Degraded); the description itself scopes out free-memory measurement, BIOS/gttsize guidance, and SVM-mapping-failure detection as separate work, and that boundary matches what the diff actually contains. Ticket ROCMAI-912 named but not retrieved (ticket-tracker lookups are out of scope for this review on a public repo).
This PR has a long review history on this account; this is a fresh pass at a new head (97afa1ff2) that advanced past the last marked review (60c29d572). I independently re-verified, against the current code rather than against commit messages, that every blocking item from the most recent prior round is genuinely fixed here: the gpu_required-with-no-declared-minimum gate now requires required.is_some() in addition to requires_gpu(recipe) (model_readiness.rs:680), confirmed against the shipped catalog; the GGUF shared-pool note and the cpu_only exemption each now have their own Gherkin scenarios (diagnose-75, diagnose-76); the evidence_lines-vs-notes self-contradiction is fixed via a threaded available_is_shared_pool flag with a relational test; and skills/rocm-doctor/reference.md's stale available_gib claim is corrected. The two non-blocking leftovers from that round (a stale scenario cross-reference in a feature-file comment, and a stale docs/architecture.md row for gguf_fit.rs) are also fixed. The two findings below are new ground past what those rounds covered.
Blocking
-
gguf_fit.rs's module-level doc comment still claims the comparison is always against "dedicated VRAM" —crates/rocm-core/src/gguf_fit.rs:8(not touched by this diff's hunks, so this cannot be anchored as an inline comment)
The module doc reads: "Weights plus KV cache plus a compute buffer plus a runtime reserve, compared against the dedicated VRAM the readiness check already reads." This is exactly the claim the rest of this PR corrects:estimate_fitnow also compares againstAcceleratorMemory::Unified's shared-pool ceiling (gated byis_shared_pool()atgguf_fit.rs:876-884), and every other doc comment in this same file that makes this claim —EstimateOutcome::Fits/DoesNotFit(lines 176-190),ContextEstimate::available_gib/available_is_shared_pool(lines 285-301) — was carefully updated in this PR to say "a discrete card's dedicated VRAM, or an APU's ceiling." This one line was missed and now directly contradicts the code it summarizes, one screen below the up-to-date docs for the type it describes.
Confidence 85 · mechanical · Fix: reword the module doc's opening line to match the updatedEstimateOutcomedoc. -
The branch that preserves an existing system-RAM remediation when the shared-pool gate also fires has no test —
crates/rocm-core/src/model_readiness.rs:680-723(inline comment posted on line 688)
See inline comment for the full trace: no test combines a shared pool with a host alreadyDegradedfrom the system-RAM check before this gate runs, so theif was_ready { ... }guard protecting that remediation from being overwritten is unexercised.
Confidence 80 · logic · Fix: add a test withAcceleratorMemory::Unified{..}ample for the recipe's GPU minimum, combined with lowsystem_ram_gib, assertingDegradedwith the system-RAMverifypreserved.
Non-blocking
None.
Decisions for the author
- DXGI partial enumeration (a non-
NOT_FOUNDEnumAdapters1error, or aGetDesc1failure on an enumerated adapter) is treated as if the adapter list were complete — answered-by-intent
PR body, Scope section: "Partial DXGI enumeration is treated as a complete answer. AnEnumAdapters1error other thanDXGI_ERROR_NOT_FOUNDends the adapter loop the same way the clean end of the list does, so a second AMD adapter sitting past a transient error would be missed and the first one's budget confidently attributed.NOT_FOUNDis what that call returns at the true end of the list in practice, and the Windows path is unexecuted either way, so this is left as known and untested rather than guessed at." This also covers the structurally identicalGetDesc1-failure path (an adapter silently dropped from consideration rather than making the result conservative, unlike the sibling Linux GTT reader added in the same PR, which counts AMD-card identity independently of telemetry-read success). Would otherwise have been a blocking architectural finding — it is a real, confirmed gap in the module's central "exactly one AMD adapter" safety invariant, with no test exercising either early-exit path. Retired because the author already named and reasoned about the general shape of this gap. Confirm this remains the intended tradeoff before the Windows path gets real execution coverage. vram_carveout_gibis currently write-only — non-blocking-improvement
Computed and stored on everyAcceleratorMemory::Unifiedvalue, but nothing in production reads it (measured_gib()discards it via..). Its own doc comment says it's kept only so a report can show the two figures side by side, and that is not in this PR's stated scope one way or the other, so this isn't retired as answered-by-intent — but it's a reasonable, low-severity completeness gap rather than dead code proper (it is written and carried, just never rendered). Either wire it into an actual report line, or state it's reserved for a specific future change.
Positive signals
- The shared-pool
Degradedgate'sis_shared_pool() && requires_gpu(recipe) && required.is_some()guard correctly handles the "GPU-requiring recipe with no declared minimum" edge case, backed by a catalog-driven (not synthetic) regression test verified directly against the seven shipped recipes with exactly that shape. gguf_fit.rs'savailable_is_shared_poolfield is threaded through soevidence_linesand the shared-pool note inestimate.notescannot independently derive and then disagree about the same figure — backed by a relational (not string-literal) test whose own comment documents the earlier bug it exists to catch.the_shared_pool_plan_names_no_check_that_can_never_clearis genuinely mutation-aware: it asks the same question twice to prove the "no verify line" premise rather than asserting it from the source.- The e2e harness's
command_env-consumed-by-value trap (aGiven's fixture reaching only the first of twoWhenquestions in one scenario) was caught and fixed withask_again_on_the_same_planted_machine, which re-asserts the planted figure on the second question so a future leak fails loudly instead of silently answering about the runner's own hardware. - The Windows DXGI/COM FFI — GUIDs, struct layout, vtable order, reference-counting on every path including early returns and the
GetDesc1-failure branch, and the pointer-width read ofSharedSystemMemoryavoiding 32-bit saturation — is correct on close inspection, despite having zero execution coverage. - User-facing docs (README.md, docs/architecture.md, docs/manual-testing.md, docs/testing.md, skills/rocm-doctor/reference.md) are thoroughly and consistently updated everywhere the old "undetermined"/"dedicated VRAM" claim lived; a full-file (not just diff) sweep found no remaining stale occurrence.
Deployment notes
Changes rocm diagnose --model's observable output for APU hosts whose shared pool is readable: previously undetermined/unified_memory_unreadable, now a measured figure with the verdict capped at degraded (never ready). Anything scripting against the old undetermined value for these hosts will see different output. No migration needed; the change is additive (new enum variant, new serde-compatible available_is_shared_pool field).
What this covered
Full diff ca170c9965cdafacf5ded70b9c85265bd3c25910...97afa1ff2cc4bd0c9b668eadb59ddaaf4b084b11 (17 files, +2653/-194), read completely across six fan-out passes, each blind (no PR description, ticket, or review-thread content): (1) the Linux/Windows measurement layer and its FFI (host_gpu.rs, host_gpu/linux.rs, host_gpu/unified_memory.rs, lib.rs, Cargo.toml, gpu_policy.rs); (2) the classification/verdict/estimator layer plus CLI help text (model_readiness.rs, gguf_fit.rs, model_fit.rs, cli.rs); (3) the e2e scenarios and step definitions (diagnose.feature, diagnose_steps.rs); (4) user-facing docs; (5) an AGENTS.md-adherence and code-comment-accuracy sweep; (6) commit/version history across all 17 commits. Passes (1), (2), (4), (5) and (6) ran as independent background workers; pass (3) could not be spawned as an independent worker after repeated attempts failed on a concurrency limit shared across other sessions on this host, so I read it myself in the same context as this report — flagged here as not independent, per the method's own fallback for a worker that cannot be spawned.
Supplemented directly: the shipped model catalog JSON (confirming the "seven recipes" and "cpu_only" claims), direct re-verification of the required.is_some() gate, the evidence_lines/notes relation test, and the two previously-flagged non-blocking doc items from the prior round. CI: all 40 reported checks are green at this head (build-and-test and clippy on both Linux and Windows, both E2E lanes, the Windows release build/lifecycle job, Sphinx docs build, commit-signature verification, security scans, skill checks) — no required check is red or pending.
Did not run: a local build/test/clippy pass (relied on CI, consistent with the PR's own disclosure that the Windows DXGI/FFI path has unit coverage only, no integration run against real hardware). Reconciliation against the five prior review rounds' threads on this PR was done only after the findings above were locked blind, per the method's ordering; it is reflected in the "genuinely fixed" statement above rather than in the findings themselves.
🤖 Automated by an AI agent
| ModelVerdict::Ready | ModelVerdict::Degraded | ||
| ) | ||
| { | ||
| let was_ready = readiness.verdict == ModelVerdict::Ready; |
There was a problem hiding this comment.
Blocking: the "preserve the system-RAM remediation" branch (if was_ready { ... } below) has no test combining a shared pool with a host already Degraded from the system-RAM check before this gate runs.
Every existing test that reaches this gate (an_apu_with_a_readable_pool_is_degraded_never_ready, the_shared_pool_plan_names_no_check_that_can_never_clear, a_cpu_only_recipe_is_not_degraded_by_a_shared_pool_it_never_uses, a_gpu_recipe_with_no_declared_minimum_is_not_degraded_by_a_pool_it_was_never_weighed_against) sets system_ram_gib comfortably above the recipe's recommendation, so was_ready stays true in all of them. The sibling test for the system-RAM path alone, a_host_below_the_recommended_system_ram_is_degraded_not_blocked, uses AcceleratorMemory::Dedicated(64.0), not a shared pool. So nothing exercises the case this comment block exists to handle: a shared-pool host that was already Degraded from the system-RAM check reaching this gate with was_ready == false. Deleting or inverting the if was_ready condition — e.g. always overwriting readiness.fix with the "just serve it" plan, silently dropping the system-RAM remediation's verify: rocm diagnose --model ... — would not be caught by any test in the suite today.
Confidence 80 · logic · Fix: add a test with AcceleratorMemory::Unified{..} ample enough to clear the recipe's GPU minimum, combined with system_ram_gib below the recipe's recommended_system_ram_gb, asserting the verdict is Degraded and that fix still carries the system-RAM check's verify/summary rather than the shared-pool "nothing is broken, just serve it" plan.
… RAM fix Two review findings. crates/rocm-core/src/gguf_fit.rs:8 still opened by saying the comparison is "against the dedicated VRAM the readiness check already reads" -- the exact claim the rest of this change corrects. Every other doc in the file saying it was updated; this one was missed, so the module summary contradicted the types documented one screen below it. The `if was_ready` guard in `model_readiness.rs` had no test. It stops the shared-pool gate writing its own `fix` over one an earlier check already wrote, which matters because the gate's `Degraded` deliberately carries no `verify` -- replacing a system-RAM remediation with it takes away the one actionable step the user had. Nothing combined the two: every shared-pool test had ample RAM and every system-RAM test had a dedicated card. `a_host_already_softened_for_system_ram_keeps_that_remediation` plants an ample shared pool with low system RAM so both softenings fire, and asserts both premises as well as the outcome. Mutation-checked: forcing the guard true replaces the fix with the gate's own, empty-`verify` one, which is the defect stated plainly. Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
|
Both findings fixed in Blocking 1 — Blocking 2 — the untested
Mutation evidence, forcing the guard true: An empty Decisions: DXGI partial enumeration remains the intended tradeoff, as the PR body states — confirmed. Verified on Linux: |
Why
rocm diagnose --modelcould not answer "will this model fit" on any AMD APU.An APU has no private VRAM.
amd-smiand every Windows adapter query report the fixed BIOS carve-out as the device's memory — 512 MiB measured on a Ryzen 7 4700U, ~4 GiB on a Strix Halo — while the engine allocates out of system memory the GPU is given an aperture onto. Comparing a recipe minimum against the carve-out refuses nearly every curated model on machines that demonstrably serve them, so the classification answeredUnifiedMemoryUnreadableand the verdict came back undetermined, on the stated grounds that the real pool "is not readable by anything in this binary today".It is readable, and that sentence was the defect.
What changes
The aperture is read where the kernel and the driver actually publish it:
mem_info_gtt_totalmem_info_vram_totalthe carve-out comes fromDXGI_ADAPTER_DESC1::SharedSystemMemoryNeither is installed RAM nor a fraction of it. Half of RAM is an assertion about driver policy; BIOS settings and
amdgpu.gttsizemove the real figure, so it is measured rather than inferred.A fit against that figure yields
Degraded, neverReady. The pool is shared with the operating system, so what was measured is a ceiling rather than an allocation, and nothing here measured how much of it is free. Below the ceiling the verdict still blocks, and says that freeing memory will not raise an aperture the driver will not hand out.UnifiedMemoryUnreadablesurvives, narrowed to its true meaning: an APU whose figure was absent or unparseable on this host. It keeps its distance fromAcceleratorMemoryUnknown, whose "runamd-smiagain" remediation would still be a dead end here.The aperture is consulted only on the APU branch. Both files exist on a discrete card too, and crediting one with the other would report an RX 7900 as having 24 + 64 GiB, after which everything fits.
The same ambiguity is refused one level down, on both platforms: the figure is per-device, so a host showing more than one AMD adapter yields no figure at all rather than the larger of two. On an APU paired with a discrete Radeon there is nothing at that point that says which adapter is the integrated one, and picking would credit the APU with the discrete card's pool.
A
cpu_onlyrecipe is left alone. The shared-pool check is the last thing the assessment does and originally fired on the host alone, so a recipe that never allocates from the accelerator was softened toDegradedand handed a remediation for a device it does not touch — on evidence no earlier branch had put in the report. It is now gated onrequires_gpu, as the "no GPU is visible" check beside it already was.The
Degradedplan names no check that can never pass. That verdict is forced by the host whenever the pool is shared and the recipe needs the GPU, so theverify: rocm diagnose --model <model>the plan used to carry reprinted the identical verdict however much the user closed — a loop with no exit, which reads as a check the user failed to satisfy rather than one that cannot be. The plan now names the one thing that does settle it (rocm serve), states in its note that this check cannot read how much of the pool is free so re-asking reports the same thing, and carries noverifyat all; the renderer omits an empty one.The GGUF estimator says the figure it compared against is shared. A
fitson an APU means "the machine would allow this at best", not "this much is waiting for it", and the note on the estimate says so — the figure is printed beside the totals with nothing else to tell the two kinds of number apart.User-facing text that still described the old behaviour was corrected with it:
README.md,docs/manual-testing.md, and the--model/--context-sizehelp inapps/rocm/src/cli.rsall said an APU's pool "can't be read" / answers "undeterminedby design" / that the comparison is "against the dedicated VRAM of the GPU".Verification
Full gate on a Linux ROCm box (MI300X, gfx942):
fmt --all --check,clippy --workspace --all-targets -D warnings,clippy -p e2e-cucumber --test e2e -D warnings,test -p e2e-cucumber --test feature_naming,xtask check-architecture-doc,xtask check-crate-edges,xtask check-module-size,test -p rocm-core(1584 passed),test -p rocm --bin rocm(1904 passed).Mutation evidence — each check was confirmed to fail against deliberately broken production code:
the_gtt_aperture_never_reaches_a_discrete_card, scenariodiagnose-73(@id:diagnose-model-a-discrete-card-is-never-credited-with-the-aperture)Readyan_apu_whose_pool_clears_the_minimum_is_degraded_not_ready,an_apu_with_a_readable_pool_is_degraded_never_ready, scenariodiagnose-71(@id:diagnose-model-an-apu-is-measured-on-its-shared-pool)diagnose-72(@id:diagnose-model-an-unreadable-shared-pool-is-said-not-guessed)two_amd_adapters_leave_the_shared_budget_unattributable,two_amd_cards_leave_the_gtt_aperture_unattributable, scenariodiagnose-74(@id:diagnose-model-two-amd-cards-leave-the-pool-unattributable)requires_gpu(recipe) && required.is_some()gate removed, softening acpu_onlyrecipea_cpu_only_recipe_is_not_degraded_by_a_shared_pool_it_never_uses, scenariodiagnose-75(@id:diagnose-model-a-cpu-only-recipe-is-not-softened-by-a-pool-it-never-uses) — the scenario's first half goes red (left: "degraded",right: "ready")verifyrestored on theDegradedplanthe_shared_pool_plan_names_no_check_that_can_never_clear— the only failure in the suitea_shared_pool_is_compared_against_its_ceiling_and_said_to_be_shared, scenariodiagnose-76(@id:diagnose-model-a-gguf-estimate-says-its-pool-is-shared) — red both when the wholeis_shared_pool()block goes and when only thenotes.pushdoes, leaving the flag setif true)DedicatedandUnknownThe last two behaviours that had only unit coverage now have scenarios of their own,
diagnose-75anddiagnose-76, both Linux-gated and both running on the GPU-less mock lane like the four APU scenarios above them.diagnose-75needs acpu_onlyrecipe, and all 49 shipped recipes aregpu_requiredorgpu_preferred, so it plants a signed recipe index — the only way the CLI loads another catalog — holding the smallest curated recipe twice, once as shipped and once with its device policy and GPU minimum removed, and asks about both on the same planted APU: the first half is the immunity, the second is the premise that the host would otherwise soften.Writing it surfaced a harness trap worth naming.
scenario_commandtakescommand_envrather than borrowing it, so aGiven's fixture reaches exactly one child process; a scenario that asks two questions of the same host silently gets the runner's real machine for the second. The first draft ofdiagnose-75answered about this box's 191.9 GiB MI300X out of the built-in catalog while reading as though it answered about the planted APU.ask_again_on_the_same_planted_machinerestores the environment between questions, and the first half now asserts the planted 60 GiB aperture so a leak fails loudly instead of changing the subject.Not verified: the Windows path has never executed. The workspace cannot cross-compile, so it was type-checked and clippy-checked against
x86_64-pc-windows-msvcin isolation and has unit coverage only. Its DXGI vtable offsets and COM lifetimes are unexercised by any running binary. That gap is written into the testing guide beside the coverage it qualifies, so it outlives this description: the adapter choice and the implausible-reading rule are pure functions tested on every platform, and the FFI around them is tested by nothing.Also unverified by construction: the
windows-sysfeature list. Nothing in the Linux or macOS toolchain here builds the MSVC target, so the merge resolution below was checked as a set operation rather than by compiling.Scope
windows-sys0.61 carries no COM interfaces at all — there is noWin32_Graphics_Dxgifeature to enable — so the three vtable slots that are read are hand-declared anddxgi.dllis loaded by absolute System32 path. The alternative was taking on thewindowscrate for three struct fields.mainadded aWin32_Security_Authorizationfeature to the same list after this branch was cut. The merge keeps both sides: windows-sys features are additive, so the resolution is the strict union (8 + 8 distinct features in, 9 out, with every feature from either side present).Non-goals, where a reviewer may wonder why this stops where it does:
Degraded, and why its plan now says so rather than offering a check to re-run.amdgpu.gttsizerecommendation, and noSVM mapping faileddetection. ROCMAI-912 also describes those; they are a separatediagnoseconcern and need none of this.EnumAdapters1error other thanDXGI_ERROR_NOT_FOUNDends the adapter loop the same way the clean end of the list does, so a second AMD adapter sitting past a transient error would be missed and the first one's budget confidently attributed.NOT_FOUNDis what that call returns at the true end of the list in practice, and the Windows path is unexecuted either way, so this is left as known and untested rather than guessed at.One adjacent fix rides along because the scenarios cannot exist without it: the serve path's DRM read now goes through
host_pathlike every other DRM read, so a simulated host root reaches it.hardware_root's module doc already listed that path as re-rooted, and this was the one caller naming it directly.