This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: PCG random number generator
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Evelyn Mitchell, mark.dickinson, rhettinger, tim.peters
Priority: normal Keywords:

Created on 2017-07-08 17:14 by Evelyn Mitchell, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg297961 - (view) Author: Evelyn Mitchell (Evelyn Mitchell) * (Python triager) Date: 2017-07-08 17:14
John Cook tested the quality of the PCG Random Number generator (http://www.pcg-random.org/index.html) and it appears to have good performance. 

His report is at: 
https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-random-number-generator/

This is a suggestion to add a PCG implementation.
msg297968 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2017-07-08 19:23
Some previous discussions: "Time for a change of random number generator": https://mail.python.org/pipermail/python-dev/2016-February/143268.html

"Should our default random number generator be secure?": (warning: long) https://mail.python.org/pipermail/python-ideas/2015-September/035820.html
msg297971 - (view) Author: Evelyn Mitchell (Evelyn Mitchell) * (Python triager) Date: 2017-07-08 20:25
Mark, thanks for the background links.

My suggestion is much more constrained than the territory covered by those links.
msg297977 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-07-09 02:36
FWIW, the previous discussions on the MersenneTwister have all resulted in a decision to stick with it.

The PCG family of PRNG is relatively new.  IIRC, the paper for it was never accepted for publication and some of its bolder claims haven't been proven.  It is far being standard or widely adopted.  In addition, there is not a single "the PCG RNG".  Instead, it is a collection of ideas and patterns for creating RNGs without recommending a single one that the "here use this one".

Tim reminded us that any issues for the MersenneTwister didn't surface for many years after its initial publication and wide-spread acceptance.  That is a cautionary note for adopting something too soon.

FWIW, I reviewed the PCG work a good while ago and discussed it with Guido.  The decision was to stick with the current safe choice.

That said, if someone wants to add this to PyPi, it is a really easy coding task.  There isn't much to the PCG code and the Python random module was designed to be "pluggable" so that other RNGs can easily be substituted by user.
msg297980 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2017-07-09 03:19
I agree closing was appropriate at this time.  I quite like PCG, but as Raymond said it's more a template for creating PRNGs than a specific generator.  So even if a compelling case could be made, there's still a long way to having specific code in mind.

In the Python world, the only non-trivial (i.e., not just a pure-Python toy demo program) PCG work I'm aware of is Robert Kern's (numpy's PRNG specialist) experiment with wrapping it:

https://github.com/rkern/pcg-python

But it hasn't been touched since late 2015.  It's also a bit concerning that Prof. O'Neill hasn't posted to her PCG blog in over 2 years:

http://www.pcg-random.org/blog/

I'm not concerned that the paper still hasn't been published - papers can sit a loooong time in review queues, and I'm afraid her paper is far too down-to-earth, readable, entertaining, and long for the TOMS editors' tastes <0.3 wink>.
History
Date User Action Args
2022-04-11 14:58:48adminsetgithub: 75063
2017-07-09 03:19:44tim.peterssetnosy: + tim.peters
messages: + msg297980
2017-07-09 02:36:35rhettingersetstatus: open -> closed
messages: + msg297977

assignee: rhettinger
resolution: rejected
stage: resolved
2017-07-08 20:25:55Evelyn Mitchellsetmessages: + msg297971
2017-07-08 19:23:09mark.dickinsonsetmessages: + msg297968
2017-07-08 17:36:19serhiy.storchakasetnosy: + rhettinger, mark.dickinson

components: + Extension Modules
versions: + Python 3.7
2017-07-08 17:14:16Evelyn Mitchellcreate