feat(snapshot): Advance memory snapshot epochs for linear incremental OverlayBD chains - #133
Draft
xeonliu wants to merge 2 commits into
Draft
feat(snapshot): Advance memory snapshot epochs for linear incremental OverlayBD chains#133xeonliu wants to merge 2 commits into
xeonliu wants to merge 2 commits into
Conversation
Contributor
|
✅ OpenCodeReview: Review skipped: no items were selected. |
xeonliu
marked this pull request as draft
August 6, 2026 11:40
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.
What
Introduce an explicit live memory parent for repeated non-terminal Firecracker captures.
After a locally successful capture,
FirecrackerSandboxadvancescurrent_memory_parentto the newly writtenmem_image.json. The next captureinherits that image instead of rebuilding from the immutable launch-time parent.
This Draft also:
Why
Repeated captures currently use the launch-time memory image as their parent.
This cannot support true per-checkpoint dirty-page epochs because resetting the
dirty set after one capture would allow later captures to omit earlier changes.
For example:
This change introduces and advances the current parent needed to build that
linear chain.
Related issue
Related to #120.
This remains a Draft and does not yet close the issue.
Scope and non-goals
Included:
Not yet included:
Design and behavior changes
launch parent
|
v
current_memory_parent
|
+-- capture S1 succeeds locally
| |
| v
| current_memory_parent = S1/mem_image.json
|
+-- capture S2 inherits S1 layers
launch remains immutable and records where the Firecracker process started.
current_memory_parent is initialized from it and advances independently.
The update currently occurs after pause_to_dir produces the local snapshot
configuration and before the VM resumes. Repository publication is not part of
this local parent transition.
Compatibility and operations
Validation
Commands and results:
cargo fmt --all -- --check
Passed.
git diff --check
Passed.
cargo test -p agentenv --lib current_memory_parent_advances_without_changing_launch_provenance
Did not compile on macOS because the Linux-only io-uring dependency requires
MAP_POPULATE, MADV_DONTFORK, cpu_set_t, and io_uring syscall constants.
The test executable was not run.
Skipped checks and reasons:
Full Rust and integration tests require a supported Linux host. No service or
generated-code checks are applicable.
Performance measurements remain TODO. The planned benchmark repeatedly rewrites
a fixed hot-page set and records:
Risks and reviewer notes
This is intentionally an incomplete Draft.
The current parent update is not yet coupled to an atomic image-config commit
or transactional dirty-epoch acknowledgement. Fork captures also need to use
the same transition. Before merge, artifact ownership should move into an
explicit lineage/lease abstraction so every referenced local layer remains
pinned.
Linear chains retain obsolete versions of repeatedly written hot pages.
Compaction policy and benchmark results are required before enabling this
behavior in production.
The main review points are:
Checklist