Re: Issue with the PRNG used by Postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Parag Paul <parag(dot)paul(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Issue with the PRNG used by Postgres
Date: 2024-04-10 18:15:51
Message-ID: 4091915.1712772951@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> The blog post to which Parag linked includes this histogram as an
> example of a low-Hamming-weight situation:

That's an interesting post indeed, but I'm not sure how relevant
it is to us, because it is about Xoshiro not Xoroshiro, and the
latter is what we use. The last sentence of the blog post is

In this case, a mix of practice and theory has shown that the
structure of Xoshiro's state space is poorer than that of many
competing generation schemes, including Blackman's gjrand and
perhaps even Vigna and Blackman's earlier Xoroshiro scheme (which
has smaller zeroland expanses and does not appear to have similar
close-repeat problems), and its output functions are unable to
completely conceal these issues.

So while pg_prng.c might have the issue posited here, this blog
post is not evidence for that, and indeed might be evidence
against it. Someone would have to do similar analysis on the
code we *actually* use to convince me that we need to worry.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2024-04-10 18:20:48 Re: psql: Greatly speed up "\d tablename" when not using regexes
Previous Message stepan rutz 2024-04-10 18:14:00 Re: Detoasting optionally to make Explain-Analyze less misleading