Skip to content

Commit

Permalink
Revert "Shuffle detection official-stockfish#2064"
Browse files Browse the repository at this point in the history
It causes a serious regression hanging a simple fixed
depth search. Reproducible with:

position fen q1B5/1P1q4/8/8/8/6R1/8/1K1k4 w - - 0 1
go depth 13

The reason is a search tree explosion due to:

if (... && depth < 3 * ONE_PLY)
      extension = ONE_PLY;

This is very dangerous code by itself because triggers **at the leafs**
and in the above position keeps extending endlessly. In normal games
time deadline makes the search to stop sooner or later, but in fixed
seacrch we just hang possibly for a very long time. This is not acceptable
because 'go depth 13' shall not be a surprise for any position.

This patch reverts commit 76f1807.
and fixes the issue official-stockfish#2091

Bench: 3243738
  • Loading branch information
mcostalba authored and mstembera committed May 18, 2019
1 parent f561267 commit 55b8dfb
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,15 +607,6 @@ namespace {
: ttHit ? tte->move() : MOVE_NONE;
ttPv = (ttHit && tte->is_pv()) || (PvNode && depth > 4 * ONE_PLY);

// if position has been searched at higher depths and we are shuffling, return value_draw
if (pos.rule50_count() > 36
&& ss->ply > 36
&& depth < 3 * ONE_PLY
&& ttHit
&& tte->depth() > depth
&& pos.count<PAWN>() > 0)
return VALUE_DRAW;

// At non-PV nodes we check for an early TT cutoff
if ( !PvNode
&& ttHit
Expand Down Expand Up @@ -934,10 +925,6 @@ namespace {
&& (pos.blockers_for_king(~us) & from_sq(move) || pos.see_ge(move)))
extension = ONE_PLY;

// Shuffle extension
else if(pos.rule50_count() > 14 && ss->ply > 14 && depth < 3 * ONE_PLY && PvNode)
extension = ONE_PLY;

// Castling extension
else if (type_of(move) == CASTLING)
extension = ONE_PLY;
Expand Down

0 comments on commit 55b8dfb

Please sign in to comment.