mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Avoid search tree explosion in qsearch
Under some rare cases we can have a search tree explosion due to a perpetual check or to a very long non-capture TT sequence. This avoids the tree explosion not following TT moves that are not captures or promotions when we are below the 'generate checks' depth. Idea suggested by Richard Vida. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b651e5334b
commit
252844e899
1 changed files with 8 additions and 0 deletions
|
@ -94,8 +94,16 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
|||
else if (d == Depth(0))
|
||||
phasePtr = QsearchWithChecksPhaseTable;
|
||||
else
|
||||
{
|
||||
phasePtr = QsearchWithoutChecksPhaseTable;
|
||||
|
||||
// Skip TT move if is not a capture or a promotion, this avoids
|
||||
// qsearch tree explosion due to a possible perpetual check or
|
||||
// similar rare cases when TT table is full.
|
||||
if (ttm != MOVE_NONE && !pos.move_is_capture_or_promotion(ttm))
|
||||
searchTT = ttMoves[0].move = MOVE_NONE;
|
||||
}
|
||||
|
||||
phasePtr += !searchTT - 1;
|
||||
go_next_phase();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue