Repository navigation
Enable PGO for Windows x86-64 Ruff releases - #27573
Merged
charliermarsh merged 2 commits intoAug 10, 2026
Merged
Conversation
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 7, 2026 20:31
0c383eb to
18cc775
Compare
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 7, 2026 20:56
18cc775 to
15b4ada
Compare
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| non-augmented-assignment | 1 | 1 | 0 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
charliermarsh
marked this pull request as ready for review
August 10, 2026 13:47
ntBre
approved these changes
Aug 10, 2026
Member
|
No benchmark results for windows? 😆 |
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 10, 2026 14:11
15b4ada to
1e847fd
Compare
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 10, 2026 14:52
1e847fd to
1622827
Compare
charliermarsh
force-pushed
the
charlie/ruff-pgo-windows-x64
branch
from
August 10, 2026 14:55
1622827 to
4a035f6
Compare
George-Ogden
pushed a commit
to George-Ogden/ruff
that referenced
this pull request
Aug 16, 2026
## Summary This PR enables PGO for Ruff's Windows x86-64 releases, following the approach outlined in astral-sh#27570.
1 task
charliermarsh
added a commit
that referenced
this pull request
Oct 10, 2026
## Summary Use thin LTO for the instrumented release executable in the PGO build, while keeping fat LTO for the final executable. Pass the override through `cargo rustc` so dependency compilation and the workspace's release profile are unchanged. Debug builds are unchanged. This reduces the estimated PGO pipeline time by 54% in a Linux x86-64 comparison, with essentially unchanged final binary size and no consistent runtime regression across the holdout projects used for the original PGO work in #27570. ## Build results | Measurement | Fat training | Thin training | | --- | ---: | ---: | | Instrumented build | 487.86 s | 85.50 s | | Final fat-LTO build, median | 247.75 s | 250.43 s | | Estimated complete PGO pipeline | 738.02 s | 338.26 s | | Final stripped executable, median | 22.719 MiB | 22.724 MiB | Instrumented builds were measured once per mode. Final build times and sizes are medians of three independently collected profiles per mode. Pipeline estimates add the instrumented build, median training and profile merge, and median final build; corpus downloads are excluded. These are clean local build measurements, not CI timing predictions. ## Runtime results We trained on the canonical 618-file corpus and evaluated linting and formatting on Django, pandas, scikit-learn, SciPy, and SymPy, whose repositories are disjoint from the training corpus. The holdout pins come from the contemporaneous Windows follow-up in #27573, since the initial Linux PR did not record exact holdout revisions. Each case used three independent profile pairs and 12 interleaved fat/thin timing pairs per profile, for 720 timed runs in total. Runs used eight pinned CPUs and eight threads, with balanced execution order and warm caches. Diagnostics and formatting diffs were checked separately from the quiet timed commands and matched across all six final binaries. Positive changes below mean thin training was slower. Intervals are per-workload hierarchical bootstrap 95% confidence intervals, resampling profile pairs and then paired timing observations; they are not adjusted for multiple comparisons. | Holdout | CPU change (95% CI) | Wall change (95% CI) | | --- | ---: | ---: | | Django lint | -0.21% [-0.77%, +0.49%] | +0.10% [-1.41%, +1.29%] | | Django format | -0.10% [-1.18%, +0.72%] | -0.27% [-1.37%, +1.45%] | | pandas lint | -0.01% [-0.45%, +0.39%] | -0.67% [-2.49%, +1.26%] | | pandas format | -0.26% [-1.10%, +0.67%] | -0.84% [-2.81%, +2.12%] | | scikit-learn lint | +0.02% [-0.62%, +1.12%] | -0.02% [-1.11%, +1.86%] | | scikit-learn format | -0.52% [-2.14%, +0.62%] | -0.79% [-2.08%, +1.03%] | | SciPy lint | -0.21% [-0.70%, +0.43%] | -0.64% [-4.59%, +1.52%] | | SciPy format | -0.52% [-1.03%, +0.13%] | -2.47% [-6.20%, +1.61%] | | SymPy lint | +0.01% [-0.30%, +0.27%] | -0.77% [-3.23%, +0.88%] | | SymPy format | -0.18% [-1.89%, +1.84%] | -0.58% [-3.58%, +3.30%] | A longer SymPy formatting repeat with the same three profile pairs and 48 timing pairs per profile measured -0.18% CPU [-1.96%, +1.66%] and -0.28% wall time [-2.19%, +1.58%]. Individual profiles varied in both directions, so the near-flat average should not be interpreted as identical performance for every trained binary. The pandas formatting wall-time interval remains inconclusive at a 2% slowdown threshold. All six profiles had matching function/CFG identities and counter layouts, with no missing-profile or profile-mismatch compiler diagnostics. Their counter values and `.profdata` bytes were not identical. Measurements used the Rust/Cargo source at `7c6f8fc8fc5655dfa47e125b05453007b9e7a6c7`, the standard release codegen-unit settings, and Ohm Rust 1.99.0-dev (`08bbd755a`, LLVM 23.1.1) with experimental defaults disabled. The benchmark was not rerun on this PR's newer base revision. This is an exploratory Linux x86-64 study with three profiles per mode, not a guarantee of zero runtime cost or equivalent results on macOS, Windows, or ARM.
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
This PR enables PGO for Ruff's Windows x86-64 releases, following the approach outlined in #27570.