Skip to content

Save sysroot and Coverage caches only on main - #1913

Merged
ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:main-only-cache-saves
Oct 9, 2026
Merged

ludfjig merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:main-only-cache-saves

Conversation

@ludfjig

@ludfjig ludfjig commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

PR runs save the sysroot and Coverage caches under their PR ref. Only that PR can restore them, but they use the shared 10 GB cache. Right now they take 1.65 GiB.

On main, the code-checks sysroot cache is saved empty. actions/cache saves in a post-job step, which runs after rust-cache's post-job cleanup has deleted the sysroot.

This PR saves both caches only on main. The sysroot is saved by an explicit step at the end of the job, before rust-cache's cleanup.

PR runs saved these caches under their own ref, where no other run can
restore them, using shared cache space. Saving the sysroot in a job step
also runs before rust-cache's post-job cleanup, which emptied the
sysroot before actions/cache saved it on main.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 00:18
@ludfjig ludfjig added kind/bugfix For PRs that fix bugs ready-for-review PR is ready for (re-)review labels Oct 9, 2026

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 cache conditions and explicit save ordering correctly implement the stated policy.

0 open findings

What changed in this PR

Restricts CI cache writes to main and preserves generated sysroots before cleanup.

Changes:

  • Splits sysroot cache restore and save operations.
  • Disables Rust cache saves outside main.
File Description
.github/​workflows/​dep_code_checks.yml Saves Linux and Windows sysroots explicitly on main.
.github/​workflows/​dep_build_guests.yml Saves guest sysroots explicitly on main.
.github/​workflows/​Coverage.yml Restricts coverage Rust cache writes to main.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hyperlight-gh-bot

Copy link
Copy Markdown

Benchmark Results

Measured commit: 6518a19cd6d7
Baseline commit: 164728cf08d0

kvm / amd (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 796.71 ns (➖ 1.04x slower)
vec_bytes 586.43 ns (➖ 1.01x slower)
379.72 µs (➖ 1.02x faster)

payload_allocation

slot_pool_segmented
262144 525.36 ns (➖ 1.00x slower)
65536 142.36 ns (➖ 1.00x slower)

sandboxes

create_initialized_and_drop
medium 81.83 ms (➖ 1.02x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
7.75 ns (➖ 1.01x faster) 7.72 ns (➖ 1.00x faster) 7.78 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 93.23 µs (➖ 1.01x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.46 µs (➖ 1.02x slower) 7.22 µs (➖ 1.01x slower)
65536 2.14 µs (➖ 1.10x slower) 1.92 µs (➖ 1.09x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 6.25 µs (➖ 1.02x faster) 6.23 µs (➖ 1.00x faster)
8192 1.07 µs (➖ 1.01x slower) 1.07 µs (➖ 1.01x faster)
262144 28.42 µs (➖ 1.02x slower)
kvm / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 719.79 ns (➖ 1.04x slower)
vec_bytes 519.68 ns (➖ 1.01x faster)
686.63 µs (➖ 1.01x slower)

payload_allocation

slot_pool_segmented
262144 506.39 ns (➖ 1.00x slower)
65536 136.59 ns (➖ 1.00x faster)

sandboxes

create_initialized_and_drop
medium 75.62 ms (➖ 1.00x slower)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
6.97 ns (➖ 1.03x faster) 6.96 ns (➖ 1.01x faster) 6.98 ns (➖ 1.01x faster)

snapshot_files

load_snapshot_unverified
small 46.14 µs (➖ 1.00x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.66 µs (➖ 1.02x slower) 7.69 µs (➖ 1.02x slower)
65536 2.17 µs (➖ 1.02x slower) 2.17 µs (➖ 1.03x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.15 µs (➖ 1.01x slower) 7.23 µs (➖ 1.01x slower)
8192 742.54 ns (➖ 1.02x faster) 736.51 ns (➖ 1.02x slower)
262144 29.46 µs (➖ 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 1.01 µs (➖ 1.08x slower)
vec_bytes 702.58 ns (➖ 1.01x slower)
298.30 µs (➖ 1.02x faster)

payload_allocation

slot_pool_segmented
262144 727.63 ns (➖ 1.00x slower)
65536 197.09 ns (➖ 1.01x slower)

sandboxes

create_initialized_and_drop
medium 58.15 ms (➖ 1.01x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
10.32 ns (➖ 1.06x slower) 9.76 ns (➖ 1.04x faster) 9.71 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 86.78 µs (➖ 1.02x faster)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 10.15 µs (➖ 1.01x faster) 9.76 µs (➖ 1.02x faster)
65536 2.45 µs (➖ 1.01x faster) 2.28 µs (➖ 1.01x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.48 µs (➖ 1.19x faster) 8.60 µs (➖ 1.11x faster)
8192 1.25 µs (➖ 1.02x faster) 1.29 µs (➖ 1.05x slower)
262144 36.32 µs (➖ 1.04x faster)
mshv3 / intel (Linux) (➖ stable)

No benchmark improved or regressed.

Benchmark Results

function_call_codec

encode_control decode_vec_bytes_copy
byte_chunks 942.23 ns (➖ 1.03x slower)
vec_bytes 659.91 ns (➖ 1.00x slower)
748.98 µs (➖ 1.06x slower)

payload_allocation

slot_pool_segmented
262144 627.59 ns (➖ 1.01x slower)
65536 169.53 ns (➖ 1.01x slower)

sandboxes

create_initialized_and_drop
medium 60.15 ms (➖ 1.07x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.60 ns (➖ 1.01x faster) 8.75 ns (➖ 1.01x faster) 8.80 ns (➖ 1.00x slower)

snapshot_files

load_snapshot_unverified
small 43.75 µs (➖ 1.00x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.92 µs (➖ 1.00x faster) 8.01 µs (➖ 1.01x slower)
65536 2.26 µs (➖ 1.01x faster) 2.30 µs (➖ 1.02x slower)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 7.79 µs (➖ 1.04x slower) 7.45 µs (➖ 1.01x faster)
8192 909.85 ns (➖ 1.04x faster) 928.23 ns (➖ 1.02x slower)
262144 38.89 µs (➖ 1.05x 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.33 µs (➖ 1.12x slower)
vec_bytes 789.57 ns (➖ 1.00x slower)
1.99 ms (➖ 1.14x faster)

payload_allocation

slot_pool_segmented
262144 800.58 ns (➖ 1.01x slower)
65536 232.11 ns (➖ 1.00x faster)

sandboxes

create_initialized_and_drop
medium 72.42 ms (➖ 1.06x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
9.94 ns (➖ 1.02x faster) 10.11 ns (➖ 1.01x slower) 10.18 ns (➖ 1.01x slower)

snapshot_files

load_snapshot_unverified
small 647.69 µs (➖ 1.11x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 9.11 µs (➖ 1.02x faster) 9.13 µs (➖ 1.00x slower)
65536 2.37 µs (➖ 1.01x faster) 2.34 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 9.04 µs (➖ 1.06x faster) 9.35 µs (➖ 1.07x slower)
8192 1.32 µs (➖ 1.01x slower) 1.30 µs (➖ 1.01x slower)
262144 38.24 µs (➖ 1.00x faster)
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.01x slower)
vec_bytes 790.07 ns (➖ 1.00x faster)
3.19 ms (➖ 1.03x slower)

payload_allocation

slot_pool_segmented
262144 740.22 ns (➖ 1.37x faster)
65536 211.01 ns (➖ 1.31x faster)

sandboxes

create_initialized_and_drop
medium 104.82 ms (➖ 1.04x faster)

slot_pool

alloc_dealloc_1500 alloc_dealloc_4096 alloc_dealloc_128
10.27 ns (➖ 1.40x faster) 10.03 ns (➖ 1.42x faster) 10.55 ns (➖ 1.36x faster)

snapshot_files

load_snapshot_unverified
small 662.94 µs (➖ 1.12x slower)

virtq_readonly

slot_pool_segmented_fragmented slot_pool_segmented
262144 7.80 µs (➖ 1.01x faster) 7.78 µs (➖ 1.01x faster)
65536 2.34 µs (➖ 1.00x slower) 2.33 µs (➖ 1.01x faster)

virtq_readwrite

slot_pool_segmented_fragmented slot_pool_segmented
65536 8.51 µs (➖ 1.03x faster) 8.49 µs (➖ 1.02x faster)
8192 1.13 µs (➖ 1.15x faster) 1.12 µs (➖ 1.01x slower)
262144 42.25 µs (➖ 1.01x faster)

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

@ludfjig
ludfjig merged commit dcb53c0 into hyperlight-dev:main Oct 9, 2026
66 checks passed
@github-actions github-actions Bot removed the ready-for-review PR is ready for (re-)review label Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants