]> git.sesse.net Git - stockfish/commitdiff
Tweak castling extension
authorSFisGOD <jonathandumale@gmail.com>
Mon, 10 Aug 2020 13:13:56 +0000 (21:13 +0800)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 11 Aug 2020 11:46:02 +0000 (13:46 +0200)
Change condition from three friendly pieces to two. This now means that we only extend castling on the king side if there are no other friendly pieces aside from king and rook. For the queen side, we only extend if there is only a rook and another friendly piece or if there is only a single rook and no other friendly piece but this is very rare.

STC:
LLR: 3.20 (-2.94,2.94) {-0.50,1.50}
Total: 31144 W: 4086 L: 3903 D: 23155
Ptnml(0-2): 227, 2843, 9278, 2968, 256
https://tests.stockfishchess.org/tests/view/5f31487f9081672066537516

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 57816 W: 3786 L: 3538 D: 50492
Ptnml(0-2): 92, 2991, 22488, 3251, 86
https://tests.stockfishchess.org/tests/view/5f3167c3908167206653753d

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

Bench: 4244812

src/search.cpp

index ef47fd22307ee9cdb31bbbbb5956d0f2869470a3..c5b4332f7213aff47f8b618e89a3d8085dade0fb 100644 (file)
@@ -1139,7 +1139,7 @@ moves_loop: // When in check, search starts from here
 
       // Castling extension
       if (   type_of(move) == CASTLING
 
       // Castling extension
       if (   type_of(move) == CASTLING
-          && popcount(pos.pieces(us) & ~pos.pieces(PAWN) & (to_sq(move) & KingSide ? KingSide : QueenSide)) <= 3)
+          && popcount(pos.pieces(us) & ~pos.pieces(PAWN) & (to_sq(move) & KingSide ? KingSide : QueenSide)) <= 2)
           extension = 1;
 
       // Late irreversible move extension
           extension = 1;
 
       // Late irreversible move extension