X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=025c1141c97546e6e98693877fad9afff26336d5;hp=a4b2ef348566eb4b62d462e0e8c63b62c1343eae;hb=91a76331ca27b40d63f0031fbd7b9e41ead354d4;hpb=76d4a80084f2ff61b0ea433ac829914370736b5e diff --git a/src/search.cpp b/src/search.cpp index a4b2ef34..025c1141 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -577,6 +577,17 @@ namespace { beta = std::min(mate_in(ss->ply+1), beta); if (alpha >= beta) return alpha; + + // Check if there exists a move which draws by repetition, or an alternative + // earlier move to this position. + if ( pos.rule50_count() >= 3 + && alpha < VALUE_DRAW + && pos.has_game_cycle(ss->ply)) + { + alpha = VALUE_DRAW; + if (alpha >= beta) + return alpha; + } } assert(0 <= ss->ply && ss->ply < MAX_PLY); @@ -737,7 +748,7 @@ namespace { && (ss-1)->statScore < 22500 && eval >= beta && ss->staticEval >= beta - 36 * depth / ONE_PLY + 225 - && !ss->excludedMove + && !excludedMove && pos.non_pawn_material(pos.side_to_move()) && (ss->ply >= thisThread->nmp_ply || ss->ply % 2 != thisThread->nmp_odd)) { @@ -1153,7 +1164,7 @@ moves_loop: // When in check, search starts from here update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, -stat_bonus(depth + ONE_PLY)); } // Bonus for prior countermove that caused the fail low - else if ( depth >= 3 * ONE_PLY + else if ( (depth >= 3 * ONE_PLY || PvNode) && !pos.captured_piece() && is_ok((ss-1)->currentMove)) update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth));