[PATCH] D34157: [llvm-stress] Use C++11 mersenne_twister_engine random device instead of our own (PR32585)

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 15:13:28 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D34157#788527, @chandlerc wrote:

> 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...


I wouldn't go so far as to say that makes the seeding useless, there are still plenty of use cases (and, FWIW, makes them no better than the system *rand*() functions). It does rule out this use case, however.


Repository:
  rL LLVM

https://reviews.llvm.org/D34157





More information about the llvm-commits mailing list