]> git.sesse.net Git - stockfish/commitdiff
Simplify both quiet check evasions' conditions
authorperegrineshahin <peregrineshahin@gmail.com>
Sun, 13 Nov 2022 09:08:17 +0000 (11:08 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 23 Nov 2022 20:36:22 +0000 (21:36 +0100)
passed Non-regression STC:
https://tests.stockfishchess.org/tests/view/6370b647f1b748d4819e0b64
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 162904 W: 43249 L: 43171 D: 76484
Ptnml(0-2): 491, 17089, 46220, 17155, 497

closes https://github.com/official-stockfish/Stockfish/pull/4228

No functional change

src/search.cpp

index 5cef5c40c235e719b5ad3bdb7ed7abc664e6da88..e73f68ffb0aba1a9499fbb0cd09941a03a3148a5 100644 (file)
@@ -1552,12 +1552,11 @@ moves_loop: // When in check, search starts here
           && (*contHist[1])[pos.moved_piece(move)][to_sq(move)] < 0)
           continue;
 
-      // movecount pruning for quiet check evasions
+      // We prune after 2nd quiet check evasion where being 'in check' is implicitly checked through the counter
+      // and being a 'quiet' apart from being a tt move is assumed after an increment because captures are pushed ahead.
       if (   bestValue > VALUE_TB_LOSS_IN_MAX_PLY
-          && quietCheckEvasions > 1
-          && !capture
-          && ss->inCheck)
-          continue;
+          && quietCheckEvasions > 1)
+          break;
 
       quietCheckEvasions += !capture && ss->inCheck;