From: Tord Romstad Date: Mon, 3 Aug 2009 07:08:59 +0000 (+0200) Subject: Added LMR at the root. X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=dad632ce5b075e8121bb783dec40d3c8fd4f5ffa Added LMR at the root. After 2000 games at 1+0 Mod vs Orig +534 =1033 -433 52.525% 1050.5/2000 +18 ELO --- diff --git a/src/search.cpp b/src/search.cpp index 252b4299..6829ab61 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -858,6 +858,7 @@ namespace { << " currmovenumber " << i + 1 << std::endl; // Decide search depth for this move + bool moveIsCapture = pos.move_is_capture(move); bool dangerous; ext = extension(pos, move, true, pos.move_is_capture(move), pos.move_is_check(move), false, false, &dangerous); newDepth = (Iteration - 2) * OnePly + ext + InitialDepth; @@ -883,15 +884,30 @@ namespace { } else { - value = -search(pos, ss, -alpha, newDepth, 1, true, 0); - if (value > alpha) + if (newDepth >= 3*OnePly + && i + MultiPV >= LMRPVMoves + && !dangerous + && !moveIsCapture + && !move_is_promotion(move) + && !move_is_castle(move)) { - // Fail high! Set the boolean variable FailHigh to true, and - // re-search the move with a big window. The variable FailHigh is - // used for time managment: We try to avoid aborting the search - // prematurely during a fail high research. - FailHigh = true; - value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0); + ss[0].reduction = OnePly; + value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0); + } + else + value = alpha + 1; // Just to trigger next condition + if(value > alpha) + { + value = -search(pos, ss, -alpha, newDepth, 1, true, 0); + if (value > alpha) + { + // Fail high! Set the boolean variable FailHigh to true, and + // re-search the move with a big window. The variable FailHigh is + // used for time managment: We try to avoid aborting the search + // prematurely during a fail high research. + FailHigh = true; + value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0); + } } }