-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix system param validation for piped systems #18785
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
Conversation
Looks fine, no point spending more time on this, since the full fix requires checking params inside each |
Won't doing eager validation like this re-introduce the issues from #16638 (comment)? If a user pipes a system that inserts a resource into a system with |
I was going to say that this is quite unlikely, since all of our existing validated parameters requires structural changes to invalidate, but system piping doesn't work for exclusive systems. I wrote a test: turns out at some point that changed! That said, I think this is a better tradeoff for now: piping exclusive systems or doing custom validated system params that are affected by an earlier system in the pipe feels quite rare. By contrast, the existing bug breaks a relatively common pattern (using validated params in a piped system) by changing the "everything is fine" behavior into a confusing panic. |
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, breaking resource_exists::<MyRes>.and(do_stuff)
is what seemed really bad, but I see you're doing this for pipe
but not combinators, so this does seem like the right tradeoff!
Co-authored-by: Chris Russell <[email protected]>
Yeah, I saw that doc test fail, stared at it for a while in dismay, and then gave up and reverted the change. That is a much harder fix than I want for "last minute during 0.16". |
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.
Not an ECS dev but the changes look good to me and has really solid tests.
# Objective - Piped systems are an edge case that we missed when reworking system parameter validation. - Fixes #18755. ## Solution - Validate the parameters for both systems, ~~combining the errors if both failed validation~~ by simply using an early out. - ~~Also fix the same bug for combinator systems while we're here.~~ ## Testing I've added a large number of tests checking the behavior under various permutations. These are separate tests, rather than one mega test because a) it's easier to track down bugs that way and b) many of these are `should_panic` tests, which will halt the evaluation of the rest of the test! I've also added a test for exclusive systems being pipeable because we don't have one and I was very surprised that that works! --------- Co-authored-by: Chris Russell <[email protected]>
# Objective - Piped systems are an edge case that we missed when reworking system parameter validation. - Fixes bevyengine#18755. ## Solution - Validate the parameters for both systems, ~~combining the errors if both failed validation~~ by simply using an early out. - ~~Also fix the same bug for combinator systems while we're here.~~ ## Testing I've added a large number of tests checking the behavior under various permutations. These are separate tests, rather than one mega test because a) it's easier to track down bugs that way and b) many of these are `should_panic` tests, which will halt the evaluation of the rest of the test! I've also added a test for exclusive systems being pipeable because we don't have one and I was very surprised that that works! --------- Co-authored-by: Chris Russell <[email protected]>
Objective
Single
causes piped systems to panic #18755.Solution
combining the errors if both failed validationby simply using an early out.Also fix the same bug for combinator systems while we're here.Testing
I've added a large number of tests checking the behavior under various permutations. These are separate tests, rather than one mega test because a) it's easier to track down bugs that way and b) many of these are
should_panic
tests, which will halt the evaluation of the rest of the test!I've also added a test for exclusive systems being pipeable because we don't have one and I was very surprised that that works!