-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Merge SystemParam::validate_param into SystemParam::get_param
#23225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alice-i-cecile
merged 24 commits into
bevyengine:main
from
alice-i-cecile:param-validation-merging
Mar 11, 2026
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
9d3a8ed
Describe strategy in the migration guide
alice-i-cecile b92e3d9
Note `SystemState` changes that will be needed
alice-i-cecile 1b739a6
Initial migration
alice-i-cecile 7c0c045
Beef up migration guide to account for changes required
alice-i-cecile 8303d4f
Add tests for validation occurring when systems are run
alice-i-cecile fbcbbb9
Perform the same changes for ExclusiveSystemParam
alice-i-cecile 026c974
Cargo fmt
alice-i-cecile fbff8d2
Note panic in `ParamSet::get_mut`
alice-i-cecile e604357
Improve migration guide for Multithreaded executor
alice-i-cecile 0a280d6
h2 headers in migration guide
alice-i-cecile b2782dd
Clippy
alice-i-cecile eeab64a
Fill in PR number
alice-i-cecile dddb08e
Clippy
alice-i-cecile 3c9560f
Fix failing tests
alice-i-cecile 40ef199
Revert incidental behavior change to `Single`
alice-i-cecile 8bcbf40
Add pipe_system_validation_skip_in_second test
alice-i-cecile fdaaeb5
Refactor gizmos::get_config
alice-i-cecile d151037
Don't format twice for no reason
alice-i-cecile 69cb5c0
Validate `ParamSet` sub-params eagerly, and skip if any fail
alice-i-cecile 4958e80
Remove panics comment
alice-i-cecile 3f700e1
Merge branch 'main' into param-validation-merging
alice-i-cecile 90ac6a1
Fix failing test by making sure error message does not change
alice-i-cecile 5c5674f
Update docs on get_param to match chescock's suggestion
alice-i-cecile 34fc43b
Fix missing unwrap...
alice-i-cecile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH this is a pretty weird pattern. Who uses
SystemStateto query on theWorld?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's silly when there is only one
Querysince they could just have usedQueryState, but usingSystemState<(Query<A>, Query<B>)>to split the world seems reasonable. And it's going to feel bad to have tounwrap()there even thoughQueryparameters never fail.I think we're eventually going to want an
InfallibleSystemParamsubtrait likeAnd then have fallible and infallible versions of
SystemState::get.That doesn't need to be in this PR, of course, although it will feel a little silly to add all these
unwrap()s if we then get to remove them again soon.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should instead be pushing users to just call
World::run_systemmore for these sorts of world-splitting use cases. The ergonomics are ultimately always going to be much better, and it's more consistent with other usages.Then: no more internal complexity!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah,
run_system_cachedhas really nice ergonomics when it works! I don't think it's a complete replacement forSystemStateyet, though. It's a little less flexible, since needing a function prevents certain kinds of control flow, and it's a little less efficient, since you need to look up the system state in the world.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhmm, but for tests and benchmarks it's a much better pattern! It just didn't exist when these were written.