Skip to content

Replace HTMX-driven DOM injection in sim reports with static templated pages#108

Open
AlexJones0 wants to merge 6 commits intolowRISC:masterfrom
AlexJones0:report_fixes_2
Open

Replace HTMX-driven DOM injection in sim reports with static templated pages#108
AlexJones0 wants to merge 6 commits intolowRISC:masterfrom
AlexJones0:report_fixes_2

Conversation

@AlexJones0
Copy link
Contributor

@AlexJones0 AlexJones0 commented Mar 5, 2026

This PR is the second of a series of 4 PRs which aim to fix issues in HTML report generation and add back Markdown CLI reports to DVSim.

This PR features a larger overall change to the HTML sim report generation which aims to make the following changes:

  • Always render static CSS/JS and an index to resolve issues when running for only single IPs/blocks (fixes CSS not generated when running DV for a single IP not part of a regression suite #89).
  • Switch from using HTMX-driven DOM injection to fully-templated static pages to resolve the issue where the HTML header, navbar and CSS (all content in the wrapper) would disappear upon refreshing, because content was no longer being fetched via HTMX from the new partial index. Since we are rendering a static site, it is better to fully template the pages. The wrapper is still used, but it now just wraps each generated templated page, so that all pages can be accessed independently. The HTMX dependency is retained for now as it might be useful in the future, however.
  • The build seed info is present in the original DVSim Markdown CLI reports but not in the generated HTML reports - this is useful info, so we add it in.

It is recommended to review commit-by-commit, checking the commit messages for more info.

This commit makes a few changes that are quite coupled, targeted at
fixing the broken CSS for generated block reports when just running a
block-level regression (i.e. no primary config). These changes are:
 - Always generate a "summary" report, regardless of if using a primary
   config or not.
 - Generating a summary report will still attach the static CSS/JS and
   HTMX wrapper, so these are now picked up by all runs.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Note: the static HTMX JS dependency is retained since it still might be
useful later.

The current HTML report generation flow generated an index file which
used HTMX to fetch the summary report. This had a couple of issues:
 - Doesn't work if there is no summary report (i.e. we are just
   generating results for a single block), meaning that block report
   will have no CSS.
 - Means that each individual page is not individually navigable, which
   causes problems if:
   - You want to load the page locally rather than being served it.
   - You refresh, at which point data is no longer retrieved via HTMX
     and so the DOCTYPE, HTML head, navbar and static CSS/JS are
     missing.

Since we are just generating a static site and are not serving it
anywhere, HTMX doesn't make as much sense for this use case and the
issue can be resolved by templating. Now:
 - The wrapper is used for templating to attach the static content to
   each individual HTML page fragment.
 - "summary.html" is now just renamed to "index.html" so that it matches
   the existing "index.json", and is automatically picked up when served
   via a HTTP server.
 - This summary is recreated on every run to keep report generation
   idempotent, so that a block-level sim in one run is not disrupted by
   results from a previous top-level sim.
 - As part of the change, the summary buttons now occupy the entire
   table cell to make linking cleaner and more intuitive to use.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
All other HTML report templates use spaces, but this one uses tabs.
Convert it to use spaces for consistency.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
Currently this top-left navbar brand element redirected nowhere, but it
should probably redirect to the root of the site to be consistent with
how other sites handle this element.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
This is no longer used and instead coverage results are reconstructed
into HTML tables by the new report logic from the dict. To avoid
cluttering the code even more, just remove this attribute.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
The build seed was surfaced in the original DVSim CLI reports, and so
should probably be surfaced in the HTML reports as well.

Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
@AlexJones0
Copy link
Contributor Author

AlexJones0 commented Mar 9, 2026

Latest force push is a rebase on master, and contains the following changes, based on initial feedback:

  • Do not record a primary_cfg attribute on the SimFlowResults, instead just make the top scope optional.
  • Always generate a summary report, even for non-primary-cfg runs (block level regressions).
  • Rename summary report from summary.html to index.html and remove redirecting index.html. This removes a layer of indirection and brings the summary report more in line with the existing index.json output.

Note: I think based on a couple of changes in this PR, it might be useful to decouple the revision info (commit, branch, URL) from the blocks/top scopes and just have it as a separate bundle of metadata in the SimResultsSummary, to avoid the workarounds I have to do in the template here. Since this is a larger refactor that would touch most parts of DVSim, I think that change in this direction should be left to a separate PR after my current series of PRs.

@AlexJones0 AlexJones0 requested a review from machshev March 9, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS not generated when running DV for a single IP not part of a regression suite

2 participants