Skip to content

SmallRng seed is too big, and seedability #1054

@SamiPerttu

Description

@SamiPerttu

Hi, I noticed the new SmallRng, and while a welcome change I'm sure, I believe there's still room for improvements. I'm thinking about seedability issues specifically and in general also.

I think it's a bad idea to require, well, pretty much anything from users regarding seed distributions, especially if it's an RNG recommended for general use. Non-specialist RNGs should handle such pesky issues themselves. Users are going to pick seeds 0, 1, 2, ... To expect anything more is madness. And we should absolutely deal with that reality.

My specific suggestion at this point is to make the default seeding procedure of SmallRng idiot proof: reduce the seed size to 192 or 128 bits and hash it, like with a 64-bit seed. (The 64-bit initialization looks very good now after SplitMix64.) Because the state space is not full 256 bits, this problem can't be fixed without reducing the seed size. It depends on your perspective whether it's a real problem, but I think we have all the tools at hand to deal with seedability and improve the user experience even more in this regard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions