mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
LMR dynamic reduction
Reduce of two plies near the leafs and when we still have enough depth to go so to limit horizon effects. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -141,8 +141,8 @@ Move MovePicker::get_next_move() {
|
|||||||
assert(move_is_ok(mateKiller));
|
assert(move_is_ok(mateKiller));
|
||||||
if (move_is_legal(pos, mateKiller, pinned))
|
if (move_is_legal(pos, mateKiller, pinned))
|
||||||
return mateKiller;
|
return mateKiller;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PH_GOOD_CAPTURES:
|
case PH_GOOD_CAPTURES:
|
||||||
numOfMoves = generate_captures(pos, moves);
|
numOfMoves = generate_captures(pos, moves);
|
||||||
|
|||||||
@@ -1332,8 +1332,11 @@ namespace {
|
|||||||
&& !move_is_castle(move)
|
&& !move_is_castle(move)
|
||||||
&& !move_is_killer(move, ss[ply]))
|
&& !move_is_killer(move, ss[ply]))
|
||||||
{
|
{
|
||||||
ss[ply].reduction = OnePly;
|
// LMR dynamic reduction
|
||||||
value = -search(pos, ss, -(beta-1), newDepth-OnePly, ply+1, true, threadID);
|
Depth R = (moveCount >= 3 * LMRNonPVMoves && depth >= 7*OnePly ? 2*OnePly : OnePly);
|
||||||
|
|
||||||
|
ss[ply].reduction = R;
|
||||||
|
value = -search(pos, ss, -(beta-1), newDepth-R, ply+1, true, threadID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
value = beta; // Just to trigger next condition
|
value = beta; // Just to trigger next condition
|
||||||
|
|||||||
Reference in New Issue
Block a user