3 ms·
I predict that prng will totally fail the DieHard tests.
by aappleby 5y ago
I predict that prng will totally fail the DieHard tests.
- 37ef_ced3 5y agoAnd you'd be wrong Here: https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-random-number-generator/ https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-ra...
- aappleby 5y agoI could very well be wrong, I haven't checked yet. That said, I have done a bit of work with these sort of things.
- aappleby 5y agoI'll read the paper.
- aappleby 5y agoAh, I missed that there was a data-dependent rotation applied in the output. So it's a lcg plus xorshift plus ddr. Still weaker than I'd like, but if it passes DieHard etc then it passes.
- 37ef_ced3 5y agoYeah, that pseudorandom rotation is what makes PCG novel
- TapamN 5y agoDoes it need to pass them? A stronger algorithm wouldn't hurt, but it's not being used for cryptography or scientific simulations. It's just for games. With the goal of having sharable seeds, the smaller space could be considered beneficial. The right tool for the job is more important. Even an 8-bit LFSR is good for certain tasks, like randomizing particle effects for an NES game.
- 37ef_ced3 5y agoPCG is a top-quality pseudorandom number generator, suitable for all non-crypto prng applications Here are the DIEHARDER results: https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-random-number-generator/ https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-ra...
- dwohnitmok 5y agoNot quite "all prng applications." As TapamN points out it is not cryptographically secure and can be broken. https://hal.inria.fr/hal-02700791/ https://hal.inria.fr/hal-02700791/ But it's probably fine for non-crytographic uses (and indeed is widely used for such). [parent comment has now added "non-crypto" to the original quote so that "all prng applications" is now moot]
- bawolff 5y agoUsually people say CSPRNG if its secure for crypto applications. Just saying PRNG kind of implies its not cryptographically secure
- dwohnitmok 5y agoFair enough.
- bhaak 5y ago> It's just for games. http://taeb-nethack.blogspot.com/2009/03/predicting-and-controlling-nethacks.html http://taeb-nethack.blogspot.com/2009/03/predicting-and-cont... https://pellsson.github.io/ https://pellsson.github.io/ Of course, nobody is in danger because your game's random state can be deduced. But it can disrupt online play quite a bit. Just imagine what this can mean for tournaments.
- TapamN 5y agoThat's true. I did think about mentioning this possibility, but decided not to. Another good example of predicting RNG, after a large amount of gameplay, for a non-turn-based game: https://www.youtube.com/watch?v=1hs451PfFzQ https://www.youtube.com/watch?v=1hs451PfFzQ I think in certain Pokemon games, people figured out how to predict and manipulate random encounters based on an animation in the load screen.