Repository navigation
Conversation
Hyperlight 0.18 replaces the PEB's I/O stacks with two VIRTIO packed rings in scratch memory. It is not on crates.io yet, so hyperlight-host and hyperlight-common track its main branch at 3ee2d4cb, and the kernel moves with it: plat-hyperlight-v2-virtio on the danbugs/unikraft fork until that merges into plat-hyperlight-v2. Both kernels and the native test fixture are rebuilt from it. Size the transport pools for 64 KiB transfers instead of the I/O stacks. Each half of the guest-to-host pool, a host call's request and its reply, holds 64 KiB plus framing, rounded up to 18 pages, so HOST_CALL_MAX is now what the guest computes from them, 69,620 bytes; the host-to-guest pool holds a guest function call of 73,716. The quickjs result-size test follows the new limits. Console output comes in through HostWrite(Vec<u8>) instead of the string HostPrint, which failed on output that was not UTF-8: it goes to stdout, and to drain_output(), decoded as it arrives, a character split between writes held until its end comes and bytes that are not UTF-8 read as U+FFFD. ReadStdin hands over bytes, not a lossy string. MultiUseSandbox is now Sandbox. SNAPSHOT_CONTRACT goes to 4: the host transport changed, and snapshots from earlier builds are refused. Signed-off-by: danbugs <danilochiarlone@gmail.com>
The guest reads and writes host files in chunks of the size GetHostFsChunkSize returns, 32 KiB. Over the virtqueues a host call carries 69,620 bytes, and a 64 KiB chunk reads and writes about 40% faster (Python, 64 MiB file, KVM); 256 KiB gains about 15% more for 0.8 MiB more pool per sandbox, and 1 MiB nothing. Return 64 KiB, checked at compile time against what one host call carries. fs_large.py keeps writing three full chunks. Signed-off-by: danbugs <danilochiarlone@gmail.com>
Each of these failed before the kernel's last changes: - a line longer than one host call reached the host cut to 4 KiB; - output that was not UTF-8 failed the guest function call; - stdin cut inside a character, or not UTF-8, arrived as U+FFFD; - a host-mount path that was not UTF-8 failed the guest function call, and one over 1,023 bytes was cut short and acted on. The long-path test runs on Linux only: the host directories it makes are past the path limits of macOS and Windows. Signed-off-by: danbugs <danilochiarlone@gmail.com>
calls.md gets a section on the transport and the knobs measured for it; the limits in calls.md, driver.md and net.md and the chunk size in fs.md follow the new figures, and fs.md says which paths are refused. RELEASE.md names the pool sizes where it named the I/O stacks. The CHANGELOG records the move and what it fixes. Signed-off-by: danbugs <danilochiarlone@gmail.com>
Hyperlight 3ef1a362 (#1788) writes the snapshot memory blob sparsely. On Windows, a sandbox built from such a snapshot pays for it on its first call: python-shell cold-snap went from 16 to 59 ms on a laptop and over the CI ceilings. Track main (5ddb37af) with that commit reverted, on the danbugs/hyperlight fork, until it is sorted out upstream. Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
danbugs
marked this pull request as ready for review
October 7, 2026 20:51
There was a problem hiding this comment.
🔵 Needs a closer look
The transport and snapshot migration needs cross-platform human validation, and output finalization remains unresolved.
1 open finding
What changed in this PR
Migrates hluk’s host–guest communication to Hyperlight’s virtqueue transport, preparing for v0.18.
Changes:
- Configures transport pools and increases hostfs transfers to 64 KiB.
- Adds byte-based console I/O and regression tests.
- Updates snapshot compatibility, dependency pins, and protocol documentation.
| File | Description |
|---|---|
| tests/step.rs | Updates transport terminology in comments. |
| tests/quickjs.rs | Adjusts oversized-result test boundaries. |
| tests/python.rs | Tests console bytes, stdin, and path limits. |
| src/lib.rs | Migrates transport, console handling, and encoding tests. |
| src/hostfs.rs | Increases transfer chunks to 64 KiB. |
| examples/python/fs_large.py | Exercises larger transfer chunks. |
| drivers/hl_env.h | Updates buffer-sizing comments. |
| drivers/hl_driver.h | Documents transport-derived limits. |
| docs/RELEASE.md | Updates snapshot compatibility guidance. |
| docs/net.md | Documents revised network transfer limits. |
| docs/fs.md | Documents chunk sizes and path errors. |
| docs/driver.md | Updates driver protocol limits. |
| docs/calls.md | Explains virtqueues and performance measurements. |
| demos/pptx-gen/Cargo.lock | Refreshes demo dependencies. |
| CHANGELOG.md | Records migration and compatibility changes. |
| Cargo.toml | Pins temporary Hyperlight fork dependencies. |
| Cargo.lock | Locks updated dependencies. |
| build.rs | Bumps the snapshot contract. |
| .gitmodules | Selects the temporary virtqueue kernel fork. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1323
to
+1324
| // Nothing will finish a character the process left cut short. | ||
| let text = output.lock().unwrap().finish(); |
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.

Moves hluk and its kernel from the PEB I/O stacks to Hyperlight's virtqueue transport, tracking hyperlight main until v0.18.0 is published. Draft: the hyperlight dependency is a git rev on danbugs/hyperlight (upstream main 5ddb37af minus 3ef1a362, whose sparse snapshot blobs slow Windows cold starts about 4x), and the kernel submodule points at danbugs/unikraft
plat-hyperlight-v2-virtio; both go back before merge.plat/hyperlight/transport.c); host function calls, guest function calls and snapshot checkpoints move onto it.HostWrite, byteReadStdin): non-UTF-8 output no longer fails the guest function call, and output over 4 KiB is no longer cut short.EILSEQ/ENAMETOOLONGinstead of failing the call or being truncated.