Skip to content

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

Closed

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.

Activity

  1. added
    arch-wasmWebAssembly architecture
    os-wasiRelated to WASI variant of arch-wasm
    on Oct 2, 2026
  2. added this to the 12.0.0 milestone on Oct 2, 2026
  3. dotnet-policy-service commented on Oct 2, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
    See info in area-owners.md if you want to be subscribed.

  4. dotnet-policy-service commented on Oct 2, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-numerics
    See info in area-owners.md if you want to be subscribed.

  5. added
    disabled-testThe test is disabled in source code against the issue
    on Oct 5, 2026
  6. lewing commented on Oct 6, 2026

    @lewing
    MemberAuthor
  7. added a commit that references this issue on Oct 17, 2026
    d80abfc
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