Repository navigation
tests: frame Ready, mapping tables, and Start in the runtime adapter - #865
Open
Enrique Saurez (esaurez) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review identified no blocking issues in the scoped framing changes, updated callers, or regression coverage; tests were not executed during this review.
No open issues 🎉
What changed in this PR
Adds the framing foundation for runtime-adapter cold sandbox startup in #822. Mapping application, startup ordering, and host build checks remain for later PRs.
Changes:
- Replaces
RootReadywithReady, carrying the guest build, and adds mapping-table and startup messages. - Adds mapping-count validation, mapping payload helpers, and structured mapping failures.
- Updates host/guest integration, protocol documentation, and framing and session regression tests.
| File | Description |
|---|---|
tests/runtime-adapter/tests/runtime.rs |
Updates the shared build constant import. |
tests/runtime-adapter/tests/host_session.rs |
Tests readiness decoding and message rejection. |
tests/runtime-adapter/tests/guest_session.rs |
Updates readiness expectations and refusal cases. |
tests/runtime-adapter/src/worker.rs |
Reports the guest build in Ready. |
tests/runtime-adapter/src/runtime.rs |
Moves the build constant out of the host-only module. |
tests/runtime-adapter/src/root.rs |
Adds readiness, mapping payloads, mapping counts, and failure codecs with tests. |
tests/runtime-adapter/src/lib.rs |
Exposes the build constant across configurations. |
tests/runtime-adapter/src/host.rs |
Decodes readiness and rejects host-only mapping and startup messages. |
tests/runtime-adapter/src/frame.rs |
Defines new message kinds, limits, and framing tests. |
tests/runtime-adapter/src/bin/runtime-adapter-host.rs |
Handles the readiness payload while preserving launch output. |
tests/runtime-adapter/README.md |
Documents the protocol additions and test coverage. |
Review effort: Balanced
Enrique Saurez (esaurez)
marked this pull request as ready for review
October 24, 2026 07:49
The adapter's guest answered a root configuration with an empty RootReady, and its framing had no message to hand the guest a mapping table or to tell it to start the sandbox's workloads. RootReady, kind 7, becomes Ready, whose body carries the guest agent's build, so that the host can check it against the build that it ships. The build is length-prefixed, so that later fields can follow it. New kinds carry a part of the host's mapping table as a MAPS payload of nvx::protocol (Maps, 22), the guest's answers to it (Mapped, 23, and MapFailed, 24, with how many mappings the guest applied and the problem), and the start of the sandbox's workloads (Start, 25, and Started, 26). The root configuration gains the number of mappings of the table, mapping-count, at most 4,096. The worker answers Ready with the crate's version, which moves to the crate root as GUEST_BUILD so that the guest side can report it. Applying the table, and the order of Ready, the table, and Start, come in later changes. Part of #822. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d3891be-9b19-4f82-96d4-fe7320eb1022
Enrique Saurez (esaurez)
changed the base branch from
dev
to
esaurez/822-pr03-handoff-replacement-20261023
October 24, 2026 17:03
Enrique Saurez (esaurez)
force-pushed
the
esaurez/822-pr04-framing-20261023
branch
from
October 24, 2026 17:03
d7972f8 to
73831cd
Compare
This was referenced Oct 24, 2026
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 #869; this PR retargets to dev when it merges.
Part of #822: PR 4 of 11, the framing.
It lands after #822's PRs 1 to 3 (#863, #867, and #869), in #822's order.
What changed and why
The runtime adapter's guest answered a root configuration with an empty
RootReady, and the adapter's framing had no message to hand the guest a mapping table or to tell it to start the sandbox's workloads. This PR adds that framing. The guest's order (#822's PR 6) and the host's order (PR 7) build on it.RootReady(kind 7) becomesReady, whose body,root::Ready, carries the guest agent's build: its length, one byte, then 1 to 255 printable ASCII characters without a space. The length prefix lets later fields, such as the activation that nvx-rs: the restricted control state and Activate after a restore, in the guest library and the test adapter's framing #843 adds, follow the build.New kinds:
MapsMAPSpayload ofnvx::protocol, at most 256 KiBMappedMapFailedroot::MapFailure: how many mappings the guest applied, au32, then the problem, at most 4 KiBStartStartedroot::encode_mapssplits a table into parts withencode_maps_payloads, and an empty table into none.root::decode_mapsreads a part withdecode_guest_maps_payload, and also refuses a part without a mapping, or one that would end the table past 4,096 mappings.The root configuration gains
mapping-count,RootConfig::mapping_count: the number of mappings of the table, at most 4,096, and absent for none.The worker answers
ReadywithGUEST_BUILD, the crate's version, which moves from the host-onlyruntimemodule to the crate root so that the guest can report it.host::Client::configure_rootreturns the decodedReady, and the client refusesMapsandStartfrom the guest, as it refuses the other messages that only the host sends.The README and the module docs describe the new kinds, their bodies, and the new field.
The worker doesn't apply mapping tables or wait for
Startyet, and the host doesn't check the build yet: those are #822's PRs 6 and 7.Validation
At this head, rebased onto #869:
cargo fmt --all --check; Clippy with-D warnings, the build, and the tests in the protocol-only and host-only configurations;cargo +1.89 check --locked --all-targetsin both;python scripts/check_markdown_links.py.--features guest --target x86_64-unknown-linux-musl), the minimum Rust version included.cargo test --locked --features host -- --ignored(25 layered, 2 restart, and 3 step scenarios), with the release thatpython scripts/nvx.py downloadinstalls for this branch, the scratch template, and the guest agent built from this branch: on WHP, on Windows, and on MSHV, on Linux, as root and with--cpu-profile host, since no built-in CPU profile supports that host's CPU. All pass.