Skip to content

SDK: Migrate to lzma-rust2 instead of patina-lzma-rs#1611

Merged
os-d merged 1 commit into
OpenDevicePartnership:mainfrom
os-d:lzma_rust2
Jul 7, 2026
Merged

SDK: Migrate to lzma-rust2 instead of patina-lzma-rs#1611
os-d merged 1 commit into
OpenDevicePartnership:mainfrom
os-d:lzma_rust2

Conversation

@os-d

@os-d os-d commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

patina-lzma-rs is a fork of the unmaintained lzma-rs crate that adds no_std support for it.

lzma-rust2 is a maintained fork of lzma-rs that already contains no_std support and large performance improvements over lzma-rs.

On an example AARCH64 platform, decompressing an LZMA compressed FV went from 2500 ms with patina-lzma-rs to 1314 ms with lzma-rust2.

Host based benchmarking shows similar performance improvements.

This commit moves patina over to the maintained crate with better performance that doesn't require a custom override.

The optimization feature is not enabled because it is primarily for encoding (which patina does not do) and does not support the FORMAT_ONLY compression type that our FV use, so the performance is the same but it adds unsafe code.

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

How This Was Tested

Tested with local benchmarks and running on an AARCH64 platform.

Integration Instructions

N/A. The changed dependency will be picked up automatically. patina-lzma-rs will be deprecated.

@patina-automation

patina-automation Bot commented Jul 2, 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/28887676740

Boot Time to EFI Shell

Platform Elapsed
ArmVirt (Linux Host) 26.7s
Q35 (Linux Host) 29.6s

Dependencies

Repository Ref
patina fc015f0
patina-dxe-core-qemu 90708a7
patina-fw-patcher 5b82a50
patina-qemu firmware v4.0.1
patina-qemu build script 1885d34

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

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@makubacki

Copy link
Copy Markdown
Collaborator

If this can wait until Monday, I'd be happy to look at it then. As mentioned offline, it's great to move off our custom fork of lzma-rs and pick up the perf improvement.

Comment thread sdk/patina_ffs/src/volume.rs
Comment thread sdk/patina_ffs/src/volume.rs Outdated
patina-lzma-rs is a fork of the unmaintained lzma-rs crate that
adds no_std support for it.

lzma-rust2 is a maintained fork of lzma-rs that already contains
no_std support and large performance improvements over lzma-rs.

On an example AARCH64 platform, decompressing an LZMA compressed
FV went from 2500 ms with patina-lzma-rs to 1314 ms with lzma-rust2.

This commit moves patina over to the maintained crate with better
performance that doesn't require a custom override.

The optimization feature is not enabled because it is primarily
for encoding (which patina does not do) and does not support the
FORMAT_ONLY compression type that our FV use, so the performance is
the same but it adds unsafe code.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
@os-d
os-d enabled auto-merge (rebase) July 7, 2026 17:46
@os-d os-d added the semver:minor Pull requests that should increment the release minor version label Jul 7, 2026
@os-d
os-d merged commit 2383d8a into OpenDevicePartnership:main Jul 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:minor Pull requests that should increment the release minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants