From 1de366d3b3d175dec3d8cef19665785301167793 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 01:53:24 +0000 Subject: [PATCH 1/2] Widen Tan tolerance for vectorized ARM64 divergence The previous fix (PR #129652) set trigTolerance to 1e-5f/1e-14 for float/double when FMA is supported, but the test still fails on iossimulator-arm64 (153/201 items for Single, 123/201 for Double). Tan = Sin/Cos amplifies range-reduction rounding errors for large radian inputs (-100 to 100), requiring a wider tolerance than Sin or Cos individually. Use the non-FMA tolerance values (1e-4f/1e-10) specifically for Tan, matching the pattern used by SinPi. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs b/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs index f61944f17d156b..97e5e08de6d169 100644 --- a/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs +++ b/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs @@ -507,7 +507,9 @@ public static IEnumerable SpanDestinationFunctionsToTest() yield return Create(TensorPrimitives.Sinh, T.Sinh, Helpers.DetermineTolerance(doubleTolerance: 1e-14)); yield return Create(TensorPrimitives.SinPi, T.SinPi, Helpers.DetermineTolerance(doubleTolerance: 1e-13, floatTolerance: 1e-4f)); yield return Create(TensorPrimitives.Sqrt, T.Sqrt); - yield return Create(TensorPrimitives.Tan, T.Tan, trigTolerance); + // Tan = Sin/Cos amplifies range-reduction rounding for large radian inputs, + // so it needs wider tolerance than individual trig functions (matches non-FMA tolerance). + yield return Create(TensorPrimitives.Tan, T.Tan, Helpers.DetermineTolerance(doubleTolerance: 1e-10, floatTolerance: 1e-4f)); yield return Create(TensorPrimitives.Tanh, T.Tanh); yield return Create(TensorPrimitives.TanPi, T.TanPi); yield return Create(TensorPrimitives.Truncate, T.Truncate); From 064ba0bc536b3083ec5f48ff243eb8b6cc7b7f12 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Jun 2026 01:53:29 +0000 Subject: [PATCH 2/2] ci: trigger checks