X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=517499b543971798d432ab0856049ce11a8343a2;hb=e89bc30fdc93f739869d0d4b285a2cfc3e7a74ee;hp=f9fdc261b16c9185520fa79d7a0d02e0eccdf2a6;hpb=6373fd56e90bc6114230a70cacad804248d955e2;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index f9fdc261..517499b5 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -606,6 +606,15 @@ namespace { : ttHit ? tte->move() : MOVE_NONE; ttPv = (ttHit && tte->is_pv()) || (PvNode && depth > 4 * ONE_PLY); + // If position has been searched at higher depths and we are shuffling, + // return value_draw. + if ( pos.rule50_count() > 36 - 6 * (pos.count() > 14) + && ss->ply > 36 - 6 * (pos.count() > 14) + && ttHit + && tte->depth() > depth + && pos.count() > 0) + return VALUE_DRAW; + // At non-PV nodes we check for an early TT cutoff if ( !PvNode && ttHit @@ -927,6 +936,14 @@ moves_loop: // When in check, search starts from here else if (type_of(move) == CASTLING) extension = ONE_PLY; + // Shuffle extension + else if ( PvNode + && pos.rule50_count() > 18 + && ss->ply > 18 + && depth < 3 * ONE_PLY + && ss->ply < 3 * thisThread->rootDepth / ONE_PLY) // To avoid infinite loops + extension = ONE_PLY; + // Passed pawn extension else if ( move == ss->killers[0] && pos.advanced_pawn_push(move)