-
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
Add JIT debugging helpers, and other debugging output improvements #100123
Conversation
1. Add `DOTNET_JitHoistLimit` to specify the maximum number of hoisted expressions to allow before stopping. 2. Add `DOTNET_JitStressModeNamesAllow` to allow specifying a set of STRESS mode names to allow. Use this in conjunction with a `DOTNET_JitStress` setting to allow JitStress to work as usual (with the usual weightings) but only for a specified set of stress modes. This is basically the opposite of `DOTNET_JitStressModeNamesNot`. One use is the enable JitStress, get a JitDump, see all the JitStress mode names that were enabled, then set `DOTNET_JitStressModeNamesAllow` to that set (e.g., `STRESS_RANDOM_INLINE STRESS_GENERIC_VARN STRESS_UNWIND`). Remove them one by one (or "binary search") to find the minimal set that causes a bug, to reduce noise in the dump and additional complexity in the IR and generated code. 3. Fix a few JitDump cases missing `dspPtr` to create diffable dumps. 4. Add `DOTNET_JitInlineLimit` support to `RandomPolicy` 5. Add `DOTNET_JitNoCSE2` support to `CSE_HeuristicRandom` 6. Remove an extra newline from `eePrintObjectDescription`
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@AndyAyersMS PTAL |
|
I agree with Jakob, once you've narrowed a stress failure down to one specific method then you can force enable the set of the modes that were randomly enabled and then whittle down that set to isolate which modes are required. Is there some use case where we want to approach this the other way around, try and whittle down the mode set first and then pinpoint the method? |
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.
Changes LGTM.
I'm ok with keeping the new config for stress allow, but as noted elsewhere I'm not sure it's needed.
This does not work. The stress modes in Thus, for a call to What you're doing you probably want to use the new fwiw, I normally did what you suggest. But it was always frustrating that a test failure that repros with |
/ba-g Build Analysis doesn't seem to be rerunning after issue opened |
I don't think that's true. If |
Yeah, that is my impression too, the enabled stress modes are not "random" but are a deterministic function of the stress mode config value and the (root) method hash. They only seem random when you look across methods. |
Not true. Remember, runtime/src/coreclr/jit/compiler.cpp Lines 3646 to 3649 in d59b32e
|
That makes sense. Are there any stress modes where we vary the weight at different call sites? I was under the impression that we don't really do that. |
Here are all the unique calls (unique as in different stress mode + weight combination). We do vary the weights, especially for
|
Doesn't it mean it's impossible to reliably create test cases with those stress modes enabled in the required way? You are forced to rely on randomness that easily breaks with test refactorings (as we have seen with a number of test cases using |
You're suggesting that, given the following calls, say:
if a test repro requires the 2nd but not the first, then you can't just use If we got rid of weights and created new stress modes for any cases that currently use the same mode with different weights, that would solve the problem. |
Right... My mental model was always that stress modes are binary things, either enabled or disabled, and that the weight you pass to Perhaps something to fix up if we ever end up in the situation where this matters... |
This includes dotnet#100154, dotnet#100160, dotnet#100123
DOTNET_JitHoistLimit
to specify the maximum number of hoisted expressions to allow before stopping.DOTNET_JitStressModeNamesAllow
to allow specifying a set of STRESS mode names to allow. Use this in conjunction with aDOTNET_JitStress
setting to allow JitStress to work as usual (with the usual weightings) but only for a specified set of stress modes. This is basically the opposite ofDOTNET_JitStressModeNamesNot
. One use is the enable JitStress, get a JitDump, see all the JitStress mode names that were enabled, then setDOTNET_JitStressModeNamesAllow
to that set(e.g.,
STRESS_RANDOM_INLINE STRESS_GENERIC_VARN STRESS_UNWIND
). Remove them one by one (or "binary search") to find the minimal set that causes a bug, to reduce noise in the dump and additional complexity in the IR and generated code.dspPtr
to create diffable dumps.DOTNET_JitInlineLimit
support toRandomPolicy
DOTNET_JitNoCSE2
support toCSE_HeuristicRandom
eePrintObjectDescription