mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 11:39:15 +00: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:
parent
aedc6c6f1f
commit
e4fd9a2df7
2 changed files with 7 additions and 4 deletions
|
@ -169,6 +169,7 @@ namespace {
|
||||||
Value(0x2A0), Value(0x340), Value(0x3A0) };
|
Value(0x2A0), Value(0x340), Value(0x3A0) };
|
||||||
|
|
||||||
// Razoring
|
// Razoring
|
||||||
|
const bool RazorAtDepthOne = false;
|
||||||
Depth RazorDepth = 4*OnePly;
|
Depth RazorDepth = 4*OnePly;
|
||||||
Value RazorMargin = Value(0x300);
|
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)");
|
UseFutilityPruning = get_option_value_bool("Futility Pruning (Main Search)");
|
||||||
|
|
||||||
FutilityMarginQS = value_from_centipawns(get_option_value_int("Futility Margin (Quiescence 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++)
|
for (int i = 0; i < 6; i++)
|
||||||
FutilityMargins[i] = (FutilityMargins[i] * fmScale) / 100;
|
FutilityMargins[i] = (FutilityMargins[i] * fmScale) / 100;
|
||||||
|
|
||||||
|
@ -1241,12 +1242,14 @@ namespace {
|
||||||
else if ( !value_is_mate(beta)
|
else if ( !value_is_mate(beta)
|
||||||
&& approximateEval < beta - RazorMargin
|
&& approximateEval < beta - RazorMargin
|
||||||
&& depth < RazorDepth
|
&& depth < RazorDepth
|
||||||
&& depth > OnePly
|
&& (RazorAtDepthOne || depth > OnePly)
|
||||||
&& ttMove == MOVE_NONE
|
&& ttMove == MOVE_NONE
|
||||||
&& !pos.has_pawn_on_7th(pos.side_to_move()))
|
&& !pos.has_pawn_on_7th(pos.side_to_move()))
|
||||||
{
|
{
|
||||||
Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID);
|
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;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace {
|
||||||
o.push_back(Option("Futility Pruning (Main Search)", true));
|
o.push_back(Option("Futility Pruning (Main Search)", true));
|
||||||
o.push_back(Option("Futility Pruning (Quiescence 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 (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("Maximum Razoring Depth", 3, 0, 4));
|
||||||
o.push_back(Option("Razoring Margin", 300, 150, 600));
|
o.push_back(Option("Razoring Margin", 300, 150, 600));
|
||||||
o.push_back(Option("LSN filtering", true));
|
o.push_back(Option("LSN filtering", true));
|
||||||
|
|
Loading…
Add table
Reference in a new issue