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.
Description
TensorPrimitives.TanforHalfreturns+0.0for inputs that need range reduction on WebAssembly whenVector128is hardware accelerated (seen in the CoreCLR WASI composite ReadyToRun lane; the WASI interpreter lane, whereVector128isn't accelerated, passes).This lines up with #134914, which rewrote
Tanrange reduction and added these tests. When neitherFma.IsSupportednorAdvSimd.Arm64.IsSupported, the new path does the non-fused multiply-adds and, if|f| < dn * TanNonFusedReductionThreshold, falls back toApplyScalar<TanOperatorSingle>(x). WebAssembly has acceleratedVector128but 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).Halfis widened tofloatand goes throughTanOperator<float>. Only theHalfinstantiations fail;float/doublepass.cc @tannergooding
34 failures in
System.Numerics.Tensors.Tests(Helix jobs e1cac54a-421c-439e-b0cd-8d98aff74c83 and eccd7d69-de48-4cc1-87fd-6036eb264d50, #134813).Tan_RangeReduction,SpanDestinationFunctions_InPlaceandTensorTanPreservesScalarAccuracyare disabled viaActiveIssueon wasm with acceleratedVector128(all element types) in #134813; the right scoping or fix is left to the area owner.Note
This issue was drafted with GitHub Copilot.