Skip to content
Permalink
Browse files

Retire easy move

Remove the easy move code and add the condition to
play instantly if only one legal move is available.

Verified there is no regression at 60+0.05
ELO: 0.17 +-1.9 (95%) LOS: 57.0%
Total: 40000 W: 6397 L: 6377 D: 27226

bench: 8502826
  • Loading branch information...
Ralph Stoesser authored and mcostalba committed Jan 8, 2014
1 parent a5869d8 commit f14cd1bb89d080f36a11df3c90f15da881c599df
Showing with 5 additions and 24 deletions.
  1. +5 −24 src/search.cpp
@@ -428,32 +428,13 @@ namespace {
if (depth > 4 && depth < 50 && PVSize == 1)
TimeMgr.pv_instability(BestMoveChanges);

// Stop the search if most of the available time has been used. We
// probably don't have enough time to search the first move at the
// next iteration anyway.
if (IterationTime > (TimeMgr.available_time() * 62) / 100)
// Stop the search if only one legal move is available or most
// of the available time has been used. We probably don't have
// enough time to search the first move at the next iteration anyway.
if ( RootMoves.size() == 1
|| IterationTime > (TimeMgr.available_time() * 62) / 100)
stop = true;

// Stop the search early if one move seems to be much better than others
if ( depth >= 12
&& BestMoveChanges <= DBL_EPSILON
&& !stop
&& PVSize == 1
&& bestValue > VALUE_MATED_IN_MAX_PLY
&& ( RootMoves.size() == 1
|| Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
{
Value rBeta = bestValue - 2 * PawnValueMg;
ss->excludedMove = RootMoves[0].pv[0];
ss->skipNullMove = true;
Value v = search<NonPV>(pos, ss, rBeta - 1, rBeta, (depth - 3) * ONE_PLY, true);
ss->skipNullMove = false;
ss->excludedMove = MOVE_NONE;

if (v < rBeta)
stop = true;
}

if (stop)
{
// If we are allowed to ponder do not stop the search now but

0 comments on commit f14cd1b

Please sign in to comment.
You can’t perform that action at this time.