Menu

State and Randomness

IgneousRed
2024-09-09
2024-09-14
  • IgneousRed

    IgneousRed - 2024-09-09

    If a 4 word PRNG shows the (Extended+MaxFold) failures as:
    8bit word => 2^30
    16bit word => 2^36
    32bit word => 2^42
    64bit word => 2^45+

    It is not state efficient, but is that fine if it is fast?
    You surely won't name it "future-proof", but would you recommend 64bit version? And why/not?

    Also from https://pracrand.sourceforge.net/ I get the sense that you hold 8bit PRNGs to the same standard of randomness as 64bit ones, why is that?
    From my perspective If one uses 8bit on a micro-controller they probably won't generate or need terabytes of random numbers.

     
  • - 2024-09-10

    Probably not. I mean, if there are other PRNGs that seem comparable in most ways but are better quality, I'd tend to recommend the better quality ones for whatever niche they were competing in.

    And the fact that it fails at 2^36 bytes for an 8 byte state and 2^42 bytes for a 16 byte state would worry me. That implies that even if the 64-bit version passed very large tests, it's might be because the tests couldn't keep track of correlations at the right distances or whatever - and there would be a faint chance that some real world application that might use it would happen to care about that particular correlation distance. The objective ratings would get whatever they objectively get, but subjective ratings would reflect my fears, and final recommendation would depend upon what other PRNGs occupy the same niche (I presume sfc & jsf, based upon "a 4 word PRNG", but if it's monocyclic or something then maybe not).

    And, yes, typical uses for 8-bit microcontrollers probably don't need terabytes of PRNG output. But for something like sfc8, the cycle length distribution is so awful I don't feel I can possibly recommend it, even for users of 8-bit microcontrollers. There are a lot of ways I could address that, but I don't actually hear from anyone using this on 8-bit micro-controllers, so I haven't gotten around to doing a PRNG specifically for 8-bits. The documentation just points as a high-quality PRNG that can operate on 8-bit integers (it uses a lot of memory by micro-controller standards, but that's adjustable, it doesn't actually need the memory if it's not trying to compete with cryptographic PRNGs - IIRC even if you reduce it to 8 bit integers and both arrays at size 1, meaning 48 bits of state, it still passes all PractRand tests out to near the maximum possible for that state size - when I actually want to force a failure before cycle exhaustion I resort to reducing integer size to 4 bits), and suggested using sfc16 if they didn't like that option - 16 bit shifts are a bit slow on 8 bit microcontrollers, but not unreasonable.

     
  • IgneousRed

    IgneousRed - 2024-09-10

    The RNG I am currently making is indeed a CountingChaotic type and is almost twice as fast on AArch64 than SFC, without using multiplication and should be easy to make it SIMD .

    I will create another topic when my long tests confirm some things.

    Also I want to say thank you for creating this amazing software!
    Cant wait for the next version (been quite a while), hopefully the 0 generator won't make a fatal error, and for folded FPF test not failing randomly with data below 2^20 :D

     

    Last edit: IgneousRed 2024-09-10
  • IgneousRed

    IgneousRed - 2024-09-13

    Just now caught an error...

    And the fact that it fails at 2^36 bytes for an 8 byte state and 2^42 bytes for a 16 byte state would worry me.

    That is not what I wrote, also 8bit version has 32bit state, and failure after 2^30 is about as much as would be expected.
    The problem is that it scales bad.

     

    Last edit: IgneousRed 2024-09-13
  • - 2024-09-13

    What?

    If a 4 word PRNG shows the (Extended+MaxFold) failures as:
    16bit word => 2^36

    16 bits is 2 bytes. 4 times 2 bytes is 8 bytes of state. Is that not saying that failures occur after 2^36 bytes with a state size of 8 bytes?

     
  • IgneousRed

    IgneousRed - 2024-09-14

    If a 4 word PRNG shows the (Extended+MaxFold) failures as:
    8bit word => 2^30
    16bit word => 2^36
    32bit word => 2^42
    64bit word => 2^45+

    Is what I wrote. Is this ModernSoftware™ moment? :D
    Maybe I am just dumb

     

    Last edit: IgneousRed 2024-09-14

Log in to post a comment.