mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #219] feat: add mincore snapshot pre-fault #261
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#261
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/219
Author: @Hygge-Gezelligheid
Created: 8/26/2026
Status: 🔄 Open
Base:
main← Head:agent/mincore-prefault-mvp📝 Commits (10+)
ccb2f79feat: add mincore snapshot prefault3e9c872chore: use firecracker v1.15.1-patch-v2352706dfix: keep mincore profiling enabled with swap4e6bf83feat: record mincore profiling baseline3d46c00docs: describe mincore working-set prefault14e95b4fix: preserve prefault restore failures74fcad9fix: profile only newly resident mincore pages5adf169bench: profile mincore restore stages26544ddbench: add controlled prefault restore comparison335f671feat: validate complete pre-fault restore📊 Changes
98 files changed (+5241 additions, -148 deletions)
View changed files
📝
Cargo.lock(+2 -1)📝
Cargo.toml(+1 -1)📝
config/default.toml(+15 -0)📝
config/deps_manifest.toml(+2 -2)📝
crates/benchmarks/Cargo.toml(+1 -0)📝
crates/benchmarks/benches/snapshot_benchmark.rs(+1178 -19)📝
crates/linux-cap/src/lib.rs(+10 -3)📝
docs/src/SUMMARY.md(+1 -0)➕
docs/src/concepts/working-set-prefault.md(+57 -0)📝
docs/src/configuration/reference.md(+21 -0)➕
docs/src/internals/agentenv-prefault-experiment-report.md(+73 -0)➕
docs/src/internals/agentenv-prefault-fixed512-raw-20260830.log(+270 -0)➕
docs/src/internals/agentenv-prefault-product-raw-20260830.log(+178 -0)➕
docs/src/internals/investigate-concurrent-kvm-prefault-backing-scaling.md(+20 -0)📝
src/cfg.rs(+36 -0)📝
src/sandbox/firecracker/config.rs(+6 -0)📝
src/sandbox/firecracker/instance.rs(+280 -1)📝
src/sandbox/firecracker/manifest.rs(+393 -1)➕
src/sandbox/firecracker/mincore_tracking.rs(+357 -0)📝
src/sandbox/firecracker/mod.rs(+12 -2)...and 78 more files
📄 Description
Scope
This draft implements the public AgentENV mincore snapshot pre-fault path, including correctness repairs required for the production restore path and reproducible benchmark coverage.
main@58732505ba415ac691f2eee2fe7b1af39ba7058ev1.15.1-patch-v2artifact does not return the completion stats this revision requires).What changes
envd-readyboundary rather thanenvd-initialized.--max-prefault-bytesoverride and a deterministic fixed-512-MiB mechanism benchmark. Product defaults remain unchanged at 256 MiB.Validation
Passed on Madsys:
cargo test -p agentenv --lib prefault_stats— 3 passedcargo test -p agentenv --lib manifest— 33 passedcargo test -p firecracker_clientcargo check -p agentenv-benchmarks --bench snapshotcargo bench -p agentenv-benchmarks --bench snapshot --no-runcargo fmt --checkandgit diff --checkmake test-unit PROFILE=debug— AgentENV 806 passed / 4 ignored; linux-cap 3 passedFirecracker-specific unit, integration, and API-route validation is recorded in firecracker#21.
Performance evidence
The included raw logs and report distinguish an isolated fixed working-set mechanism test from the product path. All fixed-512-MiB samples verified
requested == completed == 536,870,912andremaining == 0.Product resume → envd-ready
Fixed 512 MiB multi-vCPU mechanism test
All configurations pre-fault the same deterministic 512 MiB GPA range; only snapshot vCPU/worker count changes. Each row is 10 samples of complete pre-fault wall time, not guest scan or end-to-end resume time.
Per-worker monotonic timelines show the 2-worker ioctls overlap by about 99.8–100%, so this is not userspace dispatch/join serialization. In a focused 1→2 diagnostic, wall time rose 231.2 → 276.7 ms (+19%) while completed uBlk read bytes changed only 578.4 → 589.0 MiB (+1.8%); successful reads rose 4,580 → 6,012 (+31%) and mean request size fell about 126 → 98 KiB.
The supported conclusion is therefore limited: workers execute concurrently and completion accounting is correct, but this host does not show near-linear multi-vCPU pre-fault scaling. The 2-worker regression is accompanied by backing-read request fragmentation, placing the remaining question below userspace worker dispatch in the KVM / host page-fault / backing-uBlk path. This PR deliberately makes no multi-vCPU performance claim.
The product command measured here is
snapshot load → envd-ready; it is not a webpage/application first-request benchmark.Review / merge boundary
Do not merge or release this AgentENV PR until the Firecracker dependency PR is accepted and a matching immutable binary asset is published. The project CI jobs for this head have passed; a separate code-review workflow is still in progress.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.