Repository navigation
Conversation
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>
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 |
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.