From b8e3135c71e8dd9b1d05b5a7b4d61215d5066770 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 9 Nov 2024 19:46:41 -0800 Subject: [PATCH] xsimd: reduce precision to fix asin test `asin` test fails on darwin with clang-19. reduce the test precision epsilon to 1e-7 fixes the test --- pkgs/by-name/xs/xsimd/package.nix | 3 +++ pkgs/by-name/xs/xsimd/relax-asin-precision.diff | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/by-name/xs/xsimd/relax-asin-precision.diff diff --git a/pkgs/by-name/xs/xsimd/package.nix b/pkgs/by-name/xs/xsimd/package.nix index 622f11f400bc6..ad806a6a7d468 100644 --- a/pkgs/by-name/xs/xsimd/package.nix +++ b/pkgs/by-name/xs/xsimd/package.nix @@ -26,6 +26,9 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # https://github.com/xtensor-stack/xsimd/issues/1030 ./disable-test_error_gamma.patch + + # https://github.com/xtensor-stack/xsimd/issues/1063 + ./relax-asin-precision.diff ]; # strictDeps raises the chance that xsimd will be able to be cross compiled diff --git a/pkgs/by-name/xs/xsimd/relax-asin-precision.diff b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff new file mode 100644 index 0000000000000..7623f6e81e4a0 --- /dev/null +++ b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff @@ -0,0 +1,14 @@ +diff --git a/test/test_xsimd_api.cpp b/test/test_xsimd_api.cpp +index f416ae9..1f8253e 100644 +--- a/test/test_xsimd_api.cpp ++++ b/test/test_xsimd_api.cpp +@@ -468,7 +468,8 @@ struct xsimd_api_float_types_functions + void test_asin() + { + value_type val(1); +- CHECK_EQ(extract(xsimd::asin(T(val))), std::asin(val)); ++ CHECK(extract(xsimd::asin(T(val))) ++ == doctest::Approx(std::asin(val)).epsilon(1e-7)); + } + void test_asinh() + {