mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Provide selective search depth info for each pv move
No functional change Closes #1166
This commit is contained in:
parent
36a93d90f7
commit
377d77dbe9
4 changed files with 10 additions and 6 deletions
|
@ -383,6 +383,9 @@ void Thread::search() {
|
||||||
// MultiPV loop. We perform a full root search for each PV line
|
// MultiPV loop. We perform a full root search for each PV line
|
||||||
for (PVIdx = 0; PVIdx < multiPV && !Threads.stop; ++PVIdx)
|
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
|
// Reset aspiration window starting size
|
||||||
if (rootDepth >= 5 * ONE_PLY)
|
if (rootDepth >= 5 * ONE_PLY)
|
||||||
{
|
{
|
||||||
|
@ -566,8 +569,8 @@ namespace {
|
||||||
static_cast<MainThread*>(thisThread)->check_time();
|
static_cast<MainThread*>(thisThread)->check_time();
|
||||||
|
|
||||||
// Used to send selDepth info to GUI
|
// Used to send selDepth info to GUI
|
||||||
if (PvNode && thisThread->maxPly < ss->ply)
|
if (PvNode && thisThread->selDepth < ss->ply)
|
||||||
thisThread->maxPly = ss->ply;
|
thisThread->selDepth = ss->ply;
|
||||||
|
|
||||||
if (!rootNode)
|
if (!rootNode)
|
||||||
{
|
{
|
||||||
|
@ -1043,6 +1046,7 @@ moves_loop: // When in check search starts from here
|
||||||
if (moveCount == 1 || value > alpha)
|
if (moveCount == 1 || value > alpha)
|
||||||
{
|
{
|
||||||
rm.score = value;
|
rm.score = value;
|
||||||
|
rm.selDepth = thisThread->selDepth;
|
||||||
rm.pv.resize(1);
|
rm.pv.resize(1);
|
||||||
|
|
||||||
assert((ss+1)->pv);
|
assert((ss+1)->pv);
|
||||||
|
@ -1525,7 +1529,7 @@ string UCI::pv(const Position& pos, Depth depth, Value alpha, Value beta) {
|
||||||
|
|
||||||
ss << "info"
|
ss << "info"
|
||||||
<< " depth " << d / ONE_PLY
|
<< " depth " << d / ONE_PLY
|
||||||
<< " seldepth " << pos.this_thread()->maxPly
|
<< " seldepth " << rootMoves[i].selDepth
|
||||||
<< " multipv " << i + 1
|
<< " multipv " << i + 1
|
||||||
<< " score " << UCI::value(v);
|
<< " score " << UCI::value(v);
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ struct RootMove {
|
||||||
|
|
||||||
Value score = -VALUE_INFINITE;
|
Value score = -VALUE_INFINITE;
|
||||||
Value previousScore = -VALUE_INFINITE;
|
Value previousScore = -VALUE_INFINITE;
|
||||||
|
int selDepth = 0;
|
||||||
std::vector<Move> pv;
|
std::vector<Move> pv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ ThreadPool Threads; // Global object
|
||||||
Thread::Thread() {
|
Thread::Thread() {
|
||||||
|
|
||||||
exit = false;
|
exit = false;
|
||||||
maxPly = 0;
|
selDepth = 0;
|
||||||
nodes = tbHits = 0;
|
nodes = tbHits = 0;
|
||||||
idx = Threads.size(); // Start from 0
|
idx = Threads.size(); // Start from 0
|
||||||
|
|
||||||
|
@ -210,7 +210,6 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
|
||||||
|
|
||||||
for (Thread* th : Threads)
|
for (Thread* th : Threads)
|
||||||
{
|
{
|
||||||
th->maxPly = 0;
|
|
||||||
th->nodes = 0;
|
th->nodes = 0;
|
||||||
th->tbHits = 0;
|
th->tbHits = 0;
|
||||||
th->rootDepth = DEPTH_ZERO;
|
th->rootDepth = DEPTH_ZERO;
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
Material::Table materialTable;
|
Material::Table materialTable;
|
||||||
Endgames endgames;
|
Endgames endgames;
|
||||||
size_t idx, PVIdx;
|
size_t idx, PVIdx;
|
||||||
int maxPly;
|
int selDepth;
|
||||||
std::atomic<uint64_t> nodes, tbHits;
|
std::atomic<uint64_t> nodes, tbHits;
|
||||||
|
|
||||||
Position rootPos;
|
Position rootPos;
|
||||||
|
|
Loading…
Add table
Reference in a new issue