Repository navigation
feat: build release binaries with PGO - #1327
Merged
Merged
Conversation
Train host-native release binaries with the existing synthetic and Standard JSON benchmark corpora before cargo-dist packages them. Align LLVM hot-code and size thresholds to avoid profile-driven code expansion. The held-out corpus is 10.2% faster by geometric mean with a 0.4% baseline noise floor, and the Linux x86-64 binary is 4.5% smaller. Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
Build each release archive in a native custom workflow so training and the final binary use the same target flags. Pass checksummed local manifests back to cargo-dist for installer and release generation.\n\nUse a source-file-disjoint evaluation corpus with paired ABBA runs, canonical output checks, and speed, regression, drift, and size gates.
DaniPopes
approved these changes
Aug 29, 2026
DaniPopes
marked this pull request as ready for review
August 30, 2026 07:02
Pin the Rust release toolchain and carry cargo-dist's glibc floor into\nthe custom native builds. Reject binaries that exceed that floor and use\nthe release plan's cargo-dist binary for manifest generation.\n\nRead build features and release limits from dist-workspace.toml to prevent\nconfig drift. Reduce benchmark noise with hybrid percent/time gates and\navoid repeated output canonicalization.
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.
Release binaries now use a custom native workflow based on uv's Linux x86-64 PGO release work. Five host-native targets collect an LLVM profile from the existing synthetic and Standard JSON corpora, then build and package the final binary with the same target flags. The cross-compiled musl target stays unprofiled. cargo-dist 0.32.0 still plans and hosts releases, consumes the checksummed local artifact manifest, and builds the installers, source archive, and wasm bundle. Release builds use Rust 1.98.0, and the GNU installers require glibc 2.34; CI rejects binaries that exceed that limit.
The Linux x86-64 PR job compares the PGO binary with an unprofiled build on a fixed, source-file-disjoint set of eight named projects. It warms both binaries, runs paired per-case ABBA measurements, checks canonical compiler output for every repeat, and gates aggregate speed, case regressions, drift, and binary growth.
The hosted PR run measured these compile-time reductions:
solady-lib-stringseaport-1.6-projectv4-core-projectmorpho-blue-projectforge-std-1.16.1-projectprb-math-4.1.1-projectsolmate-6-projectsolarray-a547630-projectA local Valgrind 3.25.1 Callgrind run at commit
50c0b1a87measured retired guest instructions (Ir) for two ABBA legs per binary. This deterministic count is a stable proxy for CPU work, not a hardware cycle count. Canonical compiler output matched in every run, and maximum leg drift was 0.09%.solady-lib-stringseaport-1.6-projectv4-core-projectmorpho-blue-projectforge-std-1.16.1-projectprb-math-4.1.1-projectsolmate-6-projectsolarray-a547630-projectThe Linux x86-64 binary decreased from 13,731,504 bytes to 13,011,952 bytes, or 5.24%. These measurements apply only to Linux x86-64.
Prompted by: @DaniPopes