Skip to content

nvx-rs slimming 4.2.3: the old configs, the old launch code and bundled are gone #1122

Closed

Description

Parent: #1087, in #1076. Needs: #1121. Unblocks: #1123, #1124, #1125. No PR of this group merges before the API-ready commit.

Leaving code only. Every PR in this group changes only code that this workstream removes from NVX: the old config types, the old launch code, its one-shot launch and checked-file transfer, and the bundled feature, with the edits that remove references to it. Nothing that stays changes, and no later PR uses what these PRs change, so the size limits for kept code don't apply. Each PR still records its core lines and counted files, and its description opens with this note.

Goal. The old config types and the rest of host::launch, the old aggregate naming and boot rendering, NVX's old guest tokens, the one-shot foreground launch, the checked-file transfer and spawn_command are gone, with the crate-private code that those deletions leave unused. The shell /init stops reading OpenVMM's lifecycle tokens. The private OS layer keeps only the launch code that host::vm::spawn uses. bundled, its build script and its variables go; NVX_OPENVMM, NVX_AUTO_DOWNLOAD and NVX_RS keep their meaning.

Notes.

PRs, in order. Each PR has one goal, leaves dev green, and names in its description each old test of its area as kept, rewritten or retired, with each change that check_test_changes.py reports. Its tests follow the repository's test layout: a module's unit tests, and the code that only they use, sit in its tests.rs or tests/ and move with it. The estimates count core lines (code, not comments, docs or tests) and counted files; each PR records its measured values. Each PR does what its Scope says and no more: a case, input or layout that its Scope doesn't name, and whatever "Not in this PR" lists, is out of scope. Address every review comment within the scope, and ask before acting on one that asks for more.

  1. SL6.3: The old config types are gone.

    • Objective: The old configuration, launch model, one-shot foreground launcher and checked-file transfer are no longer used. They, the generic spawn helper, aggregate rendering and guest tokens are deleted, while VM spawning keeps its private synchronization and failed-spawn cleanup.
    • Contents: Leaving code. Delete LaunchSpec, SandboxPlan, SandboxLaunch, SandboxSettings, SandboxNetwork and CaptureClass, the parts of host::sandbox that only they use, prepared included, the old aggregate naming and boot rendering (aggregate_child_name, aggregate_child_argument, mount_argument, BootShares, boot_shares, aggregate_share_tokens, aggregate_command_line_fragment and export_command_line_fragment; plan_mounts, plan_mounts_with and the shared path_text stay for SL6.7b), and NVX's guest tokens, which the CLI now renders, with WORKLOAD_ACCOUNT_TOKEN and the workload limits. The rest of host::launch goes too: WorkloadIdentity (DEFAULT, select), MAX_TIMEOUT, DEFAULT_MEMORY_MIB, DEFAULT_HOSTNAME, base_command_line, kernel_parameters_problem, timeout_problem and LaunchSpec::check_process_command_line; DEFAULT_GUEST_NETWORK, COMMAND_LINE_BUDGET and the Windows command-line helpers already live in host::config. What dev added on the old path goes too: VmmLaunch (with RESERVE and arguments) and LaunchSpec::vmm_launch, OPENVMM_COMMAND_LINE_RESERVE, SandboxPlan::check_adapter_launch and PreparedLaunch::adapter_arguments; VmConfig::check_command_line keeps their guarantee. Delete the old one-shot foreground launch in platform's Linux and Windows paths and host::sys::process, Windows LaunchedProcess::{wait_timeout, request_termination}, the checked-file handoff (Inherited::proc_path, ProcessHandle::close_inherited), the generic spawn_command, and the crate-private code that these deletions leave unused; the internal spawn lock and termination after a failed spawn stay. The shell /init stops reading OpenVMM's lifecycle tokens, and so stops handing a layered root that has one to nvx-init-agent.
    • Scope:
      • Delete the old config types and their host::sandbox code, including prepared; delete old aggregate and boot rendering, but keep plan_mounts, plan_mounts_with and shared path_text for nvx-rs slimming 4.3.1: image staging, artifact discovery, the policy-file reader and the mount syntax are private to the CLI #1124.
      • Delete the remaining old host::launch values and checks, VmmLaunch, its reserve and arguments, and the adapter launch checks; keep command-line helpers in host::config and VmConfig::check_command_line.
      • Delete NVX's guest tokens, WORKLOAD_ACCOUNT_TOKEN and workload limits, and stop the old launch paths and shell /init from reading or passing the obsolete lifecycle and workload tokens.
      • Delete the Linux and Windows one-shot foreground launch paths, their host::sys::process code, and Windows LaunchedProcess::{wait_timeout, request_termination}.
      • Delete Inherited::proc_path, ProcessHandle::close_inherited, spawn_command, and crate-private code left unused; keep the internal spawn lock and termination after a failed spawn.
      • Retire the deleted paths' tests and remove the production seam entry for sandbox/plan.rs; retained mount syntax, image staging, path rules, spawn-lock and failed-spawn tests stay.
    • Not in this PR:
    • Approach: Delete the named config, rendering, foreground-launch, checked-file and generic-spawn items, remove their references, and retire their tests. Follow the compiler to delete crate-private code that becomes unused. Edit the shell init only to remove the three obsolete tokens and route. Keep retained mount, command-line, VM-spawn, spawn-lock and failed-spawn code at their current owners.
    • Done when:
      • The Test changes report lists the deleted config, launch, aggregate-rendering, checked-file, foreground-launch and generic-spawn cases as removed, and the description retires each one.
      • The old launch paths pass neither --microvm-lifecycle nor --microvm-workload-identity, and the shell /init no longer recognizes their three tokens.
      • The internal spawn-lock and failed-spawn termination tests still pass.
      • Mount syntax, image-staging and path-rule tests remain.
    • Needs: SL6.1, in nvx-rs slimming 4.2.2: the old clone path, template store and sandbox store are gone #1121.
    • Estimate: 0 core lines (deletions), 9 counted files.
  2. SL6.6a: The bundled feature is gone.

    • Objective: The bundled feature and its release-staging contract have no remaining user. The feature, build script, artifact manifest and private bundle variables are deleted from code and tooling without changing the retained discovery and download contracts.
    • Contents: Leaving code. CI's check action and mutants workflow, crate_release.py, the guest build's inventory (build_constants.py) and the provenance inventory of nvx.py's nvx-rs (nvx_rs.py's source_files(), which requires each file that it lists) stop building, checking or listing bundled and its build script. Delete the build script, links = "nvx", artifacts.json and its release check, NVX_BUNDLE_DIR, NVX_BUNDLE_HYPERVISOR, NVX_BUNDLE=skip and DEP_NVX_ARTIFACTS_DIR, from the manifest, lib.rs, contract.rs, host::artifacts and the CLI's downloads. contract::manifest_mismatches, which dev added, with the time ABI's and the restore packets' fields, stays in contract: the CLI's discovery and downloads check manifests with it.
    • Scope:
      • Delete nvx-rs/build.rs, the bundled feature, links = "nvx", artifacts.json handling and its release check.
      • Remove NVX_BUNDLE_DIR, NVX_BUNDLE_HYPERVISOR, NVX_BUNDLE=skip and DEP_NVX_ARTIFACTS_DIR from the manifest, lib.rs, contract.rs, host::artifacts and the CLI downloads.
      • Remove bundled and its build script from the check action, mutants workflow, scripts/nvx_tools/crate_release.py, the guest build inventory in scripts/nvx_tools/build_constants.py, and the provenance inventory in scripts/nvx_tools/nvx_rs.py (source_files()), which fails on a listed file that is missing.
      • Keep NVX_OPENVMM, NVX_AUTO_DOWNLOAD, NVX_RS and contract::manifest_mismatches with its time and restore fields.
    • Not in this PR:
      • Rewriting, refactoring or improving retained artifact discovery, downloads or release tooling.
      • Moving the bundle build script or artifact manifest elsewhere.
      • Adding a replacement embedding, staging or bundle feature.
      • Changing the meaning of NVX_OPENVMM, NVX_AUTO_DOWNLOAD or NVX_RS.
      • Deleting contract::manifest_mismatches; retained discovery and downloads use it.
    • Approach: Remove the feature and every fixed reference to its build script, manifest and four private variables from the listed inventories and consumers. Keep the retained environment variables and manifest comparison code untouched; do not redesign packaging or artifact discovery.
    • Done when:
      • Release checks no longer expect artifacts.json or the deleted bundle variables.
      • CI, mutant, guest-build and provenance inventories no longer build, check or list bundled or nvx-rs/build.rs, and nvx.py still records and checks the provenance of the nvx-rs that it builds.
      • Image-staging and retained artifact tests still pass.
      • NVX_OPENVMM, NVX_AUTO_DOWNLOAD, NVX_RS and manifest_mismatches remain.
    • Needs: SL6.1, in nvx-rs slimming 4.2.2: the old clone path, template store and sandbox store are gone #1121.
    • Estimate: 50 core lines, 10 counted files.

Tests. Each PR retires the tests of what it deletes, including the old config, launch, one-shot, checked-file-transfer and bundle checks. After SL6.3, /init no longer recognizes the old lifecycle or workload tokens, and no layered root reaches the old init. Tests of the private spawn lock, failed-spawn termination, mount syntax, image staging and path rules stay. Release and guest-build inventories no longer expect bundled, its variables, artifacts.json or nvx-rs/build.rs.

Done when: every PR above has merged, with dev green.

Activity

  1. esaurez commented on Nov 10, 2026

    @esaurez
    ContributorAuthor

    Workstream source/progress checkpoint - 2026-11-10 UTC

    Checked boxes below mean merged scope, not merely an implemented first iteration. Implementation branches are source checkpoints, not automatic qualification, Ready or merge approval. Some starting inputs are frozen/anonymous commits rather than standalone branches; their exact SHAs and known merged producer refs are recorded explicitly.

    • SL6.3 - no completed first-iteration handoff recorded. Inspect any preserved partial/prior work before implementing the issue's scope.

    • SL6.6a - no completed first-iteration handoff recorded. Inspect any preserved partial/prior work before implementing the issue's scope.

    The original technical scope remains authoritative, supplemented only by any portable technical clarification in this issue. No machine-specific execution policy is part of this checkpoint.

  2. ppenna commented on Nov 11, 2026

    @ppenna
    Contributor

    A note for this group's review, before SL6.3 deletes the old checked-file transfer (host::sandbox::prepared, Inherited::proc_path):

    The new launch paths already name their images by path. That covers sandbox start (#1460), sandbox run (#1490), and the restored start in #1486. dev's launches instead hand OpenVMM the checked files: /proc/self/fd/N on Linux, final paths with held handles on Windows. So with the new paths, a file that takes an image's path after its binding check is the one OpenVMM opens. A Copilot review thread on #1491 pointed this out (r4542527832).

    The library's docs make callers keep images in a directory that only their own account can write (host/sandbox/distro.rs, host/sandbox/scratch.rs, host/seal.rs). Under that precondition, no other account can replace a checked path, so the workstream's design holds. SL5.1a's security checklist (#1488) checks that precondition.

    Please confirm in SL6.3, or in the design docs of SL6.10b (#1130), that this is the intended model, since the descriptor handoff goes away for good there.

  3. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Note for SL6.3, from SL6.1 (#1121). After SL6.1, host::supervisor is a transitional module that only re-exports the low-level spawn items: spawn, spawn_vm, VmmCommand, Launched, Inherited and spawn_command. Code that stays reaches them only there:

    • examples/external-launch.rs, which calls spawn_vm;
    • tests/checked_handoff.rs;
    • the PreparedLaunch doctest.

    SL6.3 deletes spawn_command and the checked-file handoff. Along with them, it should settle:

    • how the external-launch example launches OpenVMM;
    • what stays public of the strict spawn, if anything;
    • removing the host::supervisor module, and updating the case-matrix rows that name checked_handoff.rs.
  4. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Note for SL6.3, from SL6.1 (#1520). SL6.1 keeps 11 cases in nvx-rs/tests/supervisor.rs. They test only host::process and the transitional supervisor::spawn, and they are the only tests of:

    • a spawn that breaks away from the caller's job;
    • the 258-unit working-directory limit.

    #1121's Tests rule keeps tests of code that stays. When SL6.3 removes the host::supervisor module, it should move these cases to the owner of that code rather than retire them, unless the code goes with it.

  5. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    SL6.3 design decisions (made for Pedro Henrique Penna (@ppenna)):

    • host::supervisor and the external-launch example: the example gets its own minimal launcher on std::process, and host::supervisor goes entirely. This matches SL2.8b, in which the caller supplies its own spawn, and leaves no public low-level spawn. The example's docs say what a production launcher adds: handle hygiene, a new session and umask on Linux, a job on Windows. The 11 kept cases of tests/supervisor.rs, and the 2 cases of tests/checked_handoff.rs that test code that stays, move to their owners.
    • The CLI's command-line check, and run's export fragment and size limit, move off host::sandbox in a preparatory kept-code slice, SL6.0f (nvx-rs slimming 4.2.1: the code that stays stops using what leaves #1120). SL6.3 then deletes the old types whole, and stays leaving-code-only.
    • vm::spawn's private foreground mode stays: inherit_only, SpawnMode::Foreground and Windows LaunchedProcess::wait_timeout, which run and sandbox run use. This follows the Goal: "the private OS layer keeps only the launch code that host::vm::spawn uses".
    • workload-identity and managed-lifecycle also put the CLI's own tokens on --cmdline, and stay kept once /init stops reading OpenVMM's lifecycle tokens.
    • The case-matrix rows that name checked_handoff.rs drop the deleted coverage, and images_replaced_after_the_checks_never_reach_the_vm retires under the by-path model.
  6. 51 remaining items

  7. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Added slice: SL6.6c, "the sandbox accessors that only tests use are gone" (leaving code only). Found while preparing SL6.7b (#1124).

    Once SL6.7b makes host::sandbox crate-private, 12 items in nvx-rs/src/host/sandbox/ lose their only caller, the public API, in every feature set. Only tests use them:

    • MountAccess::from_name, MountOwner::from_name and MountKind::from_name, with their helper setting_from_name. The CLI parses mounts with the *_with variants.
    • SandboxMount::{guest_target, access, policy, owner, kind, absolute, absolute_policy_paths}.
    • SandboxOptions::new.

    Making them crate-private, as #1124 plans, would leave them dead, so SL6.6c deletes them first. Its tests compare whole SandboxMount values or read its fields, call the variants that production code uses, and build the options with a test helper. SL6.7b then stays visibility-only, as SL6.4 did after SL6.6b.

  8. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Added slice: SL6.6d, "the planner items that only tests use are gone" (leaving code only). Found while preparing SL6.5a2 (#1125).

    Once SL6.5a2 makes the export planner crate-private and cli-gated, five items have no caller in any NVX program in any feature set. Only unit and integration tests use them:

    • resolve_guest_path, with its re-exports at nvx:: and nvx::host::filesystem::;
    • Target::Convention, with its branch of resolve_mapping;
    • Mapping::convention;
    • ExportRequest::new;
    • PathList::EMPTY, which only ExportRequest::new uses.

    SL6.6d deletes them first. Its tests place each mapping at an explicit Target::Guest path, which guest_path derives from the resolved host path, and build ExportRequest values directly. The README's filesystem section and the API snapshots follow. SL6.5a2 then stays visibility-only, as SL6.4 did after SL6.6b and SL6.7b after SL6.6c.

  9. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Completed on feature/nvx-refactor. Every slice of this group has merged, including the three leaving-code slices added in comments here:

    The push CI run at d67a2d5ab57, which contains all of them, passed: https://github.com/microsoft/nvx/actions/runs/43309050295

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

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions