1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

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
This commit is contained in:
Ralph Stoesser 2014-01-08 23:54:37 +09:00 committed by Marco Costalba
parent a5869d8d25
commit f14cd1bb89

View file

@ -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