From c108bfa786b29b71d321b930f41078df0f019726 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sun, 14 Sep 2025 01:29:35 +0200 Subject: [PATCH] bugfix in division | bench 6813804 --- source/search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 0ba25ea..87dbf54 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -584,7 +584,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC // Root if (!ply) { - ctx->nodesTable[currMove & 4095] += ctx->nodes - nodesBeforeSearch; + ctx->nodesTable[currMove % 4096] += ctx->nodes - nodesBeforeSearch; } if (ctx->searchStopped) return 0; @@ -711,7 +711,7 @@ public: static double ScaleTime(SearchContext *ctx, Move &move) { double notBmNodesFraction = - ctx->nodesTable[move & 4095] / ctx->nodes; + ctx->nodesTable[move % 4096] / double(ctx->nodes); double nodeScalingFactor = (1.5f - notBmNodesFraction) * 1.35f; return nodeScalingFactor;