-
Notifications
You must be signed in to change notification settings - Fork 103
Rework the available Cargo profiles #479
Conversation
d3274f9 to
e5b4ce2
Compare
Currently the default release profile enables LTO and single CGU builds, which is very slow to build. Most tests are better run with optimizations enabled since it allows testing a much larger number of inputs, so it is inconvenient that building can sometimes take significantly longer than the tests. Remedy this by doing the following: * Move the existing `release` profile to `release-opt`. * With the above, the default `release` profile is untouched (16 CGUs and thin local LTO). * `release-checked` inherits `release`, so no LTO or single CGU. This means that the simple `cargo test --release` becomes much faster for local development. We are able to enable the other profiles as needed in CI. Tests should ideally still be run with `--profile release-checked` to ensure there are no debug assetions or unexpected wrapping math hit. `no-panic` still needs a single CGU, so must be run with `--profile release-opt`. Since it is not possible to detect CGU or profilel configuration from within build scripts, the `ENSURE_NO_PANIC` environment variable must now always be set.
e5b4ce2 to
b1e7ea0
Compare
|
CI time is consistent, the wins from not LTOing every test probably washes out with whatever performance gain there could have been. |
|
CI is failing on i586: It looks like another bug caused by rust-lang/rust#114479 (the x87 extended precision results are not equal, but the rounded |
|
Intereesting that the sanity check failed here, I will update with your suggestion when I get the chance. The random tests occasionally fail for atan2 and the bessel functions on i586, but I never checked to see if it was reproducible with the same inputs. Restarted CI just to verify. |
d599300 to
a9e8dfb
Compare
There seems to be a case of unsoundness with the `i586` version of
`atan2`. For the following test:
assert_eq!(atan2(2.0, -1.0), atan(2.0 / -1.0) + PI);atan2(2.0, -1.0)
The output is optimization-dependent. The new `release-checked` profile
produces the following failure:
thread 'math::atan2::sanity_check' panicked at src/math/atan2.rs:123:5:
assertion `left == right` failed
left: 2.0344439357957027
right: 2.0344439357957027
Similarly, `sin::test_near_pi` fails with the following:
thread 'math::sin::test_near_pi' panicked at src/math/sin.rs:91:5:
assertion `left == right` failed
left: 6.273720864039203e-7
right: 6.273720864039205e-7
Mark the tests ignored on `i586` for now.
a9e8dfb to
f5f789a
Compare
|
CI on some other platforms is now stopping at rust-lang/rust#136096. I will just wait for rust-lang/rust#136098 to land. I also had to ignore a similar test for |
Rework the available Cargo profiles
Currently the default release profile enables LTO and single CGU builds, which is very slow. Most tests are better run with optimizations enabled since it allows testing a much larger number of inputs, so it is inconvenient that building can sometimes take significantly longer than the tests.
Remedy this by doing the following:
releaseprofile torelease-opt.releaseprofile is untouched (16 CGUs and thin local LTO).release-checkedinheritsrelease, so no LTO or single CGU.This means that the simple
cargo test --releasebecomes much faster for local development. We are able to enable the other profiles as needed in CI.Tests should ideally still be run with
--profile release-checkedto ensure there are no debug assetions or unexpected wrapping math hit.no-panicstill needs a single CGU, so must be run with--profile release-opt. Since it is not possible to detect CGU or profilel configuration from within build scripts, theENSURE_NO_PANICenvironment variable must now always be set.ci: allow-regressions