Skip to content

Commit

Permalink
Introduce movecount pruning for quiet check evasions in qsearch
Browse files Browse the repository at this point in the history
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 #3920

bench 4830082
  • Loading branch information
Vizvezdenec authored and vondele committed Feb 5, 2022
1 parent e178a09 commit 95d7369
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/search.cpp
Expand Up @@ -1479,6 +1479,8 @@ namespace {
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)
{
Expand Down Expand Up @@ -1540,6 +1542,15 @@ namespace {
&& (*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);
Expand Down

0 comments on commit 95d7369

Please sign in to comment.