Skip to content

Commit 0d8e8ce

Browse files
🦈 IMP: Avoid Entering Quiescence Search Under Check
--- STC --- Elo | 2.88 +- 2.31 (95%) SPRT | 10.0+0.10s Threads=1 Hash=16MB LLR | 2.99 (-2.94, 2.94) [0.00, 5.00] Games | N: 29344 W: 7246 L: 7003 D: 15095 Penta | [323, 3490, 6836, 3667, 356] --- LTC --- Elo | 2.90 +- 2.33 (95%) SPRT | 60.0+0.60s Threads=1 Hash=128MB LLR | 2.96 (-2.94, 2.94) [0.00, 5.00] Games | N: 24554 W: 5504 L: 5299 D: 13751 Penta | [134, 2881, 6046, 3078, 138] Bench: 3288122
1 parent a270b56 commit 0d8e8ce

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/Engine/Search.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,13 @@ namespace StockDory
563563
if (PV) SelectiveDepth = std::max(SelectiveDepth, ply);
564564
}
565565

566-
// If we've exhausted our search depth, we should check if there are any tactical sequences available
567-
// over the horizon. In the case there are, our evaluation at this point is not truly accurate, and we must
568-
// get a more accurate evaluation by stepping through to the end of the tactical sequence - this is handled
569-
// by the Quiescence search
570-
if (depth <= 0) return Quiescence<Color, PV>(ply, alpha, beta);
566+
const bool checked = Board.Checked<Color>();
567+
568+
// If we've exhausted our search depth and aren't in check, we should check if there are any tactical
569+
// sequences just over the horizon. If there are, we should get a more accurate evaluation through a
570+
// Quiescence search. If we are in check, we should go down the normal search path, extending as needed to
571+
// ensure we find a suitable evasion
572+
if (depth <= 0 && !checked) return Quiescence<Color, PV>(ply, alpha, beta);
571573

572574
const ZobristHash hash = Board.Zobrist();
573575

@@ -669,8 +671,6 @@ namespace StockDory
669671
Score staticEvaluation;
670672
bool improving ;
671673

672-
const bool checked = Board.Checked<Color>();
673-
674674
if (checked) {
675675
// Last non-checked Static Evaluation:
676676
//

0 commit comments

Comments
 (0)