Page 2 of 2

Re: rkiss and other dependencies in syzygy

Posted: Wed Oct 23, 2013 7:34 pm
by syzygy
Don wrote:Then I look and see this:

static RKISS rk;

And not a single reference to it in your code.
It's just a seed for a random generator, but it's not used anymore so I should have removed it. Just delete the line and the include file.

Bitboard is just uint64.
pop_lsb is what it says.
Position is what Stockfish calls its position class. Komodo surely has one but it will be a bit different. What must be extracted is:
- number of pieces of particular type and color;
- squares of those pieces for a particuar type and color;
- material signature (the code assumes you already have one, which seems reasonable, which saves the effort of calculating one);
- side to move;
- 50-move counter.
Somewhat tricky is has_repeated(): does the game history since the last reset of the 50-move counter contain two identical positions. I should have added a comment there.

MoveStack, StateInfo and CheckInfo are just things that Stockfish happens to require to generate and make moves. You know how to do this in Komodo.

Zobrist* is used only for calculating the material signature the way Stockfish does it. You should calculate it the way Komodo does it (in calc_key() and calc_key_from_pcs()).

Basically just delete everything you don't understand but keep the comments.

Re: rkiss and other dependencies in syzygy

Posted: Wed Oct 23, 2013 7:38 pm
by Don
syzygy wrote:
Don wrote:Then I look and see this:

static RKISS rk;

And not a single reference to it in your code.
It's just a seed for a random generator, but it's not used anymore so I should have removed it. Just delete the line and the include file.

Bitboard is just uint64.
pop_lsb is what it says.
Position is what Stockfish calls its position class. Komodo surely has one but it will be a bit different. What must be extracted is:
- number of pieces of particular type and color;
- squares of those pieces for a particuar type and color;
- material signature (the code assumes you already have one, which seems reasonable, which saves the effort of calculating one);
- side to move;
- 50-move counter.
Somewhat tricky is has_repeated(): does the game history since the last reset of the 50-move counter contain two identical positions. I should have added a comment there.

MoveStack, StateInfo and CheckInfo are just things that Stockfish happens to require to generate and make moves. You know how to do this in Komodo.

Basically just delete everything you don't understand but keep the comments.
Ok, I basically removed all the includes that are based on stockfish and implementing your functions one by one the komodo way. And yes, in Komodo I have a position state called "position" - so it's more or less straightforward.

Don

Re: rkiss and other dependencies in syzygy

Posted: Wed Oct 23, 2013 10:01 pm
by syzygy
Don wrote:Just so that I don't spin my wheels, which version of Stockfish do I have to download to understand this code? Is the latest official release good enough or do I have to get one of the new development versions?
Maybe it is easiest to look here:
https://github.com/syzygy1/Stockfish

This is an up to date Stockfish with slightly updated probing code. It also has a root_probe_wdl() function that can serve as a fallback in case DTZ tables are not available. In addition, it has an updated initialisation function (Tablebases::init()) that can be invoked with a path to the various tablebase directories. This fits better with the UCI way of doing things.

(Oh, I see I am responding to an older post I had missed earlier.)

Re: rkiss and other dependencies in syzygy

Posted: Wed Oct 23, 2013 10:05 pm
by Don
syzygy wrote:
Don wrote:Just so that I don't spin my wheels, which version of Stockfish do I have to download to understand this code? Is the latest official release good enough or do I have to get one of the new development versions?
Maybe it is easiest to look here:
https://github.com/syzygy1/Stockfish

This is an up to date Stockfish with slightly updated probing code. It also has a root_probe_wdl() function that can serve as a fallback in case DTZ tables are not available. In addition, it has an updated initialisation function (Tablebases::init()) that can be invoked with a path to the various tablebase directories. This fits better with the UCI way of doing things.

(Oh, I see I am responding to an older post I had missed earlier.)
Thanks, I'll use that one then.

Don

Re: rkiss and other dependencies in syzygy

Posted: Thu Oct 24, 2013 9:58 am
by JohnS
Don wrote:
static RKISS rk;
Don't know anything about syzygy, but rkiss (kiss) is a random number generator from George Marsaglia: http://www.math.niu.edu/~rusin/known-math/99/RNG.

Rkiss generates random 32-bit real numbers between 0 and 1. You could use lots of other generators instead such as the ones Marsaglia describes presuming the choice is not critical for syzygy.