]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Add a second margin to razoring
[stockfish] / src / search.cpp
index bb6ba9ac5ee84bebbf2aba40f18bff3766d2ae12..10aa196add95d87944db24863eb1cbd5c764010e 100644 (file)
@@ -1122,7 +1122,8 @@ namespace {
         }
     }
     // Null move search not allowed, try razoring
-    else if (depth < RazorDepth && approximateEval < beta - RazorMargin)
+    else if (  (approximateEval < beta - RazorMargin && depth < RazorDepth)
+             ||(approximateEval < beta - PawnValueMidgame && depth <= OnePly))
     {
         Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
         if (v < beta)
@@ -1162,7 +1163,7 @@ namespace {
 
       bool singleReply = (isCheck && mp.number_of_moves() == 1);
       bool moveIsCheck = pos.move_is_check(move, dcCandidates);
-      bool moveIsGoodCapture = (mp.current_move_type() == MovePicker::PH_GOOD_CAPTURES);
+      bool moveIsCapture = pos.move_is_capture(move);
       bool moveIsPassedPawnPush = pos.move_is_passed_pawn_push(move);
 
       movesSearched[moveCount++] = ss[ply].currentMove = move;
@@ -1174,7 +1175,7 @@ namespace {
       // Futility pruning
       if (    useFutilityPruning
           &&  ext == Depth(0)
-          && !moveIsGoodCapture
+          && !moveIsCapture
           && !moveIsPassedPawnPush
           && !move_promotion(move))
       {
@@ -1206,7 +1207,7 @@ namespace {
       if (   depth >= 2*OnePly
           && ext == Depth(0)
           && moveCount >= LMRNonPVMoves
-          && !moveIsGoodCapture
+          && !moveIsCapture
           && !move_promotion(move)
           && !moveIsPassedPawnPush
           && !move_is_castle(move)
@@ -2020,6 +2021,7 @@ namespace {
     assert(threat == MOVE_NONE || move_is_ok(threat));
     assert(!move_promotion(m));
     assert(!pos.move_is_check(m));
+    assert(!pos.move_is_capture(m));
     assert(!pos.move_is_passed_pawn_push(m));
     assert(d >= OnePly);
 
@@ -2171,6 +2173,12 @@ namespace {
     {
         lastInfoTime = t;
         lock_grab(&IOLock);
+        if (dbg_show_mean)
+            dbg_print_mean();
+
+        if (dbg_show_hit_rate)
+            dbg_print_hit_rate();
+
         std::cout << "info nodes " << nodes_searched() << " nps " << nps()
                   << " time " << t << " hashfull " << TT.full() << std::endl;
         lock_release(&IOLock);