Repository navigation
Description
based up on the lovely GSOC work by @nkartashov at https://github.com/nkartashov/SplitMix (and associated repos https://github.com/nkartashov/htestu for big crush/small crush statistical validation along and then https://github.com/nkartashov/prng-bench for performance comparison), @zaxtax and I are starting some planning work for Random Version 2.0
(and fyi to @idontgetoutmuch @gbaz et al)
let it be known
- based upon experimental data thus far, splitmix (subject to certain caveats that are mostly around bad seed subsets that can be easily addressed by porting applicable machinery from the java sibling and possibly pestering guy steele as suggested by some folks at oracle labs i spoke with this week), splitmix is the only rng aside from PCG-Random implemented in haskell that has a sequential
nextoperation that passes big crush - splitmix is the only RNG we know of implemented in haskell that supports a
splitoperation that passes big crush when used as the sequencing operation
(i need to do further auditing of how those crush tests were setup, but thats another sub item)
the following (approximate) task items, in part leveraging the excellent work by @nkartashov should form the foundation for prepping a v2 of random
- have fast gen float / double siblings (theres fast ways to generate unit interval floats, and unbiased ways, we cant have both at the same time )
- modern travis CI setup
- moving the c code back into haskell
- criterion benchmarks to compare
- test suite to compare impls
- test suite to validate determination of stream given several seeds
- migrating the bad seed mitigation stuff from the Java sibling
- emailing GUY!!!! (about the splitmix improvement work he's apparently up to, i'll handle this one next weekend)
- doc updates
- considering UX changes
- RandomT??
- Should monadic bind do a split (a la quicheck )
- cleanup big crush stuff and have that as an ancillary library (does @nkartashov want to own that? its his core work, and its an incredibly valuable tool, though he's busy with grad school and i dont want to impose that on him )
Activity
idontgetoutmuch commentedon Dec 9, 2015
This is great news.
Do we have the results of the tests written up somewhere?
I had a communication from Guy in April:
"My one recommendation is that you not standardize on a single algorithm.
Rather, make a SplittableRandom type class and provide multiple implementations."
Are we saying that PCG is somehow not as suitable as splitmix? I guess a write up of the tests would help answer this question.
cartazio commentedon Dec 9, 2015
Pcg doesn't have a good quality split operator at present.
I do have the basic test run data lying around on my work computer, I just
Got a bit buried this fall, I'll see about digging it up
On Wednesday, December 9, 2015, idontgetoutmuch [email protected]
wrote:
nkartashov commentedon Dec 9, 2015
You are free to use the code in any way you see fit, I'll try to help as much as I can.
@cartazio what parts of C code would you like to move to Haskell? TestU01 code is a mess written in a bad style (global variables, uninformative names etc.), I didn't refactor partly because it had no tests and I could break it without noticing, so I made only patchwork additions.
I moved parts of splitmix to C only for performance, although I cannot claim that my Haskell code is optimal.
@idontgetoutmuch correctness tests can be run using https://github.com/nkartashov/prng-test
btw, if you find any of the tools lacking, I can add you to collaborators, if you like.
idontgetoutmuch commentedon Jan 24, 2016
@nkartashov I haven't tried
prng-testyet but see the issues I have raised forhtestu. Perhaps I should not be tryinghtestu?nkartashov commentedon Jan 26, 2016
@idontgetoutmuch You mean discard it as a tool?
idontgetoutmuch commentedon Feb 18, 2016
See my comment on nkartashov/htestu#2. I am going to find a way we can run all the tests in
htestuand store the results somewhere. It probably ought to be part of a CI process for RNG.@cartazio do we have a CI set up? I know very little about how to provide such a thing but I can investigate.
idontgetoutmuch commentedon Feb 28, 2016
I have made some small progress e.g. I can now show that
tf-randompassessmallcrush:But I am having problems using
htestuat the command line - see: nkartashov/htestu#3.idontgetoutmuch commentedon May 5, 2016
I am copying my comments from a closed ticket so they don't get lost.
cartazio commentedon May 5, 2016
We have that code , and we need find the time to clean it up. I've
scheduled the time this weekend. Let's synch up after that :)
Or is there other bits I'm overlooking? I was a bit buried under job stuff
this winter and I'm only now climbing back up (eg I did my first new
package to havksge in a while this week ;))
On Thursday, May 5, 2016, idontgetoutmuch [email protected] wrote:
Zemyla commentedon May 10, 2016
RandomT should not use split like QuickCheck. First off, split can be slow, and splitting for every operation is pretty bad for performance. Second, it means that it violates the monad laws:
However, it should support using split to feed one half into a calculation and use the other half as the new random state.
cartazio commentedon May 10, 2016
Split in the splitmix is cheap, agree it's problematic in current random
and tf random. But let me catchup on stuff and finish getting that branch
up
Also benchmarks :)
On Tuesday, May 10, 2016, Zemyla [email protected] wrote:
cchalmers commentedon Jun 17, 2016
That's strange, I ran the
c_bigCrushtests from https://github.com/nkartashov/htestu withnextStreamFromGen,splitNextStreamFromGenandleftSplitStreamFromGenfor PCG and it passed them all. Are you where you where using the right generator? (the fast generator would be horrible for splitting, you'd want the multiple sequence generator (the standard one))Also I recently wrote a pure Haskell version of the standard generator if you're interested.
zaxtax commentedon Jun 17, 2016
Is this a pure Haskell version of splitmix?
On Fri, Jun 17, 2016 at 2:51 PM, Chris [email protected] wrote:
cchalmers commentedon Jun 17, 2016
No, a pure version of multiple sequence variant of PCG (I only had a pure version of the fast variant of PCG before).
17 remaining items
cartazio commentedon Feb 21, 2018
cartazio commentedon Feb 21, 2018
zaxtax commentedon Feb 25, 2018
cartazio commentedon Feb 25, 2018
@zaxtax the last bit I was stuck on (which the friendly inquiries last week prompted me to finally ) was what design to put in an intermediate release that wouldn't be a 100% breaking change for ( existing historical codes).
https://github.com/cartazio/random/tree/v1.2.0 is the current wip, doesn't include some of the cleanup, and i've also been figuring out how to formall characterize the set of types i can give clean semantics too, vs which ones are system / platform dependent. I want samplers to have clear meaning !
cartazio commentedon Feb 25, 2018
the system.random api there is mid refactor, because theres a subtle problem with the current api, its not portable between 32 bit and 64bit, and honestly those system dependent types should be under their own interface, at least wrt mathematical sampling code (vs system testing code)
cartazio commentedon Feb 25, 2018
(also this thread is strictly for technical discourse, anything else is not constructive, demotivating, and I will delete :) )
zaxtax commentedon Feb 25, 2018
cartazio commentedon Feb 25, 2018
@zaxtax as long as GHC tier 1 platforms include 32bit flavors, pretty important
thats not the actual blocker, even among 32bit platforms, some sizes of types can vary between OSes etc, though in haskell code thats usually isolated to C related types
cartazio commentedon Feb 25, 2018
either way, i have a satisfactory story for that issue now, so its now on the top of my oss queue... been buried under type system design work for a bit
zaxtax commentedon Feb 25, 2018
cartazio commentedon Feb 25, 2018
cartazio commentedon Feb 25, 2018
i'll be pushing periodically to https://github.com/haskell/random/tree/v1.2.0
Bodigrim commentedon Jun 24, 2020
I believe this discussion is obsolete now. Closing.