Skip to content

Enable process-owned NVX snapshot execution - #1738

Draft
Enrique Saurez (esaurez) wants to merge 1 commit into
microsoft:mainfrom
esaurez:mxc-profile/process-owned-snapshots
Draft

Enrique Saurez (esaurez) wants to merge 1 commit into
microsoft:mainfrom
esaurez:mxc-profile/process-owned-snapshots

Conversation

@esaurez

@esaurez Enrique Saurez (esaurez) commented Nov 12, 2026 •

Copy link
Copy Markdown

📖 Description

Enable snapshot-backed MicroVM create-and-run execution and lifecycle start
using the native library's existing process-owned platform cache. Keep two
stable configurations per state root: validation without VM creation, and
execution with 1-vCPU/256-MiB platform templates. No daemon, running-VM pool,
additional Rust platform cache, public ownership API, or response metadata is
introduced.

Align the SDK/model to 0.1.2 and independently approve the complete signed
v0.2.0-build189870623 bundle. Preserve per-operation signature, revocation,
inventory, file-guard, module-lifetime, and explicit-close checks. Validate and
probe before capture; surface initialization fallback through existing warning
channels, with sensitive details withheld.

Preserve lifecycle IDs and their unversioned state directory. A restored VM
has one controlling process; different VMs can share a template concurrently,
and another process can adopt a VM after its controller exits. Document this
restriction, upgrade handling, template limits, and native proxy constraints.
Require snapshot/lifecycle discovery and execution markers in nightly CI, with
negative tests for missing coverage.

No separate spec is required: this uses the existing experimental backend and
request/lifecycle contracts, without a new backend, contract field, published
SDK signature/type, workspace crate, or lifecycle ownership API. Profiling
instrumentation and evaluation artifacts are excluded.

🔗 References

Related: #1693. This is an independent change from main, not a stack; that
draft PR is unchanged. No issue was supplied.

🔍 Validation

Local Windows x64/WHP, Rust 1.93.1, complete unchanged Microsoft-signed bundle.
Cargo commands below ran from src unless an explicit manifest is shown.

Command Result
cargo fmt --manifest-path F:\source\mxc-mxc-profile\src\Cargo.toml --all -- --check Passed
cargo clippy --release --locked -p mxc-sdk --features microvm --all-targets --target x86_64-pc-windows-msvc --jobs 4 --message-format=json-render-diagnostics -- -D warnings Passed
cargo test --release --locked -p mxc-sdk --features microvm --lib --target x86_64-pc-windows-msvc --jobs 4 --message-format=json-render-diagnostics nvx:: 59 passed, none ignored
cargo test --release --locked -p mxc-sdk --features microvm --test nvx_bundle_integrity --test nvx_e2e --target x86_64-pc-windows-msvc --jobs 4 --message-format=json-render-diagnostics 21 host checks passed; 13 VM scenarios ignored, not counted as VM coverage
cargo test --release --locked -p mxc-sdk --features microvm --test nvx_e2e --target x86_64-pc-windows-msvc --jobs 4 --message-format=json-render-diagnostics -- --ignored --nocapture --test-threads=1 13 VM scenarios passed, none ignored; 299.46 seconds; task-isolated state
node --test scripts\tests\microvm-validation.test.js 59 passed, none skipped

Actual VM coverage includes NIC/noNIC template reuse, repeated SDK requests,
proxy and filesystem activation, cold fallback warnings and recovery,
lifecycle continuity and controller handoff, concurrent image/template use,
console interruption, controlled TCP/UDP policy, binary output, timeouts,
capture limits, and cleanup. An initial Node fixture run encountered a
PowerShell CLR crash; its isolated retry and the final full 59-test run passed
without changing assertions. Architecture and material implementation review
used Opus 5.5 with maximum reasoning and long context.

Linux/macOS and remote PR checks have not run here. dependency-feed-check
remains pending; no feed publication or manual Azure pipeline run was queued.
CLA status was not verified. Build and architecture conventions are unchanged.

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (see pull request builds)

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Reuse native validation and execution setups for create-and-run and lifecycle start. Preserve per-operation trust and cleanup, surface cold fallback warnings, and require functional snapshot coverage in nightly CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c97dd74f-cbe7-4314-8d24-262fa60f5c6c
Copilot AI balanced review requested due to automatic review settings November 12, 2026 00:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Switching existing V1 lifecycle starts to process-owned clones breaks cross-process control, causing run and stop calls from another process to fail while the owner remains alive.

2 open issues
What changed in this PR

Enables snapshot-backed execution in MXC’s experimental NVX backend using the native library’s process-owned cache, covering create-and-run requests and lifecycle starts without adding public API signatures.

Changes:

  • Adds snapshot initialization, cold-boot fallback warnings, and boot diagnostics.
  • Updates the native SDK dependencies and approved signed bundle.
  • Extends lifecycle, snapshot, cancellation, and isolation tests, with required nightly CI markers and documentation.
File Description
src/​mxc-sdk/​tests/​nvx_e2e.rs Adds snapshot reuse, fallback, lifecycle handoff, and interruption scenarios.
src/​mxc-sdk/​src/​core/​mxc_engine/​state_aware.rs Includes NVX operation warnings in lifecycle responses.
src/​mxc-sdk/​src/​backends/​nvx/​state_aware.rs Enables snapshot-backed lifecycle starts and warning collection.
src/​mxc-sdk/​src/​backends/​nvx/​signature_verification.rs Updates the approved bundle checksum.
src/​mxc-sdk/​src/​backends/​nvx/​runner.rs Prepares snapshot execution and logs boot mode and fallback warnings.
src/​mxc-sdk/​src/​backends/​nvx/​crate_runtime.rs Opens the execution host with stable snapshot settings.
src/​mxc-sdk/​Cargo.toml Pins the native SDK dependency to 0.1.2.
src/​Cargo.lock Records updated native SDK, model, and NVX dependencies.
scripts/​tests/​microvm-validation.test.js Adds negative checks for missing test discovery and execution markers.
scripts/​ci/​stage-nvx-validation-tests.ps1 Requires discovery of snapshot and lifecycle tests.
scripts/​ci/​run_backend_validation_tests.ps1 Requires the expanded VM execution markers.
docs/​development/​build-and-test/​ci-validation-infrastructure.md Documents snapshot coverage and nightly validation requirements.
docs/​backends/​nvx/​nvx.md Explains snapshots, process ownership, fallback, upgrades, and proxy limits.

Review effort: Balanced

Comment on lines +171 to +172
super::runner::prepare_execution(client, true, None, &mut self.logger)?;
super::runner::start_sandbox(client, &sandbox_id, true, &mut self.logger)?;
Comment on lines +296 to +299
// Opening the execution host can capture templates, so validation and probing must precede it.
if let Some(error) = client
.open_execution_host()
.map_err(|error| protect_native_error(error, "platform_snapshots", sensitive_proxy))?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants