]> git.sesse.net Git - stockfish/commit
Fix incorrect pruning in qsearch
authorJ. Oster <osterj165@googlemail.com>
Sun, 1 Nov 2020 17:33:17 +0000 (18:33 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 2 Nov 2020 18:41:17 +0000 (19:41 +0100)
commita260c9a8a24a2630a900efc3821000c3481b0c5d
tree8cac77eff2db75ff7ebfa6a6c3d61585324fd8be
parent931070b65ac0332469a24765a60eb27e038f73bc
Fix incorrect pruning in qsearch

Only do countermove based pruning in qsearch if we already have a move with a better score than a TB loss.

This patch fixes a bug (started as 843a961) that incorrectly prunes moves if in check,
and adds an assert to make sure no wrong mate scores are given in the future.
It replaces a no-op moveCount check with a check for bestValue.

Initially discussed in #3171 and later in #3199, #3198 and #3210.
This PR effectively closes #3171
It also likely fixes #3196 where this causes user visible incorrect TB scores,
which probably result from these incorrect mate scores.

Passed STC and LTC non-regression tests.
https://tests.stockfishchess.org/tests/view/5f9ef8dabca9bf35bae7f648
LLR: 2.93 (-2.94,2.94) {-1.25,0.25}
Total: 21672 W: 2339 L: 2230 D: 17103
Ptnml(0-2): 126, 1689, 7083, 1826, 112

https://tests.stockfishchess.org/tests/view/5f9f0caebca9bf35bae7f666
LLR: 2.97 (-2.94,2.94) {-0.75,0.25}
Total: 33152 W: 1551 L: 1485 D: 30116
Ptnml(0-2): 27, 1308, 13832, 1390, 19

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

Bench: 3625915
src/search.cpp