Skip to content

Commit

Permalink
idk
Browse files Browse the repository at this point in the history
bench 1743758
  • Loading branch information
Ergodice committed Jan 12, 2025
1 parent c085670 commit 0b43055
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,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 @@ -859,6 +859,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 @@ -888,17 +889,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)
if (value >= probCutBeta && probCutDepth > 0)
value =
-search<NonPV>(pos, ss + 1, -probCutBeta, -probCutBeta + 1, depth - 4, !cutNode);
-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 0b43055

Please sign in to comment.