Skip to content

Commit 45dba12

Browse files
committed
Simplify "easy move" detection
Detect a move as easy only if it is the only one ;-) or if is much better than remaining ones after we have spent 20% of search time. Tests are ongoing, but it seems this semplification stands. Anyhow it is experimental for now and could be reverted/improved with further work Gary is testing right now. No functional change.
1 parent ccad601 commit 45dba12

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/search.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ namespace {
294294
Stack ss[MAX_PLY_PLUS_2];
295295
int depth, prevBestMoveChanges;
296296
Value bestValue, alpha, beta, delta;
297-
bool bestMoveNeverChanged = true;
298297

299298
memset(ss, 0, 4 * sizeof(Stack));
300299
depth = BestMoveChanges = 0;
@@ -417,10 +416,6 @@ namespace {
417416
<< std::endl;
418417
}
419418

420-
// Filter out startup noise when monitoring best move stability
421-
if (depth > 2 && BestMoveChanges)
422-
bestMoveNeverChanged = false;
423-
424419
// Do we have found a "mate in x"?
425420
if ( Limits.mate
426421
&& bestValue >= VALUE_MATE_IN_MAX_PLY
@@ -442,18 +437,12 @@ namespace {
442437
if (Time::now() - SearchTime > (TimeMgr.available_time() * 62) / 100)
443438
stop = true;
444439

445-
bool recapture = pos.is_capture(RootMoves[0].pv[0])
446-
&& pos.captured_piece_type()
447-
&& SetupMoves->size()
448-
&& to_sq(SetupMoves->back()) == to_sq(RootMoves[0].pv[0]);
449-
450440
// Stop search early if one move seems to be much better than others
451441
if ( depth >= 12
452442
&& !stop
453443
&& PVSize == 1
454-
&& ( (bestMoveNeverChanged && recapture)
455-
|| RootMoves.size() == 1
456-
|| Time::now() - SearchTime > (TimeMgr.available_time() * 40) / 100))
444+
&& ( RootMoves.size() == 1
445+
|| Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
457446
{
458447
Value rBeta = bestValue - 2 * PawnValueMg;
459448
(ss+1)->excludedMove = RootMoves[0].pv[0];

0 commit comments

Comments
 (0)