Skip to content

Commit

Permalink
Vary time use with eval.
Browse files Browse the repository at this point in the history
Bench 2103324
  • Loading branch information
xoto10 committed Mar 27, 2024
1 parent ed24e3a commit 43abd91
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ using namespace Search;

namespace {

static constexpr double EvalLevel[10] = {1.043, 1.017, 0.952, 1.009, 0.971,
1.002, 0.992, 0.947, 1.046, 1.001};

// Futility margin
Value futility_margin(Depth d, bool noTtCutNode, bool improving, bool oppWorsening) {
Value futilityMult = 118 - 44 * noTtCutNode;
Expand Down Expand Up @@ -438,9 +441,10 @@ void Search::Worker::iterative_deepening() {
timeReduction = lastBestMoveDepth + 8 < completedDepth ? 1.495 : 0.687;
double reduction = (1.48 + mainThread->previousTimeReduction) / (2.17 * timeReduction);
double bestMoveInstability = 1 + 1.88 * totBestMoveChanges / threads.size();
int el = std::clamp((bestValue + 750) / 150, 0, 9);

double totalTime =
mainThread->tm.optimum() * fallingEval * reduction * bestMoveInstability;
double totalTime = mainThread->tm.optimum() * fallingEval * reduction
* bestMoveInstability * EvalLevel[el];

// Cap used time in case of a single legal move for a better viewer experience
if (rootMoves.size() == 1)
Expand Down

0 comments on commit 43abd91

Please sign in to comment.