mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Let LMR at root be independent of MultiPV value
Current formula enable LMR when i + MultiPV >= LMRPVMoves It means that, for instance, if MultiPV == 1 then LMR will be started to be considered at move i = LMRPVMoves - 1, while if MultiPV == 3 then it will start before, at move i = LMRPVMoves - 3. With this patch the formula becomes i >= MultiPV + LMRPVMoves - 2 So that LMR will always start after LMRPVMoves - 1 moves from the last PV move. No functional change when MultiPV == 1 Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
339bb8a524
commit
54382f8b07
1 changed files with 6 additions and 6 deletions
|
@ -894,7 +894,7 @@ namespace {
|
||||||
// Decide search depth for this move
|
// Decide search depth for this move
|
||||||
bool moveIsCapture = pos.move_is_capture(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, moveIsCapture, pos.move_is_check(move), false, false, &dangerous);
|
||||||
newDepth = (Iteration - 2) * OnePly + ext + InitialDepth;
|
newDepth = (Iteration - 2) * OnePly + ext + InitialDepth;
|
||||||
|
|
||||||
// Make the move, and search it
|
// Make the move, and search it
|
||||||
|
@ -918,8 +918,8 @@ namespace {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (newDepth >= 3*OnePly
|
if ( newDepth >= 3*OnePly
|
||||||
&& i + MultiPV >= LMRPVMoves
|
&& i >= MultiPV + LMRPVMoves - 2 // Remove -2 and decrease LMRPVMoves instead ?
|
||||||
&& !dangerous
|
&& !dangerous
|
||||||
&& !moveIsCapture
|
&& !moveIsCapture
|
||||||
&& !move_is_promotion(move)
|
&& !move_is_promotion(move)
|
||||||
|
@ -927,10 +927,10 @@ namespace {
|
||||||
{
|
{
|
||||||
ss[0].reduction = OnePly;
|
ss[0].reduction = OnePly;
|
||||||
value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0);
|
value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
value = alpha + 1; // Just to trigger next condition
|
value = alpha + 1; // Just to trigger next condition
|
||||||
if(value > alpha)
|
|
||||||
|
if (value > alpha)
|
||||||
{
|
{
|
||||||
value = -search(pos, ss, -alpha, newDepth, 1, true, 0);
|
value = -search(pos, ss, -alpha, newDepth, 1, true, 0);
|
||||||
if (value > alpha)
|
if (value > alpha)
|
||||||
|
|
Loading…
Add table
Reference in a new issue