[issue38767] Replace Mersenne Twister RNG with a PCG family algorithm

Tim Peters report at bugs.python.org
Sun Nov 17 13:53:56 EST 2019


Tim Peters <tim at python.org> added the comment:

Thanks for the NumPy discussion link, Mark!  Did that set a world record for an issue report's length? ;-)  Not complaining - it's a very high quality and informative discussion.

I'd be comfortable adopting whichever PRNGs numpy uses.  numpy has better brainpower to apply to "due diligence" in this area, and the discussion made clear too that they're acutely aware of that most users know next to nothing about the pathologies, so that the defaults have to be ignorance-resistant.

It's cute that you raised good questions about how "independent" PCG streams are, and that PCG's creator invented a new member of the family to address the pathologies your line of questioning uncovered.  No "proof" that the new member is robust, but lots of testing.  That appears to be as good as the state of art allows for now.

I had/have similar concerns about the Twister, but never pursued them.  Much like PCG, in fact, it mixes a simple generator with a more-elaborate permutation of the underlying generator's output sequence (which they call "tempering").

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38767>
_______________________________________


More information about the Python-bugs-list mailing list