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

System sets and parallel executor v2 #1144

Merged
merged 78 commits into from
Feb 9, 2021
Merged

Commits on Dec 5, 2020

  1. new year new schedule

    cart committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    c18476a View commit details
    Browse the repository at this point in the history
  2. everything works!

    cart committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    234e766 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2020

  1. fix stuff

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    2f6c231 View commit details
    Browse the repository at this point in the history
  2. state work

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    474dc05 View commit details
    Browse the repository at this point in the history
  3. states kind of work?

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    40e8953 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0cdcfd9 View commit details
    Browse the repository at this point in the history
  5. remove System::is_initialized

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    e4d7ab5 View commit details
    Browse the repository at this point in the history
  6. simpler timestep

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    e370da0 View commit details
    Browse the repository at this point in the history
  7. IntoStage

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    bf9c513 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7699ec4 View commit details
    Browse the repository at this point in the history
  9. clippy and fmt

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    dbe3748 View commit details
    Browse the repository at this point in the history
  10. initial state example

    cart committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    cadd846 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2020

  1. renames

    cart committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    2611cc5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    509f5f5 View commit details
    Browse the repository at this point in the history
  3. state example

    cart committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    000dd7e View commit details
    Browse the repository at this point in the history
  4. fmt

    cart committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    9b382ea View commit details
    Browse the repository at this point in the history
  5. adapt to new clippy rule

    cart committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    061f0c4 View commit details
    Browse the repository at this point in the history
  6. fix tests

    cart committed Dec 7, 2020
    Configuration menu
    Copy the full SHA
    5c435be View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2020

  1. Configuration menu
    Copy the full SHA
    ccad3c6 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2020

  1. Configuration menu
    Copy the full SHA
    465f59e View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2020

  1. Preparatory work for new parallel scheduling implementation:

    Renamed `access::Access` to `ArchetypeAccess`, made it private. No particular reason.
    Removed `ThreadLocalExecution`, `System::thread_local_execution()` - this information is now encoded in `::archetype_component_access()`, `::resource_access()`, and new `::is_thread_local()`.
    Extended `TypeAccess` with support for "reads/writes everything" to facilitate the above.
    Renamed `ThreadLocalSystemFn` and the module `into_thread_local` to `ExclusiveSystemFn` and `into_exclusive` respectively, to differentiate systems with this access pattern from actually thread-local systems.
    Implemented `IntoSystem` for `FnMut(&mut World)` and `FnMut(&mut Resources)`, both result in `ExclusiveSystemFn`. Just because. Probably in vain.
    Rewrote `SerialSystemStageExecutor` to account for `ThreadLocalExecution` removal.
    Implemented `ThreadLocal` system parameter.
    Implemented mk1 label and dependencies methods on `SystemSet` and `SystemStage`.
    Added `ShouldRun::NoAndLoop`.
    Ratysz committed Dec 12, 2020
    Configuration menu
    Copy the full SHA
    b966034 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2020

  1. Preparatory work, continued:

    Renamed `System::update()` to `System::update_access()`, for clarity.
    Plumbed labels and dependencies into the stage executor, via `SystemStage::labels` (a stage-global map of label to system index), `SystemSet::system_label()`, and `SystemSet::system_dependencies()`.
    Rewrote `SerialSystemStageExecutor` to support exclusive systems at start of stage as well; unfinished.
    Ratysz committed Dec 13, 2020
    Configuration menu
    Copy the full SHA
    457262c View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2020

  1. Parallel executor implementation, pt 1:

    Began implementation; doesn't do anything yet because the pathway from data it gets to data it wants is not implemented.
    Changed system sets to store systems in `NonNull` rather than `Box`. Requires auditing and a sanity check.
    Ratysz committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    ffe34e7 View commit details
    Browse the repository at this point in the history
  2. Parallel executor implementation, pt 2:

    Minor cleanup.
    Partially implemented run criteria handling.
    Ratysz committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    26afcfe View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2020

  1. Parallel executor implementation, pt 3:

    Minor refactor.
    Fixed a future bug in not yet implemented `can_start_now()`.
    Accounted for run criteria for parallel systems: if a system shouldn't run in this iteration, its task is not spawned and it's never queued to run.
    Ratysz committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    0e75a60 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2020

  1. Parallel executor implementation, pt 4:

    Added `CondensedTypeAccess` and related machinery.
    Moved the dependency resolution burden from executor to the stage; verification is not yet implemented.
    Systems with no dependencies are immediately queued to run at the start of each iteration.
    Implemented rebuilding scheduling data and updating access information.
    Implemented `can_start_now()`.
    
    Running tests violates access, right now.
    Ratysz committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    7d36fc0 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2020

  1. Fixed access violation.

    Ratysz committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    4a6db18 View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2020

  1. Merge remote-tracking branch 'upstream/master' into schedule-v2

    # Conflicts:
    #	crates/bevy_app/src/app.rs
    #	crates/bevy_app/src/app_builder.rs
    #	crates/bevy_asset/src/lib.rs
    #	crates/bevy_core/src/time/fixed_timestep.rs
    #	crates/bevy_ecs/Cargo.toml
    #	crates/bevy_ecs/src/lib.rs
    #	crates/bevy_ecs/src/schedule/mod.rs
    #	crates/bevy_ecs/src/schedule/stage.rs
    #	crates/bevy_ecs/src/schedule/stage_executor.rs
    #	crates/bevy_ecs/src/schedule/state.rs
    #	crates/bevy_ecs/src/system/into_system.rs
    #	crates/bevy_ecs/src/system/into_thread_local.rs
    #	crates/bevy_ecs/src/system/system.rs
    #	crates/bevy_ecs/src/system/system_chaining.rs
    #	crates/bevy_ecs/src/system/system_param.rs
    #	crates/bevy_input/src/lib.rs
    #	crates/bevy_render/src/lib.rs
    #	crates/bevy_render/src/render_graph/system.rs
    #	crates/bevy_scene/src/lib.rs
    #	crates/bevy_transform/src/hierarchy/hierarchy_maintenance_system.rs
    #	crates/bevy_transform/src/transform_propagate_system.rs
    #	crates/bevy_ui/src/lib.rs
    #	crates/bevy_ui/src/update.rs
    #	crates/bevy_winit/src/lib.rs
    #	examples/2d/texture_atlas.rs
    #	examples/ecs/ecs_guide.rs
    #	examples/ecs/fixed_timestep.rs
    #	examples/ecs/state.rs
    Ratysz committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    c29ab55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    52f692f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1746bb1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5d133fa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a68611b View commit details
    Browse the repository at this point in the history

Commits on Dec 24, 2020

  1. Fix formatting.

    It was one space, CI, come on now.
    Ratysz committed Dec 24, 2020
    Configuration menu
    Copy the full SHA
    55e8eb1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8fbe2a7 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2020

  1. Configuration menu
    Copy the full SHA
    c4e8261 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2021

  1. Merge branch 'upstream-master' into executor-v2

    # Conflicts:
    #	crates/bevy_ecs/Cargo.toml
    #	crates/bevy_ecs/src/schedule/mod.rs
    #	crates/bevy_ecs/src/schedule/stage.rs
    #	crates/bevy_ecs/src/schedule/stage_executor.rs
    Ratysz committed Jan 9, 2021
    Configuration menu
    Copy the full SHA
    e0b9d14 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2021

  1. System insertion API, part 1:

    Implemented (probably incomplete) `SystemDescriptor`, its coercion machinery, and its usage in `SystemStage` (parallel dependency tree is still not validated). Plumbed more data between stage and executor to make use of the latter.
    Removed most of system insertion methods on `SystemStage` and `SystemSet`, replaced remaining with those taking `Into<SystemDescriptor>` (except `App`).
    Simplified cache invalidation trigger in `SystemSet`; need to verify if any of it, along with its usage, could/should be moved to initialization instead.
    Ratysz committed Jan 12, 2021
    Configuration menu
    Copy the full SHA
    504055f View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2021

  1. System insertion API, part 2:

    Removed the check that forbade parallel systems to be used in the exclusive system queues, altered exclusive system execution to also run the parallel part.
    Changed language in `SystemStage` and the executors to reflect the above: "exclusive" systems are now "sequential".
    Moved `ParallelSystemStageExecutor` to its own file.
    Refactored the two executors to share more code; moved parallel system preparation in parallel executor to its own function, `::prepare_parallel_systems()`.
    Minor renames.
    Removed `SerialSystemStageExecutor::last_archetypes_generation`: this is used only to update access, and access is used only to parallelize things, so a strictly serial executor has no need of it.
    Ratysz committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    64a276a View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2021

  1. Configuration menu
    Copy the full SHA
    7234d22 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fe60c85 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2021

  1. Removed usage of AHashExt.

    Should've done a `cargo clean` long ago.
    Ratysz committed Jan 17, 2021
    Configuration menu
    Copy the full SHA
    44d4271 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2021

  1. Decoupled exclusive systems from parallel systems:

    Introduced `_exclusive` system insertion methods throughout the API (except states).
    Rearranged system insertion methods in `AppBuilder`; no particular reason.
    Renamed `System::run_exclusive()` to `apply_buffers()` to better reflect its function.
    Blindly made all exclusive systems in the engine be inserted with the appropriate methods; haven't done anything wrt validity of the resulting execution order.
    Ratysz committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    43a08f9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70850fa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    027f80a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    116c877 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2021

  1. Merge branch 'upstream-master' into executor-v2

    # Conflicts:
    #	crates/bevy_ecs/Cargo.toml
    Ratysz committed Jan 19, 2021
    Configuration menu
    Copy the full SHA
    c972161 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    19c7430 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ad14e57 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2021

  1. Fixed & exposed ThreadLocal; refactors; some tests; topological sor…

    …ting where applicable; more documentation.
    Ratysz committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    43dd985 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. Made dependencies "soft" by default, added test cases for that; added…

    … `SystemSet` and `ShouldRun` to the prelude; renamed `SystemStage::serial()` and `SerialSystemStageExecutor` to `::single_threaded()` and `SingleThreadedSystemStageExecutor` respectively; minor refactors.
    Ratysz committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e1da00a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6ae4398 View commit details
    Browse the repository at this point in the history
  3. Refactors: SystemStageExecutor renamed to ParallelSystemExecutor,…

    … now responsible solely for parallel systems execution; renamed things to make sense with that change; moved `SystemSet` to its own module.
    Ratysz committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e8b02fe View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2021

  1. Renamed ThreadLocal and friends into NonSend; preemptively fixed …

    …chained systems; minor refactors; more tests.
    Ratysz committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    cd20ee4 View commit details
    Browse the repository at this point in the history
  2. Moved the burder of creating and maintaining the parallel "should run…

    …" bitset to `SystemStage`.
    Ratysz committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    59a03ad View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2021

  1. Configuration menu
    Copy the full SHA
    5c9cf4d View commit details
    Browse the repository at this point in the history
  2. Implemented parallel system order ambiguity detection; plumbed archet…

    …ype-agnostic component access for parallelizable systems.
    Ratysz committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    61a0211 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

  1. Fixed parallel executor "starting" more than one non-send system at a…

    … time; more tests; minor refactors.
    Ratysz committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    c5fc80d View commit details
    Browse the repository at this point in the history
  2. Unified system descriptors, deduplicated system insertion methods; re…

    …worked exclusive systems to use separate and unambiguous `IntoExclusiveSystem` trait.
    Ratysz committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    e9321f8 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2021

  1. Execution order ambiguity for exclusive systems; refactors; reverted …

    …removal of `Send + Sync` bound from `Stage`.
    Ratysz committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    0c30716 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    01164e5 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2021

  1. Configuration menu
    Copy the full SHA
    a8df35c View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2021

  1. Configuration menu
    Copy the full SHA
    976cc53 View commit details
    Browse the repository at this point in the history
  2. Tweak benchmarks.

    Ratysz committed Feb 1, 2021
    Configuration menu
    Copy the full SHA
    ad89d68 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2021

  1. Configuration menu
    Copy the full SHA
    4a82850 View commit details
    Browse the repository at this point in the history
  2. Bare minimum documentation.

    Ratysz committed Feb 4, 2021
    Configuration menu
    Copy the full SHA
    feb38d5 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'upstream-master' into executor-v2

    # Conflicts:
    #	crates/bevy_app/src/app_builder.rs
    #	crates/bevy_ecs/src/schedule/stage.rs
    #	crates/bevy_gilrs/src/lib.rs
    #	crates/bevy_winit/src/lib.rs
    Ratysz committed Feb 4, 2021
    Configuration menu
    Copy the full SHA
    a32063e View commit details
    Browse the repository at this point in the history
  4. Post-merge fix.

    Ratysz committed Feb 4, 2021
    Configuration menu
    Copy the full SHA
    e42f1f4 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2021

  1. Configuration menu
    Copy the full SHA
    f7a0eb6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3cfd48a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e09298f View commit details
    Browse the repository at this point in the history
  4. Minor refactors for clarity.

    Ratysz committed Feb 5, 2021
    Configuration menu
    Copy the full SHA
    d9fa55d View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2021

  1. Configuration menu
    Copy the full SHA
    ec845c5 View commit details
    Browse the repository at this point in the history
  2. Clippy.

    Ratysz committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    42118c9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b532235 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2021

  1. fix flex system ambiguity

    cart committed Feb 7, 2021
    Configuration menu
    Copy the full SHA
    e23c8a8 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2021

  1. Configuration menu
    Copy the full SHA
    c69579f View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2021

  1. Configuration menu
    Copy the full SHA
    d929da3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    69a55aa View commit details
    Browse the repository at this point in the history