Skip to content

fix(rust): scope PGO and BOLT builds to the shipped binary - #527

Merged
catinspace-au merged 1 commit into
mainfrom
fix/pgo-scope-to-app
Oct 6, 2026
Merged

catinspace-au merged 1 commit into
mainfrom
fix/pgo-scope-to-app

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Closes #526.

Every cargo-pgo step now passes --bin <name> for each binary packaging ships: the PGO instrument and optimise builds, both BOLT builds, and the no-split BOLT retry.

Under --all-features cargo also built the app's feature-gated pgo-driver bin, which has no profile. So the profile-use compile logged ~2,230 "no profile data available" lines per arch on dfe-transform-vector and 500 on dfe-loader, and BOLT optimised a binary nothing ships.

  • --bin filters targets only, so features and package selection are unchanged. -p would not have helped: the driver is a bin in the same package.
  • cargo-pgo 0.3.0 forwards everything after -- to cargo build (src/build.rs:122, 231).
  • A multi-binary app gets every shipped bin built at each step. The workload still profiles the first.
  • The workload scripts build their own driver at target/release/pgo-driver, so they never used the instrumented copy under target/<triple>/. Checked in receiver, loader, archiver, fetcher, vector, vrl and elastic.
  • The plain-build fallback (no cargo-pgo) is unchanged.

Evidence: hyperi-ci check clean, with 5454 unit tests passing. 7 new tests assert the forwarded args per step, and 6 of them fail with the scoping removed.

Not proven yet: a real release-tier run showing zero "no profile data" lines. That needs one optimize-tier=release dispatch on a GA app after merge.

Every cargo-pgo step now passes --bin for each binary packaging ships: the PGO instrument and optimise builds, and both BOLT builds. The no-split BOLT retry carries the same scope.

Without a target filter, cargo builds every bin whose required features are on. Under --all-features that includes a feature-gated pgo-driver bin in the app package. It has no profile, so the profile-use compile logged about 2,200 "no profile data available" warnings per arch on dfe-transform-vector, and BOLT optimised a binary nothing ships.

--bin filters targets only. Package selection and feature resolution are unchanged, so -p would not have helped: the driver is a bin in the same package. The build stage hands over every packaged binary, so a multi-binary app still gets all of them built in each step. The workload still profiles the first one.

The plain-build fallback, used when cargo-pgo cannot be installed, is unchanged. The local smoke recipe in docs/runtime/pgo-bolt.md now passes --bin too.

Closes #526
@catinspace-au
catinspace-au merged commit 481cd4a into main Oct 6, 2026
13 checks passed
@catinspace-au
catinspace-au deleted the fix/pgo-scope-to-app branch October 6, 2026 21:07
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Released in v2.12.16 -- https://github.com/hyperi-io/hyperi-ci/releases/tag/v2.12.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(rust): PGO use phase builds the pgo_driver crate too

1 participant