Skip to content

Remove sandbox evolving and devolving and replace it with snapshotting API. #697

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 19 commits into from
Jul 16, 2025

Conversation

jprendes
Copy link
Contributor

@jprendes jprendes commented Jul 8, 2025

This PR introduces a first version of the snapshot API.

The current implementation doesn't play very nicely with memory mapping. This is because restoring a snapshot will not restore the mapped memory. As this PR already introduces many other changes, I would prefer to keep fixing the interaction with memory mapping to a different PR.

I recommend reviewing it commit by commit. Each commit should be fairly self contained.

This PR introduces a public snapshot API.
As a result, a sandbox is not automatically snapshotted and restored anymore. It has to be triggered by the user instead.
Before we were snapshotting a sandbox when evolving it, and restoring it after each guest call.
As a result, we do not need the evolve / devolve mechanism anymore.
Evolving allowed us to persist changes in a sandbox, now this happens with all guest calls.
Devolving was not being used anywhere AFAIK.
As the evolving/devolving API is removed, we don't need the transition metadata anymore (which was used by evolving), and neither the noop transition.
We can also remove the Sandbox trait that by this point has lost all but one of its methods, which can be easily inlined in the only place where it was used.
We don't need the call context anymore either.

@jprendes jprendes added the kind/refactor For PRs that restructure or remove code without adding new functionality. label Jul 8, 2025
@jprendes jprendes force-pushed the snapshot-api branch 5 times, most recently from cbf3729 to 1106a4e Compare July 15, 2025 09:41
@jprendes jprendes changed the title [WIP] Remove sandbox evolving and devolving and replace it with sandboxing API. Remove sandbox evolving and devolving and replace it with sandboxing API. Jul 15, 2025
@jprendes jprendes marked this pull request as ready for review July 15, 2025 09:51
Copy link
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

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

Great work, @jprendes!
I like when I see more code removed than it was added 😃
The PR description is a bit confusing, mentioning the removal of evolve/devolve APIs, but there is still evolveing involved 😄

I left some comments here and there where I didn't understand something.

NOTE: Some of the comments may be outdated as I reviewed each commit.

@jprendes
Copy link
Contributor Author

but there is still evolveing involved

Haha, yes, indeed. At lest the traits are not there anymore.
I would like to change that method name to initialize, but that's used all over the place.
Because of that I think that one should go on it's own PR.

ludfjig
ludfjig previously approved these changes Jul 16, 2025
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

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

LGTM

@jprendes jprendes changed the title Remove sandbox evolving and devolving and replace it with sandboxing API. Remove sandbox evolving and devolving and replace it with snapshotting API. Jul 16, 2025
jprendes added 10 commits July 16, 2025 21:29
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
jprendes added 7 commits July 16, 2025 21:29
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
ludfjig
ludfjig previously approved these changes Jul 16, 2025
Signed-off-by: Jorge Prendes <[email protected]>
ludfjig
ludfjig previously approved these changes Jul 16, 2025
Signed-off-by: Jorge Prendes <[email protected]>
Copy link
Member

@syntactically syntactically left a comment

Choose a reason for hiding this comment

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

Looks good to me apart from some very minor comments.

I agree with @jsturtevant that there is some worry about whether code will continue compiling but do something different, which would be extremely unfortunate. However, I would like to get this merged so that it can unblock other work that would ideally be (re)based on top of this, so I personally at least am happy to leave working out the exact details of what should be done there to a follow-up issue that we consider a blocker for release.

@jprendes jprendes merged commit e4a661a into hyperlight-dev:main Jul 16, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor For PRs that restructure or remove code without adding new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants