mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #133] feat(snapshot): Advance memory snapshot epochs for linear incremental OverlayBD chains #198
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/133
Author: @xeonliu
Created: 8/6/2026
Status: 🔄 Open
Base:
main← Head:feat/incrckpt📝 Commits (2)
4d217a8docs: clarify KVM access prerequisite55d040ffeat(snapshot): advance live memory parent after capture📊 Changes
3 files changed (+81 additions, -11 deletions)
View changed files
📝
crates/benchmarks/benches/snapshot_benchmark.rs(+7 -0)📝
docs/src/concepts/snapshots.md(+6 -0)📝
src/sandbox/firecracker/sandbox.rs(+68 -11)📄 Description
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.