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

Introduce movecount pruning for quiet check evasions in qsearch

Idea of this patch is that we usually don't consider quiet check evasions as "good" ones and prefer capture based ones instead. So it makes sense to think that if in qsearch 2 quiet check evasions failed to produce anything good 3rd and further ones wouldn't be good either.

passed STC
https://tests.stockfishchess.org/tests/view/61fc1b1ed508ec6a1c9f397c
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 58800 W: 15947 L: 15626 D: 27227
Ptnml(0-2): 273, 6568, 15462, 6759, 338

passed LTC
https://tests.stockfishchess.org/tests/view/61fcc56dd508ec6a1c9f5619
LLR: 2.95 (-2.94,2.94) <0.50,3.00>
Total: 89544 W: 24208 L: 23810 D: 41526
Ptnml(0-2): 81, 9038, 26134, 9440, 79

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

bench 4830082
This commit is contained in:
Michael Chaly 2022-02-04 22:42:41 +03:00 committed by Joost VandeVondele
parent e178a09c47
commit 95d7369e54

View file

@ -1479,6 +1479,8 @@ moves_loop: // When in check, search starts here
contHist,
prevSq);
int quietCheckEvasions = 0;
// Loop through the moves until no moves remain or a beta cutoff occurs
while ((move = mp.next_move()) != MOVE_NONE)
{
@ -1540,6 +1542,15 @@ moves_loop: // When in check, search starts here
&& (*contHist[1])[pos.moved_piece(move)][to_sq(move)] < CounterMovePruneThreshold)
continue;
// movecount pruning for quiet check evasions
if ( bestValue > VALUE_TB_LOSS_IN_MAX_PLY
&& quietCheckEvasions > 1
&& !captureOrPromotion
&& ss->inCheck)
continue;
quietCheckEvasions += !captureOrPromotion && ss->inCheck;
// Make and search the move
pos.do_move(move, st, givesCheck);
value = -qsearch<nodeType>(pos, ss+1, -beta, -alpha, depth - 1);