X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=0130e85f7c6fd6888434cce6b5b93cf4f4a6a155;hp=0005391fd833f2ba5eb5b379f1964686b0450641;hb=314d446518daa035526be8539b23957ba4678468;hpb=c014444f09ace05e908909d9c5c60127e998b538 diff --git a/src/search.cpp b/src/search.cpp index 0005391f..0130e85f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -205,7 +205,7 @@ void Search::think() { else { // Check Tablebases at root - int piecesCnt = RootPos.total_piece_count(); + int piecesCnt = RootPos.count(WHITE) + RootPos.count(BLACK); TBCardinality = Options["SyzygyProbeLimit"]; TBProbeDepth = Options["SyzygyProbeDepth"] * ONE_PLY; if (TBCardinality > Tablebases::TBLargest) @@ -470,6 +470,7 @@ namespace { bool inCheck, givesCheck, singularExtensionNode, improving; bool captureOrPromotion, dangerous, doFullDepthSearch; int moveCount, quietCount; + int piecesCnt; // Step 1. Initialize node Thread* thisThread = pos.this_thread(); @@ -548,10 +549,12 @@ namespace { } // Step 4a. Tablebase probe + piecesCnt = pos.count(WHITE) + pos.count(BLACK); + if ( !RootNode - && pos.total_piece_count() <= TBCardinality - && ( pos.total_piece_count() < TBCardinality || depth >= TBProbeDepth ) - && pos.rule50_count() == 0) + && piecesCnt <= TBCardinality + && (piecesCnt < TBCardinality || depth >= TBProbeDepth) + && pos.rule50_count() == 0) { int found, v = Tablebases::probe_wdl(pos, &found);