When stockfish see part 145 database, is that correct?
Code: Select all
Stockfish 240214 64 SSE4.2 by Tord Romstad, Marco Costalba and Joona Kiiski
info string Found 145 tablebases
ciao and thanks
Moderators: hgm, Rebel, chrisw
Code: Select all
Stockfish 240214 64 SSE4.2 by Tord Romstad, Marco Costalba and Joona Kiiski
info string Found 145 tablebases
That is correct.acconcio wrote:When stockfish see part 145 database, is that correct?
for example this is the code from search:syzygy wrote:That is correct.acconcio wrote:When stockfish see part 145 database, is that correct?
You probably mean that SF starts to search as normal on 5 piece positions. This is by design. See https://github.com/syzygy1/Stockfish under "What to expect" (not entirely up to date anymore, but the point remains: it is normal that SF does a search, it will however report large positive or negative scores if it is winning or losing).
Code: Select all
if ( !RootNode
&& depth >= TBProbeDepth
&& pos.count<ALL_PIECES>(WHITE) + pos.count<ALL_PIECES>(BLACK) <= TBCardinality
&& pos.rule50_count() == 0)
{
int found, v = Tablebases::probe_wdl(pos, &found);
if (found)
{
TBHits++;
if (TB50MoveRule) {
value = v < -1 ? -VALUE_MATE + MAX_PLY + ss->ply
: v > 1 ? VALUE_MATE - MAX_PLY - ss->ply
: VALUE_DRAW + 2 * v;
}
else
{
value = v < 0 ? -VALUE_MATE + MAX_PLY + ss->ply
: v > 0 ? VALUE_MATE - MAX_PLY - ss->ply
: VALUE_DRAW;
}
TT.store(posKey, value_to_tt(value, ss->ply), BOUND_EXACT,
depth + 6 * ONE_PLY, MOVE_NONE, VALUE_NONE);
return value;
}
}
Code: Select all
v = Tablebases::probe_wdl(pos, &found);
Code: Select all
value = v < -1 ? -VALUE_MATE + MAX_PLY + ss->ply
: v > 1 ? VALUE_MATE - MAX_PLY - ss->ply
On a position with 5 pieces, found should be true. If files are corrupted you are more likely to get a crash than found=false. The only integrity check that the probing code does is comparing the first 4 bytes of a file to a magic value.acconcio wrote:If there are 145 database (5men complete) and database is not corrupted and generated correctly afteris possible that syzygy returns found=false?Code: Select all
v = Tablebases::probe_wdl(pos, &found);
The possible return values from probe_wdl() are -2 / -1 / 0 / 1 / 2, which stand for loss / loss but 50-move draw / draw / win but 50-move draw / win, all from the point of view of the side to move.P.S.
If i can ask:<-1 or >1 is to report win/v>1 loss/v<-1?Code: Select all
value = v < -1 ? -VALUE_MATE + MAX_PLY + ss->ply : v > 1 ? VALUE_MATE - MAX_PLY - ss->ply
To be a bit more precise: from the point of view of the side to move and assuming the 50-move counter has just been reset. Typically, probe_wdl() will be called after a capture (into a position with 5 or 6 pieces), so that the 50-move counter indeed just has been reset.syzygy wrote:The possible return values from probe_wdl() are -2 / -1 / 0 / 1 / 2, which stand for loss / loss but 50-move draw / draw / win but 50-move draw / win, all from the point of view of the side to move.