Skip to content

Update outerloop convert tests for saturating float/double casts#130974

Merged
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:tannergooding-fix-outerloop-convert-saturation
Jul 17, 2026
Merged

Update outerloop convert tests for saturating float/double casts#130974
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:tannergooding-fix-outerloop-convert-saturation

Conversation

@tannergooding

Copy link
Copy Markdown
Member

The saturating float/double -> small integral cast changes from #128604 were not reflected in two outerloop tests, breaking CI (see #130962 (comment)).


JIT/Regression/CLR-x86-JIT/V1-M10/b05617: under saturation conv.u1 of 2.564783e7 now yields 255 (was 214) and conv.i1 of 5246667200 yields 127 (was -1). Propagating through the stack, the final conv.u4 constant is updated 4294967086 -> 4294967043 so the test still returns 100. Mono still truncates, so the test is marked unsupported on Mono, referencing the same tracking issue (#100368) used by the JIT regression test in #128604.


JIT/IL_Conformance/Convert/TestConvertFromIntegral: the two checked ushort.MaxValue -> short via Conv_I2 cases now saturate to short.MaxValue on CoreCLR instead of truncating to -1. Since the result is now runtime-divergent (Mono truncates), they are marked UnspecifiedBehaviour, consistent with how every other cross-runtime-divergent float->integral out-of-range case in this file is already handled. This keeps the rest of the file running on Mono.

Verified locally against a checked runtime: b05617 returns 100 and TestConvertFromIntegral reports "All tests passed".

Note

This PR description was drafted by Copilot.

The saturating float/double -> small integral cast changes from dotnet#128604
were not reflected in JIT/IL_Conformance/Convert/TestConvertFromIntegral
and JIT/Regression/CLR-x86-JIT/V1-M10/b05617, breaking outerloop.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 17, 2026 14:39
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 17, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates JIT test expectations/coverage to align with the current saturating semantics for out-of-range float/double → small integral conversions, preventing outerloop CI failures while keeping Mono runs green by skipping or relaxing runtime-divergent assertions.

Changes:

  • Mark b05617 as unsupported on Mono (where conversions still truncate) and adjust its IL constant to preserve the expected final result under CoreCLR’s saturating behavior.
  • Treat the ushort.MaxValue → short cases (via Conv_I2) in TestConvertFromIntegral as unspecified behavior to accommodate CoreCLR/Mono divergence.
Show a summary per file
File Description
src/tests/JIT/Regression/CLR-x86-JIT/V1-M10/b05617/b05617.ilproj Skips this test on Mono via CLRTestTargetUnsupported due to runtime behavioral divergence.
src/tests/JIT/Regression/CLR-x86-JIT/V1-M10/b05617/b05617.il Updates an ldc.i8 constant so the test continues to return the expected value under saturating cast semantics.
src/tests/JIT/IL_Conformance/Convert/TestConvertFromIntegral.cs Marks the two runtime-divergent ushort.MaxValue → short checked conversions as UnspecifiedBehaviour, consistent with other out-of-range float/double cases in the file.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

@tannergooding

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@tannergooding

Copy link
Copy Markdown
Member Author

CC. @jakobbotsch, @EgorBo, @radekdoulik for the other outerloop fix

@tannergooding

Copy link
Copy Markdown
Member Author

/ba-g unrelated failures, fixing outerloop tests

@tannergooding
tannergooding enabled auto-merge (squash) July 17, 2026 22:18
@tannergooding
tannergooding merged commit 1c124aa into dotnet:main Jul 17, 2026
139 of 145 checks passed
@tannergooding
tannergooding deleted the tannergooding-fix-outerloop-convert-saturation branch July 17, 2026 22:18
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed test: JIT\Regression\CLR-x86-JIT\V1-M10\b05617\b05617\b05617.dll

3 participants