<div><div dir="auto">Yup. I have some of these changes in a branch for a while.   Just was uncertain that those who share the common interface are ok with the current tyoeclass interface breaking.    </div></div><div dir="auto"><br></div><div dir="auto">Sounds like everyone’s willing to deal with the needed breakage. </div><div dir="auto"><br></div><div dir="auto">I’ll have a release candidate to share publicly in a few weeks.  </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Meta point: Dominic if you want to communicate with me try email. You seem to prefer anything but direct concrete communication with me. OTOH I guess we just are terrible at communicating with each other. And I guess that’s fine.   Just unfortunate. </div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 17, 2020 at 8:13 AM <<a href="mailto:dominic@steinitz.org">dominic@steinitz.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello libraries,<br>
<br>
Following a great blog [post] by @lehins, a group of us (@curiousleo,<br>
@lehins and me) are trying to improve the situation with the `random'<br>
library.<br>
<br>
@curiousleo and I have created a [resource] that tests the quality of<br>
Haskell random number generators via well known (and not so well known)<br>
test suites: dieharder, TestU01, PractRand and gjrand. The current<br>
`random' does not fare well especially with the use of the `split'<br>
function (but this is well known and the [reason] why `QuickCheck' moved<br>
from using it in [2.8] to using [tf-random] in [2.9] and latterly<br>
[splitmix] in [2.13]): see [this] for example. On the other hand,<br>
`splitmix' [passes] bigcrush[1].<br>
<br>
The putative proposal is to replace the current algorithm in `random'<br>
with that of `splitmix'[2] and to remove the performance bottleneck by<br>
changing the interface (the current interface causes the performance<br>
infelicity by making "all of the integral numbers go through the<br>
arbitrary precision Integer in order to produce the value in a desired<br>
range") - see @lehin's blog for more details.<br>
<br>
Can anyone interested:<br>
<br>
* Create a separate issue for each concern they have (eg. range for<br>
  floats (0, 1] vs [0, 1], etc.) [here].<br>
* Submit PRs with target at the [interface-to-performance] branch (or<br>
  into master if it is vastly different approach) with your suggested<br>
  alternatives.<br>
<br>
If you are going to raise a concern then it might be worth reading some<br>
of the [discussions] that have already taken place.<br>
<br>
We think once we have the API flashed out, switching to splitmix will be<br>
a piece of cake and will require an addition of just a few lines of code<br>
and removal of current StdGen related functionality. For historical<br>
reasons instead of removing it we could move StdGen into a separate<br>
module with a disclaimer not to use it, but that isn't terribly<br>
important.<br>
<br>
The Random Team (@lehins, @curiousleo, @idontgetoutmuch)<br>
<br>
<br>
[post] <a href="https://alexey.kuleshevi.ch/blog/2019/12/21/random-benchmarks/" rel="noreferrer" target="_blank">https://alexey.kuleshevi.ch/blog/2019/12/21/random-benchmarks/</a><br>
<br>
[resource] <a href="https://github.com/tweag/random-quality" rel="noreferrer" target="_blank">https://github.com/tweag/random-quality</a><br>
<br>
[reason]<br>
<a href="http://publications.lib.chalmers.se/records/fulltext/183348/local_183348.pdf" rel="noreferrer" target="_blank">http://publications.lib.chalmers.se/records/fulltext/183348/local_183348.pdf</a><br>
<br>
[2.8] <a href="https://hackage.haskell.org/package/QuickCheck-2.8" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/QuickCheck-2.8</a><br>
<br>
[tf-random] <a href="https://hackage.haskell.org/package/tf-random" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/tf-random</a><br>
<br>
[2.9] <a href="https://hackage.haskell.org/package/QuickCheck-2.9" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/QuickCheck-2.9</a><br>
<br>
[splitmix] <a href="https://hackage.haskell.org/package/splitmix" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/splitmix</a><br>
<br>
[2.13] <a href="https://hackage.haskell.org/package/QuickCheck-2.13" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/QuickCheck-2.13</a><br>
<br>
[this]<br>
<a href="https://github.com/tweag/random-quality/blob/master/results/random-word32-split-practrand-1gb" rel="noreferrer" target="_blank">https://github.com/tweag/random-quality/blob/master/results/random-word32-split-practrand-1gb</a><br>
<br>
[passes]<br>
<a href="https://github.com/tweag/random-quality/blob/master/results/splitmix-word32-testu01-bigcrush" rel="noreferrer" target="_blank">https://github.com/tweag/random-quality/blob/master/results/splitmix-word32-testu01-bigcrush</a><br>
<br>
[here] <a href="https://github.com/idontgetoutmuch/random/issues" rel="noreferrer" target="_blank">https://github.com/idontgetoutmuch/random/issues</a><br>
<br>
[interface-to-performance]<br>
<a href="https://github.com/idontgetoutmuch/random/tree/interface-to-performance" rel="noreferrer" target="_blank">https://github.com/idontgetoutmuch/random/tree/interface-to-performance</a><br>
<br>
[discussions] <a href="https://github.com/idontgetoutmuch/random/pull/1" rel="noreferrer" target="_blank">https://github.com/idontgetoutmuch/random/pull/1</a><br>
<br>
<br>
<br>
Footnotes<br>
_________<br>
<br>
[1] Just to clarify: both random and splitmix pass BigCrush. random<br>
fails any statistical test immediately (e.g. [SmallCrush]<br>
(<a href="https://github.com/tweag/random-quality/blob/master/results/random-word32-split-testu01-smallcrush#L337-L349" rel="noreferrer" target="_blank">https://github.com/tweag/random-quality/blob/master/results/random-word32-split-testu01-smallcrush#L337-L349</a>)<br>
and other even smaller ones) when a sequence based on split is<br>
used. splitmix passes Crush when split is part of the sequence, but<br>
I've seen it fail one test in BigCrush ("LinearComp"). So we should<br>
just be careful here: splitmix itself passes BigCrush and split-based<br>
sequences all pass Crush, but not all pass BigCrush.<br>
<br>
[2] `split' is already availaible as an instance: `instance Random<br>
SMGen where'.<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>