From: Marco Costalba Date: Fri, 20 Mar 2009 11:33:30 +0000 (+0100) Subject: LMR dynamic reduction X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=24b7ad54c747ef38818484567624696fe3ef5e9e LMR dynamic reduction Reduce of two plies near the leafs and when we still have enough depth to go so to limit horizon effects. Signed-off-by: Marco Costalba --- diff --git a/src/movepick.cpp b/src/movepick.cpp index d9fe8d2c..6a7fd4eb 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -141,8 +141,8 @@ Move MovePicker::get_next_move() { assert(move_is_ok(mateKiller)); if (move_is_legal(pos, mateKiller, pinned)) return mateKiller; - } - break; + } + break; case PH_GOOD_CAPTURES: numOfMoves = generate_captures(pos, moves); diff --git a/src/search.cpp b/src/search.cpp index 8d6ddb8d..295ef63e 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1332,8 +1332,11 @@ namespace { && !move_is_castle(move) && !move_is_killer(move, ss[ply])) { - ss[ply].reduction = OnePly; - value = -search(pos, ss, -(beta-1), newDepth-OnePly, ply+1, true, threadID); + // LMR dynamic reduction + Depth R = (moveCount >= 3 * LMRNonPVMoves && depth >= 7*OnePly ? 2*OnePly : OnePly); + + ss[ply].reduction = R; + value = -search(pos, ss, -(beta-1), newDepth-R, ply+1, true, threadID); } else value = beta; // Just to trigger next condition