From f14cd1bb89d080f36a11df3c90f15da881c599df Mon Sep 17 00:00:00 2001 From: Ralph Stoesser Date: Wed, 8 Jan 2014 23:54:37 +0900 Subject: [PATCH] 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 --- src/search.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 505e9ec2..be82568a 100644 --- a/src/search.cpp +++ b/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(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 -- 2.39.2