Skip to content

Commit

Permalink
Remove total time cap on single legal move
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaCat-OuO committed Mar 9, 2024
1 parent 8a4b3f0 commit e27f07a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void Search::Worker::iterative_deepening() {
double fallingEval = (73 + 19 * (mainThread->bestPreviousAverageScore - bestValue)
+ 5 * (mainThread->iterValue[iterIdx] - bestValue))
/ 700.44;
fallingEval = std::clamp(fallingEval, 0.5, 1.6);
fallingEval = std::clamp(fallingEval, 0.50, 1.60);

// If the bestMove is stable over several iterations, reduce time accordingly
timeReduction = lastBestMoveDepth + 10 < completedDepth ? 1.85 : 0.64;
Expand All @@ -393,10 +393,6 @@ void Search::Worker::iterative_deepening() {
double totalTime =
mainThread->tm.optimum() * fallingEval * reduction * bestMoveInstability;

// Cap used time in case of a single legal move for a better viewer experience
if (rootMoves.size() == 1)
totalTime = std::min(500.0, totalTime);

if (completedDepth >= 9 && nodesEffort >= 94
&& mainThread->tm.elapsed(threads.nodes_searched()) > totalTime * 0.75
&& !mainThread->ponder)
Expand Down

0 comments on commit e27f07a

Please sign in to comment.