Skip to content

Create types to store serializable data about the ECS schedule and provide tools for extracting this data.#22520

Merged
alice-i-cecile merged 23 commits intobevyengine:mainfrom
andriyDev:dump-schedules
Apr 6, 2026
Merged

Create types to store serializable data about the ECS schedule and provide tools for extracting this data.#22520
alice-i-cecile merged 23 commits intobevyengine:mainfrom
andriyDev:dump-schedules

Conversation

@andriyDev
Copy link
Copy Markdown
Contributor

@andriyDev andriyDev commented Jan 15, 2026

Objective

Here are also some non-goals for this PR. These are left as future work:

  • Extract every piece of data in the schedule. I've focused on a rough set of information that should let us visualization the most important parts.
  • Provide utilities for interpreting the data. This PR is focused on just extracting the data, interpreting it comes next.
  • Any sort of dot graph tools.

Solution

  • Create ser/de compatible structs for representing schedule data.
  • Create a function to get schedule data from an initialized Schedule.
  • Create a plugin to automatically extract the schedule data for every schedule in the App.
    • Note this doesn't include other subapps, I'll also leave that to another PR.
  • Make bevy_ecs return edges that build passes added.
  • Make bevy_ecs return the "build metadata" to the caller, and also trigger as an event.

Testing

  • Added tests!
  • Added an example - it outputs a ron file. I assume its all valid.

@andriyDev andriyDev added A-Dev-Tools Tools used to debug Bevy applications. D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged C-Feature A new feature, making something new possible labels Jan 15, 2026
@andriyDev andriyDev force-pushed the dump-schedules branch 2 times, most recently from dc577da to 66cb075 Compare January 15, 2026 04:09
@andriyDev
Copy link
Copy Markdown
Contributor Author

This is currently a draft because there's a problem that edges coming from schedule build passes (e.g., auto_insert_apply_deferred) are not being extracted.

@github-actions
Copy link
Copy Markdown
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@andriyDev andriyDev force-pushed the dump-schedules branch 2 times, most recently from db0c487 to d186888 Compare January 15, 2026 04:53
@alice-i-cecile alice-i-cecile added the A-ECS Entities, components, systems, and events label Jan 15, 2026
@cart cart added this to ECS Feb 12, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in ECS Feb 12, 2026
@alice-i-cecile alice-i-cecile added the S-Needs-Goal This should have a C-Goal and should not continue until it has one label Feb 12, 2026
@alice-i-cecile alice-i-cecile moved this from Needs SME Triage to SME Triaged in ECS Feb 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-22520

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@andriyDev andriyDev added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Feb 15, 2026
@andriyDev andriyDev marked this pull request as ready for review February 15, 2026 07:01
@andriyDev andriyDev requested a review from ItsDoot February 15, 2026 07:01
@andriyDev andriyDev requested a review from alice-i-cecile April 2, 2026 03:02
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

LGTM now, but please do open an issue about testing all features :) Not a unique problem to this PR, and not one I want to forget about.

Copy link
Copy Markdown
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

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

no major logic comments (it looks good to me), just documentation

pub fn initialize(&mut self, world: &mut World) -> Result<(), ScheduleBuildError> {
/// Moves all systems and run conditions out of the [`ScheduleGraph`]. If the schedule is built
/// successfully, returns [`Some`] with the metadata. If the schedule has previously been built
/// successfully, returns [`None`].
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

iiuc, but also if this is potentially confusing to add or initialize is not used in this way, you can reject this suggestion:

Suggested change
/// successfully, returns [`None`].
/// successfully and has not changed since previous init, returns [`None`].

@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 3, 2026
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
@alice-i-cecile alice-i-cecile enabled auto-merge April 6, 2026 22:23
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 6, 2026
Merged via the queue into bevyengine:main with commit efc6464 Apr 6, 2026
42 checks passed
@github-project-automation github-project-automation bot moved this from SME Triaged to Done in ECS Apr 6, 2026
@mockersf
Copy link
Copy Markdown
Member

mockersf commented Apr 8, 2026

This PR made the benchmarks empty_systems/0_system, run_empty_schedule/MultiThreaded and run_empty_schedule/SingleThreaded worse, but not the benches with actual systems so it's probably OK. I guess it added some overhead that disappear when you have systems in the schedule

@andriyDev andriyDev deleted the dump-schedules branch April 8, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Dev-Tools Tools used to debug Bevy applications. A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants