Skip to content

ci: add kernel binary size checks#3144

Open
benhillis wants to merge 2 commits intomicrosoft:mainfrom
benhillis:kernel_size_check
Open

ci: add kernel binary size checks#3144
benhillis wants to merge 2 commits intomicrosoft:mainfrom
benhillis:kernel_size_check

Conversation

@benhillis
Copy link
Copy Markdown
Member

Add size regression checks for OpenHCL kernel binaries in the OSS CI pipeline, matching the pattern used for the usermode openvmm_hcl binary.

On post-merge CI, kernel baselines are published as artifacts. On PRs, the current kernel is compared against the baseline using xtask verify-size (50 KiB tolerance).

Kernel variants checked:

  • x64 Main kernel
  • x64 CVM kernel
  • aarch64 Main kernel

@benhillis benhillis requested a review from a team as a code owner March 27, 2026 18:14
Copilot AI review requested due to automatic review settings March 27, 2026 18:14
@benhillis benhillis requested a review from a team as a code owner March 27, 2026 18:14
@benhillis benhillis changed the title ci: add kernel binary size checks to OSS CI ci: add kernel binary size checks Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds OpenHCL kernel binary size regression checks to the OSS GitHub CI, mirroring the existing openvmm_hcl (usermode) size-check pattern by publishing merge baselines and comparing PR outputs against them via xtask verify-size.

Changes:

  • Introduces a new kernel baseline artifact publisher node (artifact_openhcl_kernel_sizecheck) and a CI job node to publish kernel baselines on post-merge CI.
  • Adds a PR job node to download the last-merge baseline artifact and run xtask verify-size for kernel variants (x64 main, x64 CVM, aarch64 main).
  • Wires the new baseline publishing + PR comparison jobs into the checkin_gates pipeline and regenerates openvmm-ci.yaml accordingly.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
flowey/flowey_lib_hvlite/src/lib.rs Exposes the new kernel sizecheck artifact module.
flowey/flowey_lib_hvlite/src/artifact_openhcl_kernel_sizecheck.rs New node to copy the resolved kernel binary into an artifact directory for publishing.
flowey/flowey_lib_hvlite/src/_jobs/mod.rs Registers the new job nodes for kernel baseline publish + PR size verification.
flowey/flowey_lib_hvlite/src/_jobs/check_openhcl_kernel_size.rs New PR job to fetch last-merge baseline artifact and run xtask verify-size against the currently resolved kernel.
flowey/flowey_lib_hvlite/src/_jobs/build_and_publish_openhcl_kernel_baseline.rs New CI job to resolve the kernel binary and publish it as a baseline artifact.
flowey/flowey_hvlite/src/pipelines/checkin_gates.rs Adds kernel baseline publishing (CI) and kernel verify-size jobs (PR) to the pipeline graph.
.github/workflows/openvmm-ci.yaml Regenerated workflow to publish the new kernel baseline artifacts from CI jobs.

@benhillis benhillis force-pushed the kernel_size_check branch 2 times, most recently from 5d5100d to 44a963e Compare March 30, 2026 22:40
Copilot AI review requested due to automatic review settings March 30, 2026 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread flowey/flowey_lib_hvlite/src/_jobs/check_openhcl_kernel_size.rs Outdated
Comment thread flowey/flowey_lib_hvlite/src/_jobs/build_and_publish_openhcl_kernel_baseline.rs Outdated
@benhillis
Copy link
Copy Markdown
Member Author

Still looking at this, don't think I want one runner per kernel type.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread flowey/flowey_lib_hvlite/src/artifact_openvmm_hcl_sizecheck.rs
Comment thread flowey/flowey_lib_hvlite/src/_jobs/check_openvmm_hcl_size.rs Outdated
Comment thread .github/workflows/openvmm-pr.yaml
@benhillis benhillis added the CI Improvements or additions to our CI setup outside of flowey label Apr 6, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 21:26
@benhillis benhillis force-pushed the kernel_size_check branch from c125586 to ecbe39c Compare April 7, 2026 21:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread xtask/src/tasks/verify_size.rs Outdated
Comment thread xtask/src/tasks/verify_size.rs Outdated
benhillis pushed a commit to benhillis/openvmm that referenced this pull request Apr 20, 2026
Address review feedback on PR microsoft#3144:

1. Replace overly broad wildcard fallback with explicit match arms:
   - (Err, Err): both unparseable → raw file size comparison (e.g. aarch64 Image)
   - (Err, Ok) or (Ok, Err): mismatched formats → error with file path context

2. Fix integer division truncation in raw size comparison:
   - Use div_ceil when computing KiB differences for the threshold check
   - This prevents up to 1023 bytes from silently slipping through the
     50 KiB tolerance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend the existing openhcl binary size check infrastructure to also
compare kernel binaries between PRs and the last successful main merge.

Kernels checked per architecture:
- x64: Main, CVM
- aarch64: Main

The kernel baselines are included in the existing per-arch
openhcl-baseline artifact (alongside the usermode binary), and the
comparisons run in the existing 'verify openhcl binary size' jobs.
No new CI jobs, artifacts, or files are added.
Copilot AI review requested due to automatic review settings April 20, 2026 17:18
benhillis pushed a commit to benhillis/openvmm that referenced this pull request Apr 20, 2026
Address review feedback on PR microsoft#3144:

1. Replace overly broad wildcard fallback with explicit match arms:
   - (Err, Err): both unparseable → raw file size comparison (e.g. aarch64 Image)
   - (Err, Ok) or (Ok, Err): mismatched formats → error with file path context

2. Fix integer division truncation in raw size comparison:
   - Use div_ceil when computing KiB differences for the threshold check
   - This prevents up to 1023 bytes from silently slipping through the
     50 KiB tolerance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread xtask/src/tasks/verify_size.rs Outdated
Comment thread flowey/flowey_lib_hvlite/src/artifact_openvmm_hcl_sizecheck.rs Outdated
benhillis pushed a commit to benhillis/openvmm that referenced this pull request Apr 20, 2026
Address review feedback on PR microsoft#3144:

1. Replace overly broad wildcard fallback with explicit match arms:
   - (Err, Err): both unparseable → raw file size comparison (e.g. aarch64 Image)
   - (Err, Ok) or (Ok, Err): mismatched formats → error with file path context

2. Fix integer division truncation in raw size comparison:
   - Use div_ceil when computing KiB differences for the threshold check
   - This prevents up to 1023 bytes from silently slipping through the
     50 KiB tolerance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread xtask/src/tasks/verify_size.rs
Comment thread flowey/flowey_lib_hvlite/src/artifact_openvmm_hcl_sizecheck.rs
Comment thread flowey/flowey_lib_hvlite/src/_jobs/check_openvmm_hcl_size.rs
benhillis pushed a commit to benhillis/openvmm that referenced this pull request Apr 20, 2026
Address review feedback on PR microsoft#3144:

1. Replace overly broad wildcard fallback with explicit match arms:
   - (Err, Err): both unparseable → raw file size comparison (e.g. aarch64 Image)
   - (Err, Ok) or (Ok, Err): mismatched formats → error with file path context

2. Fix integer division truncation in raw size comparison:
   - Use div_ceil when computing KiB differences for the threshold check
   - This prevents up to 1023 bytes from silently slipping through the
     50 KiB tolerance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@benhillis benhillis requested a review from Copilot April 20, 2026 18:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread xtask/src/tasks/verify_size.rs Outdated
Comment thread xtask/src/tasks/verify_size.rs Outdated
Comment thread xtask/src/tasks/verify_size.rs
Address review feedback on PR microsoft#3144:

1. Replace overly broad wildcard fallback with explicit match arms:
   - (Err, Err): both unparseable → raw file size comparison (e.g. aarch64 Image)
   - (Err, Ok) or (Ok, Err): mismatched formats → error with file path context

2. Fix integer division truncation in raw size comparison:
   - Use div_ceil when computing KiB differences for the threshold check
   - This prevents up to 1023 bytes from silently slipping through the
     50 KiB tolerance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Improvements or additions to our CI setup outside of flowey

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants