X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=2f7ed7be09127428341fc7cb0564bb1ff67ba8f6;hb=9f2a64abd265e1231b02cae442c9631a3dfd63fb;hp=03af5d66d96bc393bb1106dd56694d32f560a48a;hpb=ef43e6b05d0c79bf2ec7be291866449eba2ef576;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 03af5d66..2f7ed7be 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -61,13 +61,13 @@ namespace { enum NodeType { Root, PV, NonPV, SplitPointRoot, SplitPointPV, SplitPointNonPV }; // Dynamic razoring margin based on depth - inline Value razor_margin(Depth d) { return Value(512 + 16 * int(d)); } + inline Value razor_margin(Depth d) { return Value(512 + 16 * d); } // Futility lookup tables (initialized at startup) and their access functions int FutilityMoveCounts[2][32]; // [improving][depth] inline Value futility_margin(Depth d) { - return Value(100 * int(d)); + return Value(100 * d); } // Reduction lookup tables (initialized at startup) and their access function @@ -186,6 +186,7 @@ void Search::think() { RootColor = RootPos.side_to_move(); TimeMgr.init(Limits, RootPos.game_ply(), RootColor); + DrawValue[0] = DrawValue[1] = VALUE_DRAW; Contempt[0] = Options["Contempt Factor"] * PawnValueEg / 100; // From centipawns Contempt[1] = (Options["Contempt Factor"] + 12) * PawnValueEg / 100; @@ -682,7 +683,7 @@ namespace { // Step 10. Internal iterative deepening (skipped when in check) if ( depth >= (PvNode ? 5 * ONE_PLY : 8 * ONE_PLY) && !ttMove - && (PvNode || ss->staticEval + Value(256) >= beta)) + && (PvNode || ss->staticEval + 256 >= beta)) { Depth d = depth - 2 * ONE_PLY - (PvNode ? DEPTH_ZERO : depth / 4); @@ -822,7 +823,7 @@ moves_loop: // When in check and at SpNode search starts from here if (predictedDepth < 7 * ONE_PLY) { futilityValue = ss->staticEval + futility_margin(predictedDepth) - + Value(128) + Gains[pos.moved_piece(move)][to_sq(move)]; + + 128 + Gains[pos.moved_piece(move)][to_sq(move)]; if (futilityValue <= alpha) { @@ -1127,7 +1128,7 @@ moves_loop: // When in check and at SpNode search starts from here if (PvNode && bestValue > alpha) alpha = bestValue; - futilityBase = bestValue + Value(128); + futilityBase = bestValue + 128; } // Initialize a MovePicker object for the current position, and prepare