Skip to content

refactor(rocprofiler-compute): Extract shared HTML report shell - #12529

Merged
vedithal-amd merged 5 commits into
rocprofiler-compute-developfrom
users/abchoudh/aiprofcomp-868/1-html-report-shell
Oct 19, 2026
Merged

vedithal-amd merged 5 commits into
rocprofiler-compute-developfrom
users/abchoudh/aiprofcomp-868/1-html-report-shell

Conversation

@abchoudh-amd

@abchoudh-amd abchoudh-amd commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The memory chart HTML work needs a shared report frame. This refactor moves the existing roofline page onto that frame while keeping its model and controls.

Technical Details

  • Move document assembly, asset loading, and script-safe JSON embedding into shared HTML report utilities.
  • Keep the roofline plot fragment and page assets while the shared shell supplies the document frame and theme setup.
  • Register shared-shell unit coverage alongside the existing roofline tests.

JIRA ID

JIRA ID: AIPROFCOMP-868

Test Plan

  • Run ctest for the roofline main, roofline analyze, and HTML report targets.

Test Result

  • ctest for the roofline main, roofline analyze, and HTML report targets pass

Submission Checklist

@abchoudh-amd
abchoudh-amd marked this pull request as ready for review October 1, 2026 10:36
Copilot AI balanced review requested due to automatic review settings October 1, 2026 10:36
@abchoudh-amd
abchoudh-amd requested a review from a team as a code owner October 1, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

JSON embedding remains vulnerable to script parser state changes, and NumPy booleans cannot be serialized.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Extracts a reusable standalone HTML report shell and migrates the roofline report to it.

Changes:

  • Adds shared document, asset, JSON, model, and theme utilities.
  • Refactors roofline HTML generation to use the shared shell.
  • Adds unit tests and registers them with CTest categories.
File Description
CMakeLists.txt Registers shared-shell tests.
src/​utils/​html_report/​__init__.py Defines the utility package.
src/​utils/​html_report/​document.py Implements shared document assembly.
src/​utils/​html_report/​assets/​report_shell.html Provides the common HTML frame.
src/​utils/​html_report/​assets/​report_base.js Provides shared model and theme handling.
src/​roofline/​roofline_html.py Migrates roofline document generation.
src/​roofline/​assets/​roofline_plot.html Reduces the template to body content.
src/​roofline/​assets/​roofline_plot.js Uses shared model and theme APIs.
src/​roofline/​assets/​roofline_plot.css Adopts the shared theme class.
tests/​unit/​utils/​test_html_report.py Tests shared report utilities.
tests/​unit/​roofline/​test_roofline_main.py Updates roofline integration tests.
tests/​test_categories.yaml Adds the new test to test tiers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@abchoudh-amd
abchoudh-amd removed this pull request from stack #12533 October 5, 2026 04:51
@abchoudh-amd
abchoudh-amd added this pull request to stack #12775 October 5, 2026 04:51
- Remove the model id check; every caller passes a hard-coded id.
- Test shell behavior (title escaping, fragment order, dark theme, JSON
  escaping) instead of exact template text.
- Remove the Plotly bundle and missing-file tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vedithal-amd

Copy link
Copy Markdown
Contributor

Pushed a small follow-up: removed the model id check (callers pass hard-coded ids), trimmed the shell tests to behavior instead of exact template text, and dropped the Plotly bundle and missing-file tests.

@vedithal-amd vedithal-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- Route the roofline kernel list tooltip assets from #12190 through
  build_document.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vedithal-amd
vedithal-amd merged commit c7d8b5f into rocprofiler-compute-develop Oct 19, 2026
76 checks passed
@vedithal-amd
vedithal-amd deleted the users/abchoudh/aiprofcomp-868/1-html-report-shell branch October 19, 2026 22:09
vedithal-amd added a commit that referenced this pull request Oct 19, 2026
## Motivation

The memory chart HTML work in
[AIPROFCOMP-868](https://amd-hub.atlassian.net/browse/AIPROFCOMP-868)
needs report controls and panels that can be styled consistently. This
refactor builds on #12529 and
keeps the roofline page appearance.

## Technical Details

- Move common report layout, panel, control, and theme styles into a
shared base stylesheet.
- Rename the generic roofline CSS classes and variables to report names
while keeping roofline-only rules local.
- Keep roofline element IDs and controls compatible with its existing
JavaScript and tests.

## JIRA ID

JIRA ID: AIPROFCOMP-868

## Test Plan

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.
- [x] Run workload: Open a generated two-kernel roofline page offline
and verify theme, selection, Ctrl-click, Show all, and PNG export.

## Test Result

- [x] ctest for the roofline main, roofline analyze, and HTML report
targets pass

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vedithal-amd added a commit that referenced this pull request Oct 25, 2026
The memory chart HTML work needs a shared report frame. This refactor
moves the existing roofline page onto that frame while keeping its model
and controls.

- Move document assembly, asset loading, and script-safe JSON embedding
into shared HTML report utilities.
- Keep the roofline plot fragment and page assets while the shared shell
supplies the document frame and theme setup.
- Register shared-shell unit coverage alongside the existing roofline
tests.

JIRA ID: AIPROFCOMP-868

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.

- [X] ctest for the roofline main, roofline analyze, and HTML report
targets pass

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vedithal-amd added a commit that referenced this pull request Oct 25, 2026
## Motivation

The memory chart HTML work in
[AIPROFCOMP-868](https://amd-hub.atlassian.net/browse/AIPROFCOMP-868)
needs report controls and panels that can be styled consistently. This
refactor builds on #12529 and
keeps the roofline page appearance.

## Technical Details

- Move common report layout, panel, control, and theme styles into a
shared base stylesheet.
- Rename the generic roofline CSS classes and variables to report names
while keeping roofline-only rules local.
- Keep roofline element IDs and controls compatible with its existing
JavaScript and tests.

## JIRA ID

JIRA ID: AIPROFCOMP-868

## Test Plan

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.
- [x] Run workload: Open a generated two-kernel roofline page offline
and verify theme, selection, Ctrl-click, Show all, and PNG export.

## Test Result

- [x] ctest for the roofline main, roofline analyze, and HTML report
targets pass

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vedithal-amd added a commit that referenced this pull request Oct 26, 2026
The memory chart HTML work needs a shared report frame. This refactor
moves the existing roofline page onto that frame while keeping its model
and controls.

- Move document assembly, asset loading, and script-safe JSON embedding
into shared HTML report utilities.
- Keep the roofline plot fragment and page assets while the shared shell
supplies the document frame and theme setup.
- Register shared-shell unit coverage alongside the existing roofline
tests.

JIRA ID: AIPROFCOMP-868

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.

- [X] ctest for the roofline main, roofline analyze, and HTML report
targets pass

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vedithal-amd added a commit that referenced this pull request Oct 26, 2026
## Motivation

The memory chart HTML work in
[AIPROFCOMP-868](https://amd-hub.atlassian.net/browse/AIPROFCOMP-868)
needs report controls and panels that can be styled consistently. This
refactor builds on #12529 and
keeps the roofline page appearance.

## Technical Details

- Move common report layout, panel, control, and theme styles into a
shared base stylesheet.
- Rename the generic roofline CSS classes and variables to report names
while keeping roofline-only rules local.
- Keep roofline element IDs and controls compatible with its existing
JavaScript and tests.

## JIRA ID

JIRA ID: AIPROFCOMP-868

## Test Plan

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.
- [x] Run workload: Open a generated two-kernel roofline page offline
and verify theme, selection, Ctrl-click, Show all, and PNG export.

## Test Result

- [x] ctest for the roofline main, roofline analyze, and HTML report
targets pass

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lamikr pushed a commit that referenced this pull request Oct 27, 2026
The memory chart HTML work needs a shared report frame. This refactor
moves the existing roofline page onto that frame while keeping its model
and controls.

- Move document assembly, asset loading, and script-safe JSON embedding
into shared HTML report utilities.
- Keep the roofline plot fragment and page assets while the shared shell
supplies the document frame and theme setup.
- Register shared-shell unit coverage alongside the existing roofline
tests.

JIRA ID: AIPROFCOMP-868

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.

- [X] ctest for the roofline main, roofline analyze, and HTML report
targets pass

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lamikr pushed a commit that referenced this pull request Oct 27, 2026
## Motivation

The memory chart HTML work in
[AIPROFCOMP-868](https://amd-hub.atlassian.net/browse/AIPROFCOMP-868)
needs report controls and panels that can be styled consistently. This
refactor builds on #12529 and
keeps the roofline page appearance.

## Technical Details

- Move common report layout, panel, control, and theme styles into a
shared base stylesheet.
- Rename the generic roofline CSS classes and variables to report names
while keeping roofline-only rules local.
- Keep roofline element IDs and controls compatible with its existing
JavaScript and tests.

## JIRA ID

JIRA ID: AIPROFCOMP-868

## Test Plan

- [x] Run ctest for the roofline main, roofline analyze, and HTML report
targets.
- [x] Run workload: Open a generated two-kernel roofline page offline
and verify theme, selection, Ctrl-click, Show all, and PNG export.

## Test Result

- [x] ctest for the roofline main, roofline analyze, and HTML report
targets pass

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

[AIPROFCOMP-868]:
https://amd-hub.atlassian.net/browse/AIPROFCOMP-868?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants