X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=6cc115fcf94371304aaabe328414b160e39ece66;hp=3da3d04ea963e579b7d2c6154015eb7cc1a8ee19;hb=befbcffb4e4c5d2ebfb9504b059a337ae4a60ece;hpb=87586b3d0c8961c2fc9330e2f8ac2f8c3fe79018 diff --git a/src/search.cpp b/src/search.cpp index 3da3d04e..6cc115fc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1233,7 +1233,13 @@ moves_loop: // When in check, search starts from here r++; // Decrease/increase reduction for moves with a good/bad history (~30 Elo) - r -= ss->statScore / 14884; + // If we are not in check use statScore, if we are in check + // use sum of main history and first continuation history with an offset + if (ss->inCheck) + r -= (thisThread->mainHistory[us][from_to(move)] + + (*contHist[0])[movedPiece][to_sq(move)] - 4333) / 16384; + else + r -= ss->statScore / 14884; } Depth d = std::clamp(newDepth - r, 1, newDepth);