mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Safer razoring formula
Add also the possibility to razor at ply one. It is disable dby default but it seems stronger against Stockfish itself. It is still not clear if is stronger against other engines. By now leave disabled. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -169,6 +169,7 @@ namespace {
|
||||
Value(0x2A0), Value(0x340), Value(0x3A0) };
|
||||
|
||||
// Razoring
|
||||
const bool RazorAtDepthOne = false;
|
||||
Depth RazorDepth = 4*OnePly;
|
||||
Value RazorMargin = Value(0x300);
|
||||
|
||||
@@ -416,7 +417,7 @@ void think(const Position &pos, bool infinite, bool ponder, int side_to_move,
|
||||
UseFutilityPruning = get_option_value_bool("Futility Pruning (Main Search)");
|
||||
|
||||
FutilityMarginQS = value_from_centipawns(get_option_value_int("Futility Margin (Quiescence Search)"));
|
||||
int fmScale = get_option_value_int("Futility Margin (Main Serach)");
|
||||
int fmScale = get_option_value_int("Futility Margin Scale Factor (Main Search)");
|
||||
for (int i = 0; i < 6; i++)
|
||||
FutilityMargins[i] = (FutilityMargins[i] * fmScale) / 100;
|
||||
|
||||
@@ -1241,12 +1242,14 @@ namespace {
|
||||
else if ( !value_is_mate(beta)
|
||||
&& approximateEval < beta - RazorMargin
|
||||
&& depth < RazorDepth
|
||||
&& depth > OnePly
|
||||
&& (RazorAtDepthOne || depth > OnePly)
|
||||
&& ttMove == MOVE_NONE
|
||||
&& !pos.has_pawn_on_7th(pos.side_to_move()))
|
||||
{
|
||||
Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
|
||||
if (v < beta - RazorMargin / 2 - int(depth - OnePly) * RazorMargin / 8)
|
||||
if ( (v < beta - RazorMargin - RazorMargin / 4)
|
||||
|| (depth <= 2*OnePly && v < beta - RazorMargin)
|
||||
|| (depth <= OnePly && v < beta - RazorMargin / 2))
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace {
|
||||
o.push_back(Option("Futility Pruning (Main Search)", true));
|
||||
o.push_back(Option("Futility Pruning (Quiescence Search)", true));
|
||||
o.push_back(Option("Futility Margin (Quiescence Search)", 50, 0, 1000));
|
||||
o.push_back(Option("Futility Margin (Main Serach)", 100, 0, 1000));
|
||||
o.push_back(Option("Futility Margin Scale Factor (Main Search)", 100, 0, 1000));
|
||||
o.push_back(Option("Maximum Razoring Depth", 3, 0, 4));
|
||||
o.push_back(Option("Razoring Margin", 300, 150, 600));
|
||||
o.push_back(Option("LSN filtering", true));
|
||||
|
||||
Reference in New Issue
Block a user