Skip to content

Add HIP 0001 ring buffer proposal for Hyperlight I/O - #1112

Open
andreiltd wants to merge 11 commits into
hyperlight-dev:mainfrom
andreiltd:tandr/rng-rfc
Open

Add HIP 0001 ring buffer proposal for Hyperlight I/O#1112
andreiltd wants to merge 11 commits into
hyperlight-dev:mainfrom
andreiltd:tandr/rng-rfc

Conversation

@andreiltd

Copy link
Copy Markdown
Member

@andreiltd andreiltd added area/documentation Related to documentation kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. labels Dec 12, 2025
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
jsturtevant
jsturtevant previously approved these changes Dec 16, 2025

@jsturtevant jsturtevant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for such a detailed write up. Left a few minor comments but otherwise this seems like it would set up the project to work well for the future

Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds HIP 0001, a comprehensive proposal document for implementing a virtio-inspired ring buffer mechanism for Hyperlight I/O. The proposal aims to replace the current stack-based communication model with a more efficient ring buffer approach to reduce VM exits and enable streaming communication patterns.

Changes:

  • Adds a detailed technical proposal document describing the ring buffer design, API, and implementation plan
  • Updates typos.toml to allow "readables" and "writables" as valid terms used in the proposal

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
proposals/0001-rng-buf/README.md Comprehensive HIP document describing virtio-inspired ring buffer design with memory layout, API examples, and implementation plan
typos.toml Adds exceptions for "readables" and "writables" terms used in the proposal document

Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md Outdated
@danbugs

danbugs commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Really great work on this HIP, @andreiltd! Loved seeing the diagrams, extensive testing plan, code, and whatnot.

A few thoughts:

1. Side-by-side comparison suggestion

I think the HIP could benefit from a more explicit side-by-side comparison in the "Comparison with current implementation" section. Something like a table showing:

  • Current: push_shared_output_data()-> outb -> VM Exit -> pop_shared_input_data() (per call)
  • Proposed: submit_available() × N -> notify() → VM Exit → poll_used() × N (batched)

I feel like this would help readers quickly grasp the key difference in the two approaches.

2. Related work in Nanvix fork

I've done some similar work in the Nanvix hyperlight fork that might be relevant: 76c9e7c

There, I added a credits_value field to HyperlightPEB that the guest can check before performing a VMExit. This way, the guest avoids unnecessary exits when the host signals no resources are available. This is similar to ring buffer notification suppression / checking num_free() before submitting, so I feel like Hyperlight-Nanvix could really benefit from this work!

3. Single-threaded vs multi-threaded phasing

For the multi-threaded case (guest and host on separate threads), the host would need a way to interrupt the running guest when responses are ready--yes? For that, I've also done related work for that in Nanvix's Hyperlight fork: a897cad for KVM.

My hardware interrupts work enables PIC/APIC interrupt injection which could support the ioeventfd-style notifications mentioned in the HIP. Happy to coordinate on this when the time comes :)


The backward compatibility goal (current function call model portable without public API changes) is really cool to see--great for downstream consumers like Nanvix.

Looking forward to seeing this land!

andreiltd and others added 2 commits January 19, 2026 14:17
Fix typos

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@users.noreply.github.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>

@syntactically syntactically left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly really like this! Left a few minor nits, and a couple of bigger comments clarifying the question of where buffers get allocated.

I didn't review the Rust type design in detail, as I understand that is going to be updated shortly.

Comment thread proposals/0001-rng-buf/README.md Outdated
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md

@syntactically syntactically left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, some kind of glitch seems to have resulted in my comments getting posted twice. I can't delete this duplicate review comment, apparently.

@syntactically syntactically left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some minor comments on the Rust definitions as well.

Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Comment thread proposals/0001-rng-buf/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Related to documentation kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants