mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Remove unneeded depth tracking in qsearch
Since simplification of quiet checks in qsearch this depth isn't used by any function at all apart movepicker, which also doesn't use passed qsearch depth in any way, so can be removed. No functional change. closes https://github.com/official-stockfish/Stockfish/pull/5514 No functional change
This commit is contained in:
@@ -1401,14 +1401,13 @@ moves_loop: // When in check, search starts here
|
||||
// See https://www.chessprogramming.org/Horizon_Effect
|
||||
// and https://www.chessprogramming.org/Quiescence_Search
|
||||
template<NodeType nodeType>
|
||||
Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
|
||||
Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta) {
|
||||
|
||||
static_assert(nodeType != Root);
|
||||
constexpr bool PvNode = nodeType == PV;
|
||||
|
||||
assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE);
|
||||
assert(PvNode || (alpha == beta - 1));
|
||||
assert(depth <= 0);
|
||||
|
||||
// Check if we have an upcoming move that draws by repetition (~1 Elo)
|
||||
if (alpha < VALUE_DRAW && pos.upcoming_repetition(ss->ply))
|
||||
@@ -1526,7 +1525,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta,
|
||||
// first captures+checks, then captures only (but when in check, we simply search
|
||||
// all evasions).
|
||||
Square prevSq = ((ss - 1)->currentMove).is_ok() ? ((ss - 1)->currentMove).to_sq() : SQ_NONE;
|
||||
MovePicker mp(pos, ttData.move, depth, &thisThread->mainHistory, &thisThread->captureHistory,
|
||||
MovePicker mp(pos, ttData.move, DEPTH_QS, &thisThread->mainHistory, &thisThread->captureHistory,
|
||||
contHist, &thisThread->pawnHistory);
|
||||
|
||||
// Step 5. Loop through all pseudo-legal moves until no moves remain or a beta
|
||||
@@ -1606,7 +1605,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta,
|
||||
// Step 7. Make and search the move
|
||||
thisThread->nodes.fetch_add(1, std::memory_order_relaxed);
|
||||
pos.do_move(move, st, givesCheck);
|
||||
value = -qsearch<nodeType>(pos, ss + 1, -beta, -alpha, depth - 1);
|
||||
value = -qsearch<nodeType>(pos, ss + 1, -beta, -alpha);
|
||||
pos.undo_move(move);
|
||||
|
||||
assert(value > -VALUE_INFINITE && value < VALUE_INFINITE);
|
||||
|
||||
Reference in New Issue
Block a user