Skip to content

Windows WHPX: first-principles acceptance test matrix (positive + fail-closed negatives) #252

Closed

Description

@ZhiXiao-Lin

Why

Windows WHPX support is a bounded subset of Box (docs/windows-whpx.md). Validation should be derived from first principles of the product contract, not from “whatever happened to work in a manual session.”

First principles for this host class:

  1. Isolation boundary: default MicroVM (WHPX) must run Linux OCI workloads without WSL.
  2. Lifecycle truth: create/start/exec/logs/stop/rm must reconcile host metadata with guest reality (exit codes, ps, inspect).
  3. Storage truth: bind mounts and named volumes must persist bytes across stop/restart with correct RO enforcement.
  4. Network truth: only documented published-TCP bridging works; bridge/Compose must fail closed.
  5. Negative safety: unsupported features fail before mutating box/execution state.
  6. Host preflight: info and docs must describe the real virtualization prerequisites.
  7. Cleanup: success and failure leave no orphan shim/box processes or leaked box dirs.
  8. Evidence: every claim needs a command, expected signal, and artifact (exit code / stdout / stderr substring).

Existing soak (scripts/windows-whpx-soak.ps1) covers much of the positive subset. This issue tracks a named acceptance matrix that also binds fail-closed negatives and host-preflight checks to release claims.

Proposed matrix

Host / package (WIN-HOST-*)

ID Case Expect
WIN-HOST-01 a3s-box info VM backend: whpx, OCI symlink available, published ports=tcp
WIN-HOST-02 Package layout a3s-box.exe, shim, guest-init, krun.dll, libkrunfw.dll co-located
WIN-HOST-03 Optional-feature vs runtime Docs/checklist match a host that can actually run WHPX (see related HypervisorPlatform issue)

MicroVM positives (WIN-POS-*)

ID Case Expect
WIN-POS-01 Foreground run stdout marker + uname Linux; exit 0
WIN-POS-02 Non-zero exit exit 7 → host $LASTEXITCODE 7
WIN-POS-03 Detached lifecycle run -d → ps running → logs/inspect → stop/rm
WIN-POS-04 Post-boot exec exec BOX -- CMD (note required --) returns marker
WIN-POS-05 cp / top / stats --no-stream bidirectional file copy; process list; PID stats
WIN-POS-06 Named volume write in run A, read in run B
WIN-POS-07 Bind mount dir/file RO enforcement + data visible in guest
WIN-POS-08 Published TCP guest listener + host HTTP 200 (BusyBox nc -lk -e is sufficient on Alpine)
WIN-POS-09 Snapshot stop → snapshot create → restore → start → exec marker
WIN-POS-10 Commit / export / diff (supported stopped-box paths) per windows-whpx.md boundary
WIN-POS-11 Long argv (4096) validated by soak; keep in acceptance
WIN-POS-12 Init script + state volume success + exact failure exit

Fail-closed negatives (WIN-NEG-*)

ID Case Expect
WIN-NEG-01 --isolation sandbox exit ≠ 0; no Creating box; Linux-only diagnostic
WIN-NEG-02 --tee exit ≠ 0; no Creating box; Windows-unsupported diagnostic
WIN-NEG-03 --cpus 2 early reject; exactly-1-vCPU message
WIN-NEG-04 --health-cmd / image health early reject before pull/start
WIN-NEG-05 --network bridge early reject
WIN-NEG-06 compose up reject before image/network/VM; bridge dependency message
WIN-NEG-07 attach -it / exec -it unsupported on Windows
WIN-NEG-08 warm pool commands unsupported on Windows
WIN-NEG-09 live Tier-2 resource update documented Windows refusal

Cleanup / SLO (WIN-SLO-*)

ID Case Expect
WIN-SLO-01 After each POS/NEG no residual a3s-box / shim processes for the test prefix
WIN-SLO-02 Time-to-exec-ready no happy-path WARN storm; or documented WHPX budget (see readiness WARN issue)
WIN-SLO-03 Stop path graceful stop without force-kill on idle Alpine sleep (force-kill only under declared deadline tests)

Implementation sketch

  • Extend or wrap scripts/windows-whpx-soak.ps1 with an explicit -Profile acceptance that runs POS + NEG + HOST rows and emits summary.json keys per ID above.
  • Gate Windows release claims on this matrix, not on Linux KVM soak alone.
  • Keep negatives as first-class tests (not comments in docs).

Related defects found during 3.2.5 manual WHPX dogfood

Will link after filing: sandbox/TEE create-path fail-closed gap; HypervisorPlatform optional feature vs working WHPX; exec-server readiness WARN on trivial detached runs.

Non-goals

  • Claiming Sandbox, bridge, Compose, multi-vCPU, TEE, or interactive PTY on Windows
  • Substituting unit tests for real WHPX hardware evidence

Activity

  1. added
    enhancement
    area/runtime
    priority/medium
    on Sep 7, 2026
  2. ZhiXiao-Lin commented on Sep 7, 2026

    @ZhiXiao-Lin
    Author
  3. ZhiXiao-Lin commented on Sep 7, 2026

    @ZhiXiao-Lin
    Author

    Second-pass first-principles expansion

    Follow-up matrix rows + dogfood results: #255

    New defects:

    Confirmed pass (should be acceptance rows, not new bugs):

    • Foreground stdout/stderr split
    • Detached logs stream split
    • exec -e via printenv
    • restart then exec
    • Bind :ro enforcement
    • exec -it / attach -it early reject
    • pool status|stop unsupported
    • container-update live Tier-2 reject
    • Running commit / diff / export live-unavailable
  4. ZhiXiao-Lin commented on Sep 7, 2026

    @ZhiXiao-Lin
    Author

    Third-pass matrix expansion: #257

    New defect: wait vs inspect exit code after kill: #256

  5. ZhiXiao-Lin commented on Sep 7, 2026

    @ZhiXiao-Lin
    Author

    Resolved by #258 (merged to main as 1a12b7e0).

    The first-principles WHPX acceptance matrix (positives + fail-closed negatives), including the stdio/env/restart/bind-RO/pause/FS-boundary/SLO and image/cp/top/stats/ports/commit/memory/user/rename/wait row families, is now indexed in docs/windows-whpx.md with matching early fail-closed CLI/runtime coverage for Windows-unsupported paths.

  6. ZhiXiao-Lin commented on Sep 7, 2026

    @ZhiXiao-Lin
    Author

    Closing as completed via merged PR #258.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/runtimeenhancementpriority/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions