From 760894dd1aea37b67c21e18f8ea2716f63fb81cb Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 6 Aug 2025 02:29:11 +0200 Subject: [PATCH] fixed ttHit bool | bench 10099292 --- source/search.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 8dfeb9b..3541070 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -363,11 +363,12 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (!ctx->excluded) entry = ctx->TT.GetRawEntry(board.hashKey); - const bool ttHit = entry != nullptr && entry->score != invalidEntry; + const bool ttHit = entry != nullptr + && entry->hashKey == board.hashKey; if constexpr (!isPV) { if (ttHit) { - if ((entry->hashKey == board.hashKey && entry->depth >= depth) && + if (entry->depth >= depth && ((entry->nodeType == PV) || (entry->nodeType == AllNode && entry->score <= alpha) || (entry->nodeType == CutNode && entry->score >= beta))) {