mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 03:59:15 +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;
|
<< " currmovenumber " << i + 1 << std::endl;
|
||||||
|
|
||||||
// Decide search depth for this move
|
// Decide search depth for this move
|
||||||
|
bool moveIsCapture = pos.move_is_capture(move);
|
||||||
bool dangerous;
|
bool dangerous;
|
||||||
ext = extension(pos, move, true, pos.move_is_capture(move), pos.move_is_check(move), false, false, &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;
|
newDepth = (Iteration - 2) * OnePly + ext + InitialDepth;
|
||||||
|
@ -883,15 +884,30 @@ namespace {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value = -search(pos, ss, -alpha, newDepth, 1, true, 0);
|
if (newDepth >= 3*OnePly
|
||||||
if (value > alpha)
|
&& i + MultiPV >= LMRPVMoves
|
||||||
|
&& !dangerous
|
||||||
|
&& !moveIsCapture
|
||||||
|
&& !move_is_promotion(move)
|
||||||
|
&& !move_is_castle(move))
|
||||||
{
|
{
|
||||||
// Fail high! Set the boolean variable FailHigh to true, and
|
ss[0].reduction = OnePly;
|
||||||
// re-search the move with a big window. The variable FailHigh is
|
value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0);
|
||||||
// used for time managment: We try to avoid aborting the search
|
}
|
||||||
// prematurely during a fail high research.
|
else
|
||||||
FailHigh = true;
|
value = alpha + 1; // Just to trigger next condition
|
||||||
value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0);
|
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