If you seed Xoshiro256** with a merely 32-bit seed, then use it to produce 32 bits, it'll never produce 7, or 13 — or any of 3760 other numbers between 1 and 10000. But guess what? My test program to verify that ran in 11 seconds flat. The same thing for MT19937 (which I had to run to produce my comments above) takes literally hours. MT19937 is just awful if what you care about is getting random numbers out of it in a timely fashion. It's the Java of PRNGs.
So what is the proper way to seed this generator? Well, a single integer is actually good for the majority of users, and if you really need wider state space, use
seed_seq
with only few integers.If you're already paying for heap-allocation (std::seed_seq is basically std::vector with extra steps), then you might as well fill up the seed. I claim there's no good reason to "under-seed" a generator. If you're only going to use 256 bits of seed, then you should just use a generator with 256 bits of state in the first place.> I personally think that filling the whole state (624 integers) with values from random_device> is wrong because it wastes the system entropy. If not wrong then slow and pointless.Sure, but that's a problem with MT19937 asking for too much seed material, not a problem with the core idea of "fully seeding" a generator.