]> git.sesse.net Git - stockfish/commit
Move magic random to RKISS
authorMarco Costalba <mcostalba@gmail.com>
Wed, 12 Feb 2014 13:47:36 +0000 (14:47 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 12 Feb 2014 13:47:36 +0000 (14:47 +0100)
commite6523e56b8cc110aa38d698a993cb04b430e67b0
tree4b4cd48f18e2629b11cb385c3ad55fc296d711c2
parentb534176d4acc15ca5d7fdf3f44d1afb4e33c899a
Move magic random to RKISS

When initializing the magic numbers used to
compute sliding attacks, we endless generate a
random and test it as a possible magic.

In the general case this takes a lot of iterations,
but here, insteaad of picking a casual random, we
rotate it a couple of times and generate a number that
we know has a good probability to be a magic candidate.

This is becuase the quantities by which we rotate the
number are known in advance to produce quickly a good
canidate.

The patch, inspired by DON, just moves the shuffle to RKISS
changing the boosters to take in account a left rotation
instead of a right rotation as in the original.

No functional change.
src/bitboard.cpp
src/rkiss.h