Skip to content

Commit

Permalink
Discourage '2-fold' repetition at root. Bench: 4294827
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmsgms committed Nov 21, 2022
1 parent d8f3209 commit 2349455
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,12 @@ namespace {
(ss-1)->currentMove != MOVE_NULL ? evaluate(pos)
: -(ss-1)->staticEval;

if (ss->ply >= 3) {
// Discourage "2-fold" repetition at root
Move ply1move = (ss-(ss->ply-1))->currentMove, ply3move = (ss-(ss->ply-3))->currentMove;
bestValue -= (ply3move == make_move(to_sq(ply1move), from_sq(ply1move)));
}

// Stand pat. Return immediately if static value is at least beta
if (bestValue >= beta)
{
Expand Down

0 comments on commit 2349455

Please sign in to comment.