mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 02:27:00 +08:00
No voting for TB loss / mate.
Just as we pick the shortest mate also make sure we stave off mate as long as possible. https://github.com/official-stockfish/Stockfish/pull/2603 bench: 5138771
This commit is contained in:
committed by
Joost VandeVondele
parent
0b8ce4b303
commit
84f3bf594d
@@ -280,7 +280,7 @@ void MainThread::search() {
|
|||||||
std::map<Move, int64_t> votes;
|
std::map<Move, int64_t> votes;
|
||||||
Value minScore = this->rootMoves[0].score;
|
Value minScore = this->rootMoves[0].score;
|
||||||
|
|
||||||
// Find out minimum score
|
// Find minimum score
|
||||||
for (Thread* th: Threads)
|
for (Thread* th: Threads)
|
||||||
minScore = std::min(minScore, th->rootMoves[0].score);
|
minScore = std::min(minScore, th->rootMoves[0].score);
|
||||||
|
|
||||||
@@ -290,14 +290,15 @@ void MainThread::search() {
|
|||||||
votes[th->rootMoves[0].pv[0]] +=
|
votes[th->rootMoves[0].pv[0]] +=
|
||||||
(th->rootMoves[0].score - minScore + 14) * int(th->completedDepth);
|
(th->rootMoves[0].score - minScore + 14) * int(th->completedDepth);
|
||||||
|
|
||||||
if (bestThread->rootMoves[0].score >= VALUE_TB_WIN_IN_MAX_PLY)
|
if (abs(bestThread->rootMoves[0].score) >= VALUE_TB_WIN_IN_MAX_PLY)
|
||||||
{
|
{
|
||||||
// Make sure we pick the shortest mate / TB conversion
|
// Make sure we pick the shortest mate / TB conversion or stave off mate the longest
|
||||||
if (th->rootMoves[0].score > bestThread->rootMoves[0].score)
|
if (th->rootMoves[0].score > bestThread->rootMoves[0].score)
|
||||||
bestThread = th;
|
bestThread = th;
|
||||||
}
|
}
|
||||||
else if ( th->rootMoves[0].score >= VALUE_TB_WIN_IN_MAX_PLY
|
else if ( th->rootMoves[0].score >= VALUE_TB_WIN_IN_MAX_PLY
|
||||||
|| votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]])
|
|| ( th->rootMoves[0].score > VALUE_TB_LOSS_IN_MAX_PLY
|
||||||
|
&& votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]]))
|
||||||
bestThread = th;
|
bestThread = th;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user