I already found when it broke:
passes: rustup default nightly-2024-07-29 && cargo test --doc
fails: rustup default nightly-2024-07-30 && cargo test --doc
But reading Commits · rust-lang/rust · GitHub didn't help me to narrow it down. (It's about float precision during the computation of exp
. Now depending on which branch of my code it took, the result is slightly different, only for that float function)
(the failure for the curious: Miri · tdelmas/typed_floats@83d574c · GitHub . It has nothing to do with Miri, except the fact that it uses nightly
)
stderr:
thread 'main' panicked at typed_floats/src/types/mod.rs:9:1:
assertion `left == right` failed
left: Positive(2.7182818284590455)
right: 2.718281828459045
kornel
August 14, 2024, 10:39pm
2
There's a tool to do exactly that:
Bisects rustc, either nightlies or CI artifacts
4 Likes
I didn't bisect but this seems likely.
opened 11:34AM - 30 Jul 24 UTC
C-bug
T-libs
A-floating-point
regression-untriaged
Our CI started to report an error today with nightly on Linux (other platforms a… re fine).
Simplified the test case is because of a small difference in the computation of `log`.
(I know it's bad practice to do equality tests on float, but I thought I'd report this behavior change anyway as i don't know if this was intentional).
### Code
I tried this code:
```rust
fn main() {
println!("Hello, world! {}", 9f64.log(3.) );
assert_eq!(9f64.log(3.) , 2.)
}
```
I expected to see this happen:
`Hello, world! 2` and no panics. As this happens in stable
Instead, this happened:
```
Hello, world! 2.0000000000000004
thread 'main' panicked at src/main.rs:3:5:
assertion `left == right` failed
left: 2.0000000000000004
right: 2.0
```
### Version with regression
rustc 1.82.0-nightly (612a33f20 2024-07-29)
(Linux only)
2 Likes
Thank you both!
With the suggestion of cargo-bisect-rustc
from @kornel I have confirmed that it was indeed `f64::log` precision change in 1.82 nightly · Issue #128386 · rust-lang/rust · GitHub as suggested by @quinedot !
********************************************************************************
Regression in 80d8270d8488957f62fbf0df7a19dfe596be92ac
********************************************************************************
Update compiler_builtins to 0.1.114 by nicholasbishop · Pull Request #125016 · rust-lang/rust · GitHub
Which does update compiler-builtins
from 0.1.105 to 0.1.114 and the issue `f64::log` precision change in 1.82 nightly · Issue #128386 · rust-lang/rust · GitHub found its source in Fix math libraries not being linked on some platforms by Amjad50 · Pull Request #594 · rust-lang/compiler-builtins · GitHub , merged into the 0.1.110
1 Like
system
Closed
November 13, 2024, 1:02am
5
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.