Skip to content

feat: add Windows WHP runtime, safer CLI diffs, and parallel CI - #84

Merged
reiase merged 6 commits into
mainfrom
feat/windows-whp-vm
Oct 31, 2026
Merged

reiase merged 6 commits into
mainfrom
feat/windows-whp-vm

Conversation

@reiase

@reiase reiase commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

pvisor-vm currently depends on Unix runtime modules and cannot build natively on Windows. This adds an initial Windows x86_64/WHP backend behind the existing pvisor_vm::api contract, with a Windows build/test workflow and a separate real-VM smoke job. It also includes the local CLI changes that make review/apply diff previews bounded and resistant to symlink replacement.

Changes

  • Import private Windows runtime sources from Super Rad's libkrun branch used by microsandbox, pinned to 7e90097bb568b0c9ff7ca3be264744a2dca5a740, plus the AMD guest TSC boot fix from ff7f4b5254c8984b175169b9ef5ee02b51ff2fbf. Provenance and third-party notices are included.
  • Support WHP boot/SMP, ordinary and read-only virtio-fs shares, root-level synthetic files, the current pVisor guest supervisor, vCPU pause/resume, and authenticated PID 1 exit reporting. Stop and join worker threads before releasing WHP resources.
  • Keep the public API unconditional. Add native transport ownership and move the shared LayerMutability record into pvisor-core while preserving overlay-core's existing re-export.
  • Resolve temporary paths from TEMP on Windows and lock the Windows nextest artifact. Preserve the Linux guest ABI with fixed-width long types on LLP64 Windows hosts.
  • Regenerate the committed source/API budget for the imported backend and moved record: 292,343 runtime source lines and 306 Core declarations; runtime dependencies remain 236.
  • Run MSVC builds, native unit/integration tests, and warnings-denied rustdoc on windows-2025.
  • Add a bounded WHP smoke probe covering one/two CPUs, timers, file reads/writes, read-only shares, callback failure cleanup, pause/resume, rejected legacy ioctls, and exit codes 0/7/255.

The CLI now opens regular files without following symlinks in any path component, bounds file reads, checks the complete buffer for binary data, and generates unified diffs from private copies. Regression tests cover symlink replacement, binary markers beyond 8 KiB, and review/partial-apply/conflict/drop behavior.

Most added lines are the imported private Windows backend. Existing Unix runtime modules retain their implementation.

CI parallelism

  • Run macOS Core, runtime/VM, and CLI packages in separate jobs; run Gateway-enabled runtime/CLI tests independently on Linux and macOS.
  • Build the Linux CLI once for its native tests and archive its static CLI/daemon binaries for three independent KVM contract jobs: all Bats tests and two deterministic Go partitions (43 tests each). The aggregate gate requires every shard.
  • Build baseline/candidate benchmark binaries concurrently, transfer mode-preserving archives with source SHAs and checksums, then measure them sequentially on the same runner with the existing harness, sample counts, and 15% threshold.
  • actionlint, Bash syntax, original package-set coverage, the complete/disjoint Go partition check, and 8 related Python regressions pass locally. Hosted validation passed: all 23 CI jobs and all three benchmark build/compare jobs. See CI and benchmark.

Observed workflow timings: CLI build/tests/contracts completed in about 12.5 minutes (previous run: 21.8), the complete CI in 18.9 minutes, and benchmark build/compare in 15.2 minutes (previous run: 27.7). These are individual hosted runs with different cache/runner conditions, not controlled performance claims. Additional parallel runners increase total runner usage.

Validation

Passed locally:

  • 159 CLI unit and apply/review handoff integration tests; CLI Clippy with warnings denied.
  • MSVC cross-compilation of the library with default and no default features, all library/integration test sources, and the whp_smoke example.
  • Static Linux guest probe compilation.
  • 22 public API/build/boundary tests.
  • 302 pvisor-core / pvisor-overlay-core tests (5 existing skips).
  • Linux Clippy with warnings denied, Linux and Windows-target rustdoc with warnings denied, targeted Rust formatting, actionlint, and git diff checks.

The full Linux VM suite recorded 597 passes, 29 failures and 9 skips in the sandbox. The socket/ownership failures passed when rerun outside the sandbox; 19 KVM-dependent failures remain unvalidated because this host has no /dev/kvm.

CI also passed the Linux pVisor and CLI (including Podman-derived contracts and Gateway features), Core, Gateway, native daemon/shim/shim-vm, macOS workspace, network/Gateway examples, formatting, lint, Python, and specification checks. The updated budget, strict isolation regressions, filesystem examples, documented cases, and CLI learning path also pass on the final commit.

Limits and runner setup

Windows native CI passed: MSVC builds with and without the embedded supervisor, 202 tests (zero skips), warnings-denied rustdoc, and the host runner artifact. See Windows VM run. This remains a draft pending real WHP guest execution; native contract tests do not establish guest runtime correctness.

  • The pvisor-whp label identifies a self-hosted Windows x86_64 Actions runner; no such runner was provisioned by this change.
  • Enable HypervisorPlatform and hardware virtualization, register that runner label, then set repository variable PVISOR_WINDOWS_WHP=true or manually dispatch the workflow with run_whp.
  • Without that setup, the hardware job is explicitly skipped. Once requested, missing WHP, boot errors, incorrect results and timeouts fail the job. PR/fork code is never sent to the persistent self-hosted runner.
  • Windows network/vsock attachment, Overlay/managed filesystems, DAX, snapshots, cold RAM, guest idle handoff, custom guest commands and task-stdio descriptors remain unsupported. Windows ARM64 and full pVisor product support are outside this change.

Build commands, platform behavior and runner setup are documented in crates/pvisor-vm/README.md.

@reiase reiase changed the title feat(vm): backport Windows WHP runtime and add Windows CI feat: add Windows WHP runtime and harden CLI diff previews Oct 31, 2026
@reiase reiase changed the title feat: add Windows WHP runtime and harden CLI diff previews feat: add Windows WHP runtime, safer CLI diffs, and parallel CI Oct 31, 2026
@reiase
reiase marked this pull request as ready for review October 31, 2026 16:18
@reiase
reiase merged commit 482d7b2 into main Oct 31, 2026
31 checks passed
@reiase
reiase deleted the feat/windows-whp-vm branch October 31, 2026 16:19
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.

1 participant