]> git.sesse.net Git - stockfish/commitdiff
LMR dynamic reduction
authorMarco Costalba <mcostalba@gmail.com>
Fri, 20 Mar 2009 11:33:30 +0000 (12:33 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 22 Mar 2009 22:53:22 +0000 (23:53 +0100)
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 <mcostalba@gmail.com>
src/movepick.cpp
src/search.cpp

index d9fe8d2cf329c2cf4fe109efec6f0225f329611d..6a7fd4ebce3e50bcc8d598b5d04702ad4fe7a455 100644 (file)
@@ -141,8 +141,8 @@ Move MovePicker::get_next_move() {
             assert(move_is_ok(mateKiller));
             if (move_is_legal(pos, mateKiller, pinned))
                 return mateKiller;
             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);
 
     case PH_GOOD_CAPTURES:
         numOfMoves = generate_captures(pos, moves);
index 8d6ddb8d33708c7443c6c8fb8b8a02d893c21b2a..295ef63ea24d1c9645b26aa694b5be0c353e7f8c 100644 (file)
@@ -1332,8 +1332,11 @@ namespace {
           && !move_is_castle(move)
           && !move_is_killer(move, ss[ply]))
       {
           && !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
       }
       else
         value = beta; // Just to trigger next condition