Skip to content

Hot patching systems with subsecond #19309

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

Merged
merged 33 commits into from
Jun 3, 2025
Merged

Conversation

mockersf
Copy link
Member

Objective

Solution

  • First commit is the naive thin layer
  • Second commit only check the jump table when the code is hot patched instead of on every system execution
  • Depends on subsecond: Typed HotFn pointer DioxusLabs/dioxus#4153 for a nicer API, but could be done without
  • Everything in second commit is feature gated, it has no impact when the feature is not enabled

Testing

  • Check dependencies without the feature enabled: nothing dioxus in tree
  • Run the new example: text and color can be changed

@alice-i-cecile alice-i-cecile added this to the 0.17 milestone May 20, 2025
@alice-i-cecile alice-i-cecile added X-Controversial There is active debate or serious implications around merging this PR M-Needs-Release-Note Work that should be called out in the blog due to impact A-Dev-Tools Tools used to debug Bevy applications. labels May 20, 2025
Copy link
Contributor

It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.

Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.

Copy link
Member

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

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

Consider adding the documentation on how to setup your system (i.e. download CLI, change linker, etc.) from https://github.com/TheBevyFlock/bevy_simple_subsecond_system :)

@janhohenheim janhohenheim added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label May 20, 2025
@jakkos-net
Copy link
Contributor

jakkos-net commented May 20, 2025

Just tried this on Linux with 2 of my existing projects. All I had to do was enable the feature and run with dx serve --hot-patch and all systems would hot-patch. Great stuff!

@janhohenheim
Copy link
Member

Little update: https://github.com/TheBevyFlock/bevy_simple_subsecond_system now supports changing the signatures of systems at runtime. Would be nice if this PR did so too, but I'm also fine with leaving that for a follow-up :)

@cart cart moved this to Respond (With Priority) in @cart's attention May 20, 2025
@MrGVSV
Copy link
Member

MrGVSV commented May 20, 2025

The future is now

Copy link
Contributor

@bushrat011899 bushrat011899 left a comment

Choose a reason for hiding this comment

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

A couple notes more than anything else. Really awesome to see this working, this will be a massive selling point of 0.17

@janhohenheim
Copy link
Member

janhohenheim commented May 21, 2025

Update again: I added an opt-in to rerun hot-patched systems to the prototype. This makes it way nicer to edit UIs live, as it means we can just rerun regular setup systems that are typically in OnEnter or Startup. Which breaks their run contracts, but I think that's fine as long as it's opt-in per function.
Not sure if we want to land that in the MVP, just pointing out that this possibility exists :)

mockersf added 2 commits June 1, 2025 01:27
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

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

I think this is in a good spot, once my minor feedback is addressed. Exciting times!

mockersf added 4 commits June 3, 2025 21:49
@cart cart added this pull request to the merge queue Jun 3, 2025
Merged via the queue into bevyengine:main with commit 7a7bff8 Jun 3, 2025
36 checks passed
@cart cart moved this from Respond (With Priority) to Responded in @cart's attention Jun 11, 2025
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. M-Needs-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Controversial There is active debate or serious implications around merging this PR
Projects
Status: Responded
Development

Successfully merging this pull request may close these issues.

Support hotpatching systems
10 participants