Repository navigation
tests: apply the mapping table and start the sandbox in the adapter's worker - #872
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
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in the guest-side ordering, mapping failure handling, export lifecycle, or accompanying tests.
No open issues 🎉
What changed in this PR
Implements the guest-side sequencing for #822’s runtime adapter: mount the host export, apply the mapping table, and require Start before running executions.
Changes:
- Mounts and validates the host export before reporting
Ready. - Enforces mapping order and completion, blocks startup after mapping failures, and preserves progress across session resets.
- Adds session tests and documents the updated worker lifecycle.
| File | Description |
|---|---|
tests/runtime-adapter/tests/guest_session.rs |
Tests export mounting, mapping progress, failures, resets, and startup ordering. |
tests/runtime-adapter/src/worker/order.rs |
Adds mapping progress and sandbox startup state handling. |
tests/runtime-adapter/src/worker.rs |
Integrates export mounting, mapping operations, execution gating, and export cleanup. |
tests/runtime-adapter/src/lib.rs |
Updates the adapter overview for mappings and explicit startup. |
tests/runtime-adapter/README.md |
Documents sequencing rules, failure handling, and test coverage. |
Review effort: Balanced
This was referenced Oct 24, 2026
Pedro Henrique Penna (ppenna)
force-pushed
the
esaurez/822-pr05-export-mapping-source-20261023
branch
from
October 25, 2026 15:36
1a46aba to
b684976
Compare
Base automatically changed from
esaurez/822-pr05-export-mapping-source-20261023
to
dev
October 25, 2026 16:01
… worker The runtime adapter's worker answered Ready once it assembled its root, then ran the host's executions at once: it had no host export to map from, took no mapping table, and nothing told it when the sandbox's workloads could start, so an execution could run on a root whose mappings were missing. After the assembly, the worker now mounts the host export that the kernel command line names, with nvx::protocol::export::HostExport::parse and Root::mount_export, then answers Ready. It applies the parts of the host's mapping table in order, with Root::map, from the export, and answers each with Mapped or MapFailed. A part that does not decode or does not continue the table, whose length the root configuration's mapping count announces, is refused as a whole; a mapping that the root refuses or fails to apply latches the root, and the worker refuses every later part. Start, which the worker confirms with Started, comes once every announced mapping is applied, and only then does the worker run executions: an execution before the start, a premature or second Start, and a part after the start end its session. A table of zero mappings does no work. The layout stage refuses a mapping count without an export, and export tokens that break their rules; an export that fails to mount fails the assembly. The root operations gain mount_export and map, which the tests' fake root records. Part of #822. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 04632931-537b-49f9-acc9-b12024ad6f3a
Enrique Saurez (esaurez)
force-pushed
the
esaurez/822-pr06-guest-order-20261023
branch
from
October 25, 2026 16:26
597cd3a to
e3071ec
Compare
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 #822 (PR 6 of 11: the guest's order).
The runtime adapter's worker answered
Readyonce it assembled its root, then ran the host's executions at once: it had no host export to map from, took no mapping table, and nothing told it when the sandbox's workloads could start, so an execution could run on a root whose mappings were missing.Changes
nvx::protocol::export::HostExport::parseandRoot::mount_export, then answersReady.Root::map, from the export, and answers eachMapswithMappedorMapFailed. A part that does not decode, or does not continue the table whose length the root configuration's mapping count announces, is refused as a whole. A mapping that the root refuses or fails to apply latches the root, and the worker refuses every later part.Start, which the worker confirms withStarted, comes once every announced mapping is applied, and only then does the worker run executions. An execution before the start, a premature or secondStart, and a part after the start end the session. A table of zero mappings does no work.mount_exportandmap, which the tests' fake root records.Tests
tests/guest_session.rs, with a fake root: the export and the order; a table applied in parts across a session reset, then the start; zero mappings, with and without an export; parts that do not continue the table; a mapping that the root refuses, which latches the root; and executions,Start, and parts refused out of order.Validation
On
devat b69f40b, with #822's PRs 1-5 merged:vm_layered25,vm_restart2,vm_steps3): WHP 30/30 and MSHV 30/30. KVM runs in CI.