-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Test failures pre 3.8.0 #10474
Comments
Testing for equality in This problem affects Rust's standard library too. Rust's standard library has a pretty cursed workaround for this issue: https://github.com/rust-lang/rust/blob/master/library/core/src/num/dec2flt/fpu.rs. Personally I would skip those tests for non-SSE2 x86 Or alternatively, use |
%ld expects a 4-byte parameter on 32-bit architectures and an 8-byte parameter on 64-bit architectures, but we supplied are trying to supply a 64-bit parameter that would overflow 32-bit storage. Use %lld instead which expects a `long long` parameter, which should be 8-bytes under both architectures. See #10474
As documented in #10474, there are issues with 64-bit floating point rounding under x86 targets without SSE2 extensions, where x87 floating point math causes imprecise results. Document the shortcoming and provide some version of the test that passes regardless of architecture.
I pushed some updates that got tests working for me targeting The history_formats test failure is because we are including a source code test that relies on the cmake |
|
We will continue to use the "normal" fish base directory detection when using the CMake test harness which properly sets up a sandboxed $HOME for fish to use, but when running source code tests with a bare `cargo test` we don't want to write to the actual user's profile. This also works around test failures when running `cargo test` under CI with a locked-down $HOME directory (see #10474).
@zanchey after a35925b, tests appear to pass with the following under Debian 12 i686, which I assume does the trick for you? set fish_home (mktemp -d)
sudo chown root:root $fish_home
env HOME=$fish_home cargo test --target i586-unknown-linux-gnu (I don't actually run the last command as-is because |
@KamilaBorowska do you have any idea why the other 32-bit vs 64-bit errors didn't manifest under i686 but show up under i586? For example, I would expect the |
This is all working ok now, and I fixed the issues with Ubuntu's lto-wrapper (which breaks for some reason when linking the cargo tests) with f4a79cc. |
Unfortunately the 32-bit builds are failing on Debian again.
and
|
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for i586 (*not* i686, so we don't check `status target-arch` but rather `status target` with a prefix match). To reduce the likelihood of inadvertent test breakage, the i586 reduced-accuracy tests are always run, but we also run our "standard" test for other architectures. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for i586 (*not* i686, so we don't check `status target-arch` but rather `status target` with a prefix match). To reduce the likelihood of inadvertent test breakage, the i586 reduced-accuracy tests are always run, but we also run our "standard" test for other architectures. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes fish-shell#10474.
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for i586 (*not* i686, so we don't check `status target-arch` but rather `status target` with a prefix match). To reduce the likelihood of inadvertent test breakage, the i586 reduced-accuracy tests are always run, but we also run our "standard" test for other architectures. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes fish-shell#10474.
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for i586 (*not* i686, so we don't check `status target-arch` but rather `status target` with a prefix match). To reduce the likelihood of inadvertent test breakage, the i586 reduced-accuracy tests are always run, but we also run our "standard" test for other architectures. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes fish-shell#10474.
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for x86 without SSE2 support. This normally means checking for an i586 target triple, but some distros like Debian patch the i686 target to strip out SSE2 support as well, so we need to use a combination of a target architecture check (for x86) combined with a runtime test to check for broken floating point precision. To reduce the likelihood of inadvertent test breakage, these reduced-accuracy tests are always run, but we also run our "standard" test for other architectures. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes fish-shell#10474.
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for x86 without SSE2 support. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes fish-shell#10474.
Due to the inherent floating point accuracy issues under i586 described in fish-shell#10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for x86 without SSE2 support. This commit addresses the littlecheck issues that caused fish-shell#10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes fish-shell#10474.
Due to the inherent floating point accuracy issues under i586 described in #10474 and at rust-lang/rust#114479, we need to add a workaround to our littlecheck math tests to perform less stringent comparisons when fish was built for x86 without SSE2 support. This commit addresses the littlecheck issues that caused #10474 to be re-opened, but I still have to reproduce the cargo test failures for `negative_precision_width`, `test_float`, `test_float_g`, and `test_locale`.
A few specific tests fail under i586 due to its inherent floating point inaccuracy issues (rust-lang/rust#114479), so ignore these tests if certain are met. We have specific integration tests elsewhere in fish to check that even under i586 we get mostly sane results, so this is OK. I tried to modify the assert macros to check for a loose string match (up to one character difference) or an f64 abs diff of less than epsilon, but it was a lot of code with little value and increased the friction to contributing to the tests. Also, let's just acknowledge the fact that all of i686, let alone i586 specifically, is a dead end and not worth investing such time and effort into so long as it more or less "works". Closes #10474.
The tests are failing on the package builders in a few places.
I'm filing an issue for posterity and also to make sure they actually get fixed.
@KamilaBorowska spotted this one as the argument to sprintf being long, which is 32 bits on a 32-bit platform rather than defined as 64-bit.
@mqudsi notes this is the wrong comparison to be doing as floating point values should be compared by epsilon
I don't know why these two aren't picked up by the 32-bit CI build.
HOME is set to something unwritable in the Debian package builds. This wasn't a problem pre-cargo test, because
tests/test_env.sh
was run beforehand. The cargo tests should be equally hermetic. It probably means reimplementingtest_env.sh
in Rust, because sourcing it before runningcargo test
stuffs up any rustup-installed toolchains.The text was updated successfully, but these errors were encountered: