From 93339c77288d149497ebe33e470653b44e0289f1 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sun, 21 Sep 2025 17:14:33 +0200 Subject: [PATCH] writing to tt in qs | bench 6088444 --- source/search.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/search.cpp b/source/search.cpp index 99f498e..1ca6741 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -320,6 +320,8 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear SearchResults results; + int nodeType = AllNode; + for (int i = 0; i < board.currentMoveIndex; i++) { // QS FP if (!board.InCheck() && board.moveList[i].IsCapture() && @@ -351,12 +353,16 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear int score = -Quiescence(copy, -beta, -alpha, ply + 1, ctx).score; if (score >= beta) { + if (!ctx->excluded) { + ctx->TT.WriteEntry(board.hashKey, 0, score, CutNode, board.moveList[i]); + } return score; } bestScore = std::max(score, bestScore); if (score > alpha) { + nodeType = PV; alpha = score; results.bestMove = board.moveList[i]; } @@ -364,6 +370,9 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear results.score = bestScore; if (ctx->searchStopped) return 0; + if (!ctx->excluded) { + ctx->TT.WriteEntry(board.hashKey, 0, results.score, nodeType, results.bestMove); + } return results; }