-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
cmd/compile: only use sequential compile queue algorithm for -v compiles, not all -c=1 compiles #46074
Comments
Okay, it turns out the issue I was running into wasn't that the compiler output was non-deterministic, but just the compiler diagnostics were non-deterministic. This in turn made diffing the log files generated by toolstash -cmp useless. CL 318229 was unnecessary for deterministic compiler output, but it does correctly make the diagnostics deterministic as needed for toolstash. I think that CL can stay for 1.17. For 1.18, I think it might make sense to tweak this logic: go/src/cmd/compile/internal/gc/compile.go Line 128 in 5203357
to keep normal -c=1 builds using the same work queue algorithm as -c>1 builds, and only use the strictly in-order algorithm for -v builds or something. |
Phew. Have you confirmed that CL 318229 doesn’t cause a performance regression? |
@josharian I did not, but I don't anticipate it should:
|
Ah, sorry, I missed that. Thanks! |
@mdempsky This is in the 1.18 milestone; time to move to 1.19? Thanks. |
One place I need deterministic compiling order is for debugging the compiler. Once I had a compiler bug that caused compiler crashes in multiple functions (in the same package). Once it crashed, it stopped compiling other functions. What function it crashed in was nondeterministic. I wanted it to always crash in the same function, so I can get an SSA dump and some debug outputs. I tried |
@mdempsky This is in the 1.19 milestone; time to move to 1.20? Or Backlog? Thanks. |
The other day I was seeing issues with "toolstash -cmp" failing because compiler output seemed non-deterministic. I submitted golang.org/cl/318229 to change non-concurrent builds to have a deterministic order, on the assumption that concurrent builds are expected to have non-deterministic output. But @josharian points out that's not the case.
However, I can no longer immediately reproduce the non-determinism issue, even with high -c values.
This is a tracking issue to check that with all the compiler refactoring this cycle we haven't broken deterministic output.
/cc @randall77 @cuonglm
The text was updated successfully, but these errors were encountered: