Skip to content

[wasi][R2R] BFloat16 conversions from Int128/UInt128 produce wrong values #135116

Description

@lewing

Description

In the CoreCLR WASI composite ReadyToRun library lane (LibraryTestsCoreCLR_WASI_R2R, trimmed), BFloat16 explicit conversions from Int128/UInt128 produce wrong values. The same tests pass in the WASI interpreter lane, so the R2R (RyuJIT wasm) code is wrong.

[FAIL] System.Numerics.Tests.BFloat16Tests.ExplicitConversion_FromInt128(i: 16563852592415126800007719339717296127, expected: 2.99E-26)
Expected: 2.9888E-26
Actual:   1.6532E+37
[FAIL] System.Numerics.Tests.BFloat16Tests.ExplicitConversion_FromInt128(i: 336347874021343232, expected: 0)
Expected:  +0.0
Actual:   3.3552E+17
[FAIL] System.Numerics.Tests.BFloat16Tests.ExplicitConversion_FromUInt128(...)

Reproduces locally (macOS arm64 host, wasmtime 49.0.1): System.Runtime.Tests built with /p:TestWasmReadyToRun=true /p:EnableAggressiveTrimming=true, class filter System.Numerics.Tests.BFloat16Tests: 1608 run, 3 failed.

Seen in Helix job eccd7d69-de48-4cc1-87fd-6036eb264d50 (#134813) and earlier runs. Quarantined on WASI R2R in #134813.

Note

This issue was drafted with GitHub Copilot.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmWebAssembly architecturearea-System.Numericsdisabled-testThe test is disabled in source code against the issueos-wasiRelated to WASI variant of arch-wasm

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions