-
Notifications
You must be signed in to change notification settings - Fork 88
Test suite assumes that cos, exp, and other functions have deterministic precision #463
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
Comments
...okay for most of those I see what you're saying but: log2? |
Quoting https://doc.rust-lang.org/nightly/std/primitive.f32.html#method.log2
Miri just implements what the docs say... Cc @tgross35 |
For most of our multi-width test suite, we are interested in |
Even for log2 musl (and our) implementations have up to 1ulp error (haven't checked glibc), presumably we have to allow for that if it is ever used as a fallback. This winds up with a similar problem to the standard library testsuite; asserting exact equality in our internal tests helps us be the first to know about implementation regressions rather than hiding them in a tolerance, as Jubilee mentioned. But for anything user-facing like doctest should be accounting for the possible imprecision. Not sure what the best solution is here either. Maybe |
I agree with that statement. For example, this change in rust-lang/rust#138062: - assert_biteq!(1.0f64.powi(1), 1.0);
+ assert_approx_eq!(1.0f64.powi(1), 1.0); It was made because the C23 standard doesn't specify I mean, I get why this is expected. And maybe we should rethink those tests as well? I just don't exactly know how to do this without doing this in some places: if cfg!(miri) { ... } else { ... }; But, glad to know we're catching some things :). |
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? `@oli-obk`
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? ``@oli-obk``
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? ```@oli-obk```
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? ````@oli-obk````
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? `````@oli-obk`````
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? `@oli-obk`
Rollup merge of #142337 - RalfJung:miri-float-nondet, r=oli-obk miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? `@oli-obk`
miri: add flag to suppress float non-determinism We have flags controlling most non-determinism, so this seems generally useful for debugging. It is also needed to work around rust-lang/portable-simd#463 in miri-test-libstd. I made this a rustc PR so that it propagates faster to unbreak miri-test-libstd. r? `@oli-obk`
After landing rust-lang/rust#138062, the portable-simd test suite no longer passes in Miri:
These functions do not have guaranteed precision, so results should probably by compared with
assert_approx_ex
instead ofassert_eq
, at least when running in Miri.Cc @LorrensP-2158466
The text was updated successfully, but these errors were encountered: