Repository navigation
Closed
Labels
JitStressCLR JIT issues involving JIT internal stress modesarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runs
Description
Failed in: runtime-coreclr libraries-jitstress-random 20260425.1
Failed tests:
net11.0-linux-Release-x64-jitstress_random_1-AzureLinux.3.Amd64.Open
- System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test
net11.0-linux-Release-x64-jitstress_random_2-AzureLinux.3.Amd64.Open
- System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test
Error message:
Assert.Equal() Failure: Values differ
Expected: <-2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648>
Actual: <-107374176, -107374176, -107374176, -107374176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>
Stack trace:
at System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test() in /_/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs:line 6367
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs:line 39
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
Kusto query result:
| Queued | Pipeline | Pipeline Configuration | OS | Arch | Test | Outcome | Properties | Build Reason |
|---|---|---|---|---|---|---|---|---|
| 2026-04-26 10:56:04.460000+00:00 | runtime-extra-platforms | Release | osx.15.amd64.open | x64 | System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test | Failed | {"operatingSystem":"OSX.15.Amd64.Open","System.PhaseAttempt":"2","BuildNumber":"20260425.1","System.JobAttempt":"2","System.JobId":"440ea7f6-c32f-5952-47d6-56dae7644f8a","configuration":"Release","BuildId":"1396883","Project":"public","DefinitionName":"runtime-extra-platforms","System.StageAttempt":"2","System.JobName":"__default","CollectionUri":"https://dev.azure.com/dnceng-public/","DefinitionId":"154","System.StageName":"Build","runtimeFlavor":"coreclr","AzurePipelinesTestRunId":"38961892","System.PhaseName":"build_iossimulator_x64_Release_AllSubsets_CoreCLR","Reason":"Schedule","architecture":"x64"} | Schedule |
| 2026-04-26 04:30:03.811000+00:00 | runtime-extra-platforms | Release | osx.15.amd64.open | x64 | System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test | Failed | {"Project":"public","BuildNumber":"20260425.1","System.JobAttempt":"1","DefinitionId":"154","BuildId":"1396883","Reason":"Schedule","configuration":"Release","System.PhaseAttempt":"1","DefinitionName":"runtime-extra-platforms","CollectionUri":"https://dev.azure.com/dnceng-public/","System.PhaseName":"build_iossimulator_x64_Release_AllSubsets_CoreCLR","System.JobId":"d413ef91-6ac1-5648-b23b-ad89eaf81672","System.StageName":"Build","runtimeFlavor":"coreclr","architecture":"x64","System.JobName":"__default","AzurePipelinesTestRunId":"38959244","System.StageAttempt":"1","operatingSystem":"OSX.15.Amd64.Open"} | Schedule |
| 2026-04-25 22:32:01.769000+00:00 | runtime-nativeaot-outerloop | Release | azurelinux.3.amd64.open.rt | x64 | System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test | Failed | {"System.JobId":"abdbb26b-d534-5e94-28a6-1260271ac680","AzurePipelinesTestRunId":"38955702","DefinitionId":"265","configuration":"Release","System.JobName":"__default","BuildId":"1396680","DefinitionName":"runtime-nativeaot-outerloop","System.StageAttempt":"1","Reason":"Schedule","runtimeFlavor":"coreclr","CollectionUri":"https://dev.azure.com/dnceng-public/","System.PhaseName":"build_linux_x64_Release_NativeAOT_Libs","System.StageName":"Build","architecture":"x64","Project":"public","operatingSystem":"(Debian.13.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-13-helix-amd64","BuildNumber":"20260425.2","System.JobAttempt":"1","System.PhaseAttempt":"1"} | Schedule |
| 2026-04-25 10:34:35.249000+00:00 | runtime-nativeaot-outerloop | Release | azurelinux.3.amd64.open.rt | x64 | System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test | Failed | {"System.StageName":"Build","architecture":"x64","System.PhaseName":"build_linux_musl_x64_Release_NativeAOT_Libs","System.StageAttempt":"1","System.JobId":"20e6f673-0b0c-5c85-377c-5d941d4c8ee3","runtimeFlavor":"coreclr","BuildNumber":"20260425.1","operatingSystem":"(Alpine.323.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64","Project":"public","System.PhaseAttempt":"1","BuildId":"1396429","Reason":"Schedule","System.JobAttempt":"1","DefinitionName":"runtime-nativeaot-outerloop","configuration":"Release","System.JobName":"__default","AzurePipelinesTestRunId":"38949484","DefinitionId":"265","CollectionUri":"https://dev.azure.com/dnceng-public/"} | Schedule |
| 2026-04-25 05:16:22.563000+00:00 | runtime-extra-platforms | Release | osx.15.amd64.open | x64 | System.Runtime.Intrinsics.Tests.Vectors.Vector512Tests.ConvertToInt32Test | Failed | {"BuildId":"1396313","System.StageName":"Build","System.StageAttempt":"1","operatingSystem":"OSX.15.Amd64.Open","configuration":"Release","AzurePipelinesTestRunId":"38946736","architecture":"x64","BuildNumber":"20260424.6","System.JobId":"d413ef91-6ac1-5648-b23b-ad89eaf81672","Project":"public","CollectionUri":"https://dev.azure.com/dnceng-public/","System.JobName":"__default","System.PhaseName":"build_iossimulator_x64_Release_AllSubsets_CoreCLR","DefinitionId":"154","DefinitionName":"runtime-extra-platforms","Reason":"Schedule","System.JobAttempt":"1","System.PhaseAttempt":"1","runtimeFlavor":"coreclr"} | Schedule |
Reacted by Copilot
Metadata
Metadata
Labels
JitStressCLR JIT issues involving JIT internal stress modesarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runs
Activity
dotnet-policy-service commentedon Apr 27, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
mangod9 commentedon Apr 28, 2026
Some analysis is below, @EgorBo and @tannergooding to validate:
Symptoms
Vector512Tests.ConvertToInt32Testproduces wrong results on all non-AVX512 x64 platforms:0xF99999A0instead of0x80000000)Failing platforms (all Release, all non-AVX512):
runtime-coreclr libraries-jitstress-random— Linux x64runtime-extra-platforms— macOS x64 iossimulatorruntime-nativeaot-outerloop— Linux x64 (Alpine + AzureLinux)First failure: April 25, 2026 05:16 UTC
Root Cause: Missing ISA Guard + Recent Trigger
The missing guard (since April 2023)
PR: #84932 — "Accelerate Vector512 ConvertToSingle and ConvertToInt32"
When
NI_Vector512_ConvertToInt32was added toimpSpecialIntrinsicinhwintrinsicxarch.cpp, the Vector512 case was grouped with Vector128/Vector256 without an AVX-512 ISA check:Vector128 and Vector256 work fine without AVX-512 (using SSE/AVX instructions). But when the Vector512 case enters
gtNewSimdCvtNode→gtNewSimdCvtNativeNode, it unconditionally selectsNI_AVX512_ConvertToVector512Int32WithTruncation— an AVX-512 instruction — forsimdSize=64.Compare with
ConvertToInt64which correctly gates on AVX-512:Why it was harmless for 3 years: On non-AVX512 machines, the JIT never reached this code path. The managed fallback in
Vector512.ConvertToInt32(which splits into two Vector256 operations) always ran instead — the JIT had no reason to intrinsify a Vector512 call that would be expanded from the managed code.The trigger — PR #127124 + PR #127402 (April 24, 2026)
PR: #127124 — "JIT: propagate vector constants through assertion prop"
PR: #127402 — "Allow O2K_CONST_VEC to handle all TYP_SIMD32/64"
Author: @EgorBo
These PRs enable the JIT to constant-propagate Vector512 values. The test does:
With the new constant propagation,
Vector512.Create(float.MinValue)becomes a compile-time constant. The JIT now attempts to fold theConvertToInt32call through the intrinsic path (gtNewSimdCvtNode) instead of falling back to managed code — even on non-AVX512 machines. This hits the missing guard for the first time.Timeline
NI_Vector512_ConvertToInt32without AVX-512 gategtNewSimdCvtNodesaturation logic (correctly gated by assert, but only in Debug)ConvertToInt32Test(test has existed for 2 years)The Bug in Detail
In
hwintrinsicxarch.cpp(line 1849-1858), when the JIT recognizesNI_Vector512_ConvertToInt32, it callsgtNewSimdCvtNodewithout checking for AVX-512 support:Compare with
ConvertToInt64which correctly gates:For
ConvertToInt32, Vector128 and Vector256 work fine without AVX-512 (using SSE/AVX instructions). But Vector512 requires AVX-512 for the native truncation instruction, and there's no fallback ingtNewSimdCvtNativeNodefor simdSize=64 without it.Fix
File:
src/coreclr/jit/hwintrinsicxarch.cpp— Gate Vector512 ConvertToInt32 on AVX-512, matching theConvertToInt64pattern:Same pattern applied to
ConvertToInt32Native.When AVX-512 is unavailable and
simdSize == 64,retNodestays null and the JIT falls back to the managedVector512.ConvertToInt32implementation, which correctly splits into twoVector256.ConvertToInt32calls using SSE/AVX instructions.Optionally, the assertions in
gtNewSimdCvtNodeandgtNewSimdCvtNativeNodeingentree.cppcan also be tightened to add(simdSize != 64)to the non-AVX512 condition — this would catch the issue in Debug/Checked builds if any other caller bypasses the gate in the future.JIT: fix Vector{128,256}.ConvertToInt32 use-before-def in gtNewSimdCv…
EgorBo commentedon Apr 28, 2026
@mangod9 in case if you're interested in feedback for the analysis, it seems like it's not correct, my local copilot identified a use-before-def bug elsewhere https://github.com/dotnet/runtime/pull/127524/changes
mangod9 commentedon Apr 28, 2026
ok interesting, so the determination that it was a pre-existing issue exposed by the latest PR was incorrect, or the suggested fix was not right? Maybe it over pivoted on the fact that it was failing on all non-avx512 legs?
EgorBo commentedon Apr 29, 2026
The bug was pre-existing, but the suggested fix doesn't fix the problem and effectively incorrect. But I am not sure the analysis could catch that easily, my local one had dive into JitDump
mangod9 commentedon Apr 29, 2026
ok makes sense, yeah its been somewhat off finding the exact fix, but good that it's still finding a reasonable root cause.
JIT: fix Vector{128,256}.ConvertToInt32 use-before-def in gtNewSimdCv…
JIT: fix Vector{128,256}.ConvertToInt32 use-before-def in gtNewSimdCv…