[clang] [llvm] [Hashing] Use a non-deterministic seed if LLVM_ENABLE_ABI_BREAKING_CHECKS (PR #96282)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 22:09:57 PDT 2024


MaskRay wrote:

> Aren't hashes supposed to be deterministic ?
> 
> Can we add a override for builds with asserts turned ON to favor determinism ?
> 
> Could have an API to set the determinism flag ?
> 
> This also has an effect on Build ID computation ?

Some hashes are supposed to be deterministic, but `Hashing.h` isn't .
The file-level documentation  and `get_execution_seed` are very clear about the unstability.

If you want to deploy assertions builds and have concern about non-deterministism, set LLVM_ABI_BREAKING_CHECKS to `FORCE_OFF`.

The unstable property is important to ensure that no test relies on the particular implementation and allow us to replace the implementation, which would be infeasible if people keep adding brittle tests.

https://github.com/llvm/llvm-project/pull/96282


More information about the llvm-commits mailing list