mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-06 10:53:50 +08:00
Simplify FutilityMoveCount
Inlined condition, instead of a function. closes https://github.com/official-stockfish/Stockfish/pull/6096 no functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
eb27d9420f
commit
805a2c1672
@@ -69,10 +69,6 @@ namespace {
|
|||||||
// so changing them or adding conditions that are similar requires
|
// so changing them or adding conditions that are similar requires
|
||||||
// tests at these types of time controls.
|
// tests at these types of time controls.
|
||||||
|
|
||||||
constexpr int futility_move_count(bool improving, Depth depth) {
|
|
||||||
return (3 + depth * depth) / (2 - improving);
|
|
||||||
}
|
|
||||||
|
|
||||||
int correction_value(const Worker& w, const Position& pos, const Stack* const ss) {
|
int correction_value(const Worker& w, const Position& pos, const Stack* const ss) {
|
||||||
const Color us = pos.side_to_move();
|
const Color us = pos.side_to_move();
|
||||||
const auto m = (ss - 1)->currentMove;
|
const auto m = (ss - 1)->currentMove;
|
||||||
@@ -1047,7 +1043,7 @@ moves_loop: // When in check, search starts here
|
|||||||
if (!rootNode && pos.non_pawn_material(us) && !is_loss(bestValue))
|
if (!rootNode && pos.non_pawn_material(us) && !is_loss(bestValue))
|
||||||
{
|
{
|
||||||
// Skip quiet moves if movecount exceeds our FutilityMoveCount threshold
|
// Skip quiet moves if movecount exceeds our FutilityMoveCount threshold
|
||||||
if (moveCount >= futility_move_count(improving, depth))
|
if (moveCount >= (3 + depth * depth) / (2 - improving))
|
||||||
mp.skip_quiet_moves();
|
mp.skip_quiet_moves();
|
||||||
|
|
||||||
// Reduced depth of the next LMR search
|
// Reduced depth of the next LMR search
|
||||||
|
|||||||
Reference in New Issue
Block a user