|
From: Tobias C. R. <tc...@fr...> - 2010-02-12 20:21:12
|
> 1.0.35.9: Add support for non-trivial random seeds > > SBCL is using the popular MT19937 PRNG algorithm, but up until now, > was only seeding the initial random state with a 32-bit seed, and > choosing a seed subject to a lot of collisions (a second-precise timer) > when called with (MAKE-RANDOM-STATE T). > > This patch adds and documents an SBCL extension to MAKE-RANDOM-STATE > that supports initializing a random-state based on an arbitrary UNSIGNED-BYTE > or a (SIMPLE-ARRAY (UNSIGNED-BYTE 8)). Also supported (but documented as > not officially so) is a (SIMPLE-ARRAY (UNSIGNED-BYTE 32)). Last but not least, > (MAKE-RANDOM-STATE T) will try to initialize the random state by reading > 256 bits from /dev/urandom, which should eliminate the collision problem and > make SBCL's PRNG suitable for more applications than before. > > Finally, we use in our random-state initialization routines the very same > algorithms that the author of MT19937 recommends in the latest version > of his C source, and we have tested the output to be identical (see > November 2009 discussion in the sbcl-devel mailing-list). It seems like this commit caused failings of MAKE-RANDOM-STATE.ERROR.4 and PRINT.RANDOM-STATE.1 from the ansi test suite. -T. |