Skip to content

Commit 991d7d6

Browse files
VizvezdenecMichaelB7
authored andcommitted
Introduce ProbCut for check evasions
The idea of this patch can be described as follows: if we are in check and the transposition table move is a capture that returns a value far above beta, we can assume that the opponent just blundered a piece by giving check, and we return the transposition table value. This is similar to the usual probCut logic for quiet moves, but with a different threshold. Passed STC LLR: 2.94 (-2.94,2.94) {-0.25,1.25} Total: 33440 W: 3056 L: 2891 D: 27493 Ptnml(0-2): 110, 2338, 11672, 2477, 123 https://tests.stockfishchess.org/tests/view/602cd1087f517a561bc49bda Passed LTC LLR: 2.98 (-2.94,2.94) {0.25,1.25} Total: 10072 W: 401 L: 309 D: 9362 Ptnml(0-2): 2, 288, 4365, 378, 3 https://tests.stockfishchess.org/tests/view/602ceea57f517a561bc49bf0 The committed version has an additional fix to never return unproven wins in the tablebase range or the mate range. This fix passed tests for non- regression at STC and LTC: STC: LLR: 2.93 (-2.94,2.94) {-1.25,0.25} Total: 26240 W: 2354 L: 2280 D: 21606 Ptnml(0-2): 85, 1763, 9372, 1793, 107 https://tests.stockfishchess.org/tests/view/602d86a87f517a561bc49c7a LTC: LLR: 2.95 (-2.94,2.94) {-0.75,0.25} Total: 35304 W: 1299 L: 1256 D: 32749 Ptnml(0-2): 14, 1095, 15395, 1130, 18 https://tests.stockfishchess.org/tests/view/602d98d17f517a561bc49c83 Closes official-stockfish#3362 Bench: 3830215
1 parent 07faf96 commit 991d7d6

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/search.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,23 @@ namespace {
13641364

13651365
moves_loop: // When in check, search starts from here
13661366

1367+
ttCapture = ttMove && pos.capture_or_promotion(ttMove);
1368+
1369+
// Step 11. A small Probcut idea, when we are in check
1370+
probCutBeta = beta + 400;
1371+
if ( ss->inCheck
1372+
&& !PvNode
1373+
&& depth >= 4
1374+
&& ttCapture
1375+
&& (tte->bound() & BOUND_LOWER)
1376+
&& tte->depth() >= depth - 3
1377+
&& ttValue >= probCutBeta
1378+
&& abs(ttValue) <= VALUE_KNOWN_WIN
1379+
&& abs(beta) <= VALUE_KNOWN_WIN
1380+
)
1381+
return probCutBeta;
1382+
1383+
13671384
const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
13681385
nullptr , (ss-4)->continuationHistory,
13691386
nullptr , (ss-6)->continuationHistory };
@@ -1380,12 +1397,11 @@ namespace {
13801397

13811398
value = bestValue;
13821399
singularQuietLMR = moveCountPruning = false;
1383-
ttCapture = ttMove && pos.capture_or_promotion(ttMove);
13841400

13851401
// Mark this node as being searched
13861402
ThreadHolding th(thisThread, posKey, ss->ply);
13871403

1388-
// Step 11. Loop through all pseudo-legal moves until no moves remain
1404+
// Step 12. Loop through all pseudo-legal moves until no moves remain
13891405
// or a beta cutoff occurs.
13901406
while ((move = mp.next_move(moveCountPruning)) != MOVE_NONE)
13911407
{
@@ -1483,7 +1499,7 @@ namespace {
14831499
}
14841500
}
14851501

1486-
// Step 13. Extensions (~75 Elo)
1502+
// Step 14. Extensions (~75 Elo)
14871503

14881504
// Singular extension search (~70 Elo). If all moves but one fail low on a
14891505
// search of (alpha-s, beta-s), and just one fails high on (alpha, beta),

0 commit comments

Comments
 (0)