poniedziałek, 3 stycznia 2022 o 23:26:46 UTC+1 Chris M. Thomasson napisał(a):
> On 1/1/2022 6:25 PM,
osobli...@gmail.com wrote:
> > niedziela, 2 stycznia 2022 o 00:18:23 UTC+1 Chris M. Thomasson napisał(a):
> >> On 1/1/2022 6:16 AM,
osobli...@gmail.com wrote:
> >>> I would like to add that such generators perform worse when we use multipliers with a bad score in spectral tests.
> >>>
> >>> In PractRand they can withstand up to 2^23 bytes with bad multipliers (e.g. 65539 and 3722304989 - they are really bad) and with good multipliers (e.g. 2891336453 and 29943829) they do not wrap up to 2^27 bytes.
> >>>
> >>> On the output I use a bit mixer dedicated to LCG (taken from PCG generators), 32-bit to 16-bit version XSLRR by Melissa O'Neil (Python code):
> >>>
> >>>
> >>> def XSLRR(x):
> >>> count = x >> 28
> >>> x16 = (x ^ (x >> 16)) & 65535
> >>> x = (x16 >> count) | (x16 << (16 - count)) & 65535
> >>> return x
> >>>
> >>> Otherwise the generators would fail immediately. Either way, it's a very small range of scores in PractRand (2^23 vs 2^27) compared to the huge range between spectral scores in between mutipliers 65539, 3722304989 and 289133645, 29943829.
> >>>
> >>> I wonder what PractRand detects in this case? Why it prefers multipliers with good spectral scores? Theoretically, a spectral test even without an output mixer should not show anything (or maybe he will show something?). There must therefore be something else wrong with multipliers with bad spectral scores.
> >>
> >> Try it with the Salsa20 core as a mixer and see how it does:
> >>
> >>
https://en.wikipedia.org/wiki/Salsa20
> >
> > But Salsa20 needs 16 32-bit numbers of which 256 bits are the key. So how should I use this core? It seems to me that this will only obscure the matter. How will it relate to the answer on question, do spectral scores matter in my generator? Salsa20 has nothing to do with it.
> >
> >
> > By the way here the authors studied spectral scores and summarized as follows:
> >
> >
https://onlinelibrary.wiley.com/doi/full/10.1002/spe.3030
> [...]
>
> I was just thinking about using a LCG to create blocks that the Salsa20
> core can work on... Then output the result of the mix. Something like:
>
> create a block using LCG.
> mix it using Salsa20.
>
> output the result.
>
> create another block using LCG, xor it with the Salsa20 output, then run
> it through Salsa20 again, output, repeat.
>
> I wonder how the outputs score in various tests Btw, I am quite fond of ent:
>
>
https://www.fourmilab.ch/random/
>
> and DieHarder...
It would probably work like other mixers designed for LCG, for example PCG, madeup16, murmur32:
Maybe worse, maybe better. For sure it will be slow compared to PCG mixers, so there is no point in using such "big mixers" like salsa for LCG. What is more, they are not dedicated to LCG and you can certainly get better results by performing a much smaller number of mixing operations, but designed to overcome the drawbacks of LCG concretely.