Permalink
Browse files

Avoid spamming the GUI in multipv search

Send the PV lines to GUI only once at the end of the
PV search loop or just in case of long searches.

We need to sync also sending of "currmove" info to
avoid sending info on current move without first
informing the GUI on the PV line we are searching on.

No functional change.
  • Loading branch information...
mcostalba committed Nov 18, 2012
1 parent 8367cf1 commit 55df3fa2d7631ed67e46f9433aa7f3a71c18e5e7
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/search.cpp
View
@@ -391,7 +391,8 @@ namespace {
// Sort the PV lines searched so far and update the GUI
sort<RootMove>(RootMoves.begin(), RootMoves.begin() + PVIdx + 1);
- sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
+ if (PVIdx + 1 == PVSize || Time::now() - SearchTime > 3000)
+ sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
}
// Do we need to pick now the sub-optimal best move ?
@@ -793,7 +794,7 @@ namespace {
{
Signals.firstRootMove = (moveCount == 1);
- if (thisThread == Threads.main_thread() && Time::now() - SearchTime > 2000)
+ if (thisThread == Threads.main_thread() && Time::now() - SearchTime > 3000)
sync_cout << "info depth " << depth / ONE_PLY
<< " currmove " << move_to_uci(move, pos.is_chess960())
<< " currmovenumber " << moveCount + PVIdx << sync_endl;

4 comments on commit 55df3fa

@othello1984

This comment has been minimized.

Show comment Hide comment
@othello1984

othello1984 Nov 18, 2012

get warnings when compiling the source under mingw (gcc 4.7.2)

g++ -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-use -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -c -o search.o search.cpp
In file included from book.h:26:0,
from search.cpp:27:
position.h: In function 'bool {anonymous}::prevents_threat(const Position&, Move, Move)':
position.h:274:21: warning: array subscript is above array bounds [-Warray-bounds]

get warnings when compiling the source under mingw (gcc 4.7.2)

g++ -g -Wall -Wcast-qual -fno-exceptions -fno-rtti -fprofile-use -Wextra -Wshadow -DNDEBUG -O3 -DIS_64BIT -msse -DUSE_BSFQ -c -o search.o search.cpp
In file included from book.h:26:0,
from search.cpp:27:
position.h: In function 'bool {anonymous}::prevents_threat(const Position&, Move, Move)':
position.h:274:21: warning: array subscript is above array bounds [-Warray-bounds]

@lucasart

This comment has been minimized.

Show comment Hide comment
@lucasart

lucasart Nov 26, 2012

Contributor

Marco,

I noticed something strange in the qsearch() Futility pruning:

// Prune moves with negative or equal SEE
if ( futilityBase < beta
&& depth < DEPTH_ZERO
&& pos.see(move) <= 0)
continue;

Before the continue, shouldn't you put something like:

bestValue = std::max(bestValue, futilityBase);

otherwise we can have some unwanted side effects due to fail soft, no ?

Contributor

lucasart replied Nov 26, 2012

Marco,

I noticed something strange in the qsearch() Futility pruning:

// Prune moves with negative or equal SEE
if ( futilityBase < beta
&& depth < DEPTH_ZERO
&& pos.see(move) <= 0)
continue;

Before the continue, shouldn't you put something like:

bestValue = std::max(bestValue, futilityBase);

otherwise we can have some unwanted side effects due to fail soft, no ?

@mcostalba

This comment has been minimized.

Show comment Hide comment
@mcostalba

mcostalba Nov 26, 2012

Owner
Owner

mcostalba replied Nov 26, 2012

@mcostalba

This comment has been minimized.

Show comment Hide comment
@mcostalba

mcostalba Dec 8, 2012

Owner
Owner

mcostalba replied Dec 8, 2012

Please sign in to comment.