Skip to content

Commit

Permalink
Refine probcut
Browse files Browse the repository at this point in the history
Allow probcut for depth 3 and disable deeper verification search when it would simply repeat the qsearch.

Passed STC
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 283232 W: 74450 L: 73760 D: 135022
Ptnml(0-2): 1052, 33780, 71349, 34296, 1139
https://tests.stockfishchess.org/tests/view/67843b58460e2910c51ddcc6

Passed LTC
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 339654 W: 86845 L: 85893 D: 166916
Ptnml(0-2): 298, 37734, 92802, 38704, 289
https://tests.stockfishchess.org/tests/view/678aa722c00c743bc9e9face

closes official-stockfish#5797

bench 1288648
  • Loading branch information
Ergodice authored and vondele committed Jan 18, 2025
1 parent 738ac2a commit f00d91f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ Value Search::Worker::search(
// If we have a good enough capture (or queen promotion) and a reduced search
// returns a value much above beta, we can (almost) safely prune the previous move.
probCutBeta = beta + 174 - 56 * improving;
if (depth > 3
if (depth >= 3
&& !is_decisive(beta)
// If value from transposition table is lower than probCutBeta, don't attempt
// probCut there and in further interactions with transposition table cutoff
Expand All @@ -871,6 +871,7 @@ Value Search::Worker::search(
assert(probCutBeta < VALUE_INFINITE && probCutBeta > beta);

MovePicker mp(pos, ttData.move, probCutBeta - ss->staticEval, &thisThread->captureHistory);
Depth probCutDepth = std::max(depth - 4, 0);

while ((move = mp.next_move()) != Move::none())
{
Expand Down Expand Up @@ -899,17 +900,17 @@ Value Search::Worker::search(
value = -qsearch<NonPV>(pos, ss + 1, -probCutBeta, -probCutBeta + 1);

// If the qsearch held, perform the regular search
if (value >= probCutBeta)
value =
-search<NonPV>(pos, ss + 1, -probCutBeta, -probCutBeta + 1, depth - 4, !cutNode);
if (value >= probCutBeta && probCutDepth > 0)
value = -search<NonPV>(pos, ss + 1, -probCutBeta, -probCutBeta + 1, probCutDepth,
!cutNode);

pos.undo_move(move);

if (value >= probCutBeta)
{
// Save ProbCut data into transposition table
ttWriter.write(posKey, value_to_tt(value, ss->ply), ss->ttPv, BOUND_LOWER,
depth - 3, move, unadjustedStaticEval, tt.generation());
probCutDepth + 1, move, unadjustedStaticEval, tt.generation());

if (!is_decisive(value))
return value - (probCutBeta - beta);
Expand Down

0 comments on commit f00d91f

Please sign in to comment.