Skip to content

Commit

Permalink
also fix a variable name and clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
robertnurnberg committed Mar 7, 2024
1 parent fb62861 commit a3cccf3
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 @@ -539,7 +539,7 @@ Value Search::Worker::search(
Move ttMove, move, excludedMove, bestMove;
Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue, probCutBeta;
bool givesCheck, improving, priorCapture, opponenWorsening;
bool givesCheck, improving, priorCapture, opponentWorsening;
bool capture, moveCountPruning, ttCapture;
Piece movedPiece;
int moveCount, captureCount, quietCount;
Expand Down Expand Up @@ -748,7 +748,7 @@ Value Search::Worker::search(
? ss->staticEval > (ss - 2)->staticEval
: (ss - 4)->staticEval != VALUE_NONE && ss->staticEval > (ss - 4)->staticEval;

opponenWorsening = ss->staticEval + (ss - 1)->staticEval > 2 && (depth != 2 || !improving);
opponentWorsening = ss->staticEval + (ss - 1)->staticEval > 2 && (depth != 2 || !improving);

// Step 7. Razoring (~1 Elo)
// If eval is really low check with qsearch if it can exceed alpha, if it can't,
Expand All @@ -764,7 +764,7 @@ Value Search::Worker::search(
// Step 8. Futility pruning: child node (~40 Elo)
// The depth condition is important for mate finding.
if (!ss->ttPv && depth < 11
&& eval - futility_margin(depth, cutNode && !ss->ttHit, improving, opponenWorsening)
&& eval - futility_margin(depth, cutNode && !ss->ttHit, improving, opponentWorsening)
- (ss - 1)->statScore / 314
>= beta
&& eval >= beta && eval < 30016 // smaller than TB wins
Expand Down Expand Up @@ -1046,7 +1046,8 @@ Value Search::Worker::search(
extension = 2 + (value < singularBeta - 78 && !ttCapture);
depth += depth < 16;
}
if (PvNode && !ttCapture && ss->multipleExtensions <= 5 && value < singularBeta - 50)
if (PvNode && !ttCapture && ss->multipleExtensions <= 5
&& value < singularBeta - 50)
extension = 2;
}

Expand Down

0 comments on commit a3cccf3

Please sign in to comment.