Open
Conversation
Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
When we are loading from a snapshot, we can get away with just a restore and never going through a wasmtime load. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to bring Hyperlight’s snapshot-driven copy-on-write (CoW) workflow into the Wasm path by deferring sandbox restores and enabling Wasmtime “memory image” support via VA remapping.
Changes:
- Add
needs_restore/restore_if_needed()to defer restoring the runtime snapshot until the next module load, reducing eager restore overhead. - Add
WasmSandbox::load_from_snapshot()to create a loaded sandbox by restoring a snapshot taken from aLoadedWasmSandbox. - Implement Wasmtime memory image APIs by copying VA mappings and converting writable pages to CoW mappings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
src/hyperlight_wasm/src/sandbox/wasm_sandbox.rs |
Defers restore on unload via needs_restore, adds load_from_snapshot, and wires restore into some load paths. |
src/hyperlight_wasm_runtime/src/platform.rs |
Implements Wasmtime memory image creation/mapping via page-table remaps and CoW conversion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…o restore A few minor nits/documentation fixes/formatting fixes/cleanups Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Fixes to some barrier logic, along with some minor formatting nits Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should finally get the main benefits of the hyperlight core snapshot-focused CoW workflow into wasm.