Repository navigation
test: build the native crate's suites unoptimised - #585
Merged
Merged
Conversation
This was referenced Sep 25, 2026
The test profile's opt-level 2 is there for the emulator's fixture and trace suites, which run millions of instructions in Rust. The native crate builds SQL text and its suites spend their time waiting on the server, so it gets opt-level 0 through a package override. Every other crate keeps opt-level 2, the reference emulator included. On a standard runner the native crate's 57 test binaries took 876 CPU seconds to compile at opt-level 2 and 200 at opt-level 0 (cargo --timings, CI run 36121287631). Its non-live suites ran in 0.87 s at opt-level 2 and 1.98 s at opt-level 0 locally. opt-level does not change what safe Rust computes. The generated text is byte-identical anyway: xxh64 of both resident statements, run_statement, demo_statement, the load, level and render plans and the parity queries match at opt-level 2, 1 and 0.
MarcusKainth
force-pushed
the
test/native-suites-unoptimised
branch
from
September 25, 2026 11:31
247ad37 to
97b2940
Compare
MarcusKainth
marked this pull request as ready for review
September 25, 2026 11:44
1 task done
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.
What this changes, and why
[profile.test]sets opt-level 2 for the emulator's fixture and trace suites. The native crate got it too, and its test binaries are the largest compile cost inbuild-tests: 876 CPU seconds of the workspace's own units at opt-level 2, against 200 at opt-level 0 (cargo--timingsfrom the measurement run 36121287631). The native crate builds SQL text and its suites wait on the server, so this gives it opt-level 0 through[profile.test.package.clickdoom-native]. Every other crate keeps opt-level 2,refemuincluded.Evidence
The generated SQL is byte-identical
A scratch test, not committed, hashing everything the crate generates:
Run under each profile, with the level confirmed from
cargo test -v(-C opt-level=2,=1, and no flag for 0):Rerun on a Linux runner in the throwaway run 36123894500.
cargo test -vshowedopt-level=2for the first build and no flag for the second:Compile time, from this PR's CI run 36123100020
build-testsrestored the same rust-cache key main uses (full match: true), so only the workspace crates compiled:Finished test profilecargo
--timingsin the measurement run: the native crate's test units took 876 CPU s at opt-level 2, 607 at opt-level 1 and 200 at opt-level 0.Suite times
The emulator group doesn't regress. These are test-seconds summed from each run's nextest PASS lines. Main's run and #584's are on this PR's base commit, and #580's is on an earlier commit. Together they show the spread from one runner to the next:
sqlcpu_live the_sql_cpu_passes_its_own_suitedemo3_parityrun_liverefemu's own suites, which this PR can't touch, moved from 36.8 to 48.5 test-seconds between main's run and this one. That is the runner-to-runner spread.native-rest's live suites match run 36116301376 within a few seconds each (group sum 653.1 there, 685.7 here). The pure-Rust statement tests get slower at opt-level 0:
every_cut_builds_a_statement_the_server_could_rungoes from 3.2 to 5.0 s to 15.3 s, andno_cut_statement_holds_a_comparison_operandfrom 1.6 to 2.8 s to 8.2 s. About 15 test-seconds in all, in a group that runs two at a time. The simulation groups' sums fall inside the spread between runs (sim-f: 908.8 main, 969.7 here).Every group passed and
ci-passedsucceeded.Invariants
None. Only the test profile of one crate changes.
opt-leveldoesn't change what safe Rust computes, and the hashes above show the SQL text is unchanged.Spec impact
Checks
make gates: not run locally. CI's lint job ranmake lintand every test group passedWritten mostly by Claude Opus 5.5.