Repository navigation
Closed
Labels
JitStressCLR JIT issues involving JIT internal stress modesarch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runsblocking-releaseos-windows
Milestone
Description
Run: runtime-coreclr jitstress2-jitstressregs 20220612.1
Failed test:
coreclr windows x64 Checked jitstress2_jitstressregs1 @ Windows.10.Amd64.Open
- JIT\\HardwareIntrinsics\\General\\Vector256\\Vector256_ro\\Vector256_ro.cmd
coreclr windows x64 Checked jitstress2_jitstressregs8 @ Windows.10.Amd64.Open
- JIT\\HardwareIntrinsics\\General\\Vector256\\Vector256_ro\\Vector256_ro.cmd
Error message:
Return code: 1
Raw output file: C:\h\w\9DCC08D2\w\B0130977\uploads\Reports\JIT.HardwareIntrinsics\General\Vector256\Vector256_ro\Vector256_ro.output.txt
Raw output:
BEGIN EXECUTION
"C:\h\w\9DCC08D2\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" Vector256_ro.dll
Beginning test case Abs.Byte at 6/12/2022 7:21:43 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Beginning scenario: RunClassFldScenario
Beginning scenario: RunStructLclFldScenario
Beginning scenario: RunStructFldScenario
Ending test case at 6/12/2022 7:21:43 PM
Beginning test case Abs.Double at 6/12/2022 7:21:43 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Beginning scenario: RunClassFldScenario
Beginning scenario: RunStructLclFldScenario
Beginning scenario: RunStructFldScenario
Ending test case at 6/12/2022 7:21:43 PM
Beginning test case Abs.Int16 at 6/12/2022 7:21:43 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Beginning scenario: RunClassFldScenario
Beginning scenario: RunStructLclFldScenario
Beginning scenario: RunStructFldScenario
Ending test case at 6/12/2022 7:21:43 PM
Beginning test case Abs.Int32 at 6/12/2022 7:21:43 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Beginning scenario: RunClassFldScenario
Beginning scenario: RunStructLclFldScenario
Beginning scenario: RunStructFldScenario
Ending test case at 6/12/2022 7:21:44 PM
Beginning test case Abs.Int64 at 6/12/2022 7:21:44 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Beginning scenario: RunClassFldScenario
Beginning scenario: RunStructLclFldScenario
Beginning scenario: RunStructFldScenario
Ending test case at 6/12/2022 7:21:44 PM
Beginning test case Abs.SByte at 6/12/2022 7:21:44 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Beginning scenario: RunClassFldScenario
Beginning scenario: RunStructLclFldScenario
Beginning scenario: RunStructFldScenario
Ending test case at 6/12/2022 7:21:44 PM
Beginning test case Abs.Single at 6/12/2022 7:21:44 PM
Random seed: 20010415; set environment variable CORECLR_SEED to this value to repro
Beginning scenario: RunBasicScenario_UnsafeRead
Beginning scenario: RunReflectionScenario_UnsafeRead
Beginning scenario: RunClsVarScenario
Beginning scenario: RunLclVarScenario_UnsafeRead
Beginning scenario: RunClassLclFldScenario
Begin
Stack trace
at JIT_HardwareIntrinsics._General_Vector256_Vector256_ro_Vector256_ro_._General_Vector256_Vector256_ro_Vector256_ro_cmd()
Metadata
Metadata
Assignees
Labels
JitStressCLR JIT issues involving JIT internal stress modesarch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runsblocking-releaseos-windows
Activity
tannergooding commentedon Jun 15, 2022
I have a possible repro with:
where
VincentBu commentedon Jun 20, 2022
Failed again in: runtime-coreclr jitstress2-jitstressregs 20220618.1
Failed test:
Error message:
VincentBu commentedon Jun 27, 2022
Failed again in: runtime-coreclr jitstress2-jitstressregs 20220626.1
Failed test:
Error message:
8 remaining items
BruceForstall commentedon Aug 16, 2022
The failure case is as @tannergooding mentioned above: #70642 (comment)
With this particular stress setup, some of the test cases are inlined into the "main" function
GreaterThanAllUInt64(), namely the failingtest.RunClassLclFldScenario();as well as one of its predecessors.In the inlined predecessor, we have
vpcmpeqd ymm10,ymm10,ymm10to generate-1in all lanes, from:In the inlined
RunClassLclFldScenario()we also need this value:but, as seen, because it is marked as
ReuseRegby the register allocator, we don't generate any code.The bug is, there was a call between definition of
ymm10and theReuseReguse, and only the lower half of the register was preserved (because the high part of x64 SIMD registers are not callee-saved, by the ABI definition). Thus,ymm10doesn't contain the correct value.The intermediate call doesn't have any specific kill of
ymm10since that's callee-saved (but only the low part):Looks like there's some missing logic for ReuseReg and the FEATURE_PARTIAL_SIMD_CALLEE_SAVE case.
kunalspathak commentedon Aug 16, 2022
Introduced by #70171. Still investigating.
kunalspathak commentedon Aug 17, 2022
@BruceForstall and I spoke offline and as he pointed, there is a case missing where we need to either kill the upper-half of vector register if it was callee-save or save/restore if it was callee-thrash. We create ref positions during building the interval, but we won't know which register got assigned until we come to the register assignment. I will think little bit more and try out some ideas that Bruce suggested.
BruceForstall commentedon Aug 17, 2022
@kunalspathak Given that the fix will probably require significant new work, I think we should revert #70171 and port the revert to .NET 7. A new implementation with fix can be made in .NET 8.
kunalspathak commentedon Aug 17, 2022
Yes, I was thinking on similar lines given that #70171 should be straightforward to revert. I will try few things for couple of hours and if they don't work, will submit a revert PR.
tannergooding commentedon Aug 17, 2022
I expect the "right" fix might be something involving #70182.
For these types of constants, it is cheaper to reinitialize it entirely than to involve it with caller/callee save.
ZeroandAllBitsSetwe havexorps tgtReg, tgtRegandpcmpeqd tgtReg, tgtRegIn both cases, avoiding spilling and opting to reconstitute the value directly will end up being "better" for the cases where a spill does happen.
kunalspathak commentedon Aug 17, 2022
Probably. As you know, currently, the problem is with #70171, we are doing opposite of reinitializing the constant, and instead trying to "reuse" it. In "reuse" case, we only save/restore upper half if it holds a live variable (and not constant as far as I can tell). I will see if we can patch the save/restore upper half criteria to include it. We might not able to piggyback on the kill refpositions to clear the constants (as I was discussing with Bruce) because the kill positions are per register and in our case, there is no kill refposition inserted for upper-half vector register.
kunalspathak commentedon Aug 17, 2022
Hhhm, I cannot do that because the decision of saving/restore upper-half happens during interval building, while we won't know which register holds a constant (and hence need to be saved/restored) until register assignment.