-
-
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
Use single threaded executor in benchmarks and tests #9908
base: main
Are you sure you want to change the base?
Conversation
333d60c
to
cb8253e
Compare
You shouldn't make this change for any of those scheduling benchmarks. Those are specifically measuring multithreaded execution. |
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.
Can you also do a pass over the doc examples? Those get run during testing too. A lot of them are using Schedule::default.
crates/bevy_ecs/src/query/mod.rs
Outdated
@@ -791,7 +791,7 @@ mod tests { | |||
} | |||
} | |||
|
|||
let mut schedule = Schedule::default(); | |||
let mut schedule = Schedule::default(); // Uses MultiThreaded executor |
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.
Are you sure this should use the multithreaded schedule? This seems to just be testing the parallel iterator, which is unrelated to multithreaded scheduling.
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.
When I tried it with the singlethreaded schedule it didn't work... might have accidentaly uncovered a bug :P
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 changed it to single_threaded on my machine and wasn't able to get it to fail. Could you double check and post the error if it does?
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.
Nevermind, changed it to single_threaded
and it seems to work fine :P
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.
---- query::tests::par_iter_mut_change_detection stdout ----
thread 'query::tests::par_iter_mut_change_detection' panicked at 'A ComputeTaskPool has not been initialized yet. Please call ComputeTaskPool::init beforehand.', crates/bevy_tasks/src/usages.rs:28:33
Encountered a panic in system `bevy_ecs::query::tests::par_iter_mut_change_detection::propagate_system`!
failures:
query::tests::par_iter_mut_change_detection
Got a failure for this test on the latest commit. Might be flaky...
Left the visible ones as default in order to not make things confusing. The invisible ones (marked with `/// #`) I changed to single_threaded.
I think we should make a |
Same for rendering benchmarks, we want those to be multithreaded. |
2043acb
to
bbb8c46
Compare
@JMS55 Which rendering benchmarks are you referring to? I couldn't find any in the |
Ah nvm then. All the rendering "benchmarks" are actually examples, not part of benches. |
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.
This looks like the right setup now to me.
@A-Walrus that CI failure looks like it might be real: can you reproduce it locally? |
@alice-i-cecile It's passing locally, but it has failed in CI multiple times. Weird |
So we should either do like the error is saying and call |
Objective
Fixes: #9838
Solution
Add
single_threaded
constructor forSchedule
and use it in all benchmarks and tests.