]> git.sesse.net Git - stockfish/commit
Fix fragile code to use proper random 64 bit keys.
authormstembera <MissingEmail@email>
Sat, 27 Jun 2020 00:26:46 +0000 (17:26 -0700)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 28 Jun 2020 19:57:37 +0000 (21:57 +0200)
commitde24fcebc873ce2d65b30e039745dbc2e851f443
treea12b85e531fc576aaf6c4986db9dab44b568941f
parentca41ee6632368676a2fb98fd2970ac9b183f0aa9
Fix fragile code to use proper random 64 bit keys.

This fixes an old issue where we want to make a position unique but only
change a small number of bits in the key instead of all 64 of them randomly.
This is fragile and can lead to non uniqueness issues in the TT.

Key make_key(uint64_t seed) takes any integer and produces a unique random 64 bit key.
It is computationally efficient and is based on a congruential pseudo random number
generator using well tested constants by Donald Knuth
(see https://en.wikipedia.org/wiki/Linear_congruential_generator)

STC https://tests.stockfishchess.org/tests/view/5ef6c78f761b685b4c724bb6
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 154320 W: 29343 L: 29376 D: 95601
Ptnml(0-2): 2543, 18170, 35891, 17889, 2667

LTC https://tests.stockfishchess.org/tests/view/5ef7d1a9020eec13834a940e
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 53488 W: 6629 L: 6584 D: 40275
Ptnml(0-2): 372, 4878, 16183, 4955, 356

closes https://github.com/official-stockfish/Stockfish/pull/2773

bench: 4626776
src/search.cpp
src/types.h