rust-lang / portable-simd

The testing ground for the future of portable SIMD in Rust
Apache License 2.0
903 stars 81 forks source link

f64::reduce_sum::lanes_1 test fails on latest nightly due to negative zero #432

Closed cvijdea-bd closed 4 weeks ago

cvijdea-bd commented 2 months ago

I tried this: cargo test --test f64_ops

I expected to see this happen: tests pass

Instead, this happened:

---- f64::reduce_sum::lanes_1 stdout ----
thread 'f64::reduce_sum::lanes_1' panicked at /home/cvijdea/dev/portable-simd/crates/test_helpers/src/lib.rs:126:43:
called `Result::unwrap()` on an `Err` value: Fail(Reason("assertion failed: `(left == right)` \n  left: `0.0 (0)`,\n right: `-0.0 (8000000000000000)` at crates/core_simd/tests/f64_ops.rs:5"), [-0.0])
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- f64::reduce_sum::lanes_2 stdout ----
thread 'f64::reduce_sum::lanes_2' panicked at /home/cvijdea/dev/portable-simd/crates/test_helpers/src/lib.rs:126:43:
called `Result::unwrap()` on an `Err` value: Fail(Reason("assertion failed: `(left == right)` \n  left: `0.0 (0)`,\n right: `-0.0 (8000000000000000)` at crates/core_simd/tests/f64_ops.rs:5"), [-0.0, -0.0])

Meta

rustc --version --verbose:

binary: rustc
commit-hash: 4074d4902dc19ff1bbce1d74ef9ceae15b5f41ce
commit-date: 2024-08-23
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0

nightly-2024-08-24 toolchain, portable-simd commit 4697d394138fddbf062dec154270f2a43c4cf64e