From d10230a807037f39b530b80f6c49bec55b6cca50 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 18 Dec 2025 19:12:12 +0200 Subject: [PATCH 1/3] xsimd: always apply all patches --- pkgs/by-name/xs/xsimd/package.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/xs/xsimd/package.nix b/pkgs/by-name/xs/xsimd/package.nix index 0a3cabfc2969..8167578282e9 100644 --- a/pkgs/by-name/xs/xsimd/package.nix +++ b/pkgs/by-name/xs/xsimd/package.nix @@ -17,8 +17,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-L4ttJxP46uNwQAEUMoJ8rsc51Le2GeIGbT1kX7ZzcPA="; }; - patches = lib.optionals stdenv.hostPlatform.isDarwin [ - # https://github.com/xtensor-stack/xsimd/issues/1030 + patches = [ + # See: https://github.com/xtensor-stack/xsimd/issues/1030 + # + # NOTE: Although the patch is needed only on Darwin, it is safer to always + # include it, to avoid a situation an linux user trying to update the + # package fails to notice it doesn't apply on their platform. We prefer not + # performing this test on linux platforms too although it should pass. ./disable-test_error_gamma.patch # https://github.com/xtensor-stack/xsimd/issues/1063 From 59bf4794ba011b6331356e6da74c12d4c15332a2 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 22 Mar 2026 00:33:45 +0200 Subject: [PATCH 2/3] xsimd: make gamma test patch minimal --- .../xs/xsimd/disable-test_error_gamma.patch | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch b/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch index 49957ea62ed7..5967c1efd8c0 100644 --- a/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch +++ b/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch @@ -1,30 +1,13 @@ diff --git i/test/test_error_gamma.cpp w/test/test_error_gamma.cpp -index 214cbb5..299e5b8 100644 +index 214cbb5..6c30605 100644 --- i/test/test_error_gamma.cpp +++ w/test/test_error_gamma.cpp -@@ -131,25 +131,6 @@ struct error_gamma_test +@@ -131,7 +131,7 @@ struct error_gamma_test INFO("lgamma"); CHECK_EQ(diff, 0); } -#if !(XSIMD_WITH_AVX && !XSIMD_WITH_AVX2) -- -- // tgamma (negative input) -- { -- std::transform(gamma_neg_input.cbegin(), gamma_neg_input.cend(), expected.begin(), -- [](const value_type& v) -- { return std::lgamma(v); }); -- batch_type in, out; -- for (size_t i = 0; i < nb_input; i += size) -- { -- detail::load_batch(in, gamma_neg_input, i); -- out = lgamma(in); -- detail::store_batch(out, res, i); -- } -- size_t diff = detail::get_nb_diff(res, expected); -- INFO("lgamma (negative input)"); -- CHECK_EQ(diff, 0); -- } --#endif - } - }; ++#if 0 && !(XSIMD_WITH_AVX && !XSIMD_WITH_AVX2) + // tgamma (negative input) + { From c08ceb2ee40fa7bafe15765de48e43721e8dcc8a Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 18 Dec 2025 19:08:30 +0200 Subject: [PATCH 3/3] xsimd: 13.2.0 -> 14.2.0 Diff: https://github.com/xtensor-stack/xsimd/compare/13.2.0...14.2.0 Changelog: https://github.com/xtensor-stack/xsimd/blob/14.2.0/Changelog.rst#1400 Main changes relevant to us are: - Upstream now includes CI for aarch64 and other platforms, so they run the package's tests continously, and hence shouldn't produce releases that fail to build or the tests on aarch64-linux etc. - All the local patches we had now can be removed thanks to the following issues resolved: * https://github.com/xtensor-stack/xsimd/issues/1063 * https://github.com/xtensor-stack/xsimd/issues/1232 --- .../xs/xsimd/disable-test_error_gamma.patch | 13 ------------- pkgs/by-name/xs/xsimd/package.nix | 17 ++--------------- pkgs/by-name/xs/xsimd/relax-asin-precision.diff | 14 -------------- 3 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch delete mode 100644 pkgs/by-name/xs/xsimd/relax-asin-precision.diff diff --git a/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch b/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch deleted file mode 100644 index 5967c1efd8c0..000000000000 --- a/pkgs/by-name/xs/xsimd/disable-test_error_gamma.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git i/test/test_error_gamma.cpp w/test/test_error_gamma.cpp -index 214cbb5..6c30605 100644 ---- i/test/test_error_gamma.cpp -+++ w/test/test_error_gamma.cpp -@@ -131,7 +131,7 @@ struct error_gamma_test - INFO("lgamma"); - CHECK_EQ(diff, 0); - } --#if !(XSIMD_WITH_AVX && !XSIMD_WITH_AVX2) -+#if 0 && !(XSIMD_WITH_AVX && !XSIMD_WITH_AVX2) - - // tgamma (negative input) - { diff --git a/pkgs/by-name/xs/xsimd/package.nix b/pkgs/by-name/xs/xsimd/package.nix index 8167578282e9..1b9e1f3e4788 100644 --- a/pkgs/by-name/xs/xsimd/package.nix +++ b/pkgs/by-name/xs/xsimd/package.nix @@ -8,28 +8,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "xsimd"; - version = "13.2.0"; + version = "14.2.0"; src = fetchFromGitHub { owner = "xtensor-stack"; repo = "xsimd"; tag = finalAttrs.version; - hash = "sha256-L4ttJxP46uNwQAEUMoJ8rsc51Le2GeIGbT1kX7ZzcPA="; + hash = "sha256-BTiN4B3//wlB3nmOoluM/7bL7J7YIBp5afih9zUP1yw="; }; - patches = [ - # See: https://github.com/xtensor-stack/xsimd/issues/1030 - # - # NOTE: Although the patch is needed only on Darwin, it is safer to always - # include it, to avoid a situation an linux user trying to update the - # package fails to notice it doesn't apply on their platform. We prefer not - # performing this test on linux platforms too although it should pass. - ./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 strictDeps = true; diff --git a/pkgs/by-name/xs/xsimd/relax-asin-precision.diff b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff deleted file mode 100644 index 7623f6e81e4a..000000000000 --- a/pkgs/by-name/xs/xsimd/relax-asin-precision.diff +++ /dev/null @@ -1,14 +0,0 @@ -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() - {