Repository navigation
ROCMAI-486: split command-coverage audit out of consolidated.rs - #591
Conversation
rominf
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · c4f991d
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 — no blocking findings
Full review of the whole change.
Implements the first cluster of ROCMAI-486 (the command-coverage audit split), not the rest of it. The description presents it that way and does not claim to close the ticket.
Blocking
None
Non-blocking
All findings below are new this round (first review of this PR).
-
The new module doc contradicts itself and the import below it —
crates/e2e-report/src/command_coverage.rs:8-10
The doc says the module "Consumes [crate::consolidated::PlatformReport] but shares no type with theGrid/PlatformReportreconciliation model itself". That namesPlatformReportas both consumed and not shared. The code governs: line 15 importsPlatformReport, and the module reads itsdesc,commands,effective_channel()andscenario_pass_map().docs/architecture.md:54already has the accurate wording ("shares no type with theGrid/reconciliation model").
Confidence 85 · mechanical · Fix: drop/PlatformReportfrom that sentence so it matches architecture.md. -
The new module rebuilds a label
PlatformReportalready stores, and four visibility widenings exist only for that —crates/e2e-report/src/command_coverage.rs:154-157,:166-169;crates/e2e-report/src/consolidated.rs:27-29,:166,:438,:769
PlatformReport::loadalready setslabel = with_channel_suffix(&format!("{} {}", desc.platform, desc.os), versions.channel.as_deref().or(desc.channel_from_name))(consolidated.rs:749-751).command_coverage_markdowncomputes the same string twice fromdesc.platform,desc.os,effective_channel()andwith_channel_suffix. Those are the only uses that required makingDescriptorand itsplatform/osfields,PlatformReport.desc,with_channel_suffixandeffective_channelpub(crate). The duplicate was there before the move, but it now spans two files and can drift, and the widening is new in this change.
Confidence 85 · mechanical · Fix: exposelabel(field or apub(crate) fn) and use it in both loops. The four widenings above can then be reverted. -
The test-module comment tells the history of the move and is incomplete —
crates/e2e-report/src/consolidated.rs:2440-2444
"...they now live with their code incommand_coverage.rs. The two tests below stay here..." describes the change rather than the code, so it goes stale once merged. It also leaves out the third command-coverage integration test that stayed in this file,command_coverage_ties_to_scenario_not_rc(:1699).
Confidence 70 · mechanical · Fix: delete it, or reduce it to a present-tense one-liner such as "pure helper tests live incommand_coverage.rs". -
The new architecture.md paragraph repeats the entry above it and sends readers to a ticket for the plan —
docs/architecture.md:56
Line 56 restates line 54's description of whatconsolidated.rsstill holds, then says "see the ticket for the remaining-cluster plan". Readers of a public repo cannot open that tracker. The rocmd entry in the same doc names its pending clusters inline. The bare ticket ID itself is permitted by AGENTS.md §2.
Confidence 70 · mechanical · Fix: fold line 56 into line 54 and name the remaining clusters inline. -
Pre-existing, carried over by the move: the main function's doc comment sits on the wrong item and is wrong —
crates/e2e-report/src/command_coverage.rs:30-37,:150
The "Build the ... coverage table" doc is fused ontoKNOWN_COMMAND_SURFACE's doc. As a resultcommand_coverage_markdown, the module's only entry point, has no doc of its own. The misplaced text also says not-run cells are "blank", but the code renders`n/a`(:244-248, with a comment at:242-243saying so). The code governs. This came over verbatim fromprw-base, and the new module is the natural place to fix it.
Confidence 85 · mechanical · Fix: move lines 30-37 ontocommand_coverage_markdownand change "blank" to "n/a". -
Pre-existing, in the moved file:
KNOWN_COMMAND_SURFACEhas drifted from the CLI —crates/e2e-report/src/command_coverage.rs:47-97
The list leaves out visible subcommands that exist inapps/rocm/src/main.rs:storage report,storage remove-old-installs(:840-850)services prune(:997)config clear-default-engine(:1067)- several more
configandservicessubcommands
This shrinks the denominator, so the reported coverage % is inflated. This change does not alter the list.
Confidence 85 · logic · Fix: a separate follow-up, not this PR.
Decisions for the author
-
The extraction creates a two-way dependency between sibling modules — non-blocking-improvement
consolidatedimportscommand_coverage_markdown, andcommand_coverageimportsPlatformReportandwith_channel_suffixback.docs/architecture.md:54andcomponents.rs:5-7give an acyclic module graph as the reason for the previous split, and this one reverses that without saying so. Rust accepts the cycle.
A cleaner boundary is possible:- Move
CommandRecordandparse_commandsintocommand_coverage.rs. - Have
command_coverage_markdowntake per-platform(label, &[CommandRecord], pass map)rows instead of&[PlatformReport]. - The dependency then runs one way and no
PlatformReportinternals need widening.
If you keep the current shape, one sentence in architecture.md acknowledging the back-edge would do.
- Move
-
KNOWN_COMMAND_SURFACEandcommand_coverage_summaryarepub(crate)only for one test inconsolidated.rs— tradeoff- Moving
command_coverage_counts_against_known_surfacenext to its code would keep both private. - But that test builds its input with
PlatformReport::load, which is private toconsolidated, so moving it widens visibility elsewhere instead.
Either choice is defensible.
- Moving
Positive signals
- A line-level diff of the removed block (
prw-base:consolidated.rs) againstcommand_coverage.rsshows the move is verbatim. The only differences arepub(crate)on three items, one signature rewrap, and two function-localuses hoisted to module scope. No logic drifted, and the channel-aware changes from #460 are intact. - The pure unit tests moved with their code, matching how
parse.rsandcomponents.rskeep their ownmod tests.
Deployment notes
None. This is an internal crate relocation with no change to the rendered output or the public API (lib.rs re-exports are unchanged).
What this covered
Everything was read in full:
- the whole diff and all of
command_coverage.rs,lib.rsanddocs/architecture.md - in
consolidated.rs: every changed region, theDescriptor/PlatformReport/CommandRecorddefinitions andimpl, theconsolidated_summary_markdowncall site, and all three command-coverage tests - workspace and crate lint configuration,
coverage-floors.toml, sibling module headers, and the clap enums inapps/rocm/src/main.rs
Range: prw-base (2fdff46) … c4f991d.
Method:
- Fan-out ran as three independent read-only workers: a code pass over the coupled group; agent-instruction, history and code-comment passes; and design questions. The driver then consolidated and re-verified each surviving finding against the source.
- Verification was static only because of disk constraints. No cargo build, test, check or clippy was run, so no finding is scored on a run, and the description's test-plan claims (54/54 pass, clippy clean) were not reproduced.
- Test verdicts:
- The two moved tests are byte-identical and would pass with the change reverted. That is expected for a relocation that adds no behaviour.
- Each moved branch is still exercised: the two moved tests cover
command_baseandmatched_surface_command; the three tests that stay cover the markdown and summary paths. - The one exception is the
cells.is_empty()early return (command_coverage.rs:203-205), which has no test before or after this change.
- CI at c4f991d: every completed check succeeded (clippy, build-and-test, windows-build-and-test, Test (affected crates), architecture-doc citations, the GPU E2E lanes, and others).
E2E tests (MI300X)was still queued, so that lane is unverified.
Did not run:
- Prior-changes pass: not run, because reading earlier PRs' review comments was outside this run's scope.
- Leak scan: run statically by a worker over the added lines, and clean apart from the permitted ticket IDs.
Disclosure: the driver saw the HEAD commit message while resolving scope, before findings were settled. The workers that produced the findings did not see it, the PR description, or ROCMAI-486. Those were read only at Step 9: ticket title, body and state, no comments.
No prompt-injection content was found. This report was not reconciled against the PR's discussion or earlier reviews.
|
Thanks for the review. Addressed in 455761c:
On the two open decisions:
|
rominf
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · 455761c
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 — no blocking findings
Full review of the whole change.
Implements the first staged cluster (command-coverage audit) of ROCMAI-486, not the remaining model/HTML/markdown split; the description says so and does not claim to close the ticket.
Blocking
None
Non-blocking
All findings below are new this round. The previous round (at c4f991d) raised no blocking findings, so there were no standing blockers to settle.
- The comment on where the command-coverage tests live is wrong, and the PR description repeats it —
crates/e2e-report/src/consolidated.rs:2442-2444,crates/e2e-report/src/consolidated.rs:1469
The comment says the command-coverage tests "here exercise theconsolidated_summary_markdownintegration pipeline instead". The test directly below it,command_coverage_counts_against_known_surface(:2447), does not go through that pipeline: it callsPlatformReport::load, then the pure helpercommand_coverage_summary, and asserts againstKNOWN_COMMAND_SURFACE.len(). That is whyconsolidated::testsimports both items at :1469. The other command-coverage test that stays,command_coverage_ties_to_scenario_not_rc, sits at :1701, so the comment's "here" does not cover it either. The code governs: the test's real reason for staying is that it needs the privatePlatformReport::loadand the sharedfeature_jsonhelper. The PR description's test-plan bullet makes the same "integration tests exercising the full pipeline" claim.
Confidence 85 · mechanical · Fix: reword the comment, and the description bullet, to say these tests stay because they buildPlatformReportthrough the privateloadandfeature_json. - The new
labelfield doc misdescribes the field —crates/e2e-report/src/consolidated.rs:167-169
The doc callslabel"the only piece ofdescthe command-coverage table needs".labelis not part ofdesc:PlatformReport::loadbuilds it fromdesc.platform/desc.osplus the manifest channelversions.channel(:751-753). The rationale "so a second module can't recompute it" is also stronger than what the code enforces;effective_channelis simply private.
Confidence 85 · mechanical · Fix: describe it as the precomputed column label (platform, OS and effective channel), exposed socommand_coverage.rsreuses it rather than reaching intodesc/versions. - The architecture doc points at an "opening paragraph" that does not exist —
docs/architecture.md:54
The new sentence reads "Unlikecomponents.rs, which this section's opening paragraph notes keeps the module graph acyclic…". Thecrates/e2e-reportsection is a single paragraph. The acyclicity note is an earlier clause in that same paragraph.
Confidence 85 · mechanical · Fix: "which, as noted above, keeps the module graph acyclic".
Decisions for the author
- Documenting the
consolidated.rs↔command_coverage.rsback-edge instead of removing it — tradeoff
The case for keeping it: the split stays a small, mechanical, behaviour-preserving move, and the cycle is documented indocs/architecture.md. The case against: the new module is not standalone. It readsPlatformReport'scommands,labelandscenario_pass_map(), whileconsolidated.rscallscommand_coverage_markdown. Breaking the cycle later, by movingPlatformReportinto its own model module, is the natural next phase of ROCMAI-486. Confirm the order is deliberate.
Positive signals
- Reusing the
labelthatPlatformReport::loadalready computes, instead of rebuildingwith_channel_suffix(format!("{} {}", platform, os), effective_channel())in the new module, keeps the coverage table's column headings from drifting from the per-platform detail sections. It also avoids wideningDescriptor/desc. The two are equivalent:labelis built only inloadwith exactly that expression, and nothing mutates it afterwards. - The split fixes a doc comment for
command_coverage_markdownthat at base was fused ontoKNOWN_COMMAND_SURFACE. It also corrects "blank" to "n/a", matching what the code renders (command_coverage.rs:241).
Deployment notes
None
What this covered
- What was read: every changed file in
prw-base...455761c4(command_coverage.rs,lib.rsanddocs/architecture.mdcompletely). Forconsolidated.rs: the full diff, the moved regions compared againstprw-baseline by line, plusPlatformReport/load/effective_channeland the test module. - Behaviour preserved: the removed and added hunks were diffed mechanically. Apart from visibility and doc edits, the only substitution is the column
labelreuse, and it was traced as equivalent. - Tests: 42
#[test]fns before, 40 + 2 after, with matching names.cargo test -p e2e-reportpassed 54/54,cargo clippy -p e2e-report --all-targets -D warningswas clean (re-run after touching the source), andcargo fmt --checkwas clean. - CI: all check-runs at 455761c succeeded. Skillscope and the Sphinx docs build were skipped, as not applicable.
- Passes that ran: the code pass, agent-instruction adherence, history (including #460's channel-aware columns, confirmed preserved), prior changes (#433's test-colocation convention) and code comments, each as independent workers.
- Not independent: the design review (Step 7) was run inline by the driver from the workers' evidence, not by separate workers. It produced only the one tradeoff above.
- Description and ticket: the PR description and ROCMAI-486 were read via
ghand the tracker. Ticket comments were not read. - Not reconciled: this report was not checked against the PR's discussion or earlier reviews here.
|
Thanks for the second round. Addressed in 03f4a74:
On the standing decision — documenting the back-edge instead of removing it — still deliberate, same as last round: breaking it by moving
|
consolidated.rs bundled 5 distinct concerns in one ~2,980-line file. Extract the CLI command-coverage audit table (which rocm commands were exercised, and whether they passed) into its own command_coverage.rs: it consumes PlatformReport but shares no type with the Grid/ reconciliation model itself, making it the lowest-risk cluster to split off first. Pure, behavior-preserving relocation: PlatformReport/Descriptor/ CommandRecord and a few of PlatformReport's methods gain pub(crate) visibility so the new module can consume them, following this crate's existing parse.rs precedent; no logic changed. Pure unit tests for the moved helpers move with them; two tests exercising the full consolidated_summary_markdown pipeline stay in consolidated.rs. consolidated.rs still bundles manifest/command parsing, the Grid/ PlatformReport model, and both HTML and markdown rendering - tracked as remaining work on ROCMAI-486 for a future pass. ROCMAI-486 Signed-off-by: Jussi Elo <jussi.elo@amd.com>
rominf's review of c4f991d flagged a duplicate label computation that only existed to justify four new pub(crate) widenings in consolidated.rs (Descriptor, its platform/os fields, PlatformReport.desc, with_channel_suffix, effective_channel); PlatformReport already computes the same label at load time. Reuse that field in command_coverage.rs and revert the widenings now that nothing outside consolidated.rs needs them. Also fixes a self-contradicting module doc comment, a doc comment fused onto the wrong item (and still claiming "blank" cells render, when they render `n/a`), a stale test-module comment that undercounted the tests staying in consolidated.rs, and a docs/architecture.md paragraph that pointed readers at the ticket instead of stating the remaining clusters inline. Documents the back-edge the split introduced between command_coverage.rs and consolidated.rs rather than undoing it, per author decision; KNOWN_COMMAND_SURFACE's narrow pub(crate) visibility is left as-is, also per author decision. ROCMAI-486 Signed-off-by: Jussi Elo <jussi.elo@amd.com>
- reword the test-module comment: the two tests that stay in consolidated.rs do so because they need the private PlatformReport::load and the shared feature_json helper, not because they exercise the full consolidated_summary_markdown pipeline - fix PlatformReport::label's doc comment: it's not part of Descriptor, it's the precomputed platform/OS/channel column label - fix an architecture.md cross-reference to a nonexistent "opening paragraph" Signed-off-by: Jussi Elo <jussi.elo@amd.com>
03f4a74 to
bb51aa5
Compare
rominf
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · bb51aa5
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 — no blocking findings
Full review of the whole change.
Implements the first step of ROCMAI-486 (splitting the command-coverage audit out of consolidated.rs), not the model/HTML/markdown splits. The description says this and does not claim to close the ticket.
Blocking
None
Non-blocking
The finding below is new this round. The previous rounds (at c4f991d and 455761c, both since rewritten out of the branch) raised no blocking findings, so there were no standing blockers to settle.
- The new architecture-doc text names
consolidated.rstwice without a link, which the doc's own rule forbids —docs/architecture.md:54
docs/architecture.md:11says every concrete file citation in the Module map's per-crate inventories is a relative markdown link. It allows only two exceptions ("the old agent.rs" andreport.json), and gives the reason: lychee then fails CI when a file is moved or deleted. Atprw-basethe Module map had no bare-backtick file citations. This change adds two: "Phase 1 of a staged further split ofconsolidated.rs" and "consolidated.rsstill bundles manifest/command parsing…". The rule at line 11 should govern, because it is what lets lychee catch renames. That matters most here, since this paragraph describes a staged split that will move more code out ofconsolidated.rs.
Confidence 85 · mechanical · Fix: turn both into[consolidated.rs](../crates/e2e-report/src/consolidated.rs)links, as the rest of the paragraph already does.
Decisions for the author
-
Moving the
commands.jsonlmodel into the new module would remove the two-way dependency and every visibility widening — non-blocking-improvement
The only use ofCommandRecordandparse_commandsinconsolidated.rsis as the type of thePlatformReport.commandsfield and its one loader call (consolidated.rs:179,:207,:744).scenario_pass_maphas one caller,command_coverage.rs:164.
The alternative has three steps:- Move
CommandRecordandparse_commandsintocommand_coverage.rs. - Have
command_coverage_markdown/command_coverage_summarytake a narrow view, such as(label, &[CommandRecord], &[Feature])per platform, and compute pass/fail there withparse::scenario_passed. - Map
reportsinto that view at the single call site.
The result:
- The
consolidated → command_coverage → consolidatedback-edge goes away. - The eight
pub(crate)widenings onPlatformReport/CommandRecordrevert. command_coverage_counts_against_known_surfacecan become a pure unit test next to the code it tests.- The new module then owns its input type, which
docs/architecture.md:17uses to define full domain extraction ("owns its own types… not just relocated functions").
The current shape is a valid, smaller mechanical relocation, and the cycle is documented honestly, so this is your call.
- Move
Positive signals
- Switching the coverage column key to the precomputed
r.labelremoves a second copy of thewith_channel_suffix(platform + os, effective_channel())computation. Output is unchanged:load()atconsolidated.rs:751-753computes the same expression, and nothing writes tolabelafterwards. That was confirmed against history (#460 added both copies in the same commit). - The move also fixes an old misplaced doc comment. The "Build the … coverage table" text was attached to
KNOWN_COMMAND_SURFACEand said "blank" where the code renders`n/a`. It now sits oncommand_coverage_markdownand is accurate.
Deployment notes
None
What this covered
Read completely: all four changed files (crates/e2e-report/src/command_coverage.rs, consolidated.rs, lib.rs, docs/architecture.md), plus AGENTS.md and the callers and users of the moved and widened symbols. Range: db11e474…bb51aa52 (prw-base...HEAD). Full review rather than a follow-up: the previously reviewed commit no longer exists in the branch.
Checks run:
cargo test -p e2e-report: 54 passed, including bothcommand_coverage::tests::*and the threeconsolidated::tests::command_coverage_*tests. There are 54#[test]fns at both base and head, and the same names.cargo clippy -p e2e-report --all-targets -D warnings: clean.- CI checks on bb51aa5 are all green or skipped.
- ROCMAI-486 was retrieved by its ID (title, description, status).
Passes run as independent workers: agent-instruction adherence plus code comments, history plus prior PR reviews (#433 and #460), and design.
Did not run: cargo xtask coverage locally. The per-crate floor was left to CI; no tests were deleted.
Not reconciled against any discussion on this PR here.
Two citations of consolidated.rs in the crates/e2e-report entry were bare backtick filenames instead of the relative markdown links the Module map's own rule requires (docs/architecture.md:11), so lychee couldn't catch a future rename of that file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Jussi Elo <jussi.elo@amd.com>
|
Thanks for the third round. Addressed in 9997ba2:
On the decision for the author — moving the
|
rominf
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · 9997ba2
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 — no blocking findings
Review of changes since the review at bb51aa5, plus the files they touch (docs/architecture.md).
Implements the command-coverage cluster of ROCMAI-486 (In Progress), not the remaining model/HTML/markdown splits. The description says this and does not claim to close the ticket.
Blocking
None
Non-blocking
None
Decisions for the author
None
Positive signals
- Every file citation in the
crates/e2e-reportentry is now a relative link. The one exception isreport.json, which the doc lists as exempt. This makes the entry comply with the link rule in the doc's own intro paragraph (line 11), so lychee will catch a future rename ofconsolidated.rs.
Deployment notes
None
What this covered
- What was read: all of
docs/architecture.mdagainst bb51aa5…9997ba29, with thecrates/e2e-reportentry (line 54) checked claim by claim against the source:crates/e2e-report/src/lib.rs: five privatemoddeclarations, and thepub uselist matches the seven re-exported items named in the doc.consolidated.rs→command_coverage::command_coverage_markdown, andcommand_coverage.rs→PlatformReport'scommands,labelandscenario_pass_map(). Both edges are as described.
- Also checked:
- Root
AGENTS.md, the only agent-instruction file in scope. - The commit message of 9997ba2.
- Local
lychee --offline docs/architecture.md: 118 OK, 0 errors.
- Root
- CI on 9997ba2: all completed checks pass, including
Markdown links resolve (lychee).E2E tests (Strix Halo, Windows)andE2E tests (Strix Halo, WSL2)were still queued when read. The delta changes no code, so cargo was not run. - Passes:
- Agent-instruction adherence, history and prior changes ran as independent workers. The prior-changes pass read review comments on #582 only.
- The code pass ran as a single pass in this context, not as an independent worker. The scope was one documentation line.
- The code-comments pass was folded into the adherence worker.
- Dropped below threshold: a
Co-Authored-By: Claudetrailer on 9997ba2, scored 60 against AGENTS.md §11 "avoid AI-generated boilerplate footers". That rule addresses PR and issue text, and 4 of 221 recent commits on main carry the same trailer. - Not reconciled: this report was not checked against the PR's discussion or earlier reviews.
… e2e-report Three pure, behavior-preserving dedups in crates/e2e-report, found during ROCMAI-27 code review and logged in ROCMAI-200 (the epic's quality-findings backlog): - single_report.rs::generate() and consolidated.rs::generate_consolidated() each inlined their own full `<!DOCTYPE html>...` page shell. Extract a shared page_shell() in components.rs taking the body markup and page title; both generators now call it. STYLE narrows from pub(crate) to private now that page_shell is its only caller. - consolidated.rs's platform-ordering sort key was duplicated verbatim between generate_consolidated() and consolidated_summary_markdown(). Extract platform_sort_key() and use it at both call sites. - The "platform (+ OS)" label was independently rebuilt at two more sites: the markdown summary table and the HTML matrix_table each rebuilt the platform-only half (the same pattern that drifted once already, fixed in ROCm#460). Extract a shared platform_cell() for that platform-only half and use it at both call sites. No rendering output or sort order changes: same markup, same ordering, less duplication to drift out of sync in a future head-level or ordering tweak. Adds page_shell_carries_title_and_style (components.rs), pinning every shared piece page_shell renders: doctype, lang="en", meta charset="utf-8", title, stylesheet, and the caller's body. Adds generate_renders_the_body_inside_the_shared_page_shell (single_report.rs), pinning that single_report::generate's real body — the scenario name parsed from the report JSON — reaches the shared shell at that call site. Adds platform_sort_key_orders_by_platform_then_os_then_known_bugs_then_channel (consolidated.rs), pinning all four sort-key tuple elements in precedence order: a fourth fixture row on a different platform pins platform; two Ubuntu rows pin os and known_bugs; a fifth/sixth row on two more platforms with opposite channels pin that channel doesn't outrank platform; a seventh row pins that channel doesn't outrank known_bugs either. channel's own effect as a tie-breaker, once platform/os/known_bugs are equal, is pinned by generate_consolidated_writes_html and command_coverage_distinguishes_channels_on_same_platform instead of being repeated here. PlatformReport::label's doc comment states what the label contains (platform, OS and effective channel) alongside its consumers. No new test for platform_cell() itself: existing tests already exercise both call sites' rendered output byte-for-byte (consolidated_summary_markdown_has_a_row_per_platform and generate_consolidated_writes_html) and pass unchanged. command_coverage_markdown's own duplication of the full platform+OS label, and its reuse of PlatformReport::label, already landed separately on main through ROCm#591 — not part of this change. cargo test -p e2e-report --all-targets: 57 passed, 0 failed. cargo clippy -p e2e-report --all-targets -- -D warnings: clean. cargo fmt --check: clean. cargo build --workspace: clean, no downstream breakage (xtask consumes this crate's public API). Signed-off-by: Jussi Elo <jussi.elo@amd.com>
… e2e-report Three pure, behavior-preserving dedups in crates/e2e-report, found during ROCMAI-27 code review and logged in ROCMAI-200 (the epic's quality-findings backlog): - single_report.rs::generate() and consolidated.rs::generate_consolidated() each inlined their own full `<!DOCTYPE html>...` page shell. Extract a shared page_shell() in components.rs taking the body markup and page title; both generators now call it. STYLE narrows from pub(crate) to private now that page_shell is its only caller. - consolidated.rs's platform-ordering sort key was duplicated verbatim between generate_consolidated() and consolidated_summary_markdown(). Extract platform_sort_key() and use it at both call sites. - The "platform (+ OS)" label was independently rebuilt at two more sites: the markdown summary table and the HTML matrix_table each rebuilt the platform-only half (the same pattern that drifted once already, fixed in ROCm#460). Extract a shared platform_cell() for that platform-only half and use it at both call sites. No rendering output or sort order changes: same markup, same ordering, less duplication to drift out of sync in a future head-level or ordering tweak. Adds page_shell_carries_title_and_style (components.rs), pinning every shared piece page_shell renders: doctype, lang="en", meta charset="utf-8", title, stylesheet, and the caller's body. Adds generate_renders_the_body_inside_the_shared_page_shell (single_report.rs), pinning that single_report::generate's real body — the scenario name parsed from the report JSON — reaches the shared shell at that call site. Adds platform_sort_key_orders_by_platform_then_os_then_known_bugs_then_channel (consolidated.rs), pinning all four sort-key tuple elements in precedence order: a fourth fixture row on a different platform pins platform; two Ubuntu rows pin os and known_bugs; a fifth/sixth row on two more platforms with opposite channels pin that channel doesn't outrank platform; a seventh row pins that channel doesn't outrank known_bugs either. channel's own effect as a tie-breaker, once platform/os/known_bugs are equal, is pinned by generate_consolidated_writes_html and command_coverage_distinguishes_channels_on_same_platform instead of being repeated here. PlatformReport::label's doc comment states what the label contains (platform, OS and effective channel) alongside its consumers. No new test for platform_cell() itself: existing tests already exercise both call sites' rendered output byte-for-byte (consolidated_summary_markdown_has_a_row_per_platform and generate_consolidated_writes_html) and pass unchanged. command_coverage_markdown's own duplication of the full platform+OS label, and its reuse of PlatformReport::label, already landed separately on main through ROCm#591 — not part of this change. cargo test -p e2e-report --all-targets: 57 passed, 0 failed. cargo clippy -p e2e-report --all-targets -- -D warnings: clean. cargo fmt --check: clean. cargo build --workspace: clean, no downstream breakage (xtask consumes this crate's public API). Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Two pure, behavior-preserving dedups in crates/e2e-report, found during ROCMAI-27 code review and logged in ROCMAI-200 (the epic's quality-findings backlog): - single_report.rs::generate() and consolidated.rs::generate_consolidated() each inlined their own full `<!DOCTYPE html>...` page shell. Extract a shared page_shell() in components.rs taking the body markup and page title; both generators now call it. STYLE narrows from pub(crate) to private now that page_shell is its only caller. - The "platform (+ OS)" label was independently rebuilt at two more sites: the markdown summary table and the HTML matrix_table each rebuilt the platform-only half (the same pattern that drifted once already, fixed in ROCm#460). Extract a shared platform_cell() for that platform-only half and use it at both call sites. A third dedup originally targeted here — the platform-ordering sort key, duplicated between generate_consolidated() and consolidated_summary_markdown() — landed independently on main as report_sort_key() via ROCm#592 (ROCMAI-484) while this branch was in review. Rebasing onto that picked up the existing extraction instead of adding a second one; this commit adds no new sort-key function. No rendering output or sort order changes: same markup, same ordering, less duplication to drift out of sync in a future head-level or ordering tweak. Adds page_shell_carries_title_and_style (components.rs), pinning every shared piece page_shell renders: doctype, lang="en", meta charset="utf-8", title, stylesheet, and the caller's body. Adds generate_renders_the_body_inside_the_shared_page_shell (single_report.rs), pinning that single_report::generate's real body — the scenario name parsed from the report JSON — reaches the shared shell at that call site. Adds consolidated_summary_markdown_orders_rows_by_report_sort_key (consolidated.rs), going through the public consolidated_summary_markdown entry point with realistic artifact-name fixtures rather than a direct call to report_sort_key, so a regression in load_platform_reports' use of report_sort_key is caught even if report_sort_key itself stays correct in isolation. Pins all four sort-key tuple elements in precedence order: a fourth fixture row on a different platform pins platform; two Ubuntu rows pin os and known_bugs; a fifth/sixth row on two more platforms with opposite channels pin that channel doesn't outrank platform; a seventh row pins that channel doesn't outrank known_bugs either. channel's own effect as a tie-breaker, once platform/os/known_bugs are equal, is pinned by generate_consolidated_writes_html and command_coverage_distinguishes_channels_on_same_platform instead of being repeated here. report_sort_key_orders_by_every_dimension (pre-existing, landed with ROCm#592) already pins the same four dimensions via a direct call with synthetic PlatformReports; this test complements it rather than repeating it. PlatformReport::label's doc comment states what the label contains (platform, OS and effective channel) alongside its consumers. No new test for platform_cell() itself: existing tests already exercise both call sites' rendered output by row content (consolidated_summary_markdown_has_a_row_per_platform and generate_consolidated_writes_html) and pass unchanged. command_coverage_markdown's own duplication of the full platform+OS label, and its reuse of PlatformReport::label, already landed separately on main through ROCm#591 — not part of this change. cargo test -p e2e-report --all-targets: 65 passed, 0 failed. cargo clippy -p e2e-report --all-targets -- -D warnings: clean. cargo fmt --check: clean. cargo build --workspace: clean, no downstream breakage (xtask consumes this crate's public API). Signed-off-by: Jussi Elo <jussi.elo@amd.com>
…m#585) * dedup: share HTML page shell and platform cell in e2e-report Two pure, behavior-preserving dedups in crates/e2e-report, found during ROCMAI-27 code review and logged in ROCMAI-200 (the epic's quality-findings backlog): - single_report.rs::generate() and consolidated.rs::generate_consolidated() each inlined their own full `<!DOCTYPE html>...` page shell. Extract a shared page_shell() in components.rs taking the body markup and page title; both generators now call it. STYLE narrows from pub(crate) to private now that page_shell is its only caller. - The "platform (+ OS)" label was independently rebuilt at two more sites: the markdown summary table and the HTML matrix_table each rebuilt the platform-only half (the same pattern that drifted once already, fixed in ROCm#460). Extract a shared platform_cell() for that platform-only half and use it at both call sites. A third dedup originally targeted here — the platform-ordering sort key, duplicated between generate_consolidated() and consolidated_summary_markdown() — landed independently on main as report_sort_key() via ROCm#592 (ROCMAI-484) while this branch was in review. Rebasing onto that picked up the existing extraction instead of adding a second one; this commit adds no new sort-key function. No rendering output or sort order changes: same markup, same ordering, less duplication to drift out of sync in a future head-level or ordering tweak. Adds page_shell_carries_title_and_style (components.rs), pinning every shared piece page_shell renders: doctype, lang="en", meta charset="utf-8", title, stylesheet, and the caller's body. Adds generate_renders_the_body_inside_the_shared_page_shell (single_report.rs), pinning that single_report::generate's real body — the scenario name parsed from the report JSON — reaches the shared shell at that call site. Adds consolidated_summary_markdown_orders_rows_by_report_sort_key (consolidated.rs), going through the public consolidated_summary_markdown entry point with realistic artifact-name fixtures rather than a direct call to report_sort_key, so a regression in load_platform_reports' use of report_sort_key is caught even if report_sort_key itself stays correct in isolation. Pins all four sort-key tuple elements in precedence order: a fourth fixture row on a different platform pins platform; two Ubuntu rows pin os and known_bugs; a fifth/sixth row on two more platforms with opposite channels pin that channel doesn't outrank platform; a seventh row pins that channel doesn't outrank known_bugs either. channel's own effect as a tie-breaker, once platform/os/known_bugs are equal, is pinned by generate_consolidated_writes_html and command_coverage_distinguishes_channels_on_same_platform instead of being repeated here. report_sort_key_orders_by_every_dimension (pre-existing, landed with ROCm#592) already pins the same four dimensions via a direct call with synthetic PlatformReports; this test complements it rather than repeating it. PlatformReport::label's doc comment states what the label contains (platform, OS and effective channel) alongside its consumers. No new test for platform_cell() itself: existing tests already exercise both call sites' rendered output by row content (consolidated_summary_markdown_has_a_row_per_platform and generate_consolidated_writes_html) and pass unchanged. command_coverage_markdown's own duplication of the full platform+OS label, and its reuse of PlatformReport::label, already landed separately on main through ROCm#591 — not part of this change. cargo test -p e2e-report --all-targets: 65 passed, 0 failed. cargo clippy -p e2e-report --all-targets -- -D warnings: clean. cargo fmt --check: clean. cargo build --workspace: clean, no downstream breakage (xtask consumes this crate's public API). Signed-off-by: Jussi Elo <jussi.elo@amd.com> * address non-blocking review findings on e2e-report dedup - pin the consolidated report's <title> separately from its <h1>, which happened to share the same string - route PlatformReport::load's channel fallback through the same resolve_channel() rule effective_channel() uses, instead of duplicating it - mention page_shell in the components.rs module doc - reflow a doc comment line that split mid-phrase Signed-off-by: Jussi Elo <jussi.elo@amd.com> --------- Signed-off-by: Jussi Elo <jussi.elo@amd.com>
Summary
crates/e2e-report/src/consolidated.rsbundles 5 distinct concerns in one ~2,980-line file. This is the first of a staged split (ROCMAI-486), extracting the lowest-risk cluster first.rocmcommands were exercised by at least one platform, and whether they passed) into a newcommand_coverage.rs. It consumesconsolidated::PlatformReportbut shares no type with theGrid/reconciliation model, making it the most independent cluster to split off first.PlatformReport/CommandRecordandPlatformReport'scommands/labelfields andscenario_pass_map()method gainpub(crate)visibility so the new module can consume them, following this crate's existingparse.rsmodule-split precedent (EAI-8032). No logic changed. The split does introduce a back-edge —consolidated.rscalls intocommand_coverage.rsandcommand_coverage.rsconsumesPlatformReportback — documented indocs/architecture.mdrather than eliminated.docs/architecture.md's module map forcrates/e2e-reportaccordingly.Remaining split (tracked on ROCMAI-486 for a future pass)
consolidated.rsstill bundles: manifest/command parsing, theGrid/PlatformReportreconciliation model, HTML rendering, and markdown rendering. These are more entangled with each other (the model is consumed by both renderers) than the command-coverage cluster was, so they need more careful planning before splitting — left for a follow-up pass rather than attempted here, to keep this PR small per ROCMAI-27's convention of one cluster per PR.Note on overlap
Two other PRs from the same ROCMAI-200 backlog may also touch
consolidated.rsaround the same time (ROCMAI-484: redundant re-parsing; ROCMAI-485: status→glyph mapping evaluation). These may need a rebase against each other depending on merge order.Test plan
cargo test -p e2e-report --all-targets— 54/54 pass (same count as before the split)cargo clippy -p e2e-report --all-targets -- -D warnings— cleancargo build --workspace— clean, no downstream breakage (xtask/tests/e2e-cucumberconsume this crate)cargo xtask check-architecture-doc— cleanconsolidated.rsdo so because they need the privatePlatformReport::loadand the sharedfeature_jsonhelper, both local to that module).