-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
JIT: Reconsider how stress modes are randomly applied #83733
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThe hash used to compute whether a stress mode is enabled works simply by xor'ing the integer value of the stress mode in the stress enum: runtime/src/coreclr/jit/compiler.cpp Lines 3581 to 3586 in 93dda3b
That seems like it would have a very bad distribution -- there's only a few dozens of stress modes so this at most affects only the few lowest bits of the hash code. Additionally, reordering members in the enum leads to an entirely different (unrelated) set of stress modes being enabled/disabled. This for example happened in #79283. I think it would be better if we derived a hash from the string name of each stress mode and then xor'd with that instead (e.g. using
|
Instead of using the numeric value of each stress mode inside the enum, calculate a hash based on the string name. This has the benefit that it won't change based on new members being added/reordered and reduces correlation of which stress modes get enabled together. Fix dotnet#83733
Instead of using the numeric value of each stress mode inside the enum, calculate a hash based on the string name. This has the benefit that it won't change based on new members being added/reordered and reduces correlation of which stress modes get enabled together. Fix #83733
The hash used to compute whether a stress mode is enabled works simply by xor'ing the integer value of the stress mode in the stress enum:
runtime/src/coreclr/jit/compiler.cpp
Lines 3581 to 3586 in 93dda3b
That seems like it would have a very bad distribution -- there's only a few dozens of stress modes so this at most affects only the few lowest bits of the hash code, in a very predictable way.
Additionally, reordering members in the enum leads to an entirely different (unrelated) set of stress modes being enabled/disabled. This for example happened in #79283.
I think it would be better if we derived a hash from the string name of each stress mode and then xor'd with that instead (e.g. using
HashStringA
). That would be more similar to how other randomness is mixed in as well.The text was updated successfully, but these errors were encountered: