From 40339b2d4591389bbf6fd3e7c7bbf2d2304a8cad Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 3 Sep 2025 01:21:16 +0200 Subject: [PATCH] changed the pawnhist update function | bench 8216434 --- source/search.cpp | 2 +- source/search.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);