Repository navigation
nvx-rs: give a clone's failures documented statuses - #937
Open
Enrique Saurez (esaurez) wants to merge 1 commit into
Open
Enrique Saurez (esaurez) wants to merge 1 commit into
Enrique Saurez (esaurez) wants to merge 1 commit into
Conversation
This was referenced Oct 27, 2026
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Privileged restore, acknowledgement, and shutdown changes need human review alongside the pending full-gate and VM-suite results.
No open issues 🎉
What changed in this PR
This completes the failure-status portion of #842, building on clone repair with shared exit statuses, caller-controlled shutdown, and repair integration in the runtime adapter’s guest.
Changes:
- Defines shared time, repair, and reserved activation statuses, with descriptions and collision tests.
- Adds strict time-ABI calls and repair progress reporting while preserving enforcing behavior for command tools, capture preparation, and the daemon.
- Repairs restored clones in the runtime adapter before exiting, keeping workload admission closed.
| File | Description |
|---|---|
| tests/runtime-adapter/src/worker/capture.rs | Runs clone repair and selects outcome statuses. |
| tests/runtime-adapter/src/template.rs | Documents status 31 and checks reserved-status collisions. |
| tests/runtime-adapter/src/bin/runtime-adapter-guest.rs | Updates worker documentation for repair outcomes. |
| tests/runtime-adapter/README.md | Documents repair flow, shutdown behavior, and statuses. |
| nvx-rs/src/protocol/status.rs | Defines and tests shared failure statuses. |
| nvx-rs/src/protocol/mod.rs | Exposes the status module. |
| nvx-rs/src/lib.rs | Updates the crate overview for statuses and repair. |
| nvx-rs/src/guest/time/system.rs | Records strict-mode violations instead of powering off. |
| nvx-rs/src/guest/time/mod.rs | Documents strict-mode shutdown ownership. |
| nvx-rs/src/guest/time/api.rs | Adds strict calls and violation status reporting. |
| nvx-rs/src/guest/clone/tests.rs | Checks strict-mode selection. |
| nvx-rs/src/guest/clone/repair/tests.rs | Tests failure statuses, progress, and retry accounting. |
| nvx-rs/src/guest/clone/repair.rs | Tracks repair progress and assigns failure statuses. |
| nvx-rs/src/guest/clone.rs | Selects strict mode and documents caller responsibilities. |
| nvx-rs/README.md | Documents the new public APIs and behavior. |
Review effort: Balanced
This was referenced Oct 27, 2026
Add nvx::protocol::status, the exit statuses with which a clone's guest ends its VM once it fails fast, and from which the host classifies a clone's end: the time ABI's 193, 194 and 195, which keep their meanings, one status for each other class of a clone's repair's failures, 40 to 45, and one reserved for each class of a clone's activation's failures, 50 to 58. Add the time ABI's strict mode, TimeAbi::strict, for a caller that owns the VM's exit status and its shutdown: a violation that stops the VM in enforcing mode fails the call instead, after its event, with the Violation, whose status is the one with which enforcing mode stops the VM. The command tools keep enforcing mode, and so do the time daemon and a capture's preparation. nvx::guest::clone takes the time ABI in strict mode for the capture and the repair. A RepairError reports the repair's RepairProgress, the memory blocks that it added and onlined, its reseed, and its finish, and selects its status, RepairError::status. The runtime adapter's guest repairs a clone that a restore of its template's snapshot started, behind its closed fence, and ends with 31 once repaired, since it does not activate a clone yet, or with the status of the repair's failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fbebd4aa-2ad7-427d-80ea-49358a645e9a
Enrique Saurez (esaurez)
force-pushed
the
esaurez/842-pr2-repair-20261024
branch
from
October 28, 2026 01:49
6baaf66 to
9831e19
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/842-pr3-failure-statuses-20261024
branch
from
October 28, 2026 01:49
3d8aed5 to
5683164
Compare
This was referenced Oct 28, 2026
This branch has not been deployed
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.
Stacked on #936; this PR retargets when its parent merges.
Chain: #880 → #936 → this PR → #939 → #940 → #941, on
dev; #879, #881, #885, #886, #877, #932, #884, #887, and #933 have merged.Part of #842 (PR 3 of 3: failure statuses, and repair in the test adapter's guest).
What and why
A clone's guest that fails fast ends its VM with an exit status, from which the host classifies the clone's end. Only the time ABI's 193, 194, and 195 were defined, and the time ABI powers the VM off itself on a violation, so a guest init or agent that owns the VM's exit status and its shutdown could not report a repair's failure on its own terms. This documents one status for each class of a clone's failures, adds a strict mode to the time ABI, gives a repair's errors their status and progress, and has the runtime adapter's guest repair its clones.
The statuses:
nvx::protocol::statusIt compiles in every configuration, so the host's classifier and a guest's init can share it. Each status follows a diagnostic that names the failure; the host classifies a clone's end by both, since a workload may exit with any status.
TIME_CONFORMANCETIME_VIOLATIONTIME_REPAIRREPAIR_RESTOREREPAIR_PROCESSORSREPAIR_MEMORY_TARGETREPAIR_MEMORYREPAIR_RESEEDREPAIR_FINISHACTIVATION_DEADLINEtoACTIVATION_ORDER193, 194, and 195 keep their meanings.
TIME_STATUSES,REPAIR_STATUSES, andACTIVATION_STATUSESname the ranges, anddescribereturns what a status means.Strict mode
TimeAbi::strict()selects it, andTimeAbi::is_strict()reports it: a violation that stops the VM in enforcing mode fails the call instead, after its event, withTimeError::Violation, andViolation::status()returns the status with which enforcing mode would have stopped the VM. It is for a caller that owns the VM's exit status and its shutdown. Report-only mode stays report-only.nvx-time pre-capturedoes. A failure of the deferred time work after the finish still stops the VM with the time ABI's own status.A clone's repair
nvx::guest::clonetakes the time ABI in strict mode for the capture and the repair.RepairError::status()selects the failure's status: a violation of the time ABI's its own, 193 or 195, and every other cause the status of its class. The match is exhaustive in the crate, so there is no "unknown" status.RepairError::progress()returns itsRepairProgress: the memory blocks that the repair added and onlined, each counted once, whether it reseeded, and whether its finish started.The runtime adapter's guest
worker::capture::capture_statusselects it; a capture request that the time ABI could not repair in a clone ends with the violation's status.Validation
This head is the previous one, 3d8aed5, rebased onto #936's rebased head, 9831e19, so that it now also holds #936's fix of the acknowledgement's instant, with its own diff unchanged, and brings #933's rebase onto
dev, OpenVMM at d2338ea2 andnvx-rs downloadamong it; its per-commit checks and the checks below passed on it, and the tests grew only by the 55 thatnvx-rs downloadadds tohost::cli, under all features, and by #936's test of the acknowledgement's instant, under all features, in the guest binaries' checks, and as root.On this head:
Linux x86_64:
cargo fmt --check; Clippy with-D warnings,--all-targets --all-features,--lib, and--lib --no-default-features, and with each feature alone;cargo test --all-features(1562 passed),cargo test(804 passed), and the--lib --no-default-featuresbuild and test (260 passed);tests/host_modules.rs(22 passed); the bundled-artifacts test; rustdoc with-D warnings; the MSRV (1.89) check; the aarch64-apple-darwin check; the guest's tests and MSRV check with onlyguest.nvx.py check-guest-binaries(musl Clippy and tests, 876 passed),build-guest-binaries,test-guest-binaries(33 passed),check-static-elf.tests/runtime-adapter: fmt, Clippy, build, tests, and MSRV in its protocol-only, host-only, and musl guest configurations.scripts/check_markdown_links.py.guest::cloneandguest::reseed(53 passed).Windows (x86_64-pc-windows-msvc): nvx-rs fmt, Clippy (all features,
--lib, no default features, and each feature alone), tests (all features 957 passed, default 819, no default features 260),tests/host_modules.rs, rustdoc, MSRV;tests/runtime-adapterin its protocol-only and host configurations; the Markdown links.On 3d8aed5, with OpenVMM at e68871cc, the runtime adapter's VM suites: 58 of 58 passed on WHP and on MSHV (
vm_layered43,vm_template9,vm_restart3,vm_steps3; on MSHV, on OpenVMM's host CPU profile, since the test host's CPU has no built-in one). No suite restores a clone yet, so the guest's repair runs in no VM here.CI:
ci.ymlrun 40617461513, dispatched on this head, since this chain's PRs don't targetdevand get no PR CI, passed: 36 jobs succeeded, among them nvx-rs and the CLI on Linux and Windows, the guest artifacts, OpenVMM's unit tests and vmm-tests, the NVX microVM tests and the platform jobs on KVM, MSHV, and WHP; the 6 jobs that only pull requests ordevrun were skipped. Before this rebase,ci.ymlrun 40588761279 passed on 3d8aed5.Tests added:
Left to #844's PR 5, as the issue says: the VM tests of memory targets and of deferred time work that ends after Ready.