You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[wasm] TensorPrimitives.Tan returns +0.0 for range-reduced Half inputs when Vector128 is accelerated without FMA #135117
TensorPrimitives.Tan for Half returns +0.0 for inputs that need range reduction on WebAssembly when Vector128 is hardware accelerated (seen in the CoreCLR WASI composite ReadyToRun lane; the WASI interpreter lane, where Vector128 isn't accelerated, passes).
This lines up with #134914, which rewrote Tan range reduction and added these tests. When neither Fma.IsSupported nor AdvSimd.Arm64.IsSupported, the new path does the non-fused multiply-adds and, if |f| < dn * TanNonFusedReductionThreshold, falls back to ApplyScalar<TanOperatorSingle>(x). WebAssembly has accelerated Vector128 but no FMA, so it's essentially the only configuration that takes this branch (x64 with FMA and Arm64 take the fused path; non-accelerated configurations take the scalar path). Half is widened to float and goes through TanOperator<float>. Only the Half instantiations fail; float/double pass.
[FAIL] System.Numerics.Tensors.Tests.HalfGenericTensorPrimitives.Tan_RangeReduction(length: 2, inputKind: 0)
Expected: -407.25
Actual: +0.0
[FAIL] System.Numerics.Tensors.Tests.TensorTests.TensorTanPreservesScalarAccuracy(layout: 2, columns: 33)
Expected: -407.25
Actual: +0.0
[FAIL] System.Numerics.Tensors.Tests.HalfGenericTensorPrimitives.SpanDestinationFunctions_InPlace(... Tan ...)
Assert.All() Failure: 6 out of 257 items in the collection did not pass.
Expected: -0.92969
Actual: +0.0
34 failures in System.Numerics.Tensors.Tests (Helix jobs e1cac54a-421c-439e-b0cd-8d98aff74c83 and eccd7d69-de48-4cc1-87fd-6036eb264d50, #134813). Tan_RangeReduction, SpanDestinationFunctions_InPlace and TensorTanPreservesScalarAccuracy are disabled via ActiveIssue on wasm with accelerated Vector128 (all element types) in #134813; the right scoping or fix is left to the area owner.
changed the title [-][wasi][R2R] Half Tan returns +0.0 for range-reduced inputs[/-][+][wasm] TensorPrimitives.Tan returns +0.0 for range-reduced Half inputs when Vector128 is accelerated without FMA[/+]on Oct 2, 2026
Activity
dotnet-policy-service commentedon Oct 2, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Oct 2, 2026
Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
See info in area-owners.md if you want to be subscribed.
[-][wasi][R2R] Half Tan returns +0.0 for range-reduced inputs[/-][+][wasm] TensorPrimitives.Tan returns +0.0 for range-reduced Half inputs when Vector128 is accelerated without FMA[/+][wasi] Quarantine remaining WASI ReadyToRun library failures
[wasi] Quarantine remaining WASI ReadyToRun library failures