Repository navigation
Description
Description
Mono on browser-wasm does not preserve the selected NaN sign/payload for double.Max and double.Min. The newly added shared generic-math cases from #133173 expose this on both Linux and Windows Chrome legs.
The assertion output renders both values as NaN, but AssertExtensions.Equal performs the required bitwise comparison and detects that the returned NaN differs from the expected operand.
Reproduction Steps
Run System.Runtime.Tests on browser-wasm with Mono and execute these generic-math cases:
double positiveNaN = BitConverter.Int64BitsToDouble(0x7FF8_0000_0000_0001);
double negativeNaN = BitConverter.Int64BitsToDouble(unchecked((long)0xFFF8_0000_0000_0001));
AssertExtensions.Equal(positiveNaN, NumberHelper<double>.Max(positiveNaN, -0.0));
AssertExtensions.Equal(negativeNaN, NumberHelper<double>.Max(-0.0, negativeNaN));
AssertExtensions.Equal(positiveNaN, NumberHelper<double>.Min(positiveNaN, -0.0));
AssertExtensions.Equal(negativeNaN, NumberHelper<double>.Min(-0.0, negativeNaN));CI evidence from runtime build 1584442:
- Linux Chrome: https://helix.dot.net/api/2019-06-17/jobs/1bc2e74b-084b-4d4b-8616-127a27a8b835/workitems/WasmTestOnChrome-MONO-ST-System.Runtime.Tests/console
- Windows Chrome: https://helix.dot.net/api/2019-06-17/jobs/79beaa1b-6788-4e45-93c5-ac799575551c/workitems/WasmTestOnChrome-MONO-ST-System.Runtime.Tests/console
Expected behavior
double.Max and double.Min return the selected NaN operand with its sign and payload preserved, matching the API contract and other runtimes.
Actual behavior
All four cases fail bitwise equality on Mono browser-wasm:
[FAIL] System.Tests.DoubleTests_GenericMath.MaxTest(x: NaN, y: -0, expectedResult: NaN)
[FAIL] System.Tests.DoubleTests_GenericMath.MaxTest(x: -0, y: NaN, expectedResult: NaN)
[FAIL] System.Tests.DoubleTests_GenericMath.MinTest(x: NaN, y: -0, expectedResult: NaN)
[FAIL] System.Tests.DoubleTests_GenericMath.MinTest(x: -0, y: NaN, expectedResult: NaN)
Regression?
The failing inputs were added to shared test data by #133173. That PR fixed a CoreCLR SIMD constant-folding issue but did not change Mono lowering, so this appears to expose a pre-existing Mono correctness gap rather than introduce it.
Known Workarounds
Temporarily quarantine the affected DoubleTests_GenericMath.MaxTest and MinTest theories on Mono browser-wasm using this issue as the ActiveIssue reference.
Configuration
- .NET 11 CI build from dotnet/runtime main/PR validation
- Mono browser-wasm
- Reproduces under headless Chrome on Linux x64 and Windows x64
- Four failures out of 77,353 test cases in each affected work item
Other information
Related test expansion: #133173. The implementation should be checked for IEEE 754 minimum/maximum lowering that canonicalizes or otherwise changes a NaN operand rather than preserving its bits.
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1584442
Build error leg or test failing: browser-wasm Linux and Windows Release LibraryTests - WasmTestOnChrome-MONO-ST-System.Runtime.Tests
Pull request: #130050
KBE authoring guidance (ci-failure-scan)
Error Detailsis for readers. Paste the full exception, stack trace, or build error excerpt so the failure is understandable without opening the raw log.- Build Analysis parses only the single JSON block under
Error Message. ErrorPatternuses .NETSingleline | IgnoreCase | NonBacktrackingmatching with a 50ms-per-line timeout.- Keep the regex anchored, prefer
[^\n]*over.*, and avoid catastrophic backtracking. - Set
BuildRetrytotrueonly for a clear infrastructure retry case.ExcludeConsoleLogdisables Helix console-log scanning.
Error Details
[FAIL] System.Tests.DoubleTests_GenericMath.MaxTest(x: NaN, y: -0, expectedResult: NaN)
Assert.Equal() Failure: Values differ
Expected: NaN
Actual: NaN
[FAIL] System.Tests.DoubleTests_GenericMath.MaxTest(x: -0, y: NaN, expectedResult: NaN)
[FAIL] System.Tests.DoubleTests_GenericMath.MinTest(x: NaN, y: -0, expectedResult: NaN)
[FAIL] System.Tests.DoubleTests_GenericMath.MinTest(x: -0, y: NaN, expectedResult: NaN)
Error Message
{
"ErrorMessage": "",
"ErrorPattern": "^[^\\n]*\\[FAIL\\] System\\.Tests\\.DoubleTests_GenericMath\\.(Max|Min)Test\\(x: (NaN, y: -0|-0, y: NaN), expectedResult: NaN\\)",
"BuildRetry": false,
"ExcludeConsoleLog": false
}Agentic workflow metadata (ci-failure-scan)
Workflow artifact: ci-failure-scan
Artifact kind: kbe-verification
Verified match count: 8 hits in failure.log
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 0 | 0 |
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1584442
Result validation:
Validation performed at: 9/5/2026 9:16:02 PM UTC
Note
This issue was generated with GitHub Copilot.
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1584442
Error message validated: [^[^\n]*\[FAIL\] System\.Tests\.DoubleTests_GenericMath\.(Max|Min)Test\(x: (NaN, y: -0|-0, y: NaN), expectedResult: NaN\)]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/5/2026 9:24:25 PM UTC
Note
This issue was generated with GitHub Copilot.
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 0 | 62 |
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1584442
Result validation:
Validation performed at: 9/5/2026 9:16:02 PM UTC
Note
This issue was generated with GitHub Copilot.
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1584442
Error message validated: [^[^\n]*\[FAIL\] System\.Tests\.DoubleTests_GenericMath\.(Max|Min)Test\(x: (NaN, y: -0|-0, y: NaN), expectedResult: NaN\)]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/5/2026 9:24:25 PM UTC
Note
This issue was generated with GitHub Copilot.
Activity
dotnet-policy-service commentedon Sep 5, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Sep 5, 2026
Tagging subscribers to this area: @steveisok
See info in area-owners.md if you want to be subscribed.
[Mono][browser] Quarantine double Min/Max NaN payload tests (#133312)
agocke commentedon Oct 14, 2026
Fixed by 20f7be9