-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
checked_ilog2 test fails with imprecise float intrinsics #137591
Comments
|
Ah, but the very next line also checks this for non-powers-of-2 where we can't round exactly, we have to round down, but we also have to account for floating-point error: rust/library/coretests/tests/num/int_log.rs Lines 52 to 54 in b6a3841
So probably we should do some sort of assert_approx_eq here, rather than comparing integers. I'll probably just disable the test in Miri for now to proceed with the subtree update. |
Lol, the tests seem to have caused similar issues in the past already: rust/library/coretests/tests/num/int_log.rs Lines 74 to 77 in b6a3841
|
I guess gating them is probably the most simple option for now. The tests could probably be reworked to instead check y = x.ilog2 => 2.pow(y) = x, but the float version is likely to be reasonably reliable in practice (and easy to identify if not) and having a different kind of basis is good. |
…oss35 checked_ilog tests: deal with a bit of float imprecision Fixes rust-lang#137591 r? `@tgross35`
…oss35 checked_ilog tests: deal with a bit of float imprecision Fixes rust-lang#137591 r? ``@tgross35``
Rollup merge of rust-lang#137730 - RalfJung:checked_ilog_tests, r=tgross35 checked_ilog tests: deal with a bit of float imprecision Fixes rust-lang#137591 r? `@tgross35`
…oss35 checked_ilog tests: deal with a bit of float imprecision Fixes rust-lang#137591 r? `@tgross35`
…oss35 checked_ilog tests: deal with a bit of float imprecision Fixes rust-lang#137591 r? `@tgross35`
Miri made its floatig-point intrinsics imprecise to reflect that we don't guarantee an exact result, and now we are seeing test failures when bumping the Miri subtree:
The failure occurs here:
rust/library/coretests/tests/num/int_log.rs
Line 50 in b6a3841
log2
here is the float operation. We even document:So I think the test is bogus?
Cc @saethlin @tgross35
Note that this is somewhat urgent as it blocks updating Miri's subtree.
The text was updated successfully, but these errors were encountered: