]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Razor at depth one, but do razoring only when not in check
[stockfish] / src / search.cpp
index 44bd9530d3e6a5f362de24fcb1ce438b5e86d24c..40808c6adfc77797484fb196cb8c14310d16837e 100644 (file)
@@ -652,6 +652,7 @@ void SearchStack::init(int ply) {
   pv[ply] = pv[ply + 1] = MOVE_NONE;
   currentMove = threatMove = MOVE_NONE;
   reduction = Depth(0);
+  eval = VALUE_NONE;
 }
 
 void SearchStack::initKillers() {
@@ -1391,6 +1392,7 @@ namespace {
     const int FutilityValueMargin = 112 * bitScanReverse32(int(depth) * int(depth) / 2);
 
     // Enhance score accuracy with TT value if possible
+    ss[ply].eval = staticValue;
     futilityValue = staticValue + FutilityValueMargin;
     staticValue = refine_eval(tte, staticValue, ply);
 
@@ -1445,8 +1447,9 @@ namespace {
     }
     // Null move search not allowed, try razoring
     else if (   !value_is_mate(beta)
+             && !isCheck
              && depth < RazorDepth
-             && staticValue < beta - (depth > OnePly ? NullMoveMargin + 16 * depth : 2*NullMoveMargin)
+             && staticValue < beta - (NullMoveMargin + 16 * depth)
              && ss[ply - 1].currentMove != MOVE_NULL
              && ttMove == MOVE_NONE
              && !pos.has_pawn_on_7th(pos.side_to_move()))