-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
nondeterministic LLVM-IR with @anon.HASH.number
#91168
Comments
This should be labeled with |
Some reproducibility issue with LLVM have been fixed very recently. Can you check with the latest nightly ? |
This is separate from #90301 which was fixed recently. That was an issue where the output produced by LLVM was nondeterministic for the same LLVM IR. This is an issue where the LLVM IR itself is changing. |
I'm still working on reducing a test case but wanted to add one more observation: There has been an observable chance that running the same command twice does produce the same result, so it may take multiple attempts to see a difference. What these means for automatic reduction tools like creduce/delta is that it may encounter false-negatives that discard a reduction candidate. For example, I have a test case reduced to a state where its output is repeatable about 50% of the time. |
Update: We've been able to track this down to a procedural macro whose implementation involves iterating over a HashMap. It was shown that this produces different code with |
Conclusion: The fault for this lies in the proc macro definition, not the tool itself. That said, it would be nice if there were some way to detect this, be it statically or otherwise, in the interest of deterministic (and security-auditable) builds. |
I am observing that repeating the same command twice with
--emit=llvm-ir
gives non-deterministic .rlib and .ll outputs.[I apologize in advance for not providing a full set of repro inputs and commands right now, but I will work with my team on this.]
LLVM-IR differences look like this:
Do we know why the hash value in
@anon.HASH.n
generated byrustc
is non-deterministic? and what language construct is producing such anonymous symbols?Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: