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.
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.
| 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. |
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