Skip to content

Replace the bespoke BRP schedule.graph implementation with ScheduleData.#23733

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
andriyDev:brp-schedule-data
Apr 9, 2026
Merged

Replace the bespoke BRP schedule.graph implementation with ScheduleData.#23733
alice-i-cecile merged 1 commit intobevyengine:mainfrom
andriyDev:brp-schedule-data

Conversation

@andriyDev
Copy link
Copy Markdown
Contributor

@andriyDev andriyDev commented Apr 9, 2026

Objective

Solution

  • Replace the implementation of schedule.graph with the ScheduleData API.

A disadvantage is that we now need to wait for the schedules to be initialized before we can read them. Since users have to connect with BRP though, it is almost certain that the schedules will be initialized by the time they request the schedules. This may not be true of schedules like state transitions though - since these only run rarely. In a future PR, we can build the schedules on-demand instead.

Testing

  • Updated the test for this.
  • Ran the same test as BRP Add schedule.graph endpoint #23452
    • Terminal 1: cargo r --example server --features=bevy_remote
    • Terminal 2: curl -d'{"jsonrpc":"2.0","method":"schedule.graph","id":1,"params":{"schedule_label":"First"}}' -X POST -H "Accept: applcation/json" -H "Content-Type: application/json" http://127.0.0.1:15702
    • It dumped out a whole load of JSON that looked expected!
    • I don't have a visualization of the schedule data yet, so I can't validate that it's correct, but there's no reason to believe its wrong given the existing ScheduleData tests.

@andriyDev andriyDev force-pushed the brp-schedule-data branch from 477b5c8 to 622c671 Compare April 9, 2026 05:02
@andriyDev andriyDev added 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 C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. labels Apr 9, 2026
@andriyDev andriyDev added this to the 0.19 milestone Apr 9, 2026
@andriyDev andriyDev requested a review from Zeophlite April 9, 2026 05:03
@andriyDev
Copy link
Copy Markdown
Contributor Author

This endpoint was only added in the 0.19 cycle (#23452), so no migration is needed.

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.

I would much prefer to standardize on this!

@alice-i-cecile alice-i-cecile added the X-Uncontroversial This work is generally agreed upon label Apr 9, 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-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 9, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 9, 2026
Merged via the queue into bevyengine:main with commit 9129cb1 Apr 9, 2026
54 checks passed
@andriyDev andriyDev deleted the brp-schedule-data branch April 9, 2026 23:57
viridia pushed a commit to viridia/bevy that referenced this pull request Apr 10, 2026
…ta. (bevyengine#23733)

# Objective

- A possible step towards bevyengine#10981.
- Followup to bevyengine#22520.
- We accidentally have two implementations of the same thing! We created
a way to collect schedule data in `bevy_dev_tools` and in `bevy_remote`.
`ScheduleData` is a more complete implementation of collecting schedule
data, and is less tied to the internals of BRP (e.g., it supports
serializing to disk instead of only through the BRP API), so we switch
to that.

## Solution

- Replace the implementation of `schedule.graph` with the `ScheduleData`
API.

A disadvantage is that we now need to wait for the schedules to be
initialized before we can read them. Since users have to connect with
BRP though, it is almost certain that the schedules will be initialized
by the time they request the schedules. This may not be true of
schedules like state transitions though - since these only run rarely.
In a future PR, we can build the schedules on-demand instead.

## Testing

- Updated the test for this.
- Ran the same test as bevyengine#23452
    - Terminal 1: `cargo r --example server --features=bevy_remote`
- Terminal 2: `curl
-d'{"jsonrpc":"2.0","method":"schedule.graph","id":1,"params":{"schedule_label":"First"}}'
-X POST -H "Accept: applcation/json" -H "Content-Type: application/json"
http://127.0.0.1:15702`
    - It dumped out a whole load of JSON that looked expected!
- I don't have a visualization of the schedule data yet, so I can't
validate that it's correct, but there's no reason to believe its wrong
given the existing `ScheduleData` tests.
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-Refinement Improves output quality, without fixing a clear bug or adding new functionality. 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 X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants