mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
tuned TM values
Tuned 70k games at 240+2.4 th 2: https://tests.stockfishchess.org/tests/view/6783b1b16ddf09c0b4b703f5 Failed STC: LLR: -2.93 (-2.94,2.94) <0.00,2.00> Total: 491872 W: 128260 L: 127804 D: 235808 Ptnml(0-2): 1579, 55449, 131572, 55609, 1727 https://tests.stockfishchess.org/tests/view/6785a045460e2910c51de4b8 Passed LTC: LLR: 2.94 (-2.94,2.94) <0.00,2.00> Total: 154824 W: 39315 L: 38874 D: 76635 Ptnml(0-2): 110, 15809, 45147, 16222, 124 https://tests.stockfishchess.org/tests/view/678ac722c00c743bc9e9fc35 Passed VLTC: LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 77404 W: 19825 L: 19452 D: 38127 Ptnml(0-2): 18, 7262, 23765, 7643, 14 https://tests.stockfishchess.org/tests/view/678b2a98c00c743bc9ea048c closes https://github.com/official-stockfish/Stockfish/pull/5796 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
c94bcf62e4
commit
738ac2a100
+12
-10
@@ -446,17 +446,19 @@ void Search::Worker::iterative_deepening() {
|
|||||||
// Do we have time for the next iteration? Can we stop searching now?
|
// Do we have time for the next iteration? Can we stop searching now?
|
||||||
if (limits.use_time_management() && !threads.stop && !mainThread->stopOnPonderhit)
|
if (limits.use_time_management() && !threads.stop && !mainThread->stopOnPonderhit)
|
||||||
{
|
{
|
||||||
int nodesEffort = rootMoves[0].effort * 100 / std::max(size_t(1), size_t(nodes));
|
int nodesEffort = rootMoves[0].effort * 100000 / std::max(size_t(1), size_t(nodes));
|
||||||
|
|
||||||
double fallingEval = (11 + 2 * (mainThread->bestPreviousAverageScore - bestValue)
|
double fallingEval =
|
||||||
+ (mainThread->iterValue[iterIdx] - bestValue))
|
(11.396 + 2.035 * (mainThread->bestPreviousAverageScore - bestValue)
|
||||||
/ 100.0;
|
+ 0.968 * (mainThread->iterValue[iterIdx] - bestValue))
|
||||||
fallingEval = std::clamp(fallingEval, 0.580, 1.667);
|
/ 100.0;
|
||||||
|
fallingEval = std::clamp(fallingEval, 0.5786, 1.6752);
|
||||||
|
|
||||||
// If the bestMove is stable over several iterations, reduce time accordingly
|
// If the bestMove is stable over several iterations, reduce time accordingly
|
||||||
timeReduction = lastBestMoveDepth + 8 < completedDepth ? 1.495 : 0.687;
|
timeReduction = lastBestMoveDepth + 8 < completedDepth ? 1.4857 : 0.7046;
|
||||||
double reduction = (1.48 + mainThread->previousTimeReduction) / (2.17 * timeReduction);
|
double reduction =
|
||||||
double bestMoveInstability = 1 + 1.88 * totBestMoveChanges / threads.size();
|
(1.4540 + mainThread->previousTimeReduction) / (2.1593 * timeReduction);
|
||||||
|
double bestMoveInstability = 0.9929 + 1.8519 * totBestMoveChanges / threads.size();
|
||||||
|
|
||||||
double totalTime =
|
double totalTime =
|
||||||
mainThread->tm.optimum() * fallingEval * reduction * bestMoveInstability;
|
mainThread->tm.optimum() * fallingEval * reduction * bestMoveInstability;
|
||||||
@@ -467,7 +469,7 @@ void Search::Worker::iterative_deepening() {
|
|||||||
|
|
||||||
auto elapsedTime = elapsed();
|
auto elapsedTime = elapsed();
|
||||||
|
|
||||||
if (completedDepth >= 10 && nodesEffort >= 97 && elapsedTime > totalTime * 0.739
|
if (completedDepth >= 10 && nodesEffort >= 97056 && elapsedTime > totalTime * 0.6540
|
||||||
&& !mainThread->ponder)
|
&& !mainThread->ponder)
|
||||||
threads.stop = true;
|
threads.stop = true;
|
||||||
|
|
||||||
@@ -482,7 +484,7 @@ void Search::Worker::iterative_deepening() {
|
|||||||
threads.stop = true;
|
threads.stop = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
threads.increaseDepth = mainThread->ponder || elapsedTime <= totalTime * 0.506;
|
threads.increaseDepth = mainThread->ponder || elapsedTime <= totalTime * 0.5138;
|
||||||
}
|
}
|
||||||
|
|
||||||
mainThread->iterValue[iterIdx] = bestValue;
|
mainThread->iterValue[iterIdx] = bestValue;
|
||||||
|
|||||||
+17
-14
@@ -88,17 +88,19 @@ void TimeManagement::init(Search::LimitsType& limits,
|
|||||||
const TimePoint scaledInc = limits.inc[us] / scaleFactor;
|
const TimePoint scaledInc = limits.inc[us] / scaleFactor;
|
||||||
|
|
||||||
// Maximum move horizon of 50 moves
|
// Maximum move horizon of 50 moves
|
||||||
int mtg = limits.movestogo ? std::min(limits.movestogo, 50) : 50;
|
int centiMTG = limits.movestogo ? std::min(limits.movestogo * 100, 5000) : 5051;
|
||||||
|
|
||||||
// If less than one second, gradually reduce mtg
|
// If less than one second, gradually reduce mtg
|
||||||
if (scaledTime < 1000 && double(mtg) / scaledInc > 0.05)
|
if (scaledTime < 1000 && double(centiMTG) / scaledInc > 5.051)
|
||||||
{
|
{
|
||||||
mtg = scaledTime * 0.05;
|
centiMTG = scaledTime * 5.051;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure timeLeft is > 0 since we may use it as a divisor
|
// Make sure timeLeft is > 0 since we may use it as a divisor
|
||||||
TimePoint timeLeft = std::max(TimePoint(1), limits.time[us] + limits.inc[us] * (mtg - 1)
|
TimePoint timeLeft =
|
||||||
- moveOverhead * (2 + mtg));
|
std::max(TimePoint(1),
|
||||||
|
limits.time[us]
|
||||||
|
+ (limits.inc[us] * (centiMTG - 100) - moveOverhead * (200 + centiMTG)) / 100);
|
||||||
|
|
||||||
// x basetime (+ z increment)
|
// x basetime (+ z increment)
|
||||||
// If there is a healthy increment, timeLeft can exceed the actual available
|
// If there is a healthy increment, timeLeft can exceed the actual available
|
||||||
@@ -107,31 +109,32 @@ void TimeManagement::init(Search::LimitsType& limits,
|
|||||||
{
|
{
|
||||||
// Extra time according to timeLeft
|
// Extra time according to timeLeft
|
||||||
if (originalTimeAdjust < 0)
|
if (originalTimeAdjust < 0)
|
||||||
originalTimeAdjust = 0.3285 * std::log10(timeLeft) - 0.4830;
|
originalTimeAdjust = 0.3128 * std::log10(timeLeft) - 0.4354;
|
||||||
|
|
||||||
// Calculate time constants based on current time left.
|
// Calculate time constants based on current time left.
|
||||||
double logTimeInSec = std::log10(scaledTime / 1000.0);
|
double logTimeInSec = std::log10(scaledTime / 1000.0);
|
||||||
double optConstant = std::min(0.00308 + 0.000319 * logTimeInSec, 0.00506);
|
double optConstant = std::min(0.0032116 + 0.000321123 * logTimeInSec, 0.00508017);
|
||||||
double maxConstant = std::max(3.39 + 3.01 * logTimeInSec, 2.93);
|
double maxConstant = std::max(3.3977 + 3.03950 * logTimeInSec, 2.94761);
|
||||||
|
|
||||||
optScale = std::min(0.0122 + std::pow(ply + 2.95, 0.462) * optConstant,
|
optScale = std::min(0.0121431 + std::pow(ply + 2.94693, 0.461073) * optConstant,
|
||||||
0.213 * limits.time[us] / timeLeft)
|
0.213035 * limits.time[us] / timeLeft)
|
||||||
* originalTimeAdjust;
|
* originalTimeAdjust;
|
||||||
|
|
||||||
maxScale = std::min(6.64, maxConstant + ply / 12.0);
|
maxScale = std::min(6.67704, maxConstant + ply / 11.9847);
|
||||||
}
|
}
|
||||||
|
|
||||||
// x moves in y seconds (+ z increment)
|
// x moves in y seconds (+ z increment)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
optScale = std::min((0.88 + ply / 116.4) / mtg, 0.88 * limits.time[us] / timeLeft);
|
optScale =
|
||||||
maxScale = 1.3 + 0.11 * mtg;
|
std::min((0.88 + ply / 116.4) / (centiMTG / 100.0), 0.88 * limits.time[us] / timeLeft);
|
||||||
|
maxScale = 1.3 + 0.11 * (centiMTG / 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit the maximum possible time for this move
|
// Limit the maximum possible time for this move
|
||||||
optimumTime = TimePoint(optScale * timeLeft);
|
optimumTime = TimePoint(optScale * timeLeft);
|
||||||
maximumTime =
|
maximumTime =
|
||||||
TimePoint(std::min(0.825 * limits.time[us] - moveOverhead, maxScale * optimumTime)) - 10;
|
TimePoint(std::min(0.825179 * limits.time[us] - moveOverhead, maxScale * optimumTime)) - 10;
|
||||||
|
|
||||||
if (options["Ponder"])
|
if (options["Ponder"])
|
||||||
optimumTime += optimumTime / 4;
|
optimumTime += optimumTime / 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user