]> git.sesse.net Git - stockfish/commit
Cleanup and reorder in qsearch
authorMichael Chaly <Vizvezdenec@gmail.com>
Sat, 4 Feb 2023 20:46:44 +0000 (23:46 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 9 Feb 2023 06:45:05 +0000 (07:45 +0100)
commit8f843633db3faaf447cc191cbaed9f5ddfd374bd
treeae90855491fb45ddf91e134e9c0809aa42cc399d
parentd5817a5896a8d93c4560b405da576a02aaa0c08a
Cleanup and reorder in qsearch

This patch is a simplification / code normalisation in qsearch.

Adds steps in comments the same way we have in search;

Makes a separate "pruning" stage instead of heuristics randomly being spread over qsearch code;
Reorders pruning heuristics from least taxing ones to more taxing ones;
Removes repeated check for best value not being mated, instead uses 1 check - thus removes some lines of code.
Moves prefetch and move setup after pruning - makes no sense to do them if move will actually get pruned.

Passed non-regression test:
https://tests.stockfishchess.org/tests/view/63dd2c5ff9a50a69252c1413
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 113504 W: 29898 L: 29770 D: 53836
Ptnml(0-2): 287, 11861, 32327, 11991, 286

https://github.com/official-stockfish/Stockfish/pull/4382

Non-functional change.
src/search.cpp