Skip to content

Remove SandboxRuntimeConfig - #1975

Merged
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:remove-sandbox-runtime-config
Oct 22, 2026
Merged

ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:remove-sandbox-runtime-config

Conversation

@ludfjig

@ludfjig ludfjig commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1279.

SandboxRuntimeConfig held per-sandbox settings next to per-image state. Each field now lives with the data it belongs to:

  • debug_info and guest_core_dump are read from SandboxConfiguration.
  • The crashdump entry point is read from the memory manager, which restore() already updates.
  • The guest binary path is dropped. Core dumps report <unknown> as the process name for every sandbox. Snapshot and restored sandboxes already did this since Support core dump on snapshots created from snapshot/disk #1618. The debugging docs now say dumps do not record the guest binary.

Sandbox setup, from_snapshot, and restore() no longer need crashdump or gdb plumbing.

A later improvement could link guests with a GNU build ID and report it in core dumps. That would identify the exact guest build without a path.

@ludfjig ludfjig added the kind/refactor For PRs that restructure or remove code without adding new functionality. label Oct 22, 2026
Each field moves to the place that already owns its data:

* debug_info and guest_core_dump are read from SandboxConfiguration.
* The crashdump entry point is read from the memory manager, which
  restore already updates.
* The guest binary path is dropped. Core dumps report <unknown>
  as the process name for every sandbox, as snapshot sandboxes
  already did.

Sandbox setup and restore no longer need crashdump or gdb plumbing.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig
ludfjig force-pushed the remove-sandbox-runtime-config branch from f929ea4 to ae8bd5c Compare October 22, 2026 17:34
@hyperlight-gh-bot

Copy link
Copy Markdown

Benchmark Results

Measured commit: ae8bd5c8de09
Baseline commit: 3f2ed9becd6e

kvm / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 764.04 ns (➖ 1.01x slower)
vec_bytes 581.47 ns (➖ 1.02x faster)
373.60 µs (➖ 1.02x faster)

payload_allocation

slot_pool_segmented
65536 141.62 ns (➖ 1.00x slower)
262144 522.69 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 80.90 ms (➖ 1.00x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_128 alloc_dealloc_1500
7.72 ns (➖ 1.00x faster) 7.71 ns (➖ 1.00x faster) 7.79 ns (➖ 1.01x slower)

snapshot_files

load_snapshot_unverified
small 92.49 µs (➖ 1.00x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
65536 2.06 µs (➖ 1.06x slower) 1.99 µs (➖ 1.05x faster)
262144 7.05 µs (➖ 1.00x slower) 7.13 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 6.29 µs (➖ 1.01x faster) 6.16 µs (➖ 1.03x faster)
8192 1.07 µs (➖ 1.04x slower) 1.05 µs (➖ 1.01x slower)
262144 28.32 µs (➖ 1.04x slower)
kvm / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 680.37 ns (➖ 1.01x slower)
vec_bytes 510.73 ns (➖ 1.02x faster)
682.85 µs (➖ 1.00x faster)

payload_allocation

slot_pool_segmented
65536 138.26 ns (➖ 1.01x slower)
262144 548.05 ns (➖ 1.06x slower)

sandboxes

create_initialized_and_drop
medium 70.67 ms (➖ 1.08x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_128 alloc_dealloc_1500
7.07 ns (➖ 1.00x slower) 7.01 ns (➖ 1.00x faster) 6.98 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 44.32 µs (➖ 1.02x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
65536 2.13 µs (➖ 1.00x slower) 2.13 µs (➖ 1.02x slower)
262144 7.52 µs (➖ 1.00x slower) 7.55 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 6.98 µs (➖ 1.01x faster) 7.01 µs (➖ 1.00x faster)
8192 731.35 ns (➖ 1.03x faster) 726.30 ns (➖ 1.00x slower)
262144 30.26 µs (➖ 1.03x slower)
mshv3 / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 922.97 ns (➖ 1.00x slower)
vec_bytes 711.16 ns (➖ 1.00x faster)
329.16 µs (➖ 1.04x slower)

payload_allocation

slot_pool_segmented
65536 193.01 ns (➖ 1.05x slower)
262144 670.76 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 57.68 ms (➖ 1.05x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_128 alloc_dealloc_1500
9.93 ns (➖ 1.00x slower) 9.92 ns (➖ 1.00x faster) 9.92 ns (➖ 1.06x faster)

snapshot_files

load_snapshot_unverified
small 86.48 µs (➖ 1.01x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
65536 2.66 µs (➖ 1.01x faster) 2.47 µs (➖ 1.00x faster)
262144 9.27 µs (➖ 1.00x slower) 9.00 µs (➖ 1.02x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.06 µs (➖ 1.01x faster) 7.95 µs (➖ 1.05x faster)
8192 1.33 µs (➖ 1.01x slower) 1.34 µs (➖ 1.02x slower)
262144 34.73 µs (➖ 1.01x faster)
mshv3 / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 929.82 ns (➖ 1.04x faster)
vec_bytes 695.13 ns (➖ 1.01x slower)
1.28 ms (➖ 1.22x slower)

payload_allocation

slot_pool_segmented
65536 171.12 ns (➖ 1.01x slower)
262144 652.72 ns (➖ 1.01x faster)

sandboxes

create_initialized_and_drop
medium 75.96 ms (➖ 1.02x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_128 alloc_dealloc_1500
8.81 ns (➖ 1.01x faster) 8.80 ns (➖ 1.01x faster) 8.79 ns (➖ 1.01x faster)

snapshot_files

load_snapshot_unverified
small 55.38 µs (➖ 1.04x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
65536 2.32 µs (➖ 1.02x faster) 2.30 µs (➖ 1.02x faster)
262144 8.04 µs (➖ 1.00x faster) 8.03 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.52 µs (➖ 1.02x faster) 7.61 µs (➖ 1.00x slower)
8192 935.06 ns (➖ 1.02x faster) 927.38 ns (➖ 1.02x faster)
262144 37.06 µs (➖ 1.11x faster)
hyperv-ws2025 / amd (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.13 µs (➖ 1.07x faster)
vec_bytes 766.90 ns (➖ 1.03x faster)
2.15 ms (➖ 1.04x faster)

payload_allocation

slot_pool_segmented
65536 243.74 ns (➖ 1.07x slower)
262144 790.56 ns (➖ 1.01x slower)

sandboxes

create_initialized_and_drop
medium 98.34 ms (➖ 1.25x slower)

slot_pool

alloc_dealloc_4096 alloc_dealloc_128 alloc_dealloc_1500
10.58 ns (➖ 1.00x slower) 11.00 ns (➖ 1.04x slower) 10.58 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 673.90 µs (➖ 1.82x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
65536 2.55 µs (➖ 1.00x slower) 2.55 µs (➖ 1.01x slower)
262144 8.66 µs (➖ 1.01x slower) 8.60 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 9.00 µs (➖ 1.01x slower) 8.90 µs (➖ 1.01x slower)
8192 1.40 µs (➖ 1.00x faster) 1.42 µs (➖ 1.05x slower)
262144 39.90 µs (➖ 1.03x slower)
hyperv-ws2025 / intel (Windows) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 1.22 µs (➖ 1.02x slower)
vec_bytes 774.25 ns (➖ 1.02x slower)
2.92 ms (➖ 1.02x slower)

payload_allocation

slot_pool_segmented
65536 214.56 ns (➖ 1.02x faster)
262144 747.73 ns (➖ 1.01x slower)

sandboxes

create_initialized_and_drop
medium 96.63 ms (➖ 1.13x faster)

slot_pool

alloc_dealloc_4096 alloc_dealloc_128 alloc_dealloc_1500
10.44 ns (➖ 1.05x slower) 9.96 ns (➖ 1.00x slower) 10.43 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 549.70 µs (➖ 1.18x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
65536 2.30 µs (➖ 1.01x faster) 2.31 µs (➖ 1.01x slower)
262144 7.63 µs (➖ 1.02x slower) 7.67 µs (➖ 1.02x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.58 µs (➖ 1.02x faster) 8.74 µs (➖ 1.01x slower)
8192 1.12 µs (➖ 1.02x slower) 1.19 µs (➖ 1.12x slower)
262144 55.14 µs (➖ 1.32x slower)

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

@ludfjig
ludfjig marked this pull request as ready for review October 22, 2026 18:53
Copilot AI balanced review requested due to automatic review settings October 22, 2026 18:53

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.

🟢 Approval recommended

The focused refactor preserves configuration and entry-point behavior, and the intentional metadata change is documented with no blocking issues identified.

No open issues 🎉

What changed in this PR

Removes SandboxRuntimeConfig to separate per-sandbox settings from per-image state, addressing #1279.

Changes:

  • Reads debugging settings from SandboxConfiguration and the crashdump entry point from the memory manager.
  • Simplifies sandbox creation and restore by removing runtime-config plumbing.
  • Uses <unknown> for core-dump process metadata and documents the behavior.
File Description
src/​hyperlight_host/​src/​sandbox/​uninitialized.rs Removes runtime configuration and simplifies constructors and tests.
src/​hyperlight_host/​src/​sandbox/​uninitialized_evolve.rs Reads debugger settings directly from sandbox configuration.
src/​hyperlight_host/​src/​sandbox/​initialized.rs Removes redundant creation and restore plumbing.
src/​hyperlight_host/​src/​hypervisor/​mod.rs Updates test setup to match the simplified interface.
src/​hyperlight_host/​src/​hypervisor/​hyperlight_vm/​x86_64.rs Reads the crashdump entry point from the memory manager.
src/​hyperlight_host/​src/​hypervisor/​hyperlight_vm/​mod.rs Stores the core-dump flag without a runtime-config wrapper.
src/​hyperlight_host/​src/​hypervisor/​hyperlight_vm/​aarch64.rs Removes the unused runtime-config parameter.
src/​hyperlight_host/​src/​hypervisor/​crashdump.rs Uses <unknown> for process name and command line.
docs/​how-to-debug-a-hyperlight-guest.md Explains that users must track the matching guest binary.
CHANGELOG.md Records the core-dump metadata change.

Review effort: Balanced

Comment thread src/hyperlight_host/src/hypervisor/crashdump.rs
@ludfjig
ludfjig merged commit 8a7e6b8 into hyperlight-dev:main Oct 22, 2026
122 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor For PRs that restructure or remove code without adding new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What is the expected lifecycle of SandboxRuntimeConfig?

3 participants