News for hackers. Stuff that matters.
Re:Math.random in V8 is broken by acqq on Saturday November 21, 2015 @11:37AM (#10607175)
Apparently here: https://en.m.wikipedia.org/wiki/TestU01

Wikipedia entry for MT specifies some of the problems.

Re:Math.random in V8 is broken by mmalone on Saturday November 21, 2015 @01:25PM (#10607542)
MT only fails LinearComp systematically. It is not a bad generator, it is a very good generator. The biggest problem is the "escape from zero-land" stuff where it's biased towards zero for a while if its seed is mostly zeros, but other generators have the same problem (though not to the same extent) and it's still statistically very unlikely to be a problem and it self corrects as the sequence runs.

Comparing to ChaCha20, which is a CSPRNG, is a little apples/oranges.

Re:Math.random in V8 is broken by acqq on Saturday November 21, 2015 @03:10PM (#10607866)
The author (or authors?) of MT have some more recent generators that are faster, what's the reason for staying with the original MT?
Re:Math.random in V8 is broken by mmalone on Saturday November 21, 2015 @04:49PM (#10608162)
Just familiarity. Mostly I just can't recommend something I don't know much about. The SIMD variant of MT is architecture specific, I thought? Other newer variants of MT/WELL generators and PCG are probably all good options. Also xorshift*.

But I know that MT is a very good algorithm and using it has a certain pragmatic appeal - you make a lot of people's lives easier because when they Google to learn more about your generator they'll find good information quickly.

Re:Math.random in V8 is broken by adrae5df on Saturday November 21, 2015 @11:45AM (#10607203)
The entire TestU01? Wow, I did not know that.
Re:Math.random in V8 is broken by acqq on Saturday November 21, 2015 @11:50AM (#10607222)
I thought you were interested to find the tests. The tests that fail are there. MT doesn't fail all, far from it. But there are RNGs that don't fail these that MT fails that are faster. PCG was mentioned here.
Re:Math.random in V8 is broken by adrae5df on Saturday November 21, 2015 @12:16PM (#10607308)
The only information on PCG I can find is the author's own paper which also fails some TestU01 tests. I am much more inclined to trust an established generator than an unproved one.
Re:Math.random in V8 is broken by bhickey on Saturday November 21, 2015 @05:47PM (#10608348)
PCG is a family of PRNGs. Any sensible member of the family will trivially pass TestU01 BigCrush. If you use a 32-bit PCG it's going to necessarily fail BigCrush.

PRNG design is an empirical science. We can implement a generator and throw it into a statistical battery. If one passes, we've got a constructive proof of goodness. Any of us can run BigCrush and verify the results. Unlike CSPRNGs, we don't need to sit around and wait for the results of cryptanalysis.