Skip to content

Allow BRP schedule.graph to initialize the schedules it is collecting.#23743

Merged
alice-i-cecile merged 3 commits intobevyengine:mainfrom
andriyDev:brp-init-schedules
Apr 12, 2026
Merged

Allow BRP schedule.graph to initialize the schedules it is collecting.#23743
alice-i-cecile merged 3 commits intobevyengine:mainfrom
andriyDev:brp-init-schedules

Conversation

@andriyDev
Copy link
Copy Markdown
Contributor

@andriyDev andriyDev commented Apr 10, 2026

Objective

Solution

  • Cache the ScheduleBuildMetadata whenever a schedule is built (the ScheduleBuilt event).
  • Lookup this metadata when BRP schedule.graph runs, and use it to extract the schedule data.
    • This metadata includes the edges for automatically inserted systems, making the resulting ScheduleData more accurate to the running schedule.
  • If the schedule needs to be built (has changed/hasn't run before), build the schedule which automatically caches its metadata.

Testing

  • Added a test for this.

@andriyDev andriyDev added this to the 0.19 milestone Apr 10, 2026
@andriyDev andriyDev added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Dev-Tools Tools used to debug Bevy applications. D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 10, 2026
@andriyDev andriyDev force-pushed the brp-init-schedules branch from 63fc5bc to d579593 Compare April 10, 2026 00:46
Comment thread crates/bevy_remote/src/builtin_methods.rs
@Zeophlite Zeophlite 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 10, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 12, 2026
@alice-i-cecile alice-i-cecile removed this pull request from the merge queue due to a manual request Apr 12, 2026
@alice-i-cecile
Copy link
Copy Markdown
Member

@andriyDev I would like to improve the tests per @ChristopherBiscardi before we merge.

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Apr 12, 2026
@andriyDev andriyDev 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-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Apr 12, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 12, 2026
Merged via the queue into bevyengine:main with commit dc9fad2 Apr 12, 2026
40 checks passed
mate-h pushed a commit to mate-h/bevy that referenced this pull request Apr 14, 2026
…ng. (bevyengine#23743)

# Objective

- In bevyengine#23733, we started using the `ScheduleData` API for the BRP
`schedule.graph` endpoint.
- This had a consequence that only schedules that were initialized
(i.e., previously ran) could be returned.
- In addition, the schedule data was missing edges for automatically
inserted `apply_deferred` systems.

## Solution

- Cache the `ScheduleBuildMetadata` whenever a schedule is built (the
`ScheduleBuilt` event).
- Lookup this metadata when BRP `schedule.graph` runs, and use it to
extract the schedule data.
- This metadata includes the edges for automatically inserted systems,
making the resulting ScheduleData more accurate to the running schedule.
- If the schedule needs to be built (has changed/hasn't run before),
build the schedule which automatically caches its metadata.

## Testing

- Added a test for this.
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. C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants