-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix run-once runners #10195
fix run-once runners #10195
Conversation
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.
More lifecycle work! I really like the way this sets up for solving #1255 honestly.
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
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 tested this PR with https://github.com/Bluefinger/bevy_rand/blob/main/tests/determinism.rs and https://github.com/Bluefinger/bevy_rand/blob/main/examples/turn_based_game.rs as I was experiencing breakages in my tests with commit 5d110eb. I can at least confirm this resolves the issue I was seeing on my end. My example runs only once now and outputs only "one turn" of output instead of two, and my test is now resolving to expected values for only one run.
# Objective - After bevyengine#9826, there are issues on "run once runners" - example `without_winit` crashes: ``` 2023-10-19T22:06:01.810019Z INFO bevy_render::renderer: AdapterInfo { name: "llvmpipe (LLVM 15.0.7, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 23.2.1 - kisak-mesa PPA (LLVM 15.0.7)", backend: Vulkan } 2023-10-19T22:06:02.860331Z WARN bevy_audio::audio_output: No audio device found. 2023-10-19T22:06:03.215154Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 22.04 Ubuntu", kernel: "6.2.0-1014-azure", cpu: "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", core_count: "2", memory: "6.8 GiB" } thread 'main' panicked at crates/bevy_render/src/pipelined_rendering.rs:91:14: Unable to get RenderApp. Another plugin may have removed the RenderApp before PipelinedRenderingPlugin note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` - example `headless` runs the app twice with the `run_once` schedule ## Solution - Expose a more complex state of an app than just "ready" - Also block adding plugins to an app after it has finished or cleaned up its plugins as that wouldn't work anyway ## Migration Guide * `app.ready()` has been replaced by `app.plugins_state()` which will return more details on the current state of plugins in the app
…app` (#10389) # Objective The way `bevy_app` works was changed unnecessarily in #9826 whose changes should have been specific to `bevy_winit`. I'm somewhat disappointed that happened and we can see in #10195 that it made things more complicated. Even worse, in #10385 it's clear that this breaks the clean abstraction over another engine someone built with Bevy! Fixes #10385. ## Solution - Move the changes made to `bevy_app` in #9826 to `bevy_winit` - Revert the changes to `ScheduleRunnerPlugin` and the `run_once` runner in #10195 as they're no longer necessary. While this code is breaking relative to `0.12.0`, it reverts the behavior of `bevy_app` back to how it was in `0.11`. Due to the nature of the breakage relative to `0.11` I hope this will be considered for `0.12.1`.
…app` (#10389) # Objective The way `bevy_app` works was changed unnecessarily in #9826 whose changes should have been specific to `bevy_winit`. I'm somewhat disappointed that happened and we can see in #10195 that it made things more complicated. Even worse, in #10385 it's clear that this breaks the clean abstraction over another engine someone built with Bevy! Fixes #10385. ## Solution - Move the changes made to `bevy_app` in #9826 to `bevy_winit` - Revert the changes to `ScheduleRunnerPlugin` and the `run_once` runner in #10195 as they're no longer necessary. While this code is breaking relative to `0.12.0`, it reverts the behavior of `bevy_app` back to how it was in `0.11`. Due to the nature of the breakage relative to `0.11` I hope this will be considered for `0.12.1`.
# Objective - After bevyengine#9826, there are issues on "run once runners" - example `without_winit` crashes: ``` 2023-10-19T22:06:01.810019Z INFO bevy_render::renderer: AdapterInfo { name: "llvmpipe (LLVM 15.0.7, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 23.2.1 - kisak-mesa PPA (LLVM 15.0.7)", backend: Vulkan } 2023-10-19T22:06:02.860331Z WARN bevy_audio::audio_output: No audio device found. 2023-10-19T22:06:03.215154Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 22.04 Ubuntu", kernel: "6.2.0-1014-azure", cpu: "Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz", core_count: "2", memory: "6.8 GiB" } thread 'main' panicked at crates/bevy_render/src/pipelined_rendering.rs:91:14: Unable to get RenderApp. Another plugin may have removed the RenderApp before PipelinedRenderingPlugin note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` - example `headless` runs the app twice with the `run_once` schedule ## Solution - Expose a more complex state of an app than just "ready" - Also block adding plugins to an app after it has finished or cleaned up its plugins as that wouldn't work anyway ## Migration Guide * `app.ready()` has been replaced by `app.plugins_state()` which will return more details on the current state of plugins in the app
…app` (bevyengine#10389) # Objective The way `bevy_app` works was changed unnecessarily in bevyengine#9826 whose changes should have been specific to `bevy_winit`. I'm somewhat disappointed that happened and we can see in bevyengine#10195 that it made things more complicated. Even worse, in bevyengine#10385 it's clear that this breaks the clean abstraction over another engine someone built with Bevy! Fixes bevyengine#10385. ## Solution - Move the changes made to `bevy_app` in bevyengine#9826 to `bevy_winit` - Revert the changes to `ScheduleRunnerPlugin` and the `run_once` runner in bevyengine#10195 as they're no longer necessary. While this code is breaking relative to `0.12.0`, it reverts the behavior of `bevy_app` back to how it was in `0.11`. Due to the nature of the breakage relative to `0.11` I hope this will be considered for `0.12.1`.
…app` (#10389) # Objective The way `bevy_app` works was changed unnecessarily in #9826 whose changes should have been specific to `bevy_winit`. I'm somewhat disappointed that happened and we can see in bevyengine/bevy#10195 that it made things more complicated. Even worse, in #10385 it's clear that this breaks the clean abstraction over another engine someone built with Bevy! Fixes #10385. ## Solution - Move the changes made to `bevy_app` in #9826 to `bevy_winit` - Revert the changes to `ScheduleRunnerPlugin` and the `run_once` runner in #10195 as they're no longer necessary. While this code is breaking relative to `0.12.0`, it reverts the behavior of `bevy_app` back to how it was in `0.11`. Due to the nature of the breakage relative to `0.11` I hope this will be considered for `0.12.1`.
…app` (#10389) # Objective The way `bevy_app` works was changed unnecessarily in #9826 whose changes should have been specific to `bevy_winit`. I'm somewhat disappointed that happened and we can see in bevyengine/bevy#10195 that it made things more complicated. Even worse, in #10385 it's clear that this breaks the clean abstraction over another engine someone built with Bevy! Fixes #10385. ## Solution - Move the changes made to `bevy_app` in #9826 to `bevy_winit` - Revert the changes to `ScheduleRunnerPlugin` and the `run_once` runner in #10195 as they're no longer necessary. While this code is breaking relative to `0.12.0`, it reverts the behavior of `bevy_app` back to how it was in `0.11`. Due to the nature of the breakage relative to `0.11` I hope this will be considered for `0.12.1`.
Objective
without_winit
crashes:headless
runs the app twice with therun_once
scheduleSolution
Migration Guide
app.ready()
has been replaced byapp.plugins_state()
which will return more details on the current state of plugins in the app