mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Don't special case for abs(beta) >= VALUE_MATE_IN_MAX_PLY
Remove from the search this special case and apply null search and razoring also in mate positions. Tested in no-regression mode and passed both STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 65431 W: 10860 L: 10810 D: 43761 and LTC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 34928 W: 4814 L: 4713 D: 25401 This patch kicks in only in mate positions and in these cases it seems beneficial in finding mates faster as Yery Spark measured on the Chest mate suite: Total number of positions 6425 Fixed nodes 200K per position master: 1049 new: 1154 And also the 5446 'hard' positions again with 2000K nodes (those not found by both engines in 200K nodes): master: 1069 new: 1395 bench: 7710548
This commit is contained in:
committed by
Marco Costalba
parent
66c93245e0
commit
55a3e0af8d
@@ -566,7 +566,6 @@ namespace {
|
|||||||
&& depth < 4 * ONE_PLY
|
&& depth < 4 * ONE_PLY
|
||||||
&& eval + razor_margin(depth) <= alpha
|
&& eval + razor_margin(depth) <= alpha
|
||||||
&& ttMove == MOVE_NONE
|
&& ttMove == MOVE_NONE
|
||||||
&& abs(beta) < VALUE_MATE_IN_MAX_PLY
|
|
||||||
&& !pos.pawn_on_7th(pos.side_to_move()))
|
&& !pos.pawn_on_7th(pos.side_to_move()))
|
||||||
{
|
{
|
||||||
if ( depth <= ONE_PLY
|
if ( depth <= ONE_PLY
|
||||||
@@ -594,7 +593,6 @@ namespace {
|
|||||||
&& !ss->skipNullMove
|
&& !ss->skipNullMove
|
||||||
&& depth >= 2 * ONE_PLY
|
&& depth >= 2 * ONE_PLY
|
||||||
&& eval >= beta
|
&& eval >= beta
|
||||||
&& abs(beta) < VALUE_MATE_IN_MAX_PLY
|
|
||||||
&& pos.non_pawn_material(pos.side_to_move()))
|
&& pos.non_pawn_material(pos.side_to_move()))
|
||||||
{
|
{
|
||||||
ss->currentMove = MOVE_NULL;
|
ss->currentMove = MOVE_NULL;
|
||||||
@@ -604,7 +602,8 @@ namespace {
|
|||||||
// Null move dynamic reduction based on depth and value
|
// Null move dynamic reduction based on depth and value
|
||||||
Depth R = 3 * ONE_PLY
|
Depth R = 3 * ONE_PLY
|
||||||
+ depth / 4
|
+ depth / 4
|
||||||
+ int(eval - beta) / PawnValueMg * ONE_PLY;
|
+ (abs(beta) < VALUE_KNOWN_WIN ? int(eval - beta) / PawnValueMg * ONE_PLY
|
||||||
|
: DEPTH_ZERO);
|
||||||
|
|
||||||
pos.do_null_move(st);
|
pos.do_null_move(st);
|
||||||
(ss+1)->skipNullMove = true;
|
(ss+1)->skipNullMove = true;
|
||||||
@@ -619,7 +618,7 @@ namespace {
|
|||||||
if (nullValue >= VALUE_MATE_IN_MAX_PLY)
|
if (nullValue >= VALUE_MATE_IN_MAX_PLY)
|
||||||
nullValue = beta;
|
nullValue = beta;
|
||||||
|
|
||||||
if (depth < 12 * ONE_PLY)
|
if (depth < 12 * ONE_PLY && abs(beta) < VALUE_KNOWN_WIN)
|
||||||
return nullValue;
|
return nullValue;
|
||||||
|
|
||||||
// Do verification search at high depths
|
// Do verification search at high depths
|
||||||
@@ -699,6 +698,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
|||||||
singularExtensionNode = !RootNode
|
singularExtensionNode = !RootNode
|
||||||
&& !SpNode
|
&& !SpNode
|
||||||
&& depth >= 8 * ONE_PLY
|
&& depth >= 8 * ONE_PLY
|
||||||
|
&& abs(beta) < VALUE_KNOWN_WIN
|
||||||
&& ttMove != MOVE_NONE
|
&& ttMove != MOVE_NONE
|
||||||
&& !excludedMove // Recursive singular search is not allowed
|
&& !excludedMove // Recursive singular search is not allowed
|
||||||
&& (tte->bound() & BOUND_LOWER)
|
&& (tte->bound() & BOUND_LOWER)
|
||||||
@@ -764,8 +764,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
|||||||
if ( singularExtensionNode
|
if ( singularExtensionNode
|
||||||
&& move == ttMove
|
&& move == ttMove
|
||||||
&& !ext
|
&& !ext
|
||||||
&& pos.legal(move, ci.pinned)
|
&& pos.legal(move, ci.pinned))
|
||||||
&& abs(ttValue) < VALUE_KNOWN_WIN)
|
|
||||||
{
|
{
|
||||||
assert(ttValue != VALUE_NONE);
|
assert(ttValue != VALUE_NONE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user