Thread* bestThread = this;
// Check if there are threads with a better score than main thread
- if ( Options["MultiPV"] == 1
+ if ( int(Options["MultiPV"]) == 1
&& !Limits.depth
- && !(Skill(Options["Skill Level"]).enabled() || Options["UCI_LimitStrength"])
+ && !(Skill(Options["Skill Level"]).enabled() || int(Options["UCI_LimitStrength"]))
&& rootMoves[0].pv[0] != MOVE_NONE)
{
std::map<Move, int64_t> votes;
if (mainThread)
{
if (mainThread->bestPreviousScore == VALUE_INFINITE)
- for (int i=0; i<4; ++i)
+ for (int i = 0; i < 4; ++i)
mainThread->iterValue[i] = VALUE_ZERO;
else
- for (int i=0; i<4; ++i)
+ for (int i = 0; i < 4; ++i)
mainThread->iterValue[i] = mainThread->bestPreviousScore;
}
std::copy(&lowPlyHistory[2][0], &lowPlyHistory.back().back() + 1, &lowPlyHistory[0][0]);
std::fill(&lowPlyHistory[MAX_LPH - 2][0], &lowPlyHistory.back().back() + 1, 0);
- size_t multiPV = Options["MultiPV"];
+ size_t multiPV = size_t(Options["MultiPV"]);
// Pick integer skill levels, but non-deterministically round up or down
// such that the average integer skill corresponds to the input floating point one.
&& !Threads.stop
&& !mainThread->stopOnPonderhit)
{
- double fallingEval = (332 + 6 * (mainThread->bestPreviousScore - bestValue)
- + 6 * (mainThread->iterValue[iterIdx] - bestValue)) / 704.0;
+ double fallingEval = (332 + 6 * (mainThread->bestPreviousScore - bestValue)
+ + 6 * (mainThread->iterValue[iterIdx] - bestValue)) / 704.0;
fallingEval = Utility::clamp(fallingEval, 0.5, 1.5);
// If the bestMove is stable over several iterations, reduce time accordingly
Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue;
bool ttHit, ttPv, formerPv, givesCheck, improving, didLMR, priorCapture;
- bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture, singularLMR;
+ bool captureOrPromotion, doFullDepthSearch, moveCountPruning,
+ ttCapture, singularQuietLMR;
Piece movedPiece;
int moveCount, captureCount, quietCount;
depth > 12 ? ss->ply : MAX_PLY);
value = bestValue;
- singularLMR = moveCountPruning = false;
+ singularQuietLMR = moveCountPruning = false;
ttCapture = ttMove && pos.capture_or_promotion(ttMove);
// Mark this node as being searched
// Futility pruning for captures
if ( !givesCheck
&& lmrDepth < 6
+ && !(PvNode && abs(bestValue) < 2)
&& !ss->inCheck
&& ss->staticEval + 270 + 384 * lmrDepth + PieceValue[MG][type_of(pos.piece_on(to_sq(move)))] <= alpha)
continue;
if (value < singularBeta)
{
extension = 1;
- singularLMR = true;
+ singularQuietLMR = !ttCapture;
}
// Multi-cut pruning
r--;
// Decrease reduction if ttMove has been singularly extended (~3 Elo)
- if (singularLMR)
+ if (singularQuietLMR)
r -= 1 + formerPv;
if (!captureOrPromotion)