]> git.sesse.net Git - stockfish/commitdiff
Simplify Castle Extension
authorVoyagerOne <excelgeek@gmail.com>
Mon, 19 Nov 2018 09:27:52 +0000 (10:27 +0100)
committerStéphane Nicolet <cassio@free.fr>
Mon, 19 Nov 2018 09:28:55 +0000 (10:28 +0100)
Remove depth condition in castle extension, also don't extend if
Singular Extension and Check Extansion fail to extend.

STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 42070 W: 9118 L: 9036 D: 23916
http://tests.stockfishchess.org/tests/view/5be899cc0ebc595e0ae32f07

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 78278 W: 12490 L: 12458 D: 53330
http://tests.stockfishchess.org/tests/view/5be8ac420ebc595e0ae33010

Bench: 3611041

src/evaluate.cpp
src/search.cpp

index 297d8c65070c0118d71e4a54f819dcf72e19e6d5..9ebd8748d4759b56bd20c952c0b2922d8c37ea9c 100644 (file)
@@ -257,6 +257,7 @@ namespace {
     attackedBy[Us][PAWN] = pe->pawn_attacks(Us);
     attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN];
     attackedBy2[Us]            = attackedBy[Us][KING] & attackedBy[Us][PAWN];
+
     kingRing[Us] = kingAttackersCount[Them] = 0;
 
     // Init our king safety tables only if we are going to use them
index 07680f1d1830e4447c7f61da25be41407bc69510..e113068c408561c402f47513e685bb1b874b25a4 100644 (file)
@@ -944,10 +944,8 @@ moves_loop: // When in check, search starts from here
                &&  pos.see_ge(move))
           extension = ONE_PLY;
 
-      // Extension for king moves that change castling rights
-      if (   pos.can_castle(us)
-          && type_of(movedPiece) == KING
-          && depth < 12 * ONE_PLY)
+      else if (   pos.can_castle(us) // Extension for king moves that change castling rights
+               && type_of(movedPiece) == KING)
           extension = ONE_PLY;
 
       // Calculate new depth for this move