diff --git a/source/search.cpp b/source/search.cpp index d154728..358388a 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -659,7 +659,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (ctx->searchStopped) return 0; if (!ctx->excluded) { - if (!board.InCheck() && (results.bestMove.IsQuiet()) + if (!board.InCheck() && ((results.bestMove.IsQuiet() || !results.bestMove)) && !(nodeType == AllNode && results.score >= staticEval)) { int corrHistBonus = std::clamp(results.score - staticEval, -CORRHIST_LIMIT, CORRHIST_LIMIT); diff --git a/source/search.h b/source/search.h index 229dd6b..44b671a 100644 --- a/source/search.h +++ b/source/search.h @@ -50,7 +50,7 @@ public: int* entry = &pawnHist[board.sideToMove][board.pawnKey % CORRHIST_SIZE]; const int scaledDiff = diff * CORRHIST_GRAIN; - const int newWeight = 4 * std::min(depth + 1, 16); + const int newWeight = std::min(depth * depth + 2 * depth + 1, 128); *entry = (*entry * (CORRHIST_WEIGHT_SCALE - newWeight) + scaledDiff * newWeight) / CORRHIST_WEIGHT_SCALE; *entry = std::clamp(*entry, -CORRHIST_MAX, CORRHIST_MAX);