Skip to content

feat: support tuple returns from host and guest functions - #2108

Draft
andreiltd wants to merge 1 commit into
tandr/streams/futuresfrom
tandr/streams/return-tuples
Draft

andreiltd wants to merge 1 commit into
tandr/streams/futuresfrom
tandr/streams/return-tuples

Conversation

@andreiltd

Copy link
Copy Markdown
Member

Stack created with GitHub Stacks CLI • Give Feedback 💬

Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
@andreiltd
andreiltd added this pull request to stack #2110 November 25, 2026 17:58
@andreiltd andreiltd changed the title tandr/streams/return tuples feat: support tuple returns from host and guest functions Nov 25, 2026
@andreiltd andreiltd added the C-enhancement For PRs adding features, improving functionality, docs, tests, etc. label Nov 25, 2026
@hyperlight-gh-bot

Copy link
Copy Markdown

Benchmark Results

Measured commit: e672ceee7227
Baseline commit: 31665a70f4c9

kvm / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 274.03 ns (➖ 1.01x slower)
vec_bytes 72.94 ns (➖ 1.00x faster)
377.27 µs (➖ 1.01x slower)

payload_allocation

slot_pool_segmented
65536 141.99 ns (➖ 1.00x slower)
262144 522.77 ns (➖ 1.00x slower)

sandboxes

create_initialized_and_drop
medium 13.71 ms (➖ 1.01x slower)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
7.71 ns (➖ 1.00x slower) 7.70 ns (➖ 1.00x slower) 7.68 ns (➖ 1.00x faster)

snapshot_files

load_snapshot_unverified
small 107.99 µs (➖ 1.01x slower)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 1.92 µs (➖ 1.09x faster) 2.03 µs (➖ 1.07x slower)
262144 7.07 µs (➖ 1.00x faster) 7.36 µs (➖ 1.02x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 6.23 µs (➖ 1.01x faster) 6.22 µs (➖ 1.02x faster)
262144 28.30 µs (➖ 1.02x slower)
8192 1.05 µs (➖ 1.00x faster) 1.02 µs (➖ 1.00x faster)
kvm / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 264.98 ns (➖ 1.04x slower)
vec_bytes 75.65 ns (➖ 1.01x slower)
649.88 µs (➖ 1.02x faster)

payload_allocation

slot_pool_segmented
65536 135.32 ns (➖ 1.00x slower)
262144 497.35 ns (➖ 1.00x faster)

sandboxes

create_initialized_and_drop
medium 15.29 ms (➖ 1.03x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
6.90 ns (➖ 1.00x slower) 6.89 ns (➖ 1.00x faster) 6.90 ns (➖ 1.00x faster)

snapshot_files

load_snapshot_unverified
small 54.50 µs (➖ 1.01x slower)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.14 µs (➖ 1.02x slower) 2.12 µs (➖ 1.01x faster)
262144 7.54 µs (➖ 1.00x slower) 7.52 µs (➖ 1.00x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 7.09 µs (➖ 1.00x slower) 7.08 µs (➖ 1.00x slower)
262144 29.40 µs (➖ 1.07x faster)
8192 718.05 ns (➖ 1.01x faster) 728.11 ns (➖ 1.01x slower)
mshv3 / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 373.73 ns (➖ 1.00x slower)
vec_bytes 100.00 ns (➖ 1.02x slower)
265.93 µs (➖ 1.25x faster)

payload_allocation

slot_pool_segmented
65536 265.49 ns (➖ 1.37x slower)
262144 731.13 ns (➖ 1.00x slower)

sandboxes

create_initialized_and_drop
medium 67.96 ms (➖ 1.01x slower)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
9.89 ns (➖ 1.01x faster) 9.87 ns (➖ 1.00x faster) 9.93 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 100.87 µs (➖ 1.02x slower)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.23 µs (➖ 1.00x faster) 2.39 µs (➖ 1.03x faster)
262144 9.69 µs (➖ 1.03x faster) 10.02 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 8.32 µs (➖ 1.19x faster) 8.53 µs (➖ 1.17x faster)
262144 36.47 µs (➖ 1.06x faster)
8192 1.25 µs (➖ 1.01x slower) 1.25 µs (➖ 1.10x faster)
mshv3 / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 354.77 ns (➖ 1.03x faster)
vec_bytes 83.73 ns (➖ 1.03x faster)
630.83 µs (➖ 1.09x faster)

payload_allocation

slot_pool_segmented
65536 170.98 ns (➖ 1.01x faster)
262144 634.36 ns (➖ 1.03x faster)

sandboxes

create_initialized_and_drop
medium 75.32 ms (➖ 1.06x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
8.67 ns (➖ 1.01x faster) 9.16 ns (➖ 1.17x faster) 8.88 ns (➖ 1.02x slower)

snapshot_files

load_snapshot_unverified
small 53.43 µs (➖ 1.01x slower)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.24 µs (➖ 1.01x faster) 2.27 µs (➖ 1.00x faster)
262144 7.91 µs (➖ 1.00x slower) 7.89 µs (➖ 1.00x faster)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 7.49 µs (➖ 1.00x slower) 7.52 µs (➖ 1.00x slower)
262144 40.05 µs (➖ 1.04x slower)
8192 917.70 ns (➖ 1.01x faster) 920.98 ns (➖ 1.01x faster)
hyperv-ws2025 / amd (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 593.33 ns (➖ 1.08x slower)
vec_bytes 139.05 ns (➖ 1.05x faster)
1.98 ms (➖ 1.01x slower)

payload_allocation

slot_pool_segmented
65536 229.18 ns (➖ 1.04x faster)
262144 792.65 ns (➖ 1.00x faster)

sandboxes

create_initialized_and_drop
medium 15.19 ms (➖ 1.01x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
10.34 ns (➖ 1.00x faster) 10.06 ns (➖ 1.03x faster) 10.34 ns (➖ 1.00x faster)

snapshot_files

load_snapshot_unverified
small 680.41 µs (➖ 1.02x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.30 µs (➖ 1.01x faster) 2.31 µs (➖ 1.01x faster)
262144 9.30 µs (➖ 1.00x slower) 9.20 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 8.92 µs (➖ 1.03x slower) 8.85 µs (➖ 1.00x slower)
262144 38.59 µs (➖ 1.13x faster)
8192 1.26 µs (➖ 1.01x faster) 1.25 µs (➖ 1.03x faster)
hyperv-ws2025 / intel (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 494.17 ns (➖ 1.04x slower)
vec_bytes 122.06 ns (➖ 1.02x slower)
3.31 ms (➖ 1.01x faster)

payload_allocation

slot_pool_segmented
65536 202.61 ns (➖ 1.03x slower)
262144 671.86 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 14.88 ms (➖ 1.06x slower)

slot_pool

alloc_dealloc_4096 alloc_dealloc_1500 alloc_dealloc_128
8.83 ns (➖ 1.15x faster) 8.89 ns (➖ 1.01x slower) 8.85 ns (➖ 1.01x slower)

snapshot_files

load_snapshot_unverified
small 467.01 µs (➖ 1.23x faster)

virtq_readonly

slot_pool_segmented slot_pool_segmented_fragmented
65536 2.58 µs (➖ 1.02x slower) 2.59 µs (➖ 1.02x slower)
262144 8.91 µs (➖ 1.01x slower) 8.87 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented slot_pool_segmented_fragmented
65536 9.38 µs (➖ 1.00x faster) 9.34 µs (➖ 1.00x faster)
262144 35.27 µs (➖ 1.01x faster)
8192 1.10 µs (➖ 1.01x faster) 1.10 µs (➖ 1.01x slower)

Reported by cargo ci bench-report --candidate run:45670302362 --config-file bench_report.toml.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant