Repository navigation
feat: record the git revision of each cfg extension in the reports - #283
Open
hcallahan-lowrisc wants to merge 2 commits into
Open
hcallahan-lowrisc wants to merge 2 commits into
hcallahan-lowrisc wants to merge 2 commits into
Conversation
This was referenced Nov 10, 2026
There is no way to add to a cfg that dvsim loads from the project tree
without editing that tree: import_cfgs and overrides only act on the
file that holds them, and a primary cfg can't reach into its children.
A partner or licensed-VIP testbench kept outside the tree therefore has
to patch the project's hjson.
--cfg-extend NAME=PATH (repeatable) loads PATH with its imports and
merges it into the cfg whose name is NAME, after that cfg has merged all
of its own files and before overrides and wildcards are processed. The
normal rules apply: lists concatenate, so the extension's build_opts
come after the tool's, which hold its filelist; a conflicting scalar is
an error (tool included, unless --tool is given); the extension's
overrides join the cfg's own. Because the arguments are shared with
every child cfg, this works whether NAME is run on its own or is a
child of a primary cfg. The extension names its own files with
{file_dir}.
Extensions apply in command-line order. An extension that no cfg
matched is an error, which catches typos and upstream renames; so is
naming the same NAME=PATH twice, naming a primary cfg, an extension that
sets use_cfgs, or one that names an import that can't be resolved.
AI-assisted (Claude Code) — reviewed and approved by author
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
A report says which project commit its results came from, but not which version of a --cfg-extend file was merged in. When the extension lives in its own repository, as it usually does, the results of the tests it adds can't be traced back to it. When a cfg merges an extension, dvsim now reads the git revision of the checkout that holds the extension file: the origin URL, with any credentials stripped as for the project's own, the commit, and whether the checkout is dirty, which includes the file itself being untracked or ignored. The sim flow JSON results list each cfg's extensions in command-line order with that revision (null outside git), the Markdown block report lists them with their revisions, and the HTML block report shows them in its header. This adds a key, extensions, to the JSON results: to each flow's <flow>.json and to each entry of flow_results in index.json. A flow that merged no extension leaves the key out, so the JSON of a run that doesn't use --cfg-extend is unchanged. A run that does use it writes JSON that an older dvsim can't load: SimFlowResults and SimResultsSummary forbid unknown keys (extra="forbid"), so for example dvsim-admin report gen of an earlier release fails to validate it. Readers that parse the JSON leniently are not affected. The JSON has no schema version that a reader could check; making the models ignore unknown keys, or adding a version, is left to a later change. AI-assisted (Claude Code) — reviewed and approved by author Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Harry Callahan <hcallahan@lowrisc.org>
hcallahan-lowrisc
force-pushed
the
stack/06-cfg-extend-report-rev
branch
from
November 12, 2026 12:47
b1cc6e4 to
9649c09
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
This changes the results JSON.
A run that uses
--cfg-extendwrites a new key,extensions, which released dvsim (v1.59.1 and earlier) can't load.A run without
--cfg-extendwrites the same JSON as before.Details are under "Results JSON" below.
Description
A report says which project commit its results came from, but not which version of a
--cfg-extendfile was merged in.When the extension lives in its own repository, as it usually does, the results of the tests it adds can't be traced back to it.
When a cfg merges an extension, dvsim now reads the git revision of the checkout that holds the extension file.
That revision is:
originURL, with any credentials stripped as for the project's own;The revision is reported in three places:
nulloutside git).Extension: ext.hjson sha: 1a2b3c4 (dirty).Files that an extension imports from elsewhere are not recorded.
Results JSON
The new key
extensionsgoes in each flow's<flow>.json, and in each entry offlow_resultsinindex.json:--cfg-extend: the key is left out, so the JSON is unchanged, and any reader that loads it today still does.--cfg-extend:SimFlowResultsandSimResultsSummaryforbid unknown keys (extra="forbid"), so an older dvsim rejects the file.For example, v1.57.1's
dvsim-admin report genfails with1 validation error for SimFlowResults: extensions: Extra inputs are not permitted.Readers that parse the JSON leniently are not affected.
feat, notfeat!, because nothing that works today stops working.Only results of the new option are new, and today's dvsim reads every JSON it wrote before.
If you'd rather treat "old readers reject new output" as breaking, I'll add a
BREAKING CHANGE:footer.Making the models ignore unknown keys, or adding a version, would stop this happening again.
I'd like to leave that to its own PR, and can open one if you agree.
Testing
pytest: 531 passed (499 on master), which addstests/report/test_extensions.pyand git revision cases intests/utils/test_git.py.They cover the JSON with and without extensions, the Markdown and HTML output, and a round trip.
ruff checkis clean.dvsim-admin report genloads the JSON of a run without--cfg-extendfrom this branch, and rejects that of a run with it, on the oneextensionskey.Checklist
git commit -s), indicating acceptance of the CLA<type>[(<scope>)][!]: <description>)!or aBREAKING CHANGE:footerThis PR includes AI-assisted content generated with Claude Code. All changes have been reviewed and are the responsibility of the listed author(s).