Skip to content
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

CRlibm fails many tests on 32 bit systems #45

Open
c42f opened this issue Feb 23, 2021 · 1 comment
Open

CRlibm fails many tests on 32 bit systems #45

c42f opened this issue Feb 23, 2021 · 1 comment

Comments

@c42f
Copy link
Contributor

c42f commented Feb 23, 2021

With the new binarybuilder build from #26, we now have the ability to test on 32 bit systems.

This led to finding the test failure noted in JuliaIntervals/IntervalArithmetic.jl#440. These have probably always existed with this package on 32 bit linux, but nobody noticed until now.

I've built crlibm locally with 32 bit gcc (from a 64 bit host) and have managed to reproduce the failures using the underlying crlibm test suite. Build instructions:

# Get the source from https://github.com/taschini/crlibm
# Build
./prepare
./configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu CC=i686-linux-gnu-gcc
make
make check

This results in many test failures (log summary attached at bottom)

I also build crlibm in a 32 bit userland inside a docker container with the default prepare and configure and all build settings autodetected — I found that the errors persist. So these may be real bugs in crlibm (or its build system) rather than an issue with cross compilation.

It seems that CRLibm.jl should not use the current binarybuilder build for 32 bit systems unless this is fixed. The simple fix is to fall back to MPFR on 32 bit.

On a related note, it would be nice to convert the relatively comprehensive tests which come with CRLibm itself into tests for this package. They are well designed data-driven tests so the test files could just be copied into this package and run with a new test runner.

Test failure log summary:

FAIL: check_exp
FAIL: check_expm1
PASS: check_log
FAIL: check_log2
FAIL: check_log10
PASS: check_log1p
FAIL: check_sin
FAIL: check_cos
FAIL: check_tan
PASS: check_asin
PASS: check_acos
PASS: check_atan
FAIL: check_sinh
FAIL: check_cosh
PASS: check_sinpi
PASS: check_cospi
PASS: check_tanpi
FAIL: check_asinpi
FAIL: check_acospi
FAIL: check_atanpi
PASS: check_pow
Testsuite summary for 
============================================================================
# TOTAL: 21
# PASS:  9
# SKIP:  0
# XFAIL: 0
# FAIL:  12
# XPASS: 0
# ERROR: 0
@dpsanders
Copy link
Member

Many thanks for the analysis, @c42f!
I'm not sure why we never saw an issue with 32 bit Linux before.

Unfortunately there doesn't seem to be anywhere upstream to report these issues.

I agree that the safe course of action is to fall back to MPFR for now on 32-bit systems, at least for the failing functions.

Yes it would be great to import the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants