/*
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
- Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file)
+ Copyright (C) 2004-2022 The Stockfish developers (see AUTHORS file)
Stockfish is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
bool givesCheck, improving, didLMR, priorCapture;
bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture;
Piece movedPiece;
- int moveCount, captureCount, quietCount, bestMoveCount, improvement;
+ int moveCount, captureCount, quietCount, bestMoveCount, improvement, complexity;
// Step 1. Initialize node
ss->inCheck = pos.checkers();
ss->staticEval = eval = VALUE_NONE;
improving = false;
improvement = 0;
+ complexity = 0;
goto moves_loop;
}
else if (ss->ttHit)
: 200;
improving = improvement > 0;
+ complexity = abs(ss->staticEval - (us == WHITE ? eg_value(pos.psq_score()) : -eg_value(pos.psq_score())));
// Step 7. Futility pruning: child node (~25 Elo).
// The depth condition is important for mate finding.
&& (ss-1)->statScore < 23767
&& eval >= beta
&& eval >= ss->staticEval
- && ss->staticEval >= beta - 20 * depth - improvement / 15 + 204
+ && ss->staticEval >= beta - 20 * depth - improvement / 15 + 204 + complexity / 25
&& !excludedMove
&& pos.non_pawn_material(us)
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
continue;
// SEE based pruning (~9 Elo)
- if (!pos.see_ge(move, Value(-218) * depth))
+ if (!pos.see_ge(move, Value(-217) * depth))
continue;
}
else
// Continuation history based pruning (~2 Elo)
if ( lmrDepth < 5
- && history < -3000 * depth + 3000)
+ && history < -3875 * (depth - 1))
continue;
history += thisThread->mainHistory[us][from_to(move)];
// Futility pruning: parent node (~9 Elo)
if ( !ss->inCheck
&& lmrDepth < 8
- && ss->staticEval + 142 + 139 * lmrDepth + history / 64 <= alpha)
+ && ss->staticEval + 138 + 137 * lmrDepth + history / 64 <= alpha)
continue;
// Prune moves with negative SEE (~3 Elo)