So at non-root-node I do this (even inside PV): if a wdl score is available, I return it, adding the static evaluation to it if it is a real win/loss, TB_WIN_SCORE being +2000cp. I add evaluation so that search leads to mate in classic endgame (eval is using the classic push to edge things).
I always update TT entry as "exact" score with a giant depth.
Code: Select all
ScoreType tbScore = 0;
if ( !rootnode && skipMove==INVALIDMOVE && (countBit(p.allPieces[Co_White]|p.allPieces[Co_Black])) <= SyzygyTb::MAX_TB_MEN && SyzygyTb::probe_wdl(p, tbScore, false) > 0){
++stats.counters[Stats::sid_tbHit1];
if ( abs(tbScore) == SyzygyTb::TB_WIN_SCORE) tbScore += eval(p, gp);
TT::setEntry({INVALIDMOVE,createHashScore(tbScore,ply),tbScore,TT::B_exact,DepthType(200),computeHash(p)});
return tbScore;
}
Code: Select all
if (rootnode && (countBit(p.allPieces[Co_White] | p.allPieces[Co_Black])) <= SyzygyTb::MAX_TB_MEN) {
ScoreType tbScore = 0;
if (SyzygyTb::probe_root(*this, p, tbScore, moves) < 0) { // only good moves if TB success
if (capMoveGenerated) generate<GP_quiet>(p, moves, true);
else generate<GP_all> (p, moves, false);
}
else ++stats.counters[Stats::sid_tbHit2];
moveGenerated = true;
}