Skip to content

Commit

Permalink
Revert "Implement old 'multipv' search"
Browse files Browse the repository at this point in the history
This revert the following commit:
official-stockfish@44a7db0

Bug report by Ronald de Man in issue:
official-stockfish#1392

Bench: 5023629
  • Loading branch information
snicolet committed Feb 4, 2018
1 parent d93baae commit e316e43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
24 changes: 8 additions & 16 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void Thread::search() {
mainThread->bestMoveChanges = 0;
}

multiPV = Options["MultiPV"];
size_t multiPV = Options["MultiPV"];
Skill skill(Options["Skill Level"]);

// When playing with strength handicap enable MultiPV search that we will
Expand Down Expand Up @@ -802,20 +802,12 @@ namespace {
if (move == excludedMove)
continue;

if (rootNode)
{
// At root obey the "searchmoves" option and skip moves not listed in Root
// Move List. As a consequence any illegal move is also skipped.
if (!std::count(thisThread->rootMoves.begin() + thisThread->PVIdx,
thisThread->rootMoves.end(), move))
continue;

// In MultiPV mode we not only skip PV moves which have already been searched,
// but also any other move except we have reached the last PV line.
if ( thisThread->PVIdx + 1 < thisThread->multiPV
&& move != ttMove)
continue;
}
// At root obey the "searchmoves" option and skip moves not listed in Root
// Move List. As a consequence any illegal move is also skipped. In MultiPV
// mode we also skip PV moves which have been already searched.
if (rootNode && !std::count(thisThread->rootMoves.begin() + thisThread->PVIdx,
thisThread->rootMoves.end(), move))
continue;

ss->moveCount = ++moveCount;

Expand Down Expand Up @@ -1535,7 +1527,7 @@ string UCI::pv(const Position& pos, Depth depth, Value alpha, Value beta) {
int elapsed = Time.elapsed() + 1;
const RootMoves& rootMoves = pos.this_thread()->rootMoves;
size_t PVIdx = pos.this_thread()->PVIdx;
size_t multiPV = pos.this_thread()->multiPV;
size_t multiPV = std::min((size_t)Options["MultiPV"], rootMoves.size());
uint64_t nodesSearched = Threads.nodes_searched();
uint64_t tbHits = Threads.tb_hits() + (TB::RootInTB ? rootMoves.size() : 0);

Expand Down
2 changes: 1 addition & 1 deletion src/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Thread {
Pawns::Table pawnsTable;
Material::Table materialTable;
Endgames endgames;
size_t PVIdx, multiPV;
size_t PVIdx;
int selDepth, nmp_ply, nmp_odd;
std::atomic<uint64_t> nodes, tbHits;

Expand Down

0 comments on commit e316e43

Please sign in to comment.