From: Marco Costalba Date: Wed, 3 Oct 2012 08:08:10 +0000 (+0200) Subject: Don't hide thresolds values X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=561eb34aea03aeac06ebeb66ad225222143445e6 Don't hide thresolds values Show the real value in the code, not hide it behind a variable name, especially when there is only once occurence. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 163df7b4..e44324f7 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -62,28 +62,9 @@ namespace { const bool Slidings[18] = { 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1 }; inline bool piece_is_slider(Piece p) { return Slidings[p]; } - // Maximum depth for razoring - const Depth RazorDepth = 4 * ONE_PLY; - // Dynamic razoring margin based on depth inline Value razor_margin(Depth d) { return Value(512 + 16 * int(d)); } - // Maximum depth for use of dynamic threat detection when null move fails low - const Depth ThreatDepth = 5 * ONE_PLY; - - // Minimum depth for use of internal iterative deepening - const Depth IIDDepth[] = { 8 * ONE_PLY, 5 * ONE_PLY }; - - // At Non-PV nodes we do an internal iterative deepening search - // when the static evaluation is bigger then beta - IIDMargin. - const Value IIDMargin = Value(256); - - // Minimum depth for use of singular extension - const Depth SingularExtensionDepth[] = { 8 * ONE_PLY, 6 * ONE_PLY }; - - // Futility margin for quiescence search - const Value FutilityMarginQS = Value(128); - // Futility lookup tables (initialized at startup) and their access functions Value FutilityMargins[16][64]; // [depth][moveNumber] int FutilityMoveCounts[32]; // [depth] @@ -644,7 +625,7 @@ namespace { // Step 6. Razoring (is omitted in PV nodes) if ( !PvNode - && depth < RazorDepth + && depth < 4 * ONE_PLY && !inCheck && refinedValue + razor_margin(depth) < beta && ttMove == MOVE_NONE @@ -664,7 +645,7 @@ namespace { // the score by more than futility_margin(depth) if we do a null move. if ( !PvNode && !ss->skipNullMove - && depth < RazorDepth + && depth < 4 * ONE_PLY && !inCheck && refinedValue - futility_margin(depth, 0) >= beta && abs(beta) < VALUE_MATE_IN_MAX_PLY @@ -723,7 +704,7 @@ namespace { // parent node, which will trigger a re-search with full depth). threatMove = (ss+1)->currentMove; - if ( depth < ThreatDepth + if ( depth < 5 * ONE_PLY && (ss-1)->reduction && threatMove != MOVE_NONE && connected_moves(pos, (ss-1)->currentMove, threatMove)) @@ -736,7 +717,7 @@ namespace { // and a reduced search returns a value much above beta, we can (almost) safely // prune the previous move. if ( !PvNode - && depth >= RazorDepth + ONE_PLY + && depth >= 5 * ONE_PLY && !inCheck && !ss->skipNullMove && excludedMove == MOVE_NONE @@ -765,9 +746,9 @@ namespace { } // Step 10. Internal iterative deepening - if ( depth >= IIDDepth[PvNode] + if ( depth >= (PvNode ? 5 * ONE_PLY : 8 * ONE_PLY) && ttMove == MOVE_NONE - && (PvNode || (!inCheck && ss->eval + IIDMargin >= beta))) + && (PvNode || (!inCheck && ss->eval + Value(256) >= beta))) { Depth d = (PvNode ? depth - 2 * ONE_PLY : depth / 2); @@ -786,7 +767,7 @@ split_point_start: // At split points actual search starts from here value = bestValue; // Workaround a bogus 'uninitialized' warning under gcc singularExtensionNode = !RootNode && !SpNode - && depth >= SingularExtensionDepth[PvNode] + && depth >= (PvNode ? 6 * ONE_PLY : 8 * ONE_PLY) && ttMove != MOVE_NONE && !excludedMove // Recursive singular search is not allowed && (tte->type() & BOUND_LOWER) @@ -1175,7 +1156,7 @@ split_point_start: // At split points actual search starts from here if (PvNode && bestValue > alpha) alpha = bestValue; - futilityBase = ss->eval + evalMargin + FutilityMarginQS; + futilityBase = ss->eval + evalMargin + Value(128); enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMg; }