-
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 a test for determinism #93600
Add a test for determinism #93600
Conversation
Resolves dotnet#73931. This checks that the result of parallel build is the same as the result of single-threaded build. I'd like to add some more code to this so that there's more junk to compile but don't have a good idea of what to add. `XmlSerializer`? Suggestions welcome.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsResolves #73931. This checks that the result of parallel build is the same as the result of single-threaded build. I'd like to add some more code to this so that there's more junk to compile but don't have a good idea of what to add. Cc @dotnet/ilc-contrib
|
using var baseline = File.OpenRead("baseline.object"); | ||
using var compare = File.OpenRead("compare.object"); |
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.
Invoke these via reflection? Downstream, I have seen determinism issues (RyuJit-induced, since then fixed) pop up in reflection internals.
if (baseline.Length != compare.Length) | ||
throw new Exception("Different sizes"); | ||
|
||
for (int i = 0; i < baseline.Length; i++) |
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.
for (int i = 0; i < baseline.Length; i++) | |
long length = baseline.Length; | |
for (int i = 0; i < length; i++) |
Roslyn? |
The unfortunate part about doing that would be that we then compile Roslyn single-threaded. We want more stuff, but not too much stuff. |
I made this call into the other test that does a bunch of random things and exercises things like static virtuals, generic virtual methods, etc. |
Looks like it found a bug:
|
|
I was wrong. The debug info part is just a symptom of the problem. The problem is that codegen wasn't deterministic. Filed #93843. @SingleAccretion was right that the reflection stack is problematic. |
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.
LGTM. Thanks!
Resolves #73931. This checks that the result of parallel build is the same as the result of single-threaded build.
I'd like to add some more code to this so that there's more junk to compile but don't have a good idea of what to add.
XmlSerializer
? Suggestions welcome.Cc @dotnet/ilc-contrib