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

Some tests fail on arm64 on macOS #11

Open
dyfer opened this issue Oct 28, 2022 · 2 comments
Open

Some tests fail on arm64 on macOS #11

dyfer opened this issue Oct 28, 2022 · 2 comments

Comments

@dyfer
Copy link

dyfer commented Oct 28, 2022

After commenting out tests that wouldn't compile (see #10), here are the tests that fail on arm64 on macOS (Apple M1 CPU, Clang):

./simd_binary_tests
Running 65 test cases...
/path/to/nova-simd/testsuite/test_helper.hpp:50: fatal error: in "over_comparer_vv": difference{7.00122e-07} between ref[i]{0.766212404} and test[i]{0.766211867} exceeds 2.00000002e-07
/path/to/nova-simd/testsuite/test_helper.hpp:50: fatal error: in "over_comparer_vs": difference{2.06854e-07} between ref[i]{0.576296568} and test[i]{0.576296449} exceeds 2.00000002e-07
/path/to/nova-simd/testsuite/test_helper.hpp:50: fatal error: in "over_comparer_sv": difference{4.0017e-06} between ref[i]{0.253213376} and test[i]{0.253212363} exceeds 2.00000002e-07

*** 3 failures are detected in the test module "Master Test Suite"
./simd_unary_tests
Running 9 test cases...
/path/to/nova-simd/testsuite/test_helper.hpp:50: fatal error: in "reciprocal_tester": difference{3.81471e-06} between ref[i]{1} and test[i]{0.999996185} exceeds 9.99999997e-07

*** 1 failure is detected in the test module "Master Test Suite"
./simd_math_tests
Running 14 test cases...
/path/to/nova-simd/testsuite/test_helper.hpp:50: fatal error: in "signed_sqrt_tests": difference{0.00207162} between ref[i]{-4.46289062} and test[i]{-4.47213602} exceeds 4.99999987e-06

*** 1 failure is detected in the test module "Master Test Suite"
./vec_test
Running 4 test cases...
/path/to/nova-simd/testsuite/vec_test.cpp:153: fatal error: in "reciprocal_tester": difference{3.81471e-06} between result{0.249999046} and 0.25{0.25} exceeds 1e-05%

*** 1 failure is detected in the test module "Master Test Suite"

In particular simd_math_tests seems to be catching an issue we see in SuperCollider with the behavior of sqrt.
I'd be happy to try any solutions you might have, but I don't know enough to propose the fixes on my own. I'd appreciate any help with that. Thanks!

@timblechmann
Copy link
Owner

could you try to changes this?

    static inline float32x4_t gen_sign_mask(void)
    {
        static const int sign_mask = 0x80000000;
        float * casted = (float*)(&sign_mask);
        return vdupq_n_f32(*casted);
    }

to

    static inline float32x4_t gen_sign_mask(void)
    {
        return set_bitmask(0x80000000);
    }

and similar for gen_abs_mask?

@dyfer
Copy link
Author

dyfer commented Nov 2, 2022

Yes, after looking at the SSE implementation I tried that already. It compiles, but the error is still there - it gives the same result as the original code - difference{0.00207162} in the simd_math_tests is the same.

dyfer added a commit to dyfer/supercollider that referenced this issue Nov 6, 2022
Disable recip and sqrt from nova-simd on arm64 due to an issue upstream: timblechmann/nova-simd#11
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