-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
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:
release
profile torelease-opt
.release
profile is untouched (16 CGUs and thin local LTO).release-checked
inheritsrelease
, 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, theENSURE_NO_PANIC
environment variable must now always be set.ci: allow-regressions