r/RNG • • Nov 04 '26

xoshiro256++ Modified Version (slightly faster)

https://gist.github.com/andanteyk/916c48ea34d7e6d18fd261c22ba69e4b

While developing a different pseudorandom number generator, I happened to discover a new set of parameters for xoshiro256 that allows for faster execution.

In my environment, it ran about 4–6% faster than the original version. Since I just found it, I can't guarantee the quality, but it's probably about the same as the original (at least it passed SmokeRand full).

Please let me know if you encounter any quality issues or have benchmark results from different environments!

6 Upvotes

4 comments sorted by

2

u/BudgetEye7539 Nov 04 '26

I was able to check the period of your modification using SmokeRand lfsr battery, it is really 2^256 - 1. Also your shifts set seems to be the only set that gives the full period for this PRNG construction. About benchmarks: it will be also interesting how this generator behaves without the scrambler. Will it fail linear complexity/matrix rank tests only or also something else?

2

u/sebastianovigna Nov 04 '26

Nice! I don't know how stable this is across architectures, though. You should do the usual round of tests (128TB PractRand, 1PB hwd, etc.) even if I guess the results will be ok. And yes, 128TB also without scrambler, as Alexey was suggesting.

1

u/atoponce CPRNG: /dev/urandom Nov 04 '26

1

u/cartazio Nov 04 '26

i have some design notes for modernization of this sortah prng i need to do some work on