stateless PRNGs

By: hobold (hobold.delete@this.vectorizer.org), March 26, 2022 10:32 am
Room: Moderated Discussions
Jörn Engel (joern.delete@this.purestorage.com) on March 25, 2022 9:30 pm wrote:
> hobold (hobold.delete@this.vectorizer.org) on March 25, 2022 2:34 pm wrote:

[...]
> > In its simplest form this is essentially a hash function that turns a given running index 0 .. N
>
> Err. hash(counter++) is a decent PRNG, assuming your hash is decent as
> well. But that isn't exactly stateless. Your state is the counter.

Yep, the counter is state information. But the counter isn't inherently owned by the PRNG. In quite a few practical cases the counter is "free" as the surrounding application already enumerates objects in a sequence. In that sense the PRNG can be stateless.

> And you can do slightly better if you increment the counter by a large odd number instead of 1. Basically,
> that allows you to weaken the hash function a little bit without compromising the PRNG quality.

Sounds like moving "Counter * LargeOddScaleFactor" from the callee to the caller. Is that really a win?
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Nvidia H100 Tensor Core GPUHopper2022/03/22 08:48 AM
  Nvidia H100 Tensor Core GPUMarcus2022/03/23 11:23 PM
    Nvidia H100 Tensor Core GPUdmcq2022/03/24 01:40 AM
      Nvidia H100 Tensor Core GPUMarcus2022/03/24 03:03 AM
        Pseudo-random number generator would provide reproducible stochastic rounding (NT)Paul A. Clayton2022/03/24 11:43 AM
          Pseudo-random number generator would provide reproducible stochastic roundingrwessel2022/03/24 01:28 PM
            Pseudo-random number generator would provide reproducible stochastic roundingAdrian2022/03/24 02:34 PM
              Pseudo-random number generator would provide reproducible stochastic roundingMarcus2022/03/25 12:57 AM
                Pseudo-random number generator would provide reproducible stochastic roundingAdrian2022/03/25 04:16 AM
                  Pseudo-random number generator would provide reproducible stochastic roundingMarcus2022/03/25 05:48 AM
                    Pseudo-random number generator would provide reproducible stochastic roundingAdrian2022/03/25 09:37 AM
                      stateless PRNGshobold2022/03/25 02:34 PM
                        stateless PRNGsJörn Engel2022/03/25 09:30 PM
                          stateless PRNGshobold2022/03/26 10:32 AM
                            stateless PRNGsJörn Engel2022/03/26 02:14 PM
                              stateless PRNGshobold2022/03/27 02:11 AM
                      Pseudo-random number generator would provide reproducible stochastic roundingblaine2022/03/26 01:09 PM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? 🍊