-
-
Notifications
You must be signed in to change notification settings - Fork 480
Description
This question came up recently regarding a possible adoption to libstd (read from here), but I'm not sure we ever really asked the question of rand.
StdRng and SmallRng are deterministic but not reproducible (and in the latter case also not portable). Should we add a PRNG with guaranteed reproducibility as a new item under rand::rngs?
We already have five PRNGs available in rand if you count the ChaCha variants:
ChaCha8Rng,ChaCha12Rng,ChaCha20RngXoshiro128PlusPlus,Xoshiro256PlusPlus
I'm not sure if we should ever add a guaranteed-reproducible ChaCha PRNG in rand since if we ever wanted to change the generator behind ThreadRng it would add dependencies. Given how long we've been using ChaCha in this role this may be less of an issue now.
The Xoshiro variants are more acceptable (if only because they require a lot less code; both are directly implemented in rand), though selecting one of these is likely sufficient, e.g. rang::rngs::Xoshiro256PlusPlus.
CC @hanna-kruppe @joshtriplett in case of interest