[PATCH] D34157: [llvm-stress] Use C++11 mersenne_twister_engine random device instead of our own (PR32585)
Chandler Carruth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 22 15:08:29 PDT 2017
chandlerc added a comment.
In https://reviews.llvm.org/D34157#781369, @mclow.lists wrote:
> > my only concern is I have no idea if `uniform_int_distribution` guarantees the same behaviour on different targets as `mersene` does
>
> It does not.
> [rand.dist.general]/3:
>
> > The algorithms for producing each of the specified distributions are implementation-defined.
Wait, really? This makes using a seeded PRNG inside any of the standard distributions pretty much useless -- you can seed things all you want but you can't actually reproduce the particular results when fed through a distribution...
If this is true, it seems like yet another horrible and glaring hole in the entire PRNG system of the C++ standard library, which is pretty sad IMO.
We still shouldn't (IMO) use the raw and undistributed results of the PRNG engine. But maybe we have to build our own API (perhaps based in part on libc++'s code) since we can't actually use the standard library.
Repository:
rL LLVM
https://reviews.llvm.org/D34157
More information about the llvm-commits
mailing list