X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=edeed9c030446a9e015cf99218ce2a5ca402315b;hb=b82d93ece484f833c994b40d9eddd959ba20ef92;hp=5e022e664ca18266ee55c457b85a03d3f27481f4;hpb=e4b7403f127a36a35bbace9f833ab43babd98a6c;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 5e022e66..edeed9c0 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -260,6 +260,7 @@ void MainThread::search() { bestThread = Threads.get_best_thread(); bestPreviousScore = bestThread->rootMoves[0].score; + bestPreviousAverageScore = bestThread->rootMoves[0].averageScore; // Send again PV info if we have a new best thread if (bestThread != this) @@ -489,7 +490,8 @@ void Thread::search() { && !Threads.stop && !mainThread->stopOnPonderhit) { - double fallingEval = (318 + 6 * (mainThread->bestPreviousScore - bestValue) + double fallingEval = (142 + 6 * (mainThread->bestPreviousScore - bestValue) + + 6 * (mainThread->bestPreviousAverageScore - bestValue) + 6 * (mainThread->iterValue[iterIdx] - bestValue)) / 825.0; fallingEval = std::clamp(fallingEval, 0.5, 1.5); @@ -1187,9 +1189,8 @@ moves_loop: // When in check, search starts here && !likelyFailLow) r -= 2; - // Increase reduction at non-PV nodes when the best move does not change frequently - if ( !PvNode - && thisThread->bestMoveChanges <= 2) + // Increase reduction at non-PV nodes + if (!PvNode) r++; // Decrease reduction if opponent's move count is high (~1 Elo) @@ -1379,7 +1380,15 @@ moves_loop: // When in check, search starts here // Bonus for prior countermove that caused the fail low else if ( (depth >= 3 || PvNode) && !priorCapture) - update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth) * (1 + (PvNode || cutNode))); + { + //Assign extra bonus if current node is PvNode or cutNode + //or fail low was really bad + bool extraBonus = PvNode + || cutNode + || bestValue < alpha - 94 * depth; + + update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth) * (1 + extraBonus)); + } if (PvNode) bestValue = std::min(bestValue, maxValue);