placed qs see above makemove | bench 1302405 #162

Merged
rektdie merged 1 commits from qs-see-reorder into main 2026-03-20 23:38:35 +01:00
+14 -8
View File
@@ -230,6 +230,10 @@ static bool IsDecisive(int score) {
return std::abs(score) > WIN_SCORE; return std::abs(score) > WIN_SCORE;
} }
static bool IsLoss(int score) {
return score < -WIN_SCORE;
}
template <bool isPV, searchMode mode> template <bool isPV, searchMode mode>
static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) { static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) {
if (ShouldStop<mode>(ctx)) return 0; if (ShouldStop<mode>(ctx)) return 0;
@@ -295,12 +299,17 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear
Move currMove; Move currMove;
while ((currMove = mp.Next())) { while ((currMove = mp.Next())) {
// QS FP if (!IsLoss(bestScore)) {
if (!board.InCheck() && currMove.IsCapture() && // QS FP
fpScore <= alpha && !SEE(board, currMove, 1)) { if (!board.InCheck() && currMove.IsCapture() &&
fpScore <= alpha && !SEE(board, currMove, 1)) {
bestScore = std::max(bestScore, fpScore); bestScore = std::max(bestScore, fpScore);
continue; continue;
}
if (!SEE(board, currMove, seeQsThreshold))
continue;
} }
if (!board.IsLegal(currMove)) 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].moveTo = currMove.MoveTo();
ctx->ss[ply].side = board.sideToMove; ctx->ss[ply].side = board.sideToMove;
if (!SEE(board, currMove, seeQsThreshold))
continue;
if (copy.positionIndex >= ctx->positionHistory.size()) { if (copy.positionIndex >= ctx->positionHistory.size()) {
ctx->positionHistory.resize(copy.positionIndex + 100); ctx->positionHistory.resize(copy.positionIndex + 100);
} }