Skip to content

Commit 95d7369

Browse files
Vizvezdenecvondele
authored andcommitted
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 #3920 bench 4830082
1 parent e178a09 commit 95d7369

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/search.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,8 @@ namespace {
14791479
contHist,
14801480
prevSq);
14811481

1482+
int quietCheckEvasions = 0;
1483+
14821484
// Loop through the moves until no moves remain or a beta cutoff occurs
14831485
while ((move = mp.next_move()) != MOVE_NONE)
14841486
{
@@ -1540,6 +1542,15 @@ namespace {
15401542
&& (*contHist[1])[pos.moved_piece(move)][to_sq(move)] < CounterMovePruneThreshold)
15411543
continue;
15421544

1545+
// movecount pruning for quiet check evasions
1546+
if ( bestValue > VALUE_TB_LOSS_IN_MAX_PLY
1547+
&& quietCheckEvasions > 1
1548+
&& !captureOrPromotion
1549+
&& ss->inCheck)
1550+
continue;
1551+
1552+
quietCheckEvasions += !captureOrPromotion && ss->inCheck;
1553+
15431554
// Make and search the move
15441555
pos.do_move(move, st, givesCheck);
15451556
value = -qsearch<nodeType>(pos, ss+1, -beta, -alpha, depth - 1);

0 commit comments

Comments
 (0)