Avoid more expensive legality check
authorbmc4 <bmc4@cin.ufpe.br>
Sat, 16 Jan 2021 04:44:11 +0000 (01:44 -0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 31 Jan 2021 09:00:17 +0000 (10:00 +0100)
commit7d0a16e06d968c81f17140b0123db9768ce02a82
tree4eee85f7df87606a837a947f097cd168b4d75ef9
parent70a818cbd6784ccfa8503d94bc31dd1dc16dd1ff
Avoid more expensive legality check

speedup of the code, enough to pass STC, failed LTC.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 68928 W: 6334 L: 6122 D: 56472
Ptnml(0-2): 233, 4701, 24369, 4943, 218
https://tests.stockfishchess.org/tests/view/6002747f6019e097de3ef8dc

Failed LTC:
LLR: -2.96 (-2.94,2.94) {0.25,1.25}
Total: 44560 W: 1702 L: 1675 D: 41183
Ptnml(0-2): 25, 1383, 19438, 1408, 26
https://tests.stockfishchess.org/tests/view/6002a4836019e097de3ef8e3

About 1% speedup:

Result of  50 runs
==================
base (...kfish.master) =    2237500  +/- 7428
test (...ckfish.patch) =    2267003  +/- 7017
diff                   =     +29503  +/- 4774

speedup        = +0.0132
P(speedup > 0) =  1.0000

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

No functional change.
src/position.cpp