Skip to content

patina: decompress: Read bits directly from source bytes - #1928

Merged
Javagedes merged 2 commits into
OpenDevicePartnership:mainfrom
Javagedes:personal/joeyvagedes/decompress-size
Oct 28, 2026
Merged

Javagedes merged 2 commits into
OpenDevicePartnership:mainfrom
Javagedes:personal/joeyvagedes/decompress-size

Conversation

@Javagedes

Copy link
Copy Markdown
Contributor

Description

The UEFI and Tiano decompressor used bitvec to extract bits from the compressed stream. This commit updates the logic to read bits directly from the source bytes using shifts and masks, retaining bounds checks while reducing binary size and improving decompression performance.

The included decompress benchmark noted a roughly 20% performance gain with this change.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

N/A

Integration Instructions

N/A

@patina-automation

patina-automation Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/40722721892

Boot Time to EFI Shell

Platform Elapsed
ArmVirt (Linux Host) 20.2s
Q35 (Linux Host) 36.9s

Dependencies

Repository Ref
patina d3da3f2
patina-dxe-core-qemu 1295159
patina-fw-patcher 9b100b3
patina-qemu firmware v4.1.3
patina-qemu build script 05d359d

Binary Size Report

Platform Commit Δ Debug Δ Release Δ Debug
(LZMA)
Δ Release
(LZMA)
Q35 (x86_64) Base:5c983c6
PR:d3da3f2
 
1.23 MB
1.22 MB
Δ -5.50 KB
976.00 KB
972.50 KB
Δ -3.50 KB
472.63 KB
470.49 KB
Δ -2.14 KB
383.75 KB
382.19 KB
Δ -1.56 KB
ArmVirt (aarch64) Base:5c983c6
PR:d3da3f2
 
1.11 MB
1.10 MB
Δ -5.50 KB
883.50 KB
880.00 KB
Δ -3.50 KB
383.39 KB
381.27 KB
Δ -2.12 KB
313.04 KB
311.98 KB
Δ -1.05 KB

Compressed sizes use LZMA-alone format at preset 6 (xz --format=lzma -6).

Shared QEMU integration: 1295159.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added the impact:non-functional Does not have a functional impact label Oct 27, 2026
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.10145% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/patina/src/uefi/decompress.rs 97.10% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Javagedes
Javagedes force-pushed the personal/joeyvagedes/decompress-size branch from 3efb85c to 9b2f3c5 Compare October 27, 2026 21:56
@Javagedes
Javagedes requested review from makubacki and os-d October 27, 2026 22:29
Comment thread sdk/patina/src/uefi/decompress.rs
The UEFI and Tiano decompressor used bitvec to extract bits from the
compressed stream. This commit updates the logic to read bits directly
from the source bytes using shifts and masks, retaining bounds checks
while reducing binary size and improving decompression performance.

The included decompress benchmark noted a roughly 20% performance
gain with this change.
@Javagedes
Javagedes force-pushed the personal/joeyvagedes/decompress-size branch from 9b2f3c5 to d3da3f2 Compare October 28, 2026 15:52
@Javagedes
Javagedes merged commit 9cfe4f2 into OpenDevicePartnership:main Oct 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants