mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 03:59:15 +00:00
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.
This commit is contained in:
parent
ccad601389
commit
45dba12c5b
1 changed files with 2 additions and 13 deletions
|
@ -294,7 +294,6 @@ namespace {
|
||||||
Stack ss[MAX_PLY_PLUS_2];
|
Stack ss[MAX_PLY_PLUS_2];
|
||||||
int depth, prevBestMoveChanges;
|
int depth, prevBestMoveChanges;
|
||||||
Value bestValue, alpha, beta, delta;
|
Value bestValue, alpha, beta, delta;
|
||||||
bool bestMoveNeverChanged = true;
|
|
||||||
|
|
||||||
memset(ss, 0, 4 * sizeof(Stack));
|
memset(ss, 0, 4 * sizeof(Stack));
|
||||||
depth = BestMoveChanges = 0;
|
depth = BestMoveChanges = 0;
|
||||||
|
@ -417,10 +416,6 @@ namespace {
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out startup noise when monitoring best move stability
|
|
||||||
if (depth > 2 && BestMoveChanges)
|
|
||||||
bestMoveNeverChanged = false;
|
|
||||||
|
|
||||||
// Do we have found a "mate in x"?
|
// Do we have found a "mate in x"?
|
||||||
if ( Limits.mate
|
if ( Limits.mate
|
||||||
&& bestValue >= VALUE_MATE_IN_MAX_PLY
|
&& bestValue >= VALUE_MATE_IN_MAX_PLY
|
||||||
|
@ -442,18 +437,12 @@ namespace {
|
||||||
if (Time::now() - SearchTime > (TimeMgr.available_time() * 62) / 100)
|
if (Time::now() - SearchTime > (TimeMgr.available_time() * 62) / 100)
|
||||||
stop = true;
|
stop = true;
|
||||||
|
|
||||||
bool recapture = pos.is_capture(RootMoves[0].pv[0])
|
|
||||||
&& pos.captured_piece_type()
|
|
||||||
&& SetupMoves->size()
|
|
||||||
&& to_sq(SetupMoves->back()) == to_sq(RootMoves[0].pv[0]);
|
|
||||||
|
|
||||||
// Stop search early if one move seems to be much better than others
|
// Stop search early if one move seems to be much better than others
|
||||||
if ( depth >= 12
|
if ( depth >= 12
|
||||||
&& !stop
|
&& !stop
|
||||||
&& PVSize == 1
|
&& PVSize == 1
|
||||||
&& ( (bestMoveNeverChanged && recapture)
|
&& ( RootMoves.size() == 1
|
||||||
|| RootMoves.size() == 1
|
|| Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
|
||||||
|| Time::now() - SearchTime > (TimeMgr.available_time() * 40) / 100))
|
|
||||||
{
|
{
|
||||||
Value rBeta = bestValue - 2 * PawnValueMg;
|
Value rBeta = bestValue - 2 * PawnValueMg;
|
||||||
(ss+1)->excludedMove = RootMoves[0].pv[0];
|
(ss+1)->excludedMove = RootMoves[0].pv[0];
|
||||||
|
|
Loading…
Add table
Reference in a new issue