Build pecos-stab-tn at opt-level 2 in dev and test profiles like the other simulation crates - #709
Conversation
…other simulation crates
|
Verified independently. Both load-bearing claims hold.
|
| wall | result | |
|---|---|---|
current dev, opt-level 0 |
63.9 s | 352 passed, 8 ignored |
| with the change, opt-level 2 | 2.3 s | 352 passed, 8 ignored |
That is 28x, matching the ratio in the description (159 s to 5.6 s) on a faster host. Same pass and ignore counts on both sides, so nothing is being skipped to achieve it.
Reads correctly otherwise
The crate belongs on that list on the same grounds as the entries already there, and the comment records the measurement and its date, which is what makes the entry auditable later. Rejecting [profile.dev.package."*"] because it slows every dependency recompile for no gain on this crate is the right call, and worth having written down so it is not retried.
No objection to merging.
# Conflicts: # Cargo.toml
Why
After #683/#684 the PR gate's critical path is
pr-core-rust, and inside it the workspace test phase: 2486 CPU-seconds of test work on a 4-core runner, ~10.4 min however it is scheduled (a nextest trial, #698, confirmed the phase is CPU-bound, not serialization-bound). The two largest contributors are the surface-code LER equivalence test and thepecos-stab-tntest binaries. The rootCargo.tomlalready builds the simulation crates atopt-level = 2in dev/test builds for exactly this reason, butpecos-stab-tnwas not on the list, so its tensor-network code ran unoptimized under test.Measured locally (14 cores):
pecos-stab-tnlib tests (352)pecos-stab-tntest targets (lib, verification, exact_default_measurement)Also tried
[profile.dev.package."*"] opt-level = 2for every external dependency: no further gain on stab-tn, 6% on the LER test, and every dependency recompiles slower. Not taken.What
One entry in the existing
[profile.dev.package.*]block plus a comment with the numbers.profile.testinherits the per-package overrides (verified by reading the rustc invocations:-C opt-level=2for the listed crates incargo testbuilds). Debug assertions stay on. Crates that depend onpecos-stab-tn(the stab-mps and mast Selene plugins, pecos-rslib-exp, benchmarks) get the optimized crate in their debug builds.Verification
cargo test --locked -p pecos-stab-tnwith the change: lib 352 passed / 8 ignored, verification 95 passed / 9 ignored, exact_default_measurement 9 passed / 20 ignored; 46 s wall including the 37 s compile.Cargo.toml: clean.pr-core-rust17 min end to end, down from 25 min on the previous warm-cache run and ~30 min before Cut ~20 min of wasted native builds from the Python CI lanes and make the PR-gate Rust caches restorable #683. Workspace test phase 5.1 min (per-binary times sum to 284 s, was 656 s; longest binary is now the LER test at 191 s), follow-up phases 1.6 min, compile 6.6 min.