Skip to content

ci: the optimized gate builds at opt-level = 2 - #110

Merged
shinaoka merged 1 commit into
mainfrom
ci-lower-optimized-gate
Oct 13, 2026
Merged

shinaoka merged 1 commit into
mainfrom
ci-lower-optimized-gate

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Follow-up to #109, from your suggestion: the optimized gate need not build at the shipping opt-level either.

What this job needs from the shipping profile is the other half -- debug-assertions and overflow-checks off, and a build the compiler optimizes rather than a debug one -- which release-test still inherits from release. opt-level = 3 is a shipping knob.

Measured on four CPUs, the shape of a hosted runner, over the same package and its test targets with warm dependencies:

opt-level time
1 26.4 s auto-vectorization off
2 34.3 s this profile
3 36.2 s what release uses

Level 2 keeps vectorization, the codegen feature the packed kernels are built around, for 5% over level 1; level 3's last 5% buys a gate nothing. (For reference, thin LTO with one codegen unit -- the other two shipping knobs -- cost 4.2x: 72.6 s against 17.1 s on a 24-thread host.)

The shipping profile is still built, linked and run by c-consumer. Checks: cargo test -p tcontract --profile release-test (34 suites), cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings.

What this job needs from the shipping profile is `debug-assertions` and
`overflow-checks` off and a build the compiler optimizes; `opt-level = 3` itself is a
shipping knob. Measured on four CPUs, the shape of a hosted runner, over the same
package and test targets with warm dependencies:

    opt-level = 1   26.4 s      auto-vectorization off
    opt-level = 2   34.3 s      <- this profile
    opt-level = 3   36.2 s      what `release` uses

Level 2 keeps vectorization, which is the codegen feature the packed kernels are
built around, and level 3's last few per cent buy a gate nothing. The shipping
profile is still built, linked and run by `c-consumer`.
@shinaoka
shinaoka merged commit 880622c into main Oct 13, 2026
12 checks passed
@shinaoka
shinaoka deleted the ci-lower-optimized-gate branch October 13, 2026 10:41
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.

1 participant