1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Fix output for GUI

Fritz 19 can hang with the current way to provide output,
i.e. too much output in a short time for a mate / depth 245 found quickly.

fallout from 25361e514b

closes https://github.com/official-stockfish/Stockfish/pull/5460

No functional change
This commit is contained in:
Joost VandeVondele 2024-07-07 11:23:50 +02:00
parent 5752529cab
commit 5d3517c601

View file

@ -355,9 +355,10 @@ void Search::Worker::iterative_deepening() {
break;
// When failing high/low give some update before a re-search.
// To avoid excessive output, only start at rootDepth > 30.
// To avoid excessive output that could hang GUIs like Fritz 19, only start
// at nodes > 10M (rather than depth N, which can be reached quickly)
if (mainThread && multiPV == 1 && (bestValue <= alpha || bestValue >= beta)
&& rootDepth > 30)
&& nodes > 10000000)
main_manager()->pv(*this, threads, tt, rootDepth);
// In case of failing low/high increase aspiration window and
@ -388,7 +389,7 @@ void Search::Worker::iterative_deepening() {
std::stable_sort(rootMoves.begin() + pvFirst, rootMoves.begin() + pvIdx + 1);
if (mainThread
&& (threads.stop || pvIdx + 1 == multiPV || rootDepth > 30)
&& (threads.stop || pvIdx + 1 == multiPV || nodes > 10000000)
// A thread that aborted search can have mated-in/TB-loss PV and score
// that cannot be trusted, i.e. it can be delayed or refuted if we would have
// had time to fully search other root-moves. Thus we suppress this output and
@ -968,7 +969,7 @@ moves_loop: // When in check, search starts here
ss->moveCount = ++moveCount;
if (rootNode && is_mainthread() && rootDepth > 30)
if (rootNode && is_mainthread() && nodes > 10000000)
{
main_manager()->updates.onIter(
{depth, UCIEngine::move(move, pos.is_chess960()), moveCount + thisThread->pvIdx});