From: Fabian Fichter Date: Mon, 1 Jun 2020 10:26:06 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a87c260f1c9cde27abd83a3e821aec5657ea7341;p=fairystockfish.git Merge official-stockfish/master bench: 4964428 --- a87c260f1c9cde27abd83a3e821aec5657ea7341 diff --cc src/movepick.cpp index 8dfece9,575c902..daa9d3a --- a/src/movepick.cpp +++ b/src/movepick.cpp @@@ -116,10 -112,11 +116,11 @@@ void MovePicker::score() else if (Type == QUIETS) m.value = (*mainHistory)[pos.side_to_move()][from_to(m)] - + 2 * (*continuationHistory[0])[pos.moved_piece(m)][to_sq(m)] - + 2 * (*continuationHistory[1])[pos.moved_piece(m)][to_sq(m)] - + 2 * (*continuationHistory[3])[pos.moved_piece(m)][to_sq(m)] - + (*continuationHistory[5])[pos.moved_piece(m)][to_sq(m)] + + 2 * (*continuationHistory[0])[history_slot(pos.moved_piece(m))][to_sq(m)] + + 2 * (*continuationHistory[1])[history_slot(pos.moved_piece(m))][to_sq(m)] + + 2 * (*continuationHistory[3])[history_slot(pos.moved_piece(m))][to_sq(m)] - + (*continuationHistory[5])[history_slot(pos.moved_piece(m))][to_sq(m)]; ++ + (*continuationHistory[5])[history_slot(pos.moved_piece(m))][to_sq(m)] + + (ply < MAX_LPH ? 4 * (*lowPlyHistory)[ply][from_to(m)] : 0); else // Type == EVASIONS { diff --cc src/movepick.h index b4b71fd,33c4b08..c1dc566 --- a/src/movepick.h +++ b/src/movepick.h @@@ -86,8 -86,14 +86,14 @@@ enum StatsType { NoCaptures, Captures } /// unsuccessful during the current search, and is used for reduction and move /// ordering decisions. It uses 2 tables (one for each color) indexed by /// the move's from and to squares, see www.chessprogramming.org/Butterfly_Boards -typedef Stats ButterflyHistory; +typedef Stats ButterflyHistory; + /// LowPlyHistory at higher depths records successful quiet moves on plies 0 to 3 + /// and quiet moves which are/were in the PV (ttPv) + /// It get cleared with each new search and get filled during iterative deepening + constexpr int MAX_LPH = 4; -typedef Stats LowPlyHistory; ++typedef Stats LowPlyHistory; + /// CounterMoveHistory stores counter moves indexed by [piece][to] of the previous /// move, see www.chessprogramming.org/Countermove_Heuristic typedef Stats CounterMoveHistory; diff --cc src/thread.cpp index fd7a4af,b5cb87d..245ffde --- a/src/thread.cpp +++ b/src/thread.cpp @@@ -210,7 -211,8 +211,8 @@@ void ThreadPool::start_thinking(Positio th->nodes = th->tbHits = th->nmpMinPly = 0; th->rootDepth = th->completedDepth = 0; th->rootMoves = rootMoves; - th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th); + th->rootPos.set(pos.variant(), pos.fen(), pos.is_chess960(), &setupStates->back(), th); + th->lowPlyHistory.fill(0); } setupStates->back() = tmp;