Skip to content

[browser][CoreCLR][R2R] Double Max/Min do not preserve selected NaN payload #134268

Closed

Description

@lewing

Description

The trimmed browser-wasm CoreCLR ReadyToRun library-test lane exposes four generic-math double.Max/double.Min cases where the selected NaN operand's sign/payload is not preserved. The assertion output renders both values as NaN, but the bitwise comparison detects that the result differs from the expected operand.

This resembles #133311, but that issue is explicitly scoped to Mono browser-wasm. This issue tracks the distinct CoreCLR ReadyToRun configuration so its quarantine and re-enable condition are independent.

Reproduction Steps

Run System.Runtime.Tests using browser-wasm CoreCLR with trimmed ReadyToRun images:

XHARNESS_COMMAND=test-browser ./dotnet.sh build /t:Test \
  src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj \
  /p:TargetOS=browser /p:TargetArchitecture=wasm /p:RuntimeFlavor=CoreCLR /p:Configuration=Release \
  /p:TestWasmReadyToRun=true /p:EnableAggressiveTrimming=true \
  /p:Scenario=WasmTestOnChrome /p:InstallChromeForTests=true

The affected member-data rows are the positive/negative NaN payload cases in MaxDouble and MinDouble from src/libraries/Common/tests/System/GenericMathTestMemberData.cs.

Expected behavior

double.Max and double.Min return the selected NaN operand with its sign and payload preserved, matching the generic-math test expectations.

Actual behavior

Four rows fail because the returned NaN has different bits from the expected NaN operand:

  • MaxDouble: positive NaN with -0.0
  • MaxDouble: -0.0 with negative NaN
  • MinDouble: positive NaN with -0.0
  • MinDouble: -0.0 with negative NaN

Regression?

Unknown. The new full trimmed ReadyToRun library sweep first exposed the behavior.

Known Workarounds

Temporarily omit only these four member-data rows when PlatformDetection.IsWasmReadyToRun is true.

Configuration

  • Runtime: CoreCLR
  • Target: browser-wasm
  • Mode: ReadyToRun with aggressive trimming
  • Browser: Chrome
  • Architecture: wasm32

Other information

Related Mono-specific issue: #133311.

Note

This issue was created by GitHub Copilot based on locally reproduced CI evidence.

Activity

  1. added
    untriaged
    on Sep 19, 2026
  2. dotnet-policy-service commented on Sep 19, 2026

    @dotnet-policy-service
    Contributor

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

  3. added this to the 12.0.0 milestone on Sep 19, 2026
  4. added
    arch-wasm
    and removed
    arch-wasm
    on Sep 19, 2026
  5. removed
    untriaged
    on Sep 19, 2026
  6. dotnet-policy-service commented on Sep 19, 2026

    @dotnet-policy-service
    Contributor

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

  7. added
    arch-wasm
    on Sep 19, 2026
  8. lewing commented on Sep 19, 2026

    @lewing
    MemberAuthor
  9. dotnet-policy-service commented on Sep 19, 2026

    @dotnet-policy-service
    Contributor

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

  10. added
    disabled-test
    on Sep 21, 2026
  11. added a commit that references this issue on Sep 22, 2026
    d4b2951
  12. locked and limited conversation to collaborators on Oct 22, 2026
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-wasmarea-ReadyToRundisabled-test

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions