Skip to content

Fix for out of range mask pattern assert - #132981

Merged
dhartglassMSFT merged 3 commits into
dotnet:mainfrom
dhartglassMSFT:132910
Sep 16, 2026
Merged

dhartglassMSFT merged 3 commits into
dotnet:mainfrom
dhartglassMSFT:132910

Conversation

@dhartglassMSFT

@dhartglassMSFT dhartglassMSFT commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

EvaluateSimdPatternToMask assertion if an out-of-range mask pattern was supplied

Sve.CreateTrueMaskSingle(SveMaskPattern.VectorCount5);

The evaluator should instead allow this through and treat mask constant as all zeros:
https://support.arm.com/documentation/ddi0602/2026-06/SVE-Instructions/PTRUE--predicate---Initialize-predicate-from-named-constraint-?lang=en

fixes #132910

@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 Aug 31, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 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.

@dhartglassMSFT

Copy link
Copy Markdown
Contributor Author

Hi @a74nh or @SwapnilGaikwad very small change here, but appreciate a quick look to make sure I got this case right

One of the fuzzers hits this case frequently

@azure-pipelines

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

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.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes SVE mask-pattern constant evaluation in the CoreCLR JIT so that out-of-range SveMaskPattern values no longer trip an assertion and instead produce an all-false mask, and adds a regression test.

Changes:

  • Update EvaluateSimdPatternToMask to treat patterns that exceed the current vector lane count as “no active lanes” (all zeros) instead of asserting.
  • Add a JIT regression test covering Sve.CreateTrueMask* with an out-of-range SveMaskPattern.
  • Wire the new regression test into the merged regression test project.
File summaries
File Description
src/coreclr/jit/simd.h Adjusts SVE pattern→mask evaluation to handle out-of-range patterns by producing an all-false mask instead of asserting.
src/tests/JIT/Regression/JitBlue/Runtime_132910/Runtime_132910.cs Adds a regression test for Sve.CreateTrueMask* handling out-of-range mask patterns.
src/tests/JIT/Regression/Regression_ro_2.csproj Includes the new regression test in the merged regression project.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/tests/JIT/Regression/JitBlue/Runtime_132910/Runtime_132910.cs
Comment thread src/tests/JIT/Regression/JitBlue/Runtime_132910/Runtime_132910.cs Outdated
@SwapnilGaikwad

Copy link
Copy Markdown
Contributor

Hi @a74nh or @SwapnilGaikwad very small change here, but appreciate a quick look to make sure I got this case right

One of the fuzzers hits this case frequently

Overall LGTM! Copilot's comments are worth adding, especially the VL>128bits scenario.

Copilot AI review requested due to automatic review settings September 2, 2026 20:42

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.

🟢 Approval recommended

The behavioral change is localized, matches documented SVE semantics for out-of-range constraints, and is covered by a targeted regression test.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@dhartglassMSFT
dhartglassMSFT enabled auto-merge (squash) September 10, 2026 22:20
Copilot AI review requested due to automatic review settings September 10, 2026 22:20

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.

🟢 Approval recommended

The fix and regression coverage address the reported assertion.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@dhartglassMSFT

Copy link
Copy Markdown
Contributor Author

@EgorBo can you sign off again? Merge conflicts in new regression test

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.

🟢 Approval recommended

No unresolved review issues remain.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@dhartglassMSFT

Copy link
Copy Markdown
Contributor Author

wasm failure is 134018, plus unrelated failure in mono

@dhartglassMSFT

Copy link
Copy Markdown
Contributor Author

/ba-g known wasm and mono test failures

@dhartglassMSFT
dhartglassMSFT merged commit cc91aab into dotnet:main Sep 16, 2026
139 of 142 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 17, 2026
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
EvaluateSimdPatternToMask assertion if an out-of-range mask pattern was
supplied

`Sve.CreateTrueMaskSingle(SveMaskPattern.VectorCount5);`

The evaluator should instead allow this through and treat mask constant
as all zeros:

https://support.arm.com/documentation/ddi0602/2026-06/SVE-Instructions/PTRUE--predicate---Initialize-predicate-from-named-constraint-?lang=en

fixes dotnet#132910
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.

ARM64: jit assertion finalOne <= count

4 participants