Repository navigation
Conversation
tomastola
left a comment
There was a problem hiding this comment.
Review of #728: needs work
The production fix is correct, and the doc comments now match the code. The PR is held back by two gaps around the new behaviour: one guard has no test, and there is no e2e scenario.
Full review of the whole change (one commit, apps/rocm/src/therock.rs).
No ticket named. It is a follow-up to #566, and the description matches what the diff does.
Blocking
-
The new empty-tail guard is not tested —
apps/rocm/src/therock.rs:6953, test at:12127- The new condition has two parts:
!tail.is_empty() && tail.chars().all(|c| c.is_ascii_digit()). - I removed
!tail.is_empty()and rancargo test -p rocm --bin rocm -- host_version. All 3 tests still passed. - Without the guard,
.all()is vacuously true on an empty tail. So7.2.4-would quietly be read as7.2.4, when today (and under the old rule) it isNone. - The repo's AGENTS.md rule ("test fails before fix and passes after fix") covers the reverted fix. It does not cover this branch.
- Confidence 100 · logic · Fix: add
assert_eq!(parse_host_version("7.2.4-"), None);.
- The new condition has two parts:
-
No e2e scenario, and no stated reason for skipping one —
apps/rocm/src/therock.rs:6948- AGENTS.md §3: "If the change alters what a user of the CLI can observe — command output … that behavior must be covered by a Gherkin scenario … a unit test asserting the internal helper does NOT discharge this."
- The description itself says the install-time
version_note"now never appears" for a mixed-suffix host. That is a change in command output. - No scenario in
tests/e2e-cucumber/covers the host-newer note. A grep forthis host reports ROCm,version_noteandhost.*newerfinds nothing. - The description explains why the
update-scenarios are unaffected, but never addresses the scenario rule for the install path. - A scenario looks practical:
plant_unmanaged_rocm(tests/e2e-cucumber/tests/e2e.rs:579) already writes.info/version. - Confidence 85 · convention · Fix: either add a scenario that plants
.info/versionwith a mixed suffix and asserts the note is absent, or state in the PR text why one is not warranted.
Non-blocking
- The last assertion in the new test duplicates an existing one —
apps/rocm/src/therock.rs:12149-12152host_version_newer_than(Some("7.20.1-33"), "7.13.0") == Some("7.20.1-33")is already asserted, word for word, at:12117-12120.- Confidence 85 · mechanical · Fix: delete it, or replace it with the
7.2.4-case above.
Decisions for the author
- Other packaging tails now become "can't tell" too — tradeoff
-
The all-digit rule rejects more than
98rc1. Tracing by hand (not run):Host string Old rule New rule 7.2.4-98.el97.2.4 None6.4.1-120~22.046.4.1 None7.2.4-98-17.2.4 None7.2.4-98+local7.2.4 None -
The
+localcase is a little inconsistent.split_once('-')runs before the ordering parser strips+…, so7.2.4+local-98parses but7.2.4-98+localdoes not. -
Real risk looks low. The host string comes from
.info/version*or therocm-X.Y.Zdirectory name (crates/rocm-core/src/rocm_install.rs:210)..info/versionis normallyX.Y.Z-N, and I could not confirm whatversion-utilsorversion-libscontain on real installs. The worst case is a missing note, never a false one. -
Strict (current): no way to misread a version, at the cost of losing the note for distro-style tails.
-
Lenient alternative: drop the leading digit run when it is followed by end,
.,~,+or-, and reject only when letters follow directly (the98rc1case). -
Either way, a couple of these shapes as test cases would put the choice on record.
-
Positive signals
host_version_newer_than("7.20.1-33rc1", "7.13.0").is_none()tests what the user sees: under the old rule it would have produced a false "host is newer" note.- The new doc paragraph explains why checking only that the suffix starts with a digit was wrong, which stops it coming back.
- The change is confined to the host-parsing path. The comparator,
version_relationand the update flow are untouched.
Deployment notes
None.
nowycondro
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · 034970b
This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer.
Review — needs work
Full review of the whole change (prw-base 1c33248…pr-728 034970b). Implements and fully closes ROCMAI-674 ("a host ROCm version with a mixed build suffix such as 7.2.4-98rc1 is read as 7.2.4") — a narrow, self-contained fix with no unaddressed remainder.
Blocking
- CI is red on this commit, for reasons unrelated to the diff —
E2E tests (MI300X, current)(job 121516351833),E2E tests (Strix Halo, Windows, current)(job 121516351719), andE2E consolidated report (self-hosted)(job 121564010295, a cascade of the Windows failure not uploading its report artifact).
Traced both root causes directly from the job logs: the Windows lane fails downloading a TheRock tarball (HTTP error 403fromrepo.amd.com) before anyrocmcode under test runs; the MI300X lane fails scenariotherock-next-09-live-install-reports-vllm-rocm10x-discovery-pinson auv pip installdependency conflict between a nightlyvllmbuild and its pinnedamd-aiterversion — again before touchingparse_host_versionorhost_version_newer_than. Neither failure exercises the changed code path.build-and-test,windows-build-and-test,Test (affected crates), andclippyall pass, which is the evidence that actually bears on this change.
Confidence 85 · mechanical · Fix: rerun the two GPU lanes (or escalate per AGENTS.md §12's "infrastructure flakes" handling); no code change indicated.
Non-blocking
None
Decisions for the author
None
Positive signals
- The fix is traced correctly against every call site.
parse_host_versionhas exactly one production caller (host_version_newer_than), and the new all-digit check was verified by hand against every existing assertion (7.2.4-98,7.0.0-rc1,7.4,7.13.0-56,unknown) plus the new ones (7.2.4-98rc1,7.20.1-33rc1) — all parse exactly as documented, with no regression on the pre-existing testhost_version_newer_than_reports_only_a_strictly_newer_host. - The three doc comments describing the old "numeric suffix" rule were all updated to "all digits," consistently (
compare_version_strings's andparse_version_for_ordering's module docs, plusparse_host_version's own doc and inline comment) — a grep for the old wording turned up nothing stale. - The new test sits next to, and mirrors the structure of, the existing
host_version_newer_than_reports_only_a_strictly_newer_host, including a comment explaining the user-visible consequence of the fix, consistent with this file's documentation-heavy style.
Deployment notes
None — this narrows an existing edge case (an unreadable host version is treated as "can't tell" rather than silently misread); it does not change any CLI flag, message wording, or routing behavior, per the PR's own description, which this review's blind trace corroborates.
What this covered
Read completely: apps/rocm/src/therock.rs's changed region and its surrounding context — compare_version_strings, parse_version_for_ordering, parse_version_stage, split_leading_number, parse_version, parse_host_version, host_version_newer_than, host_rocm_version_newer_than, and wheel_host_version_note/tarball_host_version_note — plus the new and neighboring unit tests. Read AGENTS.md in full for agent-instruction adherence. Ran the history pass (git log, targeted git show) and traced parse_host_version to its introduction in #566 (same author), confirming this is a legitimate follow-up fix to that PR's own logic, matching the PR body's "follow-up to #566" claim. Checked impact: parse_host_version has exactly one caller, so the fix's blast radius is fully covered by the single changed call path.
Diff is small and tightly coupled to one function, its two doc sites, and one new test, so this ran as a single pass rather than a fan-out, per the task's own Step 3 guidance for a change this size.
Did not run: cargo test/cargo clippy locally — no Rust toolchain available in this sandbox; relied on manual trace of every branch (cross-checked against all assertions in both the new and pre-existing tests) plus GitHub's own Test (affected crates) and clippy checks, which both report success for this commit. "Prior-changes" pass found no separate review-thread history to check beyond the commit message of #566 (not retrieved as PR review discussion, consistent with this review's blind-findings rule). Not reconciled against any PR discussion or review comments — none were read, per this method's rule that discussion is never read even at Step 9.
|
🤖 Automated review (Claude Code) · 034970b Reviewed the single changed file, One low-confidence, non-blocking behavioral note: at I did not build or run the test suite myself (no Rust toolchain set up in this sandbox); I relied on manual tracing of the diff and the PR's reported local verification (fmt, 🤖 Generated with Claude Code |
tomastola
left a comment
There was a problem hiding this comment.
Re-review of #728: ready to approve
Every point from my previous review is answered.
This review covers only the new commit, 9cf7266, which adds tests only. The production fix from 034970b is unchanged, and I already reviewed it as correct. The branch still merges cleanly into current main. The new scenario IDs runtime-20 and runtime-21 don't clash with anything on main, which stops at runtime-19.
What happened to each point from my last review
| Point (034970b) | Status | Evidence |
|---|---|---|
| Blocking: the empty-tail guard had no test | Fixed | Adds assert_eq!(parse_host_version("7.2.4-"), None). I removed !tail.is_empty(), and the test now fails at therock.rs:12151 (left: Some(VersionOrderKey { release: [7, 2, 4], .. }), right: None). Before this commit, that mutation went unnoticed. |
| Blocking: no e2e scenario for the changed install-preview note | Fixed | Adds runtime-20 (a readable newer host such as 7.20.1-33 prints the version_note) and runtime-21 (the unreadable 7.20.1-33rc1 makes no newer-host claim). Both pass locally. I reverted the fix to the old starts_with rule, and runtime-21 fails, printing the false note: version_note: this host reports ROCm 7.20.1-33rc1, but 7.10.0 is … selected. So the scenario catches the original bug, not just the helper function. |
Non-blocking: duplicated 7.20.1-33 assertion |
Fixed | Removed. The same check still exists in the neighbouring test. |
| Decision: strict vs lenient handling of distro-style tails | Decided: strict, and now pinned by tests | Tests now assert that -98.el9, -120~22.04, -98-1 and -98+local are all unreadable. A comment says why: a host with such a version loses the note, but never gets a false one. That puts the choice on record. |
The new test code
runtime-20makesruntime-21meaningful. It shows the same preview printing the note when the host version is readable, so the note's absence inruntime-21is real evidence. Both step comments say so.runtime-20asserts the note text together with the selected artifact (tarball:andlatest_version: 7.10.0). That follows the AGENTS.md rule that a message must be asserted together with the behaviour it describes.- The scenarios need no network or GPU: they use a loopback catalog, a named
--familyand a planted.info/version. They're tagged@requires-os:linux, which is correct because--format tarballis refused on Windows. They should therefore run on the ordinary Linux E2E lane. plant_unmanaged_rocmnow delegates toplant_unmanaged_rocm_reporting("6.0.0"), so existing callers behave the same.
Blocking
None.
Non-blocking
- The PR description is out of date (PR body, "Test" section)
- It still describes only the unit test, and lists "
7.20.1-33still is [newer]" as one of that test's cases. This commit removed that assertion from the test. - It doesn't mention
runtime-20/runtime-21, the7.2.4-case, or the distro-tail cases. AGENTS.md asks the PR text to name the scenario that covers a user-visible change. - Confidence 90 · documentation · Fix: list the two scenario
@id:s and the new unit-test cases under "Test".
- It still describes only the unit test, and lists "
Decisions for the author
None left. The strict-vs-lenient question is settled and covered by tests.
Verification I ran (branch at 9cf7266, Linux)
cargo test -p rocm --bin rocm -- host_version: 3 tests pass.- With the emptiness guard removed: the new test fails. With it restored: it passes.
cargo test -p e2e-cucumber --test e2e -- -n "runtime-2[01]": 2 scenarios, 9 steps, all pass.- With the production fix reverted:
runtime-21fails with the false note shown above. cargo fmt --all -- --checkis clean.cargo clippy -p rocm -p e2e-cucumber --all-targets -- -D warningsis clean.
Note
CI has not run on 9cf7266 yet. The only result on the commit is Read the Docs (pass). There are no Actions runs at all (CI, CodeQL, E2E self-hosted), whereas 034970b got all three. The workflows may need re-triggering before merge; the local runs above are the only evidence so far.
parse_host_version's doc says only a numeric - suffix (a packaging build number such as 7.2.4-98) is dropped, but the check only looked at the first character of the suffix. A host string like 7.2.4-98rc1 therefore had -98rc1 silently dropped and was read as plain 7.2.4. Require the whole suffix to be digits. Any other suffix now stays on the string for the PEP 440 ordering parser, which reads 7.0.0-rc1 as a release candidate and cannot read 7.2.4-98rc1, so that host version is "can't tell" and produces no host-newer note at install time. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
…l note Address review on the all-digit host-version rule: - assert that `7.2.4-` is unreadable, which is what the emptiness guard protects (`.all()` holds vacuously on an empty tail); it replaces an assertion duplicated from the neighbouring test - pin that distro-style packaging tails (`-98.el9`, `-120~22.04`, `-98-1`, `-98+local`) are unreadable under the strict rule - add runtime-20 and runtime-21: a tarball install preview on a host whose own ROCm reports a newer version names it in a version_note, and a host version with an unreadable suffix produces no newer-host claim Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
9cf7266 to
cb98413
Compare
nowycondro
left a comment
There was a problem hiding this comment.
🤖 Automated review (Claude Code) · cb98413
This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer.
Review — needs work
Full review of the whole change (two commits: 0f3cc3a9 the production fix, cb984134 adding unit-test and e2e coverage), run as four independent fan-out passes (production-fix + unit-test; e2e scenarios + step definitions + helper; agent-instruction adherence against AGENTS.md; history and prior-review-applicability), then consolidated here.
Implements and fully closes Jira ROCMAI-674 ("a host ROCm version with a mixed build suffix such as 7.2.4-98rc1 is read as 7.2.4") — retrieved directly from Jira, and its description matches the PR's own account of the bug exactly, with no unaddressed remainder. The production fix matches both the ticket and the PR description; the PR description itself, however, does not mention everything the current diff contains (see Blocking).
Blocking
-
The PR description omits the second commit's additions — PR body ("Test" section); undocumented work lands at
tests/e2e-cucumber/features/runtime_setup.feature:431-453,tests/e2e-cucumber/tests/e2e/therock_steps.rs:1511-1596,apps/rocm/src/therock.rs:6151-6161,tests/e2e-cucumber/tests/e2e.rs:604-618
The live PR body's "Test" section still describes onlyparse_host_version_drops_only_an_all_digit_build_suffix's original cases (all-digit suffix,7.0.0-rc1,7.2.4-98rc1, and "7.20.1-33rc1is not reported as newer... while7.20.1-33still is"). It says nothing about the two new Gherkin scenarios (@id:runtime-install-preview-notes-newer-host-rocm/runtime-20,@id:runtime-install-preview-ignores-unreadable-host-rocm/runtime-21), the empty-tail case (7.2.4-), the four distro-packaging-tail cases, or theplant_unmanaged_rocm_reportinghelper — all of which are present at the current head. It also still claims "7.20.1-33still is [newer]" as one of the new test's own assertions, but that duplicate assertion was removed from the new test by the second commit (it now exists only in the neighboring pre-existing test).AGENTS.md§5 asks the PR body to be written from the final diff and re-read after every follow-up commit, listing every user-visible change and naming the lane that exercises new behavior — exactly what the two new scenarios are and aren't named here.
Confidence 90 · documentation · Fix: update the PR body's "Test" section to name both scenario@id:s and the additional unit-test cases, and correct the stale duplicate-assertion claim. -
CI is not green on this commit — checks
E2E tests (Strix Halo, Windows, current)(FAILURE),E2E tests (MI300X, current)(QUEUED),E2E tests (Strix Halo, Ubuntu, release, current)(QUEUED),E2E tests (Strix Halo, Ubuntu, nightly, current)(IN_PROGRESS), as observed at review time
Traced the Windows failure directly from its job log (run41661809200, job126006886858): scenarioruntime-09 - Previewing a release SDK install resolves the canonical aggregate for this GPU(@id:runtime-resolve-canonical-release) fails onassertion left == right,canonical_source: expectedhttps://repo.amd.com/rocm/whl-multi-arch, gothttps://mirror-lax.techaccelerator.com/repository/pypi-therock— a live-hardware package-mirror mismatch, unrelated toparse_host_version/host_version_newer_than/the host-version note this PR touches. The checks that actually exercise this diff (build-and-test,windows-build-and-test,Test (affected crates),clippy) all pass. Three GPU-dependent E2E lanes had not finished as of this review (two queued, one in progress), so the diff's full E2E surface isn't yet confirmed all-green.
Confidence 85 · mechanical · Fix: rerun/wait on the GPU lanes (or escalate perAGENTS.md§12); no code change indicated for the Windows failure.
Non-blocking
None.
Decisions for the author
- The all-digit rule also rejects distro-style packaging tails, not just the reported
rc1shape — tradeoff
7.2.4-98.el9,6.4.1-120~22.04,7.2.4-98-1and7.2.4-98+localall become unreadable ("can't tell") under the new rule, same as7.2.4-98rc1. This is already deliberate and tested (the four distro-tail cases are assertedNonein the new unit test, with a comment explaining the cost is only ever a missing host-newer note, never a false one), so there's nothing left to fix — flagging only so the choice (strict/no-false-positives over lenient/fewer-missed-notes) stays visible as a design call rather than reading as an afterthought.
Positive signals
- The production fix was hand-traced against every existing and new assertion, every call site of
host_rocm_version_newer_than(both the wheel and tarballversion_notesites), and edge cases beyond the tests (multiple dashes, non-ASCII digits,+localordering relative to the-split) — no correctness defect found anywhere. - All three doc-comment sites describing the old "numeric suffix" rule were updated to "all digits" consistently; a full-file grep for the old wording turned up nothing stale.
runtime-20andruntime-21are genuinely coupled, not just parallel scenarios:runtime-20proves the install preview can print the host-newer note from this exact fixture shape, which is what makesruntime-21's absence assertion real evidence rather than a vacuous pass, andpreview_explains_host_newerasserts the note's text together with the state it describes, perAGENTS.md's "message asserted together with the behavior" rule.- This is a traceable, legitimate follow-up: the exact gap closed here was flagged, almost word-for-word, as a non-blocking note in the human review of the parent PR (#566) that introduced
parse_host_version, and the PR's own "follow-up to #566" claim checks out against that review text. - No existing test was weakened or deleted, and the one duplicated assertion a prior round of feedback identified has since been cleanly removed rather than left in place.
Deployment notes
None — this only narrows when an existing "host is newer" note is shown (removing false positives); it changes no CLI flag, message wording, or routing behavior.
What this covered
Read completely at PR head cb98413491dfe05327a77d770cacfb5a6ace6d84 (merge-base e6d2f7c0d7b9a8051a475dfaca84756e5b97aecf): apps/rocm/src/therock/version.rs in full; the full mod tests region of apps/rocm/src/therock.rs plus every non-test call site of parse_host_version/host_version_newer_than/host_rocm_version_newer_than in that file; the full tests/e2e-cucumber/features/runtime_setup.feature; the full tests/e2e-cucumber/tests/e2e/therock_steps.rs; the diffed region of tests/e2e-cucumber/tests/e2e.rs plus every caller of plant_unmanaged_rocm across the e2e test tree. Read AGENTS.md in full for the agent-instruction-adherence pass. Ran the history/prior-changes pass against full local git history, including PR #566's merged diff and its human review text. Checked CI via a live gh pr view --json statusCheckRollup query and traced the one failing job's log directly, not from workflow-definition guesswork.
Did not run: cargo test/cargo clippy locally (no Rust toolchain in this environment) — relied on hand-tracing every branch against the PR-head source, cross-checked against GitHub's own passing Test (affected crates)/clippy/build-and-test checks for this exact commit.
Not reconciled against any PR discussion or prior review thread content: the fan-out passes that produced every finding above read only the code, AGENTS.md, and git history, never any review or comment. As orchestrator I did see this PR's existing reviews while performing the required same-identity claim-check (to confirm no prior review of mine already covers this exact commit); none of their text, conclusions, or framing was passed to the workers, and every finding and positive signal above was independently re-derived from the code, logs, or a live query rather than carried over.
🤖 Generated with Claude Code
Follow-up to #566, from the first non-blocking note in @juhovainio's approving review.
parse_host_versiondrops the packaging build number that a system ROCm install reports (7.2.4-98is read as7.2.4). Its doc says only a numeric-suffix is dropped. The code, however, only checked that the suffix starts with a digit, so7.2.4-98rc1would have had-98rc1dropped silently and been read as7.2.4.Change
tail.chars().all(|c| c.is_ascii_digit())).7.0.0-rc1is read as a release candidate, as before.7.2.4-98rc1cannot be read, so the host version is "can't tell".What users see
parse_host_versionhas one production caller: the check behind the install-timeversion_note("this host reports ROCm X, but Y … is selected"). For a host string that has a mixed suffix, that note now never appears. Before, it could appear based on the version with its suffix dropped. "Can't tell" never claims that the host is newer.rocm updatestatuses do not go through this function: they usecompare_version_strings. So none of theupdate-scenarios need to change.update-07andupdate-08compare catalog versions with installed runtimes, not host strings.Test
parse_host_version_drops_only_an_all_digit_build_suffixcovers:7.2.4-98is read as7.2.4);7.0.0-rc1;7.2.4-98rc1(unreadable);7.20.1-33rc1is not reported as newer than7.13.0, while7.20.1-33still is.Mutation check: with the check reverted to
starts_with, the new test fails (left: Some(VersionOrderKey { release: [7, 2, 4], .. }),right: None).The proptest oracle also calls
parse_host_version. Its version alphabet has no suffix that starts with a digit and goes on with something else, so its results are unchanged.Verified locally:
fmt
rocm --bin rocmtests: 1307 passxtasktests: 317 passboth clippy invocations on Linux and for
x86_64-pc-windows-gnuNo ticket ID; no xfail rows apply.
No new subcommand or subsystem.
No message wording changed. The test asserts when the host-newer note is produced, not its text.