Skip to content

Commit

Permalink
Correct some comments. No functional change
Browse files Browse the repository at this point in the history
  • Loading branch information
cj5716 committed Oct 29, 2023
1 parent 347d613 commit f2b2840
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,16 +830,19 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
}
}

// Step 10. If the position doesn't have a ttMove, decrease depth by 2,
// or by 4 if the TT entry for the current position was hit and
// Step 10. Internal iterative reductions (~9 Elo)
// For PV nodes without a ttMove, we decrease depth by 2,
// or by 4 if the current position is present in the TT and
// the stored depth is greater than or equal to the current depth.
// Use qsearch if depth is equal or below zero (~9 Elo)
// Use qsearch if depth <= 0.
if (PvNode && !ttMove)
depth -= 2 + 2 * (ss->ttHit && tte->depth() >= depth);

if (depth <= 0)
return qsearch<PV>(pos, ss, alpha, beta);

// For cutNodes without a ttMove, we decrease depth by 2
// if current depth >= 8.
if (cutNode && depth >= 8 && !ttMove)
depth -= 2;

Expand Down Expand Up @@ -1129,7 +1132,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
if (PvNode)
r--;

// Decrease reduction if ttMove has been singularly extended (~1 Elo)
// Decrease reduction if a quiet ttMove has been singularly extended (~1 Elo)
if (singularQuietLMR)
r--;

Expand Down Expand Up @@ -1194,7 +1197,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
// Step 18. Full-depth search when LMR is skipped
else if (!PvNode || moveCount > 1)
{
// Increase reduction for cut nodes and not ttMove (~1 Elo)
// Increase reduction for cut nodes without ttMove (~1 Elo)
if (!ttMove && cutNode)
r += 2;

Expand Down Expand Up @@ -1724,7 +1727,7 @@ void update_all_stats(const Position& pos,


// Updates histories of the move pairs formed
// by moves at ply -1, -2, -4, and -6 with current move.
// by moves at ply -1, -2, -3, -4, and -6 with current move.
void update_continuation_histories(Stack* ss, Piece pc, Square to, int bonus) {

for (int i : {1, 2, 3, 4, 6})
Expand Down

0 comments on commit f2b2840

Please sign in to comment.