From 2e952b0f92039edd2db752857f8ca05e4e336eb6 Mon Sep 17 00:00:00 2001 From: rektdie Date: Fri, 20 Mar 2026 23:15:54 +0100 Subject: [PATCH] placed qs see above makemove | bench 1302405 --- source/search.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 7c735b6..c41189b 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -230,6 +230,10 @@ static bool IsDecisive(int score) { return std::abs(score) > WIN_SCORE; } +static bool IsLoss(int score) { + return score < -WIN_SCORE; +} + template static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) { if (ShouldStop(ctx)) return 0; @@ -295,12 +299,17 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear Move currMove; while ((currMove = mp.Next())) { - // QS FP - if (!board.InCheck() && currMove.IsCapture() && - fpScore <= alpha && !SEE(board, currMove, 1)) { + if (!IsLoss(bestScore)) { + // QS FP + if (!board.InCheck() && currMove.IsCapture() && + fpScore <= alpha && !SEE(board, currMove, 1)) { - bestScore = std::max(bestScore, fpScore); - continue; + bestScore = std::max(bestScore, fpScore); + continue; + } + + if (!SEE(board, currMove, seeQsThreshold)) + continue; } if (!board.IsLegal(currMove)) continue; @@ -311,9 +320,6 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear ctx->ss[ply].moveTo = currMove.MoveTo(); ctx->ss[ply].side = board.sideToMove; - if (!SEE(board, currMove, seeQsThreshold)) - continue; - if (copy.positionIndex >= ctx->positionHistory.size()) { ctx->positionHistory.resize(copy.positionIndex + 100); }