-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Remove unsound SystemParam impl for DeferredWorld #17609
Conversation
Does this mean |
I think the only thing we need to do to make it sound is to check for existing access like if system_meta.component_access_set.has_any_component_read()
|| system_meta.component_access_set.has_any_resource_read()
{
panic!("Useful message")
} Oh, and system_meta.archetype_component_access.write_all(); Could we do that instead? |
DeferredWorld pushes into the World's command queue, not one specific to the system and that requires exclusive access to the world. |
Well, it was a little more complicated than I expected, but I created a competing PR that tries to leave the |
Oh! I missed that. It might still be sound, though. If we declare that accessing the World's command queue requires write-all-components access, then no more than one system can claim it. |
On second thought, I'd prefer fixing this in 0.16 cycle. |
It might be sound, but when do the command queue get applied? I don't think there's a determined place when they ever will get applied. Just whenever the world's queue happen's to get applied. Fixing this properly would be to somehow pass a system stored command queue to the constructor of DeferredWorld. |
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 pref here is to remove this for now and it can just be readded once an appropriate pr shows up.
Closing in favor of #17616. |
Objective
The following test currently passes (i.e. no panic) on main:
Solution
Remove the unsound
SystemParam
impl forDeferredWorld
.Migration Guide
The
SystemParam
implementation forDeferredWorld
was removed due to unsoundness. Consider usingCommands
instead.