mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Added LMR at the root.
After 2000 games at 1+0 Mod vs Orig +534 =1033 -433 52.525% 1050.5/2000 +18 ELO
This commit is contained in:
parent
2f7723fd44
commit
dad632ce5b
1 changed files with 24 additions and 8 deletions
|
@ -858,6 +858,7 @@ namespace {
|
|||
<< " currmovenumber " << i + 1 << std::endl;
|
||||
|
||||
// Decide search depth for this move
|
||||
bool moveIsCapture = pos.move_is_capture(move);
|
||||
bool dangerous;
|
||||
ext = extension(pos, move, true, pos.move_is_capture(move), pos.move_is_check(move), false, false, &dangerous);
|
||||
newDepth = (Iteration - 2) * OnePly + ext + InitialDepth;
|
||||
|
@ -883,15 +884,30 @@ namespace {
|
|||
}
|
||||
else
|
||||
{
|
||||
value = -search(pos, ss, -alpha, newDepth, 1, true, 0);
|
||||
if (value > alpha)
|
||||
if (newDepth >= 3*OnePly
|
||||
&& i + MultiPV >= LMRPVMoves
|
||||
&& !dangerous
|
||||
&& !moveIsCapture
|
||||
&& !move_is_promotion(move)
|
||||
&& !move_is_castle(move))
|
||||
{
|
||||
// Fail high! Set the boolean variable FailHigh to true, and
|
||||
// re-search the move with a big window. The variable FailHigh is
|
||||
// used for time managment: We try to avoid aborting the search
|
||||
// prematurely during a fail high research.
|
||||
FailHigh = true;
|
||||
value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0);
|
||||
ss[0].reduction = OnePly;
|
||||
value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0);
|
||||
}
|
||||
else
|
||||
value = alpha + 1; // Just to trigger next condition
|
||||
if(value > alpha)
|
||||
{
|
||||
value = -search(pos, ss, -alpha, newDepth, 1, true, 0);
|
||||
if (value > alpha)
|
||||
{
|
||||
// Fail high! Set the boolean variable FailHigh to true, and
|
||||
// re-search the move with a big window. The variable FailHigh is
|
||||
// used for time managment: We try to avoid aborting the search
|
||||
// prematurely during a fail high research.
|
||||
FailHigh = true;
|
||||
value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue