1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Modify castling extension

Extend castling only if there are few friendly pieces on the castling side.

Inspired by silversolver1's (Rahul Dsilva) test
https://tests.stockfishchess.org/tests/view/5f0fef560640035f9d2978cf

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 7096 W: 947 L: 818 D: 5331
Ptnml(0-2): 32, 604, 2181, 665, 66
https://tests.stockfishchess.org/tests/view/5f309f729081672066537426

LTC:
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 4712 W: 300 L: 215 D: 4197
Ptnml(0-2): 2, 190, 1895, 259, 10
https://tests.stockfishchess.org/tests/view/5f30a2039081672066537430

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

Bench: 4094850
This commit is contained in:
SFisGOD 2020-08-10 15:39:22 +08:00 committed by Joost VandeVondele
parent 875183b310
commit ad2ad4c657

View file

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