Enable PGO for macOS ARM64 Ruff releases - #27572
Draft
charliermarsh wants to merge 1 commit into
Draft
Conversation
charliermarsh
force-pushed
the
charlie/ruff-pgo-macos-arm64
branch
from
August 7, 2026 20:31
2dbf8aa to
2d81158
Compare
charliermarsh
changed the base branch from
charlie/ruff-bolt-prototype
to
charlie/ruff-pgo-prototype
August 7, 2026 20:33
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 96.96%. The percentage of expected errors that received a diagnostic held steady at 92.96%. The number of fully passing files held steady at 106/133. |
Memory usage reportMemory usage unchanged ✅ |
|
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| non-augmented-assignment | 1 | 1 | 0 | 0 | 0 |
charliermarsh
force-pushed
the
charlie/ruff-pgo-macos-arm64
branch
from
August 7, 2026 20:56
2d81158 to
5d3c2fc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the existing profile-guided Ruff release pipeline to native Apple Silicon macOS builds. We build an instrumented release executable, train
checkandformaton the same eight SHA-pinned Python ecosystem projects, and pass the merged LLVM profile into the existing maturin wheel build.The instrumented and optimized builds retain our existing Mach-O LLD and identical-code-folding flags. The final build also disables C and C++ profiling so Apple Clang does not attempt to consume profile data produced by Rust's LLVM toolchain.
Only the
aarch64-apple-darwinrelease job changes. Wheels and standalone archives continue to use the same optimized executable.The native macOS release job completed successfully: profile generation took 4 minutes 39 seconds, followed by a 2-minute-37-second optimized wheel build. Compared with the matching non-PGO release artifacts, the compressed standalone artifact decreased by 1.1% and the wheel artifact decreased by 0.9%.
macOS ARM64 performance
Compared the actual non-PGO and PGO macOS ARM64 release binaries on an Apple M5 Max with eight Rayon threads. Both binaries have identical Ruff 0.16.1 source, workspace dependencies,
Cargo.lock, Rust 1.97.1 toolchain, deployment target, and Mach-O linker/ICF flags. Benchmarks covered 5,396 held-out Python and stub files totaling 90.57 MB, with five warmup pairs and thirty alternating baseline/candidate pairs per workload.ruff checkruff formatAcross all ten workloads, wall time improved by 6.8% and CPU time improved by 7.8%. PGO won 257 of 300 paired wall-time comparisons and 273 of 300 paired CPU comparisons. The stripped executable decreased from 23.80 MB to 23.62 MB.
Stacked on #27570.