Skip to content

Commit

Permalink
Simplify Castle Extension
Browse files Browse the repository at this point in the history
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
  • Loading branch information
VoyagerOne authored and snicolet committed Nov 19, 2018
1 parent 0e508f3 commit 4111f36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/evaluate.cpp
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/search.cpp
Expand Up @@ -944,10 +944,8 @@ namespace {
&& 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
Expand Down

0 comments on commit 4111f36

Please sign in to comment.