davidbau / seedrandom

seeded random number generator for Javascript
2.04k stars 160 forks source link

add more dieharder tests #45

Closed mreinstein closed 7 years ago

mreinstein commented 7 years ago

@davidbau your dieharder test harness is really well written!

One part that I'm a little curious about: https://github.com/davidbau/seedrandom/blob/released/test/bitgen.js#L28

what does seedrandom(0) do? Is this autoseeding? Essentially the same as seedrandom() ?

I noticed that only ARC4 is tested. Are the others worth running through dieharder, or are they known to fail some of the tests?

davidbau commented 7 years ago

seedrandom(0) uses zero as the seed. It's different from seedrandom() which autoseeds.

It would be nice to add more command-line options to run_diharder.sh and bitgen.js to allow testing of other seeds (or autoseeding), and the other PRNGs, through the diharder suite. I have not tested the other algorithms included in the package: they are all included based on tests that have been done by their original authors.

mreinstein commented 7 years ago

seedrandom(0) uses zero as the seed.

Is there any particular reason for seeding with 0 instead of another specific value?

Why is the dieharder test script seed hardcoded? I would think the test harness might produce a different set of random values on each invocation and provide more results.

davidbau commented 7 years ago

Zero is not special; it's just a seed.

It would be fine to add command-line options to run_diharder.sh to run it in different modes, including using any fixed seed you choose or a randomly chosen seed. If you're interested in seeing this, I'd be happy to merge an update that adds this.

mreinstein commented 7 years ago

ah ok. I think that makes sense; so it's really just a quick treatment showing that for at least one specific seed, this does not fail the dieharder test suite.

Thanks for clarifying!