mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 11:36:51 +08:00
Limit depth after extensions to avoid asserts.
currently extensions can cause depth to exceed MAX_PLY. This triggers the assert near line 542 in search when running a binary compiled with `debug=yes` on a testcase like: ``` position fen 7K/P1p1p1p1/2P1P1Pk/6pP/3p2P1/1P6/3P4/8 w - - 0 1 go nodes 1000000 ``` passed STC https://tests.stockfishchess.org/tests/view/6668a56a602682471b064c8d LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 143936 W: 37338 L: 37238 D: 69360 Ptnml(0-2): 514, 16335, 38149, 16477, 493 closes https://github.com/official-stockfish/Stockfish/pull/5383 Bench: 1160467
This commit is contained in:
@@ -528,6 +528,9 @@ Value Search::Worker::search(
|
||||
if (depth <= 0)
|
||||
return qsearch < PvNode ? PV : NonPV > (pos, ss, alpha, beta);
|
||||
|
||||
// Limit the depth if extensions made it too large
|
||||
depth = std::min(depth, MAX_PLY - 1);
|
||||
|
||||
// Check if we have an upcoming move that draws by repetition, or
|
||||
// if the opponent had an alternative move earlier to this position.
|
||||
if (!rootNode && alpha < VALUE_DRAW && pos.has_game_cycle(ss->ply))
|
||||
|
||||
Reference in New Issue
Block a user