]> git.sesse.net Git - stockfish/commitdiff
Extend discovered checks regardless of SEE
authorMiguel Lahoz <miguel_lahoz@protonmail.com>
Tue, 29 Jan 2019 14:26:03 +0000 (22:26 +0800)
committerStéphane Nicolet <cassio@free.fr>
Fri, 1 Feb 2019 15:27:21 +0000 (16:27 +0100)
A simple idea, but it makes sense: in current master the search is extended
for checks that are considered somewhat safe, and for for this we use the
static exchange evaluation which only considers the `to_sq` of a move.
This is not reliable for discovered checks, where another piece is giving
the check and is arguably a more dangerous type of check. Thus, if the check
is a discovered check, the result of SEE is not relevant and can be ignored.

STC:
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 29370 W: 6583 L: 6274 D: 16513
http://tests.stockfishchess.org/tests/view/5c5062950ebc593af5d4d9b5

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 227341 W: 37972 L: 37165 D: 152204
http://tests.stockfishchess.org/tests/view/5c5094fb0ebc593af5d4dc2c

Bench: 3611854

src/search.cpp

index de67560a808a701ef11299bf7d6a3b8fb1753246..651bd95b6feff4ceecc70840ef82fb37bafbb86d 100644 (file)
@@ -953,11 +953,13 @@ moves_loop: // When in check, search starts from here
           else if (cutNode && singularBeta > beta)
               return beta;
       }
-      else if (    givesCheck // Check extension (~2 Elo)
-               &&  pos.see_ge(move))
+
+      // Check extension (~2 Elo)
+      else if (    givesCheck
+               && (pos.blockers_for_king(~us) & from_sq(move) || pos.see_ge(move)))
           extension = ONE_PLY;
 
-      // Extension if castling
+      // Castling extension
       else if (type_of(move) == CASTLING)
           extension = ONE_PLY;