]> git.sesse.net Git - stockfish/commitdiff
Decrease NullMoveMargin and adjust razoring
authorMarco Costalba <mcostalba@gmail.com>
Sun, 10 Jan 2010 00:12:15 +0000 (01:12 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 11 Jan 2010 20:17:02 +0000 (21:17 +0100)
Also retire razoring margins vector and use
a simpler formula instead.

Now that we use a more accurate static evaluation
try to avoid useless null searches when we are well
below beta. And for teh same reason increase a bit
the razoring.

After 972 games at 1+0
Mod vs Orig +224 =558 -190 +12 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index ea9240e56e5664d2c0dafe7509fac4cc783939a2..44bd9530d3e6a5f362de24fcb1ce438b5e86d24c 100644 (file)
@@ -172,9 +172,9 @@ namespace {
   // best move from the previous iteration, Problem is set back to false.
   const Value NoProblemMargin = Value(0x14);
 
-  // Null move margin. A null move search will not be done if the approximate
+  // Null move margin. A null move search will not be done if the static
   // evaluation of the position is more than NullMoveMargin below beta.
-  const Value NullMoveMargin = Value(0x300);
+  const Value NullMoveMargin = Value(0x200);
 
   // If the TT move is at least SingleReplyMargin better then the
   // remaining ones we will extend it.
@@ -190,13 +190,6 @@ namespace {
   // Depth limit for razoring
   const Depth RazorDepth = 4 * OnePly;
 
-  // Remaining depth:                 1 ply         1.5 ply       2 ply         2.5 ply       3 ply         3.5 ply
-  const Value RazorMargins[6]     = { Value(0x180), Value(0x300), Value(0x300), Value(0x3C0), Value(0x3C0), Value(0x3C0) };
-
-  // Remaining depth:                 1 ply         1.5 ply       2 ply         2.5 ply       3 ply         3.5 ply
-  const Value RazorApprMargins[6] = { Value(0x520), Value(0x300), Value(0x300), Value(0x300), Value(0x300), Value(0x300) };
-
-
   /// Variables initialized by UCI options
 
   // Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes
@@ -1453,12 +1446,12 @@ namespace {
     // Null move search not allowed, try razoring
     else if (   !value_is_mate(beta)
              && depth < RazorDepth
-             && staticValue < beta - RazorApprMargins[int(depth) - 2]
+             && staticValue < beta - (depth > OnePly ? NullMoveMargin + 16 * depth : 2*NullMoveMargin)
              && ss[ply - 1].currentMove != MOVE_NULL
              && ttMove == MOVE_NONE
              && !pos.has_pawn_on_7th(pos.side_to_move()))
     {
-        Value rbeta = beta - RazorMargins[int(depth) - 2];
+        Value rbeta = beta - (NullMoveMargin + 16 * depth);
         Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply, threadID);
         if (v < rbeta)
           return v;