]> git.sesse.net Git - stockfish/commit
Delay castling legality check
authorMarco Costalba <mcostalba@gmail.com>
Wed, 2 Jan 2019 07:31:03 +0000 (08:31 +0100)
committerStéphane Nicolet <stephanenicoletsuriphone@gmail.com>
Fri, 4 Jan 2019 13:23:14 +0000 (14:23 +0100)
commit3c576efa77f431cf3687881b8fd6a728e87ed97d
tree5a06e6da0b3fef359e3064c5b3d6226ff2d7e1ee
parenteb6d7f537d214c4dc8bde7d4fdc2aaead47dd3c3
Delay castling legality check

Delay legality check of castling moves at search time,
just before making the move, as is the standard with all
the other move types.

This should avoid an useless and not trivial legality check
when the castling is then not tried later. For instance due
to a previous cut-off.

The patch is also a big simplification and allows to entirely
remove generate_castling()

Bench changes due to a different move sequence out of MovePicker.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 45073 W: 9918 L: 9843 D: 25312
http://tests.stockfishchess.org/tests/view/5c2f176f0ebc596a450bdfb3

LTC:
LLR: 3.15 (-2.94,2.94) [-3.00,1.00]
Total: 10156 W: 1707 L: 1560 D: 6889
http://tests.stockfishchess.org/tests/view/5c2e7dfd0ebc596a450bcdf4

Verified with perft both in standard and Chess960 cases.

Closes https://github.com/official-stockfish/Stockfish/pull/1929

Bench: 3559104
src/movegen.cpp
src/position.cpp
src/position.h
src/types.h