-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Improve safety for the multi-threaded executor using UnsafeWorldCell
#8292
Merged
alice-i-cecile
merged 33 commits into
bevyengine:main
from
joseph-gio:system-unsafe-world-cell
May 29, 2023
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
6816767
use `UnsafeWorldCell` for system impls
joseph-gio 6c25b97
add `ReadOnlySystem::run_read_only`
joseph-gio ea4f902
validate world in `run_read_only`
joseph-gio 87f267f
use `UnsafeWorldCell` in the system executor
joseph-gio f7ff99d
use elided lifetimes in the system executor
joseph-gio bf82d9d
remove an unnecessary unsafe block
joseph-gio 6f73a7d
improve docs for `run_read_only`
joseph-gio f026dd2
modify safety invariants for `System::run_unsafe`
joseph-gio 46a44a5
tweak some phrasing
joseph-gio 9b30215
simplify a condition-folding invariant
joseph-gio df64a3c
improve safety invariants in the executor
joseph-gio d8e70b4
use a more appropriate world access function
joseph-gio 6e036cd
return `Tick` from `UnsafeWorldCell::increment_change_tick
joseph-gio 0fb60ca
fix lifetimes
joseph-gio 21066eb
improve docs for `System::run`
joseph-gio a1d47d3
make condition evaluation function unsafe
joseph-gio c621dc4
Merge remote-tracking branch 'upstream/main' into system-unsafe-world…
joseph-gio 106ae64
Merge remote-tracking branch 'upstream/main' into system-unsafe-world…
joseph-gio 0cd81e8
add `UnsafeWorldCell::id`
joseph-gio 2da604f
use `UnsafeWorldCell` for `update_archetype_component_access`
joseph-gio 3eedf5c
update callsites in doctests
joseph-gio 9b934c0
split an unsafe block
joseph-gio 432d6d7
update some benchmarks
joseph-gio 07f9302
tweak a safety comment
joseph-gio c32b69b
Merge remote-tracking branch 'upstream/main' into system-unsafe-world…
joseph-gio 59dd4b7
simplify `impl SystemParam for WorldId`
joseph-gio a3d537d
Merge remote-tracking branch 'upstream/main' into system-unsafe-world…
joseph-gio 840dd95
fix formatting for a comment
joseph-gio 02334b5
remove an apostrophe
joseph-gio 2615867
rephrase a safety comment
joseph-gio 702f09f
rephrase another safety comment
joseph-gio 5e11ad5
Apply suggestions from code review
joseph-gio 4e6630d
Update crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
joseph-gio 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 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 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 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 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 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 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 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 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 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.
Really suprised we can elide the lifetime here.
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.
My preference is to always write
UnsafeWorldCell<'_>
to make it obvious this is happening.