Repository navigation
host: prepare checked cold VM launches - #1342
Merged
Pedro Henrique Penna (ppenna) merged 5 commits intoNov 9, 2026
Merged
Pedro Henrique Penna (ppenna) merged 5 commits into
Pedro Henrique Penna (ppenna) merged 5 commits into
Conversation
Contributor
This pull request changes existing testsIt modifies or removes 2 existing test asset(s), listed below. Review each with care: a change to a test can hide a regression that the test caught. See doc/contribute.md#changes-to-existing-tests. Test code
Relocated unchanged: 0; added: 11. Compared the merge base |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
VM preparation can accept Linux socket paths that exceed the address byte limit or contain listener-option delimiters, leading to unusable endpoints, incorrect socket selection, or startup failures.
2 open issues
What changed in this PR
Adds inspectable cold-launch preparation as part of the move toward a mechanism-focused nvx library. Callers can obtain checked arguments, output names, and a capability without starting a VM.
Changes:
- Add
vm::createandPrepared, retaining opened resources and cleaning up the newly created log on failure. - Make the whole-config renderer internal and add an opaque
Snapshottype, with restoration explicitly unsupported. - Add focused preparation tests and update documentation, public API snapshots, and test-layout metadata.
| File | Description |
|---|---|
scripts/test-layout-allowlist.json |
Remove the obsolete VM test-seam allowance. |
nvx-rs/src/host/vm/tests.rs |
Test preparation, refusal, cleanup, resource ownership, and command-line limits. |
nvx-rs/src/host/vm.rs |
Implement cold-launch preparation and resource retention. |
nvx-rs/src/host/snapshot.rs |
Introduce the opaque snapshot input type. |
nvx-rs/src/host/mod.rs |
Export snapshots and document prepared launches. |
nvx-rs/src/host/config/mod.rs |
Make argument rendering internal to preparation. |
nvx-rs/README.md |
Document the preparation API and ownership contract. |
nvx-rs/public-api/windows.txt |
Record the updated Windows public API. |
nvx-rs/public-api/linux.txt |
Record the updated Linux public API. |
Review effort: Balanced
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.2.1-sl2.8-20261107
branch
from
November 8, 2026 19:16
e0b5191 to
e2d5624
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/slim-2.2.1-sl2.8-20261107
branch
from
November 8, 2026 20:02
e2d5624 to
49ee94b
Compare
Enrique Saurez (esaurez)
marked this pull request as ready for review
November 8, 2026 20:10
Enrique Saurez (esaurez)
marked this pull request as draft
November 8, 2026 20:22
Enrique Saurez (esaurez)
marked this pull request as ready for review
November 8, 2026 21:18
Base automatically changed from
esaurez/slim-2.1.2-sl2.4c-20261107
to
feature/nvx-refactor
November 8, 2026 21:25
Create an inspectable cold launch with its owned log, capability, outputs, arguments, and opened resources without starting a process. Refuse restores and missing boot data, preserve existing outputs, remove only newly created output on failure, and check the complete portable command-line limit. Keep the whole-configuration renderer internal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 98b02bc4-2d86-490f-8241-2234ccd39feb
Reject Linux listener-option delimiters and socket names of 108 bytes or more before creating any cold-launch output. Cover both console configurations, Unicode byte boundaries, real valid socket binds, and preservation of caller inputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 98b02bc4-2d86-490f-8241-2234ccd39feb
Validate the resolved Linux endpoint names before creating the log, retaining the supplied outputs and existing listener-option checks. Add ancestor-symlink Unicode and byte-boundary regressions without changing rollback or launch ownership. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 98b02bc4-2d86-490f-8241-2234ccd39feb
Adapt the original cold fixture to the inherited Boot.capture field. Preserve every existing preparation, socket, rollback and command-line assertion without changing production behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 98b02bc4-2d86-490f-8241-2234ccd39feb
Hold the fixture clock until its pending connect starts, then reach the unchanged 200 ms request deadline. Preserve the socket-shutdown assertions without depending on worker scheduling latency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 98b02bc4-2d86-490f-8241-2234ccd39feb
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/slim-2.2.1-sl2.8-20261107
branch
from
November 8, 2026 21:25
1017e0d to
0701ea5
Compare
Pedro Henrique Penna (ppenna)
merged commit Nov 9, 2026
708dcef
into
feature/nvx-refactor
53 checks passed
Pedro Henrique Penna (ppenna)
deleted the
esaurez/slim-2.2.1-sl2.8-20261107
branch
November 9, 2026 01:22
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.


Part of #1076.
Current CI follow-up
1017e0deadds one test-only linear commit on49ee94b4; all five own commits remain single-parent, with no merge commit. The failing Ready-triggered CI run 42518746270 reached its 200 ms metadata deadline before the mocked connect started, so the pending-connect fixture'sblockedassertion failed. The production timeout and shutdown behavior were correct and are unchanged. The fixture now models the request clock: first ensure the connect is actually pending, then reach the same 200 ms deadline. No assertion, workload deadline or production code was removed or weakened.The original fixture deterministically fails with a 350 ms worker-start delay; the corrected fixture passes that identical delayed-start reproduction and all three metadata socket cases. The complete 1,818-case Windows unit suite passes with 69 recorded platform skips, using the exact current CI-built CLI/provenance; Python lint/format and both typing targets, host tests and helps also pass. Local broader adversarial checks retain separate Windows Store process-containment and PID-file-sharing fixture failures, not passes; no unrelated source was changed. Current full CI run 42523865334, attempt 1, is pending on
1017e0de. The same-head automatic PR run42523863567is tracked separately; automatic Draft-job skips are not CI green. Earlier source results below are retained history, not validation of this current test correction.Add SL2.8's cold
host::vm::createAPI and inspectablePreparedresult without spawning a process. RequireBoot, refuse snapshot restoration, retain the opened private log and inherited files, and expose the capability, output names and checked arguments. Failed preparation removes only the log it created; pre-existing outputs and runtime inputs remain untouched. Check the complete Windows command line with the actual paths and no reserve before returning.Make the existing whole-config renderer internal, add the opaque
Snapshotshell, and update the documentation and Linux/Windows public API snapshots. No restore, launcher, native pin, provider or budget changes. Preserve the predecessor's snapshot metadata, capture/restore types and legacy launch APIs rather than replacing them with the opaque shell.The retained
7c4156adcorrection refuses Linux listener-option delimiters (,and=) and generated control/boot-console socket names of 108 bytes or more before creating any output. Valid Unicode and space-containing names remain supported within the byte bound; Windows pipe selection is unchanged.The retained
e0b51916correction additionally validates the canonical directory-derived Linux socket names for Unicode and the 107-byte limit before opening the log. This closes the ancestor-symlink bypass while preserving valid aliases, supplied output paths and arguments, and all existing ownership and rollback behavior.Prior linear replay
49ee94b4targeted the published #1334 headd86792ec, retaining the SL2.7 inputs and native14dc4116. It replayed only the three original logical cold-create/socket commits and their test-onlyBoot.capture = Noneintegration correction, preserving the original refs, history and captures. The only rebase conflict was README wording: keep the parent's listener/export refusal documentation and this layer's internal-renderer/Preparedinspection documentation. All four replayed commits and the additional current CI-fix commit have one parent; the latest parent remains an ancestor: zero merge commits in this PR's own history. The repository supports rebase-and-merge; no merge was performed. Child PR #1349 and complete native stack membership are preserved.Prior replay
e2d56248targetedac93c908and had the same complete tree as the qualifiedc4935bee. Those source, review, CLI, runtime and CI captures remain retained at their original identities; they are not validation of the new inheritedd86792ecguards.Official whole-row measurement against the exact published parent: 149 core lines, 4 counted files, 10 raw paths, including the test-layout metadata without discounts. The inherited cold-block guard still preserves read-only ISO images and case-sensitive extension selection; the legacy sandbox wrapper retains its VMDK policy.
Tests
Add nine focused tests and two fixture helpers for cold preparation, Boot/snapshot refusal before outputs, rollback versus pre-existing resources, opened-file ownership, the exact complete-command-line boundary, Linux listener delimiters/socket byte limits, and canonical endpoint validation through ancestor symlinks. The direct-path regressions retain both console modes and Unicode/space names at 107/108/109 bytes. The two ancestor-symlink regressions cover valid canonical 107-byte Unicode/space names and real Unix binds, rejection at 108/109 bytes, non-Unicode canonical ancestors, both console modes, unchanged supplied outputs, and caller-file/symlink preservation before any failure output. Their genuine old-
394b0833production RED and corrected-source GREEN captures remain preserved.The existing-test inventory flags one removed hook:
VmDir::outputsis now used by production preparation, so its obsolete conditional dead-code allowance is removed. Against the current predecessor, tighten its remaining test-layout seam allowance from 6 to 5. Adapt the original cold fixture withcapture: NoneinsideBoot, without enabling capture rendering. No existing tests, assertions or workload deadlines are removed or weakened.Validation
Prior
49ee94b4verification passed source/native consistency, exact parent ancestry, four single-parent own commits, clean integration tree, whole-row measurement, test-layout inventory and Markdown links. Its README-only rebase correction qualified for the mechanical fast path. Manual CI run 42518070173, attempt 1, succeeded and its Copilot review was clear; the separate Ready-triggered CI failure is addressed above. None of these prior results is relabeled as a current1017e0deCI pass.c4935bee: 30 Windows and 35 Linux commands, including feature combinations, warnings-denied Clippy/rustdoc, tests, public API snapshots, MSRV 1.89, the macOS check, and protocol/host/guest runtime-adapter checks. Reuse is explicitly bound to the identical completee2d56248source tree and unchanged four-patch diff; these are not reruns or commit-hash-relabeled passes.c4935bee/ tree8a88c619, exactly the current source tree and layer diff. No unchanged review replay or new-hash review claim.c4935bee, source digest683f505b, executable hashesa36bdbb5/0784c90c. Their provenance validates against the identical currente2d56248inputs. The three genuinely CLI-dependent unit cases passed on each platform.e2d56248WHP and MSHV acceptance: six owned consumers each, processors=1, covering guest-boot, command-line-limit, managed-execution configuration, sandbox-lifecycle, proxy-only and RAM-upper behavior. Both hosts retained clean source/runtime tuples; no owned VMM remains. No compiler ran in these VM phases, and the compiler-bearingmanaged-lifecyclescenario was excluded.a9f23c1e, without a kernel or OpenVMM producer. Installed and validated only the needed current guest artifacts on Windows; original payloads/provenance remain retained.efa7e627quality actions, and its input-equivalenta919db3ePython/CLI-unit, adversarial, host-inventory and help evidence. The inherited unit runs recorded 1,818 cases with 70 Windows / 39 Linux skips; adversarial runs recorded 84 cases with 11 Windows / zero Linux skips. Those are component reuse, not fresh current-head full-suite or old-CLI passes; the actual current CLI-dependent, guest and selected native-runtime results are above.This remains a Draft. Prior CI run 42514434863, attempt 1, and Copilot review
5819320543succeeded one2d56248; they are historical, not current-head evidence. This latest head requires its own singleci.ymldispatch and current Copilot review; automatic Draft-job skips are not CI green. No development-release dispatch, Ready/demotion, merge or other-ref mutation.