]> git.sesse.net Git - stockfish/commitdiff
Use special null move technique in low depth.
authorJoona Kiiski <joona.kiiski@gmail.com>
Mon, 24 Aug 2009 17:06:09 +0000 (20:06 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 26 Aug 2009 15:30:39 +0000 (16:30 +0100)
Try good captures before null move when depth < 3 * OnePly.
Use this kind of null move also in Depth == OnePly.

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

index 8089345546a1f1c58c31a8f3365fe0f2cf388c24..7e338dbf62de586ec2e14fa0346eaab44c36b875 100644 (file)
@@ -45,6 +45,7 @@ namespace {
   CACHE_LINE_ALIGNMENT
   const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_NULL_MOVE, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
   const MovegenPhaseT MainSearchNoNullPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
   CACHE_LINE_ALIGNMENT
   const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_NULL_MOVE, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
   const MovegenPhaseT MainSearchNoNullPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
+  const MovegenPhaseT LowSearchPhaseTable[]  = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_NULL_MOVE, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
   const MovegenPhaseT EvasionsPhaseTable[] = { PH_STOP, PH_EVASIONS, PH_STOP};
   const MovegenPhaseT QsearchWithChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_QCHECKS, PH_STOP};
   const MovegenPhaseT QsearchWithoutChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_STOP};
   const MovegenPhaseT EvasionsPhaseTable[] = { PH_STOP, PH_EVASIONS, PH_STOP};
   const MovegenPhaseT QsearchWithChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_QCHECKS, PH_STOP};
   const MovegenPhaseT QsearchWithoutChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_STOP};
@@ -79,8 +80,10 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
 
   if (p.is_check())
       phasePtr = EvasionsPhaseTable;
 
   if (p.is_check())
       phasePtr = EvasionsPhaseTable;
-  else if (d > Depth(0))
+  else if (d >= Depth(3 * OnePly))
       phasePtr = useNullMove ? MainSearchPhaseTable : MainSearchNoNullPhaseTable;
       phasePtr = useNullMove ? MainSearchPhaseTable : MainSearchNoNullPhaseTable;
+  else if (d > Depth(0))
+      phasePtr = useNullMove ? LowSearchPhaseTable : MainSearchNoNullPhaseTable;
   else if (d == Depth(0))
       phasePtr = QsearchWithChecksPhaseTable;
   else
   else if (d == Depth(0))
       phasePtr = QsearchWithChecksPhaseTable;
   else
index 804108b42b3815487692eac98bfa866c69ad9a6d..944d9c6926a6b8a4e71eb0617f03743e5f380e0a 100644 (file)
@@ -1282,7 +1282,7 @@ namespace {
     bool isCheck = pos.is_check();
 
     bool useNullMove = (    allowNullmove
     bool isCheck = pos.is_check();
 
     bool useNullMove = (    allowNullmove
-                        &&  depth > OnePly
+                        //&&  depth > OnePly
                         && !isCheck
                         && !value_is_mate(beta)
                         &&  ok_to_do_nullmove(pos)
                         && !isCheck
                         && !value_is_mate(beta)
                         &&  ok_to_do_nullmove(pos)