Skip to content
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

[Merged by Bors] - Migrate engine to Schedule v3 #7267

Closed
wants to merge 297 commits into from
Closed
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
297 commits
Select commit Hold shift + click to select a range
7bea2e7
Remove add_set method
alice-i-cecile Jan 19, 2023
3ef0b50
Use outer schedule, rather than active schedule
alice-i-cecile Jan 19, 2023
d4da305
Merge remote-tracking branch 'origin/main' into stage-yeet
alice-i-cecile Jan 19, 2023
366e867
Hard code which schedule is run in App::update
alice-i-cecile Jan 19, 2023
777f381
Revert "Hard code which schedule is run in App::update"
alice-i-cecile Jan 19, 2023
a1da867
Active and default schedules have been removed
alice-i-cecile Jan 19, 2023
b221923
Implement *Label for Box<dyn *Label>
alice-i-cecile Jan 19, 2023
c981a73
Improve bevy_ecs prelude
alice-i-cecile Jan 19, 2023
2552d97
Fix incorrect usage of default_schedule_label
alice-i-cecile Jan 19, 2023
92aff8a
Export common_conditions in the prelude
alice-i-cecile Jan 19, 2023
780a574
Make run_schedule take a &Label
alice-i-cecile Jan 19, 2023
1c8e075
Borrow checker fixes
alice-i-cecile Jan 19, 2023
f278e2e
Clean up imports
alice-i-cecile Jan 19, 2023
a67a5a1
Remove .at_end from tick_global_task_pools_on_main_thread
alice-i-cecile Jan 19, 2023
a1ec0d7
Fix more imports
alice-i-cecile Jan 19, 2023
77f4314
Replace run criteria for ReportHierarchyIssue
alice-i-cecile Jan 19, 2023
95490e6
TimeSystem is no longer an exclusive system
alice-i-cecile Jan 19, 2023
b090724
Fix newly merged add_system_to_stage
alice-i-cecile Jan 19, 2023
b7479f2
Actually break out of the startup schedule
alice-i-cecile Jan 19, 2023
ea7bef3
Basic setup for fixed time steps
alice-i-cecile Jan 19, 2023
15e6548
Implement new strategy for fixed timesteps
alice-i-cecile Jan 19, 2023
7e1d952
Fix imports in log_diagnostics_plugin
alice-i-cecile Jan 19, 2023
4cf7063
Find and replace error
alice-i-cecile Jan 19, 2023
63633a3
Imports for bevy_asset
alice-i-cecile Jan 19, 2023
bc66890
Add and use app.init_schedule
alice-i-cecile Jan 19, 2023
b2189a5
Merge branch `main` into stage-yeet
alice-i-cecile Jan 19, 2023
5679670
Migrate AssetStage to AssetSet
alice-i-cecile Jan 20, 2023
558766b
Find and replace error
alice-i-cecile Jan 20, 2023
d1f4daa
transform_propagate_system_set -> Schedule
alice-i-cecile Jan 20, 2023
bdaada4
Clean up and fix imports
alice-i-cecile Jan 20, 2023
4b96751
Merge remote-tracking branch 'origin/main' into stage-yeet
alice-i-cecile Jan 20, 2023
c035d5c
Remove fresh add_system_to_stage
alice-i-cecile Jan 20, 2023
4053484
Migrate bevy_transform system tests
alice-i-cecile Jan 20, 2023
0f25c8f
Migrate RenderStage -> RenderSet
alice-i-cecile Jan 20, 2023
43fdc34
Remove flush point after RenderSet::Extract
alice-i-cecile Jan 20, 2023
d2ddb20
Remove `set_must_read_resource`
alice-i-cecile Jan 20, 2023
3929c85
Outline strategy of pipelined rendering migration
alice-i-cecile Jan 20, 2023
63b587a
Add and use App::add_extract_system convenience method
alice-i-cecile Jan 20, 2023
d6330ec
Re-add MainThreadExecutor
alice-i-cecile Jan 20, 2023
49f6221
Fix merge conflict
alice-i-cecile Jan 20, 2023
0718073
Move calculate_bounds system to Update
alice-i-cecile Jan 20, 2023
525679f
Add Schedule::apply_system_buffers
alice-i-cecile Jan 20, 2023
d82e533
Fix new systems added in bevy_winit
alice-i-cecile Jan 20, 2023
021141c
Remove dead imports to unbreak RA
alice-i-cecile Jan 20, 2023
de49e4e
get bevy_render compiling
hymm Jan 21, 2023
d5c8224
move some stuff back to make the diff cleaner
hymm Jan 21, 2023
7c36bf9
add main thread executor to multithreaded executor scope
hymm Jan 21, 2023
5d6a44b
Merge pull request #81 from hymm/pipelined-stage-yeet
alice-i-cecile Jan 22, 2023
1103e16
just have extract schedule live in render app schedules
hymm Jan 22, 2023
850b59f
Merge pull request #82 from hymm/extract-as-normal-schedule
alice-i-cecile Jan 22, 2023
29e3c3a
fix getting thread executor from the world
hymm Jan 23, 2023
81b9b9d
Merge pull request #83 from hymm/fix-main-thread-executor
alice-i-cecile Jan 23, 2023
ee30461
fix default_schedule_label lookup
jakobhellermann Jan 23, 2023
2776f6c
Merge pull request #84 from jakobhellermann/stage-yeet
alice-i-cecile Jan 23, 2023
b6fd119
Merge branch 'main' into stage-yeet
alice-i-cecile Jan 23, 2023
405569d
Move scene_spawner_system
alice-i-cecile Jan 23, 2023
f4fc839
Trivial compiler error fixes
alice-i-cecile Jan 23, 2023
99f5367
Migrate more rendering systems
alice-i-cecile Jan 23, 2023
27d738f
Make bevy_pbr::add_clusters an ordinary system
alice-i-cecile Jan 23, 2023
dcef89c
Get bevy_text compiling
alice-i-cecile Jan 23, 2023
29e166a
Get bevy_ui compiling
alice-i-cecile Jan 23, 2023
4a471fd
Migrate bevy_pbr::prepare_lights and prepare_views
alice-i-cecile Jan 23, 2023
4877dce
First pass of docs for references to stages
alice-i-cecile Jan 23, 2023
2cea36c
Remove usages of add_system_to_stage in tests and examples
alice-i-cecile Jan 23, 2023
cd69bbb
Remove simple usages of SystemStage
alice-i-cecile Jan 23, 2023
c8c1749
More docs cleanup
alice-i-cecile Jan 23, 2023
841f39c
CoreSchedule::Outer runs CoreScheduleMain on the first update
alice-i-cecile Jan 23, 2023
c09938d
Remove dead example from Cargo.toml
alice-i-cecile Jan 23, 2023
17eb90d
Rename bevy_ecs/schedule -> bevy_ecs/scheduling
alice-i-cecile Jan 23, 2023
29f2caf
Clippy
alice-i-cecile Jan 23, 2023
432900a
Migrate simple uses of SystemSet
alice-i-cecile Jan 23, 2023
c1e3e23
Assorted example compile error fixes
alice-i-cecile Jan 23, 2023
5bc8970
Correctly initialize the outer schedule
alice-i-cecile Jan 23, 2023
b6859c5
Initialize Schedules resource in RenderApp
alice-i-cecile Jan 23, 2023
91e2b07
doobie
tim-blackbird Jan 23, 2023
4a87dde
Merge pull request #88 from devil-ira/stage-yeet
alice-i-cecile Jan 23, 2023
6091b66
Revert "Merge pull request #88 from devil-ira/stage-yeet"
alice-i-cecile Jan 23, 2023
1ac76da
Merge remote-tracking branch 'alice-i-cecile/stage-yeet' into stage-yeet
alice-i-cecile Jan 23, 2023
291c8c4
fire
tim-blackbird Jan 24, 2023
6e5f8cc
Yay!
tim-blackbird Jan 24, 2023
b1d4032
Merge pull request #89 from devil-ira/stage-yeet-remove-on_enter-and-…
alice-i-cecile Jan 24, 2023
60dcaf8
Merge pull request #90 from devil-ira/stage-yeet-hello-world-is-working
alice-i-cecile Jan 24, 2023
c2fc8e2
Typo fix
alice-i-cecile Jan 24, 2023
319e021
Apply default set appropriately
alice-i-cecile Jan 24, 2023
facf9c1
Fix implementation of impl Label for BoxedLabel
alice-i-cecile Jan 24, 2023
d0a80d8
Fix doc strings for FixedTimeStep
alice-i-cecile Jan 24, 2023
83db16e
Fix typo in derive macro
alice-i-cecile Jan 24, 2023
19e23de
Move `world.init_resource::<Schedules>()` to `App::empty`
tim-blackbird Jan 24, 2023
e414ea6
Merge remote-tracking branch 'origin/main' into stage-yeet
alice-i-cecile Jan 24, 2023
ae5c433
Add `App::configure_set`
tim-blackbird Jan 24, 2023
93e97e4
Add `no_default_set()` to `IntoSystem(Set)Config`
tim-blackbird Jan 24, 2023
2822e1c
Make `SubApp`s run the outer_schedule instead of the default_schedule
tim-blackbird Jan 24, 2023
fdd5a59
ecs_guide example fixes
tim-blackbird Jan 24, 2023
c6a7539
no_default_set > add_default_set
tim-blackbird Jan 24, 2023
62200a4
Merge pull request #91 from devil-ira/stage-yeet-patch
alice-i-cecile Jan 24, 2023
55d9976
Remove the notion of a "default system set"
alice-i-cecile Jan 24, 2023
d1a1c8d
Merge remote-tracking branch 'alice-i-cecile/stage-yeet' into stage-yeet
alice-i-cecile Jan 24, 2023
270a9fc
Add in_set(CoreSet::Update) and in_set(StartupSet::Startup)
alice-i-cecile Jan 24, 2023
1f95bdf
Use correct syntax for state enter/exit systems
alice-i-cecile Jan 24, 2023
d9e5583
Expose public system labels for command flushes
alice-i-cecile Jan 24, 2023
c7803b4
Update FixedTimestep examples
alice-i-cecile Jan 24, 2023
57956a4
Remove obsolete system_sets.rs example
alice-i-cecile Jan 24, 2023
fe8d23e
Improve docs for states
alice-i-cecile Jan 24, 2023
985ed3f
FixedTime::new_from_secs
alice-i-cecile Jan 24, 2023
8efe4cf
fix loops in assets
hymm Jan 26, 2023
2e6e7bc
add a simple outer schedule
hymm Jan 26, 2023
16491d7
dyn_clone the label instead of explicitly boxing it
hymm Jan 26, 2023
2f7439b
Merge pull request #94 from hymm/fix-schedule-run
alice-i-cecile Jan 26, 2023
ad44974
Merge pull request #93 from hymm/render-app-outer-schedule
alice-i-cecile Jan 26, 2023
e4c586d
Merge pull request #92 from hymm/fix-assets-loops
alice-i-cecile Jan 26, 2023
ccccfd8
configure core schedules for extract sub app
hymm Jan 26, 2023
3fe0f36
Merge pull request #95 from hymm/extract-app-core-schedules
alice-i-cecile Jan 26, 2023
9e900c8
Remove references from schedule label apis where possible
cart Jan 26, 2023
a79ee4d
Switch edit_schedule cases to add_system_to_schedule. Tweak api.
cart Jan 26, 2023
8072215
Merge pull request #96 from cart/migration-tweaks
alice-i-cecile Jan 26, 2023
b438b08
Fix typo
alice-i-cecile Jan 26, 2023
e9b062f
Fix merge conflict error with duplicate audio resource
alice-i-cecile Jan 26, 2023
8f27c77
App::schedule -> App::get_schedule
alice-i-cecile Jan 26, 2023
6725648
NextState::queue -> NextState::set
alice-i-cecile Jan 26, 2023
41c1cc0
Tiny errors
alice-i-cecile Jan 26, 2023
816bb6f
Remove vestigal test
alice-i-cecile Jan 26, 2023
35a3f8f
Merge remote-tracking branch 'upstream/main' into merge-main-into-sta…
hymm Jan 26, 2023
19863ac
fix merge issues
hymm Jan 26, 2023
e73f937
Merge pull request #97 from hymm/merge-main-into-stage-yeet
alice-i-cecile Jan 26, 2023
95cb847
Minor cleanup
alice-i-cecile Jan 26, 2023
047d261
Simple changes for benchmark migration
alice-i-cecile Jan 26, 2023
474896c
Fix NumLabel impl
alice-i-cecile Jan 26, 2023
635ab9b
Readd and fix benchmarks from stage.rs as running_systems.rs
alice-i-cecile Jan 26, 2023
f6efd8e
Fix some example errors
cart Jan 26, 2023
c315764
Merge pull request #99 from cart/example-fixes
alice-i-cecile Jan 26, 2023
d8dbe62
move fixed timestep between preupdate and update
hymm Jan 26, 2023
7229c73
Merge pull request #100 from hymm/stage-yeet-move-fixedtimestep
alice-i-cecile Jan 26, 2023
0eda986
Remove App::run_schedule
alice-i-cecile Jan 27, 2023
74ed86a
Style: remove second impl block for App
alice-i-cecile Jan 27, 2023
bc1c5dc
Remove flushes after FixedUpdate and ApplyStateTransitions
alice-i-cecile Jan 27, 2023
20466e4
CoreSet::FixedTimestep -> CoreSet::FixedUpdate
alice-i-cecile Jan 27, 2023
bfbd2f8
Use add_system_to_schedule
alice-i-cecile Jan 27, 2023
2bcb1a2
Fix doc link
alice-i-cecile Jan 27, 2023
3a70836
Remove questionable doc comment
alice-i-cecile Jan 27, 2023
7c8a6b4
Remove resolved TODO
alice-i-cecile Jan 27, 2023
d850929
Remove duplicated system
alice-i-cecile Jan 27, 2023
f02913e
Remove added ordering
alice-i-cecile Jan 27, 2023
764369b
Merge remote-tracking branch 'alice-i-cecile/stage-yeet' into stage-yeet
alice-i-cecile Jan 27, 2023
57d8077
Take `label` by value in App::edit_schedule
alice-i-cecile Jan 27, 2023
f5b7477
Better preserve existing timing of AssetSet
alice-i-cecile Jan 27, 2023
674174b
Remove Copy trait bound on States
alice-i-cecile Jan 27, 2023
9f98b69
Ensure all bevy_ecs tests pass
alice-i-cecile Jan 27, 2023
e42f040
Fix App::add_state
alice-i-cecile Jan 27, 2023
c8f1641
Ensure all bevy_app tests pass
alice-i-cecile Jan 27, 2023
cf04714
Compilation fixes for examples
alice-i-cecile Jan 27, 2023
36e500f
Add on_update to IntoSystemConfigs trait
alice-i-cecile Jan 27, 2023
fb2f6a3
Export transform_propagate_systems w SystemConfigs
alice-i-cecile Jan 27, 2023
8931af5
Panic if the requested schedule is not found
alice-i-cecile Jan 27, 2023
4f1deb5
Fix shadow mapping
superdump Jan 27, 2023
3026957
Merge pull request #101 from superdump/fix-shadows
alice-i-cecile Jan 27, 2023
3ddffc4
stageless: better system set inheritance
jakobhellermann Jan 24, 2023
31de4d8
Fix ambiguity in Breakout
alice-i-cecile Jan 27, 2023
0d0ab95
Merge remote-tracking branch 'alice-i-cecile/stage-yeet' into stage-yeet
alice-i-cecile Jan 27, 2023
b5b1a67
add a system to run the enter schedule of the initial state
hymm Jan 27, 2023
2587424
add new behavior to doc
hymm Jan 27, 2023
4b13dc9
Merge pull request #103 from hymm/stage-yeet-enter-initial-state
alice-i-cecile Jan 27, 2023
f736104
Merge pull request #102 from jakobhellermann/stageless-better-set-inh…
alice-i-cecile Jan 27, 2023
803c1d2
Remove transform_propagate_system_set
alice-i-cecile Jan 27, 2023
e0f91e7
CI nits
alice-i-cecile Jan 27, 2023
fe3a452
Merge remote-tracking branch 'origin/main' into stage-yeet
alice-i-cecile Jan 27, 2023
90238b1
Fix timing of UI layout systems
alice-i-cecile Jan 27, 2023
9548e8e
Make bevy_transform::systems public
alice-i-cecile Jan 27, 2023
3ad4377
Improve error message for World::run_schedule
alice-i-cecile Jan 27, 2023
0751e0b
Module docs for bevy_transform::systems
alice-i-cecile Jan 27, 2023
6076c80
Clippy formatting nit
alice-i-cecile Jan 27, 2023
3ff2302
Fix typo in example description
alice-i-cecile Jan 27, 2023
110981f
Clippy fixes for example
alice-i-cecile Jan 27, 2023
7904389
Remove metadata for removed example
alice-i-cecile Jan 27, 2023
23a18c6
Clippy: avoid unnecessary as cast
alice-i-cecile Jan 27, 2023
54aab6f
Update examples README
alice-i-cecile Jan 27, 2023
5c007ad
Clippy
alice-i-cecile Jan 27, 2023
4959658
Force tick_global_task_pools to use main thread
alice-i-cecile Jan 27, 2023
a214800
make fixed time resource available to fixed time schedule
hymm Jan 28, 2023
ce6493b
OnUpdate set is in StateTransitions
hymm Jan 28, 2023
a0a6999
change stage to set in message
hymm Jan 28, 2023
9f0b929
Merge pull request #105 from hymm/stage-yeet-fix-alien-cake
alice-i-cecile Jan 28, 2023
f3a67f4
Merge pull request #104 from hymm/stage-yeet-fixed-time-res
alice-i-cecile Jan 28, 2023
a555032
Merge pull request #106 from hymm/stage-yeet-ecs-guide-word
alice-i-cecile Jan 28, 2023
b75773d
fix bugs
maniwani Jan 28, 2023
8228cdc
Merge pull request #107 from maniwani/stage-yeet-fix-bugs
alice-i-cecile Jan 28, 2023
5a3c43a
Sync between add_clusters and assign_lights_to_clusters
superdump Jan 28, 2023
7ca8cd5
Merge pull request #108 from superdump/stageless-fix-point-shadows
alice-i-cecile Jan 28, 2023
1c7349c
cleanup executor traces
hymm Jan 28, 2023
053fdd4
Merge pull request #109 from hymm/state-yeet-executor-traces
alice-i-cecile Jan 28, 2023
e7f8cc2
add a method on add to create a simple outer schedule
hymm Jan 29, 2023
ff63a8b
remove some references to stage
hymm Jan 29, 2023
41d0b86
Merge pull request #111 from hymm/stage-yeet-more-span-cleanup
alice-i-cecile Jan 29, 2023
075209e
Merge pull request #110 from hymm/stage-yeet-cleanup-outer-schedules
alice-i-cecile Jan 29, 2023
216c7c9
move final checking outside multithreaded executor
hymm Jan 29, 2023
645a226
fix unapplied buffers not being cleared
hymm Jan 29, 2023
b1c7b5c
remove more spans
hymm Jan 29, 2023
6adcafa
Reframe comment as invariant
alice-i-cecile Jan 30, 2023
ee7b0a6
Merge pull request #112 from hymm/stage-yeet-commands-fixing
alice-i-cecile Jan 30, 2023
096fbdd
fix example
hymm Jan 30, 2023
94a1016
Merge pull request #114 from hymm/stage-yeet-fix-sub-app-example
alice-i-cecile Jan 30, 2023
412342f
add ability to disable final sync
hymm Jan 30, 2023
f138926
disable final sync on extract schedule
hymm Jan 30, 2023
20d9c50
clippy
hymm Jan 30, 2023
2d21836
change to a set function.
hymm Jan 30, 2023
6541d66
cargo fmt
hymm Jan 30, 2023
8fdae03
Merge pull request #113 from hymm/stage-yeet-skip-commands
alice-i-cecile Jan 30, 2023
2868545
fix menu
hymm Jan 31, 2023
a441ad2
Merge pull request #121 from hymm/stage-yeet-fix-game-menu
alice-i-cecile Jan 31, 2023
d2c7446
Merge remote-tracking branch 'origin/main' into stage-yeet
alice-i-cecile Jan 31, 2023
83afdad
Resolve merge conflicts with ambiguity reducing and fog PRs
alice-i-cecile Jan 31, 2023
2f5cc7d
Make debug_assert in report_conflicts return more useful data
alice-i-cecile Jan 31, 2023
f8ce290
Don't forget to add gamepad_event_system
alice-i-cecile Jan 31, 2023
288f4fc
Report the number of ambiguities
alice-i-cecile Jan 31, 2023
9cc1e22
Report component / resource name in ambiguities
alice-i-cecile Jan 31, 2023
5030691
Add LogLevel::Ignore
alice-i-cecile Jan 31, 2023
325b3ec
Ignore system order ambiguities by default
alice-i-cecile Jan 31, 2023
e60e657
Port nondeterministic_system_order example
alice-i-cecile Jan 31, 2023
b2431d5
Derive Clone and Debug for ScheduleBuildSettings
alice-i-cecile Jan 31, 2023
084cca5
Fix assert failures
maniwani Jan 31, 2023
ca6b28f
typo
maniwani Jan 31, 2023
dca1f58
Merge pull request #122 from maniwani/stage-yeet-fix-asserts
alice-i-cecile Jan 31, 2023
9e9c63b
Merge remote-tracking branch 'alice-i-cecile/stage-yeet' into stage-yeet
alice-i-cecile Jan 31, 2023
e7c3f6a
Fixes for CI
alice-i-cecile Jan 31, 2023
5e11c85
Rename bevy_ecs::scheduling to bevy_ecs::schedule_v3 to aid review
alice-i-cecile Jan 31, 2023
dc52879
Clippy lints
alice-i-cecile Feb 1, 2023
a74e820
Merge remote-tracking branch 'bevyengine/main' into merge-main-230202
hymm Feb 3, 2023
7149205
Merge pull request #123 from hymm/merge-main-230202
alice-i-cecile Feb 3, 2023
ebdb821
Fix broken link
alice-i-cecile Feb 3, 2023
ba4ff14
Typo fix
alice-i-cecile Feb 3, 2023
605d91d
Don't bother fetching component ID for MainWorld
alice-i-cecile Feb 4, 2023
598221f
Improve docs for state.rs example
alice-i-cecile Feb 4, 2023
0c3453a
Move CacluclateBounds back to PostUpdate
alice-i-cecile Feb 4, 2023
9e02924
Merge remote-tracking branch 'origin/main' into stage-yeet
alice-i-cecile Feb 4, 2023
1a96791
Add configure_system_sets
alice-i-cecile Feb 4, 2023
2c5e15f
Formatting
alice-i-cecile Feb 4, 2023
2f473d1
Fully disable tick_global_tasks_pools on web
alice-i-cecile Feb 4, 2023
7684926
Fix links to CoreStage in docs
alice-i-cecile Feb 4, 2023
034ef1c
Another stray CoreStage reference in the docs
alice-i-cecile Feb 4, 2023
24e8da8
More broken doc links
alice-i-cecile Feb 4, 2023
abe90bb
Add and use an extra commands flush for AABB calculations
alice-i-cecile Feb 4, 2023
4e5ef1b
Doc links
alice-i-cecile Feb 4, 2023
8c5cb03
Explicit add CalculateBoundsFlush to PostUpdate
alice-i-cecile Feb 5, 2023
1e18e31
Add close_when_requested to a CoreSet
alice-i-cecile Feb 5, 2023
5ad0c47
put add clusters flush into a set
hymm Feb 5, 2023
c26d582
Merge pull request #124 from hymm/cleanup-add-clusters-flush
alice-i-cecile Feb 5, 2023
00f226d
Merge remote-tracking branch 'origin/main' into pr/alice-i-cecile/7267
cart Feb 5, 2023
780a47c
Fix doc links
cart Feb 6, 2023
acb3f24
Fix doc links
alice-i-cecile Feb 6, 2023
01a43ae
Doc link
alice-i-cecile Feb 6, 2023
60fa3e8
Doc links T_T
alice-i-cecile Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/contributing/example_style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For more advice on writing examples, see the [relevant section](../../CONTRIBUTI
4. In Queries, prefer `With<T>` filters over actually fetching unused data with `&T`.
5. Prefer disjoint queries using `With` and `Without` over param sets when you need more than one query in a single system.
6. Prefer structs with named fields over tuple structs except in the case of single-field wrapper types.
7. Use enum-labels over string-labels for system / stage / etc. labels.
7. Use enum-labels over string-labels for system / schedule / etc. labels.

## "Feature" examples

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ path = "examples/ecs/removal_detection.rs"

[package.metadata.example.removal_detection]
name = "Removal Detection"
description = "Query for entities that had a specific component removed in a previous stage during the current frame"
description = "Query for entities that had a specific component removed earlier in the same current frame"
category = "ECS (Entity Component System)"
wasm = false

Expand Down
28 changes: 12 additions & 16 deletions benches/benches/bevy_ecs/components/archetype_updates.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
use bevy_ecs::{
component::Component,
schedule::{Stage, SystemStage},
world::World,
};
use bevy_ecs::{component::Component, world::World};
use criterion::{BenchmarkId, Criterion};

#[derive(Component)]
struct A<const N: u16>(f32);

fn setup(system_count: usize) -> (World, SystemStage) {
fn setup(system_count: usize) -> (World, Schedule) {
let mut world = World::new();
fn empty() {}
let mut stage = SystemStage::parallel();
let mut schedule = Schedule::new();
for _ in 0..system_count {
stage.add_system(empty);
schedule.add_system(empty);
}
stage.run(&mut world);
(world, stage)
schedule.run(&mut world);
(world, schedule)
}

/// create `count` entities with distinct archetypes
Expand Down Expand Up @@ -78,13 +74,13 @@ pub fn no_archetypes(criterion: &mut Criterion) {
let mut group = criterion.benchmark_group("no_archetypes");
for i in 0..=5 {
let system_count = i * 20;
let (mut world, mut stage) = setup(system_count);
let (mut world, mut schedule) = setup(system_count);
group.bench_with_input(
BenchmarkId::new("system_count", system_count),
&system_count,
|bencher, &_system_count| {
bencher.iter(|| {
stage.run(&mut world);
schedule.run(&mut world);
});
},
);
Expand All @@ -101,12 +97,12 @@ pub fn added_archetypes(criterion: &mut Criterion) {
|bencher, &archetype_count| {
bencher.iter_batched(
|| {
let (mut world, stage) = setup(SYSTEM_COUNT);
let (mut world, schedule) = setup(SYSTEM_COUNT);
add_archetypes(&mut world, archetype_count);
(world, stage)
(world, schedule)
},
|(mut world, mut stage)| {
stage.run(&mut world);
|(mut world, mut schedule)| {
schedule.run(&mut world);
},
criterion::BatchSize::LargeInput,
);
Expand Down
39 changes: 17 additions & 22 deletions benches/benches/bevy_ecs/empty_archetypes.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use bevy_ecs::{
component::Component,
prelude::*,
schedule::{Stage, SystemStage},
world::World,
};
use bevy_ecs::{component::Component, prelude::*, world::World};
use bevy_tasks::{ComputeTaskPool, TaskPool};
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};

Expand Down Expand Up @@ -80,14 +75,14 @@ fn par_for_each(
});
}

fn setup(parallel: bool, setup: impl FnOnce(&mut SystemStage)) -> (World, SystemStage) {
fn setup(parallel: bool, setup: impl FnOnce(&mut Schedule)) -> (World, Schedule) {
let mut world = World::new();
let mut stage = SystemStage::parallel();
let mut schedule = Schedule::new();
if parallel {
world.insert_resource(ComputeTaskPool(TaskPool::default()));
}
setup(&mut stage);
(world, stage)
setup(&mut schedule);
(world, schedule)
}

/// create `count` entities with distinct archetypes
Expand Down Expand Up @@ -158,8 +153,8 @@ fn add_archetypes(world: &mut World, count: u16) {
fn empty_archetypes(criterion: &mut Criterion) {
let mut group = criterion.benchmark_group("empty_archetypes");
for archetype_count in [10, 100, 500, 1000, 2000, 5000, 10000] {
let (mut world, mut stage) = setup(true, |stage| {
stage.add_system(iter);
let (mut world, mut schedule) = setup(true, |schedule| {
schedule.add_system(iter);
});
add_archetypes(&mut world, archetype_count);
world.clear_entities();
Expand All @@ -177,20 +172,20 @@ fn empty_archetypes(criterion: &mut Criterion) {
e.insert(A::<10>(1.0));
e.insert(A::<11>(1.0));
e.insert(A::<12>(1.0));
stage.run(&mut world);
schedule.run(&mut world);
group.bench_with_input(
BenchmarkId::new("iter", archetype_count),
&archetype_count,
|bencher, &_| {
bencher.iter(|| {
stage.run(&mut world);
schedule.run(&mut world);
})
},
);
}
for archetype_count in [10, 100, 500, 1000, 2000, 5000, 10000] {
let (mut world, mut stage) = setup(true, |stage| {
stage.add_system(for_each);
let (mut world, mut schedule) = setup(true, |schedule| {
schedule.add_system(for_each);
});
add_archetypes(&mut world, archetype_count);
world.clear_entities();
Expand All @@ -208,20 +203,20 @@ fn empty_archetypes(criterion: &mut Criterion) {
e.insert(A::<10>(1.0));
e.insert(A::<11>(1.0));
e.insert(A::<12>(1.0));
stage.run(&mut world);
schedule.run(&mut world);
group.bench_with_input(
BenchmarkId::new("for_each", archetype_count),
&archetype_count,
|bencher, &_| {
bencher.iter(|| {
stage.run(&mut world);
schedule.run(&mut world);
})
},
);
}
for archetype_count in [10, 100, 500, 1000, 2000, 5000, 10000] {
let (mut world, mut stage) = setup(true, |stage| {
stage.add_system(par_for_each);
let (mut world, mut schedule) = setup(true, |schedule| {
schedule.add_system(par_for_each);
});
add_archetypes(&mut world, archetype_count);
world.clear_entities();
Expand All @@ -239,13 +234,13 @@ fn empty_archetypes(criterion: &mut Criterion) {
e.insert(A::<10>(1.0));
e.insert(A::<11>(1.0));
e.insert(A::<12>(1.0));
stage.run(&mut world);
schedule.run(&mut world);
group.bench_with_input(
BenchmarkId::new("par_for_each", archetype_count),
&archetype_count,
|bencher, &_| {
bencher.iter(|| {
stage.run(&mut world);
schedule.run(&mut world);
})
},
);
Expand Down
2 changes: 0 additions & 2 deletions benches/benches/bevy_ecs/scheduling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use criterion::criterion_group;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think calling this module bevy_ecs::schedule makes more sense / is more consistent with rust naming conventions:

  • This provides the Schedule type, so calling it the schedule module makes sense (ex: std::vec::Vec)
  • std generally doesn't call things -ing. Ex: it is backtrace not backtracing, panicnotpacking, threadnotthreading`, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there's a schedule submodule within this module, which stores the Schedule and Schedules type.

I renamed this to a) make the diff more readable and b) avoid a very sensible clippy lint warning against that confusing scenario.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait: this comment is on the benches folder: is that where you meant to coment?

Copy link
Member

@cart cart Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there's a schedule submodule within this module, which stores the Schedule and Schedules type.
I renamed this to a) make the diff more readable and b) avoid a very sensible clippy lint warning against that confusing scenario.

I'm not a fan of this lint in the first place (nor is @dtolnay ... note that this is in a "most suppressed clippy lints" thread). Combining multiple "private" submodules for a given context into the same submodule is an extremely common pattern. To follow the std::vec::Vec example above, imagine you wanted to have std/vec/vec.rs (containing the vec impl) and std/vec/vec_iterators.rs (containing iterator impls for vec). This is a valid way to break up your files in my opinion. Imo the only valid alternative is dumping the vec.rs internals into std/vec/mod.rs, which combines the "meta module-joining" context of the original mod.rs with the "implementation details" of vec.rs. I don't think we should compromise our ideal module names or file structure to satisfy a controversial clippy lint. I don't see the value.

Likewise being diff/review-friendly is good and I don't hate something like this as an intermediate step. But we shouldn't compromise our ideal api for that either.

Wait: this comment is on the benches folder: is that where you meant to coment?

It was meant to be on the actual scheduling module. I just left it in the wrong place / commented on the first scheduling.rs I found :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vote is to suppress this lint as a matter of policy and rename this module to schedule.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i have the changes prepped)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved by alice-i-cecile#98 (if we agree to go that route)

mod run_criteria;
mod schedule;
mod stages;

use run_criteria::*;
use schedule::*;
use stages::*;

criterion_group!(
scheduling_benches,
Expand Down
66 changes: 31 additions & 35 deletions benches/benches/bevy_ecs/scheduling/run_criteria.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use bevy_ecs::{prelude::*, schedule::ShouldRun};
use bevy_ecs::prelude::*;
use criterion::Criterion;

fn run_stage(stage: &mut SystemStage, world: &mut World) {
stage.run(world);
}

/// Labels for run criteria which either always return yes, or always return no.
#[derive(RunCriteriaLabel)]
enum Always {
Expand All @@ -22,22 +18,22 @@ pub fn run_criteria_yes(criterion: &mut Criterion) {
ShouldRun::Yes
}
for amount in 0..21 {
let mut stage = SystemStage::parallel();
stage.add_system(empty.with_run_criteria(always_yes));
let mut schedule = Schedule::parallel();
schedule.add_system(empty.with_run_criteria(always_yes));
for _ in 0..amount {
// TODO: should change this to use a label or have another bench that uses a label instead
stage
schedule
.add_system(empty.with_run_criteria(always_yes))
.add_system(empty.with_run_criteria(always_yes))
.add_system(empty.with_run_criteria(always_yes))
.add_system(empty.with_run_criteria(always_yes))
.add_system(empty.with_run_criteria(always_yes));
}
// run once to initialize systems
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
bencher.iter(|| {
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
});
});
}
Expand All @@ -54,21 +50,21 @@ pub fn run_criteria_no(criterion: &mut Criterion) {
ShouldRun::No
}
for amount in 0..21 {
let mut stage = SystemStage::parallel();
stage.add_system(empty.with_run_criteria(always_no));
let mut schedule = Schedule::parallel();
schedule.add_system(empty.with_run_criteria(always_no));
for _ in 0..amount {
stage
schedule
.add_system(empty.with_run_criteria(always_no))
.add_system(empty.with_run_criteria(always_no))
.add_system(empty.with_run_criteria(always_no))
.add_system(empty.with_run_criteria(always_no))
.add_system(empty.with_run_criteria(always_no));
}
// run once to initialize systems
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
bencher.iter(|| {
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
});
});
}
Expand All @@ -85,22 +81,22 @@ pub fn run_criteria_yes_with_labels(criterion: &mut Criterion) {
ShouldRun::Yes
}
for amount in 0..21 {
let mut stage = SystemStage::parallel();
let mut schedule = Schedule::parallel();

stage.add_system(empty.with_run_criteria(always_yes.label(Always::Yes)));
schedule.add_system(empty.with_run_criteria(always_yes.in_set(Always::Yes)));
for _ in 0..amount {
stage
schedule
.add_system(empty.with_run_criteria(Always::Yes))
.add_system(empty.with_run_criteria(Always::Yes))
.add_system(empty.with_run_criteria(Always::Yes))
.add_system(empty.with_run_criteria(Always::Yes))
.add_system(empty.with_run_criteria(Always::Yes));
}
// run once to initialize systems
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
bencher.iter(|| {
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
});
});
}
Expand All @@ -117,22 +113,22 @@ pub fn run_criteria_no_with_labels(criterion: &mut Criterion) {
ShouldRun::No
}
for amount in 0..21 {
let mut stage = SystemStage::parallel();
let mut schedule = Schedule::parallel();

stage.add_system(empty.with_run_criteria(always_no.label(Always::No)));
schedule.add_system(empty.with_run_criteria(always_no.in_set(Always::No)));
for _ in 0..amount {
stage
schedule
.add_system(empty.with_run_criteria(Always::No))
.add_system(empty.with_run_criteria(Always::No))
.add_system(empty.with_run_criteria(Always::No))
.add_system(empty.with_run_criteria(Always::No))
.add_system(empty.with_run_criteria(Always::No));
}
// run once to initialize systems
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
bencher.iter(|| {
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
});
});
}
Expand All @@ -153,21 +149,21 @@ pub fn run_criteria_yes_with_query(criterion: &mut Criterion) {
query.single().0.into()
}
for amount in 0..21 {
let mut stage = SystemStage::parallel();
stage.add_system(empty.with_run_criteria(yes_with_query));
let mut schedule = Schedule::parallel();
schedule.add_system(empty.with_run_criteria(yes_with_query));
for _ in 0..amount {
stage
schedule
.add_system(empty.with_run_criteria(yes_with_query))
.add_system(empty.with_run_criteria(yes_with_query))
.add_system(empty.with_run_criteria(yes_with_query))
.add_system(empty.with_run_criteria(yes_with_query))
.add_system(empty.with_run_criteria(yes_with_query));
}
// run once to initialize systems
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
bencher.iter(|| {
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
});
});
}
Expand All @@ -185,21 +181,21 @@ pub fn run_criteria_yes_with_resource(criterion: &mut Criterion) {
res.0.into()
}
for amount in 0..21 {
let mut stage = SystemStage::parallel();
stage.add_system(empty.with_run_criteria(yes_with_resource));
let mut schedule = Schedule::parallel();
schedule.add_system(empty.with_run_criteria(yes_with_resource));
for _ in 0..amount {
stage
schedule
.add_system(empty.with_run_criteria(yes_with_resource))
.add_system(empty.with_run_criteria(yes_with_resource))
.add_system(empty.with_run_criteria(yes_with_resource))
.add_system(empty.with_run_criteria(yes_with_resource))
.add_system(empty.with_run_criteria(yes_with_resource));
}
// run once to initialize systems
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
bencher.iter(|| {
run_stage(&mut stage, &mut world);
run_schedule(&mut schedule, &mut world);
});
});
}
Expand Down
Loading