-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling disasm checks under certain testing environments #76202
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
@dotnet/jit-contrib @EgorBo This is ready. |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsShould resolve:
Description We need to disable disasm checks if we are running under GCStress, TieredPGO, R2R, or on linux-musl(alpine).
|
Are these being disabled because we don't want to test in those scenarios or because it will take more work to test them correctly? In other words, should we open work items to enable them? |
src/tests/Common/CLRTest.Jit.targets
Outdated
@@ -222,7 +222,10 @@ IF NOT DEFINED DoLink ( | |||
DependsOnTargets="GetDisasmCheckData"> | |||
<PropertyGroup> | |||
<HasBashDisasmCheck>false</HasBashDisasmCheck> | |||
<HasBashDisasmCheck Condition="'$(HasDisasmCheck)' == 'true' and '$(RuntimeFlavor)' == 'coreclr' and ('$(TargetOS)' == 'Linux' or '$(TargetOS)' == 'OSX') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')">true</HasBashDisasmCheck> | |||
<HasBashDisasmCheck Condition="'$(HasDisasmCheck)' == 'true' and '$(RuntimeFlavor)' == 'coreclr' and ('$(TargetOS)' == 'Linux' or '$(TargetOS)' == 'OSX') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64') and '$(RunCrossGen2)' != 'true'">true</HasBashDisasmCheck> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could fold the RunCrossGen2 check into GetDisasmCheckData and then not duplicate it on the bash/batch sides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I can also do the setting of GCStressIncompatible/HeapVerifyIncompatible
well too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<EDIT: removed my comment about the Incompatible vars because it was wrong>
src/tests/Common/CLRTest.Jit.targets
Outdated
<HasBashDisasmCheck Condition="'$(HasDisasmCheck)' == 'true' and '$(RuntimeFlavor)' == 'coreclr' and ('$(TargetOS)' == 'Linux' or '$(TargetOS)' == 'OSX') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64') and '$(RunCrossGen2)' != 'true'">true</HasBashDisasmCheck> | ||
|
||
<GCStressIncompatible Condition="'$(HasBashDisasmCheck)' == 'true'">true</GCStressIncompatible> | ||
<HeapVerifyIncompatible Condition="'$(HasBashDisasmCheck)' == 'true'">true</HeapVerifyIncompatible> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious to know the restrictions here. I thought these "just" impacted the runtime - do they change the codegen and therefore the disasm output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure - we should probably ask.
@AndyAyersMS - Does GCStress/HeapVerify impact codegen at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear - ok to disable and merge - just wondering about the future steps
<BashDisasmCheckPostCommands Condition="'$(HasBashDisasmCheck)' == 'true'"><![CDATA[ | ||
if [[ -n $COMPlus_JitDisasm ]]; then | ||
@(DisasmCheckFiles -> ' dotnet $CORE_ROOT/SuperFileCheck/SuperFileCheck.dll --csharp "%(Identity)" --allow-unused-prefixes --check-prefixes=CHECK,$(TargetArchitecture.ToUpperInvariant()),$(TargetArchitecture.ToUpperInvariant())-$(TargetOS.ToUpperInvariant()) --dump-input-context 25 --input-file "$(BashDisasmOutputFile)" | ||
if [[ ( -z "$COMPlus_JitStress" ) && ( -z "$COMPlus_JitStressRegs" ) && ( -z "$COMPlus_TailcallStress" ) && ( "$COMPlus_TieredPGO" != "1" ) ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is repeated four times, which will be difficult to maintain. For each of bash/batch, the two could be combined to one by defining a variable and using it in the two if
s.
Bash vs batch is difficult because the syntax is different. So perhaps instead of the above suggestion, the condition strings could be separately defined in msbuild variables and included twice in each script. Then those msbuild variables could be defined back-to-back so that it is clear that if you change one you need to change the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see if I can clean it up - I'm just so afraid of getting the syntaxes wrong for each of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a clean test run, merge without this to unblock outerloop, but please factor this afterwards.
I don't think it's too bad because you already have the script syntax. Something like
<PropertyGroup>
<DisasmBashCondition>(<![CDATA[( -z "$COMPlus_JitStress" ) && ( -z "$COMPlus_JitStressRegs" ) && ( -z "$COMPlus_TailcallStress" ) && ( "$COMPlus_TieredPGO" != "1" )]]></DisasmBashCondition>
<DisasmBatchCondition>"%COMPlus_JitStress%"=="" IF "%COMPlus_JitStressRegs%"=="" IF "%COMPlus_TailcallStress%"=="" IF NOT "%COMPlus_TieredPGO%" == "1"</DisasmBatchCondition>
</PropertyGroup>
Then the if
lines:
if [[ $(DisasmBashCondition) ]]; then
IF $(DisasmBatchCondition) (
For right now, we should only enable disasm checks for test modes that have predictable codegen. |
I think these are all predictable, except perhaps tiering (not sure if available information can impact the codegen) and the timing and whether the next tier happens can vary by execution in some ways. But they are different from "normal optimized", which perhaps is what you mean for "right now"? EDIT - also fine to disable for now even if it should work - I just want to know what is expected, what the next steps are, etc. |
For this PR, I'm waiting to see a failure on all x64 runs for the single test so I know this worked correctly. If so, I'll fix the test and hopefully we can get this merged in ASAP. |
Yes, this is what I'm asking about (and what the future work is to enable scenarios that ought to already work vs add new scenarios) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving but I believe you need to fix the two Incompatible
vars by either not putting them in the other Target or modifying it to Return them as I wrote in the comment before it will work fully
I'll make a separate PR for those. |
CI is clean, failure is unrelated. |
Should resolve:
Description
We need to disable disasm checks if we are running under GCStress, TieredPGO, R2R, JITStress.