Repository navigation
feat: fall back to a built mode when the primary build mode isn't built - #281
Open
hcallahan-lowrisc wants to merge 1 commit into
Open
hcallahan-lowrisc wants to merge 1 commit into
hcallahan-lowrisc wants to merge 1 commit into
Conversation
A sim cfg's primary_build_mode says whose coverage goes first in the merge. If a run selects only tests that use other build modes, and more than one of them, dvsim stops with "primary_build_mode ... is invalid", even though nothing else in the run depends on that build. So a cfg whose default build is not the primary one, or a run of only the tests that need special builds, can't be run without editing the cfg. Use the first of the run's builds by name instead, so the choice is the same from run to run, and warn if coverage is enabled (without it, nothing reads the primary build mode). A primary_build_mode that names no build mode of the cfg is still an error. A run that does build the primary mode is unchanged. 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/04-build-mode-fallback
branch
from
November 12, 2026 12:47
1c955a2 to
ea38617
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.
Description
A sim cfg's
primary_build_modedecides whose coverage goes first in the merge.If a run selects only tests that use other build modes, and more than one of them, dvsim stops with
primary_build_mode ... is invalid, even though nothing else in the run depends on that build.So a cfg whose default build is not the primary one can't be run without editing the cfg, and neither can a run of only the tests that need special builds.
dvsim now uses the first of the run's builds by name instead, rather than whichever build the test order happens to give first.
It warns if coverage is enabled; without coverage, nothing reads the primary build mode.
What stays the same:
primary_build_modethat names no build mode of the cfg is still an error.Compatibility
Runs that worked before are unchanged; a run that used to stop with this error now runs.
Testing
pytest: 506 passed (499 on master), which adds seven cases intests/sim/test_build_modes.py: the mode is kept when built, a single build becomes the primary, an equivalent build is followed, the fallback with and without coverage, an undefined primary, and a run with nothing to do.ruff checkis clean.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).