You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that phf generates different maps depending on which platform you run the generator on. 32-bit and 64-bit platforms don't match. I tracked this down to SmallRng generating different keys in phf_generator/src/lib.rs. I think it would be useful if phf was reproducible and generated the same output on all platforms. This should be possible by switching to a fixed random number generator instead of using one of the default generators from the rand crate.
The docs for SmallRng say:
Furthermore, SmallRng is not a good choice when:
Portability is required. Its implementation is not fixed.
At at the module level it says:
PRNGs: Several companion crates are available, providing individual or families of PRNG algorithms. These provide the implementations behind StdRng and SmallRng but can also be used directly, indeed should be used directly when reproducibility matters.
I originally saw this in https://github.com/humenda/isolang-rs - it commits the output of phf_codegen to git and uses a test to verify the output hasn't changed. The test fails on 32-bit platforms due to this issue.
The text was updated successfully, but these errors were encountered:
I noticed that phf generates different maps depending on which platform you run the generator on. 32-bit and 64-bit platforms don't match. I tracked this down to
SmallRng
generating different keys inphf_generator/src/lib.rs
. I think it would be useful if phf was reproducible and generated the same output on all platforms. This should be possible by switching to a fixed random number generator instead of using one of the default generators from therand
crate.The docs for
SmallRng
say:At at the module level it says:
I originally saw this in https://github.com/humenda/isolang-rs - it commits the output of
phf_codegen
to git and uses a test to verify the output hasn't changed. The test fails on 32-bit platforms due to this issue.The text was updated successfully, but these errors were encountered: