1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Simplify casting extension

On November 16th, before the removal of the depth condition, I tried
revising castling extensions to only handle castling moves, rather than
moves that change castling rights generally. It appeared to be a slight
Elo gain at STC but insufficient to pass [0, 4] (+0.5 Elo), but what I
overlooked was that it made pos.can_castle(us) irrelevant and should
have been a simplification. Recent discussion with @Chess13234 and
Michael Chaly (@Vizvezdenec) inspired me to take a second look, and
the simplification continues to pass when rebased on the current master.

This replaces two conditions with one, because type_of(move) == CASTLING
implies pos.can_castle(Us), allowing us to remove the latter condition.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 110948 W: 24209 L: 24263 D: 62476
http://tests.stockfishchess.org/tests/view/5bf8f65c0ebc5902bced3a63

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 88283 W: 14681 L: 14668 D: 58934
http://tests.stockfishchess.org/tests/view/5bf994a60ebc5902bced4349

Bench: 3939338
This commit is contained in:
31m059 2018-11-24 01:55:09 -05:00 committed by Stéphane Nicolet
parent de7182f4ee
commit 7b6fa353a3

View file

@ -948,8 +948,8 @@ moves_loop: // When in check, search starts from here
&& pos.see_ge(move)) && pos.see_ge(move))
extension = ONE_PLY; extension = ONE_PLY;
else if ( pos.can_castle(us) // Extension for king moves that change castling rights // Extension if castling
&& type_of(movedPiece) == KING) else if (type_of(move) == CASTLING)
extension = ONE_PLY; extension = ONE_PLY;
// Calculate new depth for this move // Calculate new depth for this move