Using Pre-calculated Random Numbers for Zobrist Hashing

Discussion of chess software programming and technical issues.

Moderator: Ras

ZirconiumX
Posts: 1361
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: Using Pre-calculated Random Numbers for Zobrist Hashing

Post by ZirconiumX »

mcostalba wrote:
ZirconiumX wrote: Fruit also uses precomputed random numbers, IIRC to make probing Polyglot books quicker.
to make probing Polyglot books possible
Doesn't SF have its own PRNG? Surely the odds are way against the PRNG being able to generate *exactly* the same keys.

So wouldn't you have to regenerate the hash again?

Using the same keys natively would be quicker.

But since I have no status here, I'm not going to argue with you.

Matthew:out
tu ne cede malis, sed contra audentior ito
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Using Pre-calculated Random Numbers for Zobrist Hashing

Post by mcostalba »

ZirconiumX wrote: Doesn't SF have its own PRNG? Surely the odds are way against the PRNG being able to generate *exactly* the same keys.

So wouldn't you have to regenerate the hash again?

Using the same keys natively would be quicker.

But since I have no status here, I'm not going to argue with you.

Matthew:out
Matthew, all Polyglot books readers must use exactly the same random keys to guarantee interoperability.

The probability that a random PRNG is able to produce exactly the same 781 pseudo random 64bits keys in exactly the correct order is practically zero. So the only possibility to implement a Polyglot book is to copy the keys from the original source. No other way.

It is a pity that the author of the book format published just the keys and not the algorithm he used to generate them. That would have been nicer and allowed engine developers to recalculate Polyglot keys at startup...but unfortunatly this is currently not possible given the published information (at best of my knowledge).


P.S: You can argue with everybody, the validity of what all we write does not depend on what you call "status" (that means nothing), but, being a technical forum, depends on the content.
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

Re: Using Pre-calculated Random Numbers for Zobrist Hashing

Post by diep »

mcostalba wrote:
ZirconiumX wrote: Doesn't SF have its own PRNG? Surely the odds are way against the PRNG being able to generate *exactly* the same keys.

So wouldn't you have to regenerate the hash again?

Using the same keys natively would be quicker.

But since I have no status here, I'm not going to argue with you.

Matthew:out
Matthew, all Polyglot books readers must use exactly the same random keys to guarantee interoperability.

The probability that a random PRNG is able to produce exactly the same 781 pseudo random 64bits keys in exactly the correct order is practically zero. So the only possibility to implement a Polyglot book is to copy the keys from the original source. No other way.

It is a pity that the author of the book format published just the keys and not the algorithm he used to generate them. That would have been nicer and allowed engine developers to recalculate Polyglot keys at startup...but unfortunatly this is currently not possible given the published information (at best of my knowledge).


P.S: You can argue with everybody, the validity of what all we write does not depend on what you call "status" (that means nothing), but, being a technical forum, depends on the content.
You would be able to decrypt this in O ( n log n )

As for Diep - no chance to find the algorithm used to produce the book keys - as there wasn't any :)