No functional change
Closes #1166
// MultiPV loop. We perform a full root search for each PV line
for (PVIdx = 0; PVIdx < multiPV && !Threads.stop; ++PVIdx)
{
// MultiPV loop. We perform a full root search for each PV line
for (PVIdx = 0; PVIdx < multiPV && !Threads.stop; ++PVIdx)
{
+ // Reset UCI info selDepth for each depth and each PV line
+ selDepth = 0;
+
// Reset aspiration window starting size
if (rootDepth >= 5 * ONE_PLY)
{
// Reset aspiration window starting size
if (rootDepth >= 5 * ONE_PLY)
{
static_cast<MainThread*>(thisThread)->check_time();
// Used to send selDepth info to GUI
static_cast<MainThread*>(thisThread)->check_time();
// Used to send selDepth info to GUI
- if (PvNode && thisThread->maxPly < ss->ply)
- thisThread->maxPly = ss->ply;
+ if (PvNode && thisThread->selDepth < ss->ply)
+ thisThread->selDepth = ss->ply;
if (moveCount == 1 || value > alpha)
{
rm.score = value;
if (moveCount == 1 || value > alpha)
{
rm.score = value;
+ rm.selDepth = thisThread->selDepth;
rm.pv.resize(1);
assert((ss+1)->pv);
rm.pv.resize(1);
assert((ss+1)->pv);
ss << "info"
<< " depth " << d / ONE_PLY
ss << "info"
<< " depth " << d / ONE_PLY
- << " seldepth " << pos.this_thread()->maxPly
+ << " seldepth " << rootMoves[i].selDepth
<< " multipv " << i + 1
<< " score " << UCI::value(v);
<< " multipv " << i + 1
<< " score " << UCI::value(v);
Value score = -VALUE_INFINITE;
Value previousScore = -VALUE_INFINITE;
Value score = -VALUE_INFINITE;
Value previousScore = -VALUE_INFINITE;
Thread::Thread() {
exit = false;
Thread::Thread() {
exit = false;
nodes = tbHits = 0;
idx = Threads.size(); // Start from 0
nodes = tbHits = 0;
idx = Threads.size(); // Start from 0
for (Thread* th : Threads)
{
for (Thread* th : Threads)
{
th->nodes = 0;
th->tbHits = 0;
th->rootDepth = DEPTH_ZERO;
th->nodes = 0;
th->tbHits = 0;
th->rootDepth = DEPTH_ZERO;
Material::Table materialTable;
Endgames endgames;
size_t idx, PVIdx;
Material::Table materialTable;
Endgames endgames;
size_t idx, PVIdx;
std::atomic<uint64_t> nodes, tbHits;
Position rootPos;
std::atomic<uint64_t> nodes, tbHits;
Position rootPos;