Skip to content

BRP Add schedule.list endpoint#23447

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
Zeophlite:brp-systems
Mar 25, 2026
Merged

BRP Add schedule.list endpoint#23447
alice-i-cecile merged 8 commits intobevyengine:mainfrom
Zeophlite:brp-systems

Conversation

@Zeophlite
Copy link
Copy Markdown
Contributor

@Zeophlite Zeophlite commented Mar 21, 2026

Objective

  • List schedules in BRP

Solution

  • Add the endpoint
  • Add to Schedules some tracking of temporarily_removed (schedule removed to execute) and empty_labels (no Schedule for that label)

Related:

Testing

  • in terminal 1 run cargo run --example server --features="bevy_remote"
  • in terminal 2 run curl -d'{"jsonrpc":"2.0","method":"schedule.list","id":1,"params":{}}' -X POST -H "Accept: applcation/json" -H "Content-Type: application/json" http://127.0.0.1:15702
Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "empty_schedule_labels": [
            "FixedPreUpdate",
            "FixedUpdate"
        ],
        "schedule_labels": [
            "Startup",
            "First",
            "RunFixedMainLoop",
            "PostStartup",
            "FixedFirst",
            "StateTransition",
            "PreUpdate",
            "PostUpdate",
            "Update",
            "PreStartup",
            "SpawnScene",
            "Last",
            "FixedLast",
            "FixedPostUpdate",
            "FixedMain"
        ],
        "unavailable_schedule_labels": [
            "Main",
            "RemoteLast"
        ]
    }
}

@Zeophlite Zeophlite marked this pull request as ready for review March 21, 2026 15:13
@Zeophlite Zeophlite added D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 21, 2026
@Zeophlite
Copy link
Copy Markdown
Contributor Author

@kfc35 Apologies I had a larger WIP branch that I split out this from, could you please have another look?

@kfc35 kfc35 self-requested a review March 21, 2026 15:48
@kfc35 kfc35 added A-Dev-Tools Tools used to debug Bevy applications. C-Feature A new feature, making something new possible labels Mar 21, 2026
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.

This looks good for an initial endpoint, and I appreciate the vision heh. I checked out the branch and it works as expected for the remote example, sample response: {"jsonrpc":"2.0","id":1,"result":["StateTransition","FixedFirst","Update","FixedMain","PreUpdate","PreStartup","Startup","Last","SpawnScene","FixedLast","First","RunFixedMainLoop","FixedPostUpdate","PostStartup","PostUpdate”]}

I wonder if people will be curious to see the schedules for the render subapp too, but that could be extended later as a request parameter or something. Don’t mind my tendency to over-engineer edit: i see your other PR has to do with render app stuff and bevy_remote, so I will just have to look at that I suppose

Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
@Zeophlite
Copy link
Copy Markdown
Contributor Author

Zeophlite commented Mar 21, 2026

I wonder if people will be curious to see the schedules for the render subapp too, but that could be extended later as a request parameter or something. Don’t mind my tendency to over-engineer edit: i see your other PR has to do with render app stuff and bevy_remote, so I will just have to look at that I suppose

Indeed, and it gives this response for the render subapp

{"jsonrpc":"2.0","id":1,"result":["Core3d","RenderGraph","ExtractSchedule","Core2d","RenderStartup"]}

Ref: #23446

@Zeophlite Zeophlite added this to the 0.19 milestone Mar 21, 2026
@ChristopherBiscardi
Copy link
Copy Markdown
Contributor

It feels strange that this is basically a special-cased endpoint for the Schedules Resource that skips around the world.get_resources handler. That also means this doesn't return ScheduleLabels like Main, which also can't be used in the followup #23452 .

We should at least document the caveats for what data is going to be returned here so users know what to expect.

@Zeophlite
Copy link
Copy Markdown
Contributor Author

As mentioned in #23452 (comment) , bevy_ecs temporarily removes a schedule from the resource in order to execute it. New version tracks these "unavailable" schedules, so the user knows they exist but can't be queried. Also tracks "empty" schedule labels. Output is now as follows:

{"jsonrpc":"2.0","id":1,"result":{"empty_schedule_labels":["FixedPreUpdate","FixedUpdate"],"schedule_labels":["Startup","First","RunFixedMainLoop","PostStartup","FixedFirst","StateTransition","PreUpdate","PostUpdate","Update","PreStartup","SpawnScene","Last","FixedLast","FixedPostUpdate","FixedMain"],"unavailable_schedule_labels":["Main","RemoteLast"]}}

@Zeophlite Zeophlite changed the title BRP list schedules BRP Add schedule.list endpoint Mar 24, 2026
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.

Needs a test :)

Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
@kfc35 kfc35 requested a review from alice-i-cecile March 25, 2026 16:22
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 25, 2026
@alice-i-cecile alice-i-cecile removed the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Mar 25, 2026
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 25, 2026
Merged via the queue into bevyengine:main with commit 1a5fdf9 Mar 25, 2026
40 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Mar 26, 2026
# Objective

- Describe the graph for a given schedule

## Solution

- Add endpoint `schedule.graph`

## Related:

- #23447
- #23446

## Testing

- in terminal 1 run `cargo run --example server
--features="bevy_remote"`
- in terminal 2 run `curl
-d'{"jsonrpc":"2.0","method":"schedule.graph","id":1,"params":{"schedule_name":"First"}}'
-X POST -H "Accept: applcation/json" -H "Content-Type: application/json"
http://127.0.0.1:15702 `

<details><summary>Response</summary>
<p>

```json
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "systemsets": [
            {
                "key": "SystemSetKey(1v1)",
                "method": "SystemTypeSet:bevy_ecs::message::update::message_update_system"
            },
            {
                "key": "SystemSetKey(2v1)",
                "method": "MessageUpdateSystems"
            },
            {
                "key": "SystemSetKey(3v1)",
                "method": "SystemTypeSet:bevy_time::time_system"
            },
            {
                "key": "SystemSetKey(4v1)",
                "method": "TimeSystems"
            },
            {
                "key": "SystemSetKey(5v1)",
                "method": "SystemTypeSet:bevy_render::view::window::screenshot::clear_screenshots"
            },
            {
                "key": "SystemSetKey(6v1)",
                "method": "SystemTypeSet:bevy_ecs::schedule::executor::ApplyDeferred"
            },
            {
                "key": "SystemSetKey(7v1)",
                "method": "SystemTypeSet:bevy_ui::widget::viewport::viewport_picking"
            },
            {
                "key": "SystemSetKey(8v1)",
                "method": "PostInput"
            },
            {
                "key": "SystemSetKey(9v1)",
                "method": "SystemTypeSet:bevy_picking::input::mouse_pick_events"
            },
            {
                "key": "SystemSetKey(10v1)",
                "method": "Input"
            },
            {
                "key": "SystemSetKey(11v1)",
                "method": "SystemTypeSet:bevy_picking::input::touch_pick_events"
            }
        ],
        "hierarchy_nodes": [
            "Set(SystemSetKey(11v1))",
            "Set(SystemSetKey(10v1))",
            "System(SystemKey(6v1))",
            "Set(SystemSetKey(9v1))",
            "System(SystemKey(5v1))",
            "Set(SystemSetKey(8v1))",
            "Set(SystemSetKey(7v1))",
            "System(SystemKey(4v1))",
            "Set(SystemSetKey(6v1))",
            "Set(SystemSetKey(5v1))",
            "System(SystemKey(3v1))",
            "Set(SystemSetKey(4v1))",
            "Set(SystemSetKey(3v1))",
            "System(SystemKey(2v1))",
            "Set(SystemSetKey(2v1))",
            "Set(SystemSetKey(1v1))",
            "System(SystemKey(1v1))"
        ],
        "hierarchy_edges": [
            [
                "Set(SystemSetKey(1v1))",
                "System(SystemKey(1v1))"
            ],
            [
                "Set(SystemSetKey(3v1))",
                "System(SystemKey(2v1))"
            ],
            [
                "Set(SystemSetKey(8v1))",
                "System(SystemKey(4v1))"
            ],
            [
                "Set(SystemSetKey(2v1))",
                "System(SystemKey(1v1))"
            ],
            [
                "Set(SystemSetKey(7v1))",
                "System(SystemKey(4v1))"
            ],
            [
                "Set(SystemSetKey(4v1))",
                "System(SystemKey(2v1))"
            ],
            [
                "Set(SystemSetKey(9v1))",
                "System(SystemKey(5v1))"
            ],
            [
                "Set(SystemSetKey(10v1))",
                "System(SystemKey(6v1))"
            ],
            [
                "Set(SystemSetKey(5v1))",
                "System(SystemKey(3v1))"
            ],
            [
                "Set(SystemSetKey(10v1))",
                "System(SystemKey(5v1))"
            ],
            [
                "Set(SystemSetKey(11v1))",
                "System(SystemKey(6v1))"
            ]
        ],
        "dependency_nodes": [
            "System(SystemKey(1v1))",
            "Set(SystemSetKey(1v1))",
            "Set(SystemSetKey(2v1))",
            "System(SystemKey(2v1))",
            "Set(SystemSetKey(3v1))",
            "Set(SystemSetKey(4v1))",
            "System(SystemKey(3v1))",
            "Set(SystemSetKey(5v1))",
            "Set(SystemSetKey(6v1))",
            "System(SystemKey(4v1))",
            "Set(SystemSetKey(7v1))",
            "Set(SystemSetKey(8v1))",
            "System(SystemKey(5v1))",
            "Set(SystemSetKey(9v1))",
            "Set(SystemSetKey(10v1))",
            "System(SystemKey(6v1))",
            "Set(SystemSetKey(11v1))"
        ],
        "dependency_edges": [
            [
                "Set(SystemSetKey(2v1))",
                "Set(SystemSetKey(10v1))"
            ],
            [
                "Set(SystemSetKey(10v1))",
                "Set(SystemSetKey(8v1))"
            ],
            [
                "System(SystemKey(3v1))",
                "Set(SystemSetKey(6v1))"
            ],
            [
                "System(SystemKey(5v1))",
                "System(SystemKey(6v1))"
            ],
            [
                "Set(SystemSetKey(4v1))",
                "Set(SystemSetKey(8v1))"
            ],
            [
                "Set(SystemSetKey(4v1))",
                "Set(SystemSetKey(10v1))"
            ],
            [
                "Set(SystemSetKey(2v1))",
                "Set(SystemSetKey(8v1))"
            ],
            [
                "Set(SystemSetKey(1v1))",
                "System(SystemKey(3v1))"
            ]
        ]
    }
}
```

</p>
</details> 

From the above response, the below graph can be generated. Hierarchy
edges are blue, dependency edges are red. System nodes are implied by
hierarchy from Set to System.

<img width="1543" height="347" alt="first"
src="https://github.com/user-attachments/assets/80ac7e80-2a28-4246-80cc-29337bad4383"
/>

<details><summary>GraphViz Source</summary>
<p>

```
digraph {
    "Set(SystemSetKey(1v1))" [label="message_update_system"]
    "Set(SystemSetKey(2v1))" [label="MessageUpdateSystems"]
    "Set(SystemSetKey(3v1))" [label="time_system"]
    "Set(SystemSetKey(4v1))" [label="TimeSystems"]
    "Set(SystemSetKey(5v1))" [label="clear_screenshots"]
    "Set(SystemSetKey(6v1))" [label="ApplyDeferred"]
    "Set(SystemSetKey(7v1))" [label="viewport_picking"]
    "Set(SystemSetKey(8v1))" [label="PostInput"]
    "Set(SystemSetKey(9v1))" [label="mouse_pick_events"]
    "Set(SystemSetKey(10v1))" [label="Input"]
    "Set(SystemSetKey(11v1))" [label="touch_pick_events"]

    // implied nodes
    "System(SystemKey(1v1))" [label="implied message_update_system", shape=rectangle]
    "System(SystemKey(2v1))" [label="implied time_system", shape=rectangle]
    "System(SystemKey(3v1))" [label="implied clear_screenshots", shape=rectangle]
    "System(SystemKey(4v1))" [label="implied viewport_picking", shape=rectangle]
    "System(SystemKey(5v1))" [label="implied mouse_pick_events", shape=rectangle]
    "System(SystemKey(6v1))" [label="implied touch_pick_events", shape=rectangle]

    // hierarchy
    "Set(SystemSetKey(1v1))" -> "System(SystemKey(1v1))" [color=blue]
    "Set(SystemSetKey(3v1))" -> "System(SystemKey(2v1))" [color=blue]
    "Set(SystemSetKey(8v1))" -> "System(SystemKey(4v1))" [color=blue]
    "Set(SystemSetKey(2v1))" -> "System(SystemKey(1v1))" [color=blue]
    "Set(SystemSetKey(7v1))" -> "System(SystemKey(4v1))" [color=blue]
    "Set(SystemSetKey(4v1))" -> "System(SystemKey(2v1))" [color=blue]
    "Set(SystemSetKey(9v1))" -> "System(SystemKey(5v1))" [color=blue]
    "Set(SystemSetKey(10v1))" -> "System(SystemKey(6v1))" [color=blue]
    "Set(SystemSetKey(5v1))" -> "System(SystemKey(3v1))" [color=blue]
    "Set(SystemSetKey(10v1))" -> "System(SystemKey(5v1))" [color=blue]
    "Set(SystemSetKey(11v1))" -> "System(SystemKey(6v1))" [color=blue]

    // dependencies
    "Set(SystemSetKey(2v1))" -> "Set(SystemSetKey(10v1))" [color=red]
    "Set(SystemSetKey(10v1))" -> "Set(SystemSetKey(8v1))" [color=red]
    "System(SystemKey(3v1))" -> "Set(SystemSetKey(6v1))" [color=red]
    "System(SystemKey(5v1))" -> "System(SystemKey(6v1))" [color=red]
    "Set(SystemSetKey(4v1))" -> "Set(SystemSetKey(8v1))" [color=red]
    "Set(SystemSetKey(4v1))" -> "Set(SystemSetKey(10v1))" [color=red]
    "Set(SystemSetKey(2v1))" -> "Set(SystemSetKey(8v1))" [color=red]
    "Set(SystemSetKey(1v1))" -> "System(SystemKey(3v1))" [color=red]
}
```

</p>
</details>

---------

Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
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-Feature A new feature, making something new possible 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.

4 participants