X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=370889cca3c2ecd6a3196a2374d3dd2854c1b258;hp=180414c76ab93268f663f8452c35e7e67dea4508;hb=3bb1ab34e4f007549fe9836aa167654f8fef39e6;hpb=15153a1de71d2d36c1f95eecfcf036fb76565309 diff --git a/src/search.cpp b/src/search.cpp index 180414c7..370889cc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -423,7 +423,7 @@ bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[ // Look for a book move, only during games, not tests if (UseTimeManagement && Options["OwnBook"].value()) { - if (Options["Book File"].value() != OpeningBook.file_name()) + if (Options["Book File"].value() != OpeningBook.name()) OpeningBook.open(Options["Book File"].value()); Move bookMove = OpeningBook.get_move(pos, Options["Best Book Move"].value()); @@ -702,6 +702,7 @@ namespace { // Step 1. Initialize node (polling is omitted at root) ss->currentMove = ss->bestMove = MOVE_NONE; + (ss+2)->killers[0] = (ss+2)->killers[1] = (ss+2)->mateKiller = MOVE_NONE; // Step 2. Check for aborted search (omitted at root) // Step 3. Mate distance pruning (omitted at root) @@ -1908,8 +1909,9 @@ split_point_start: // At split points actual search starts from here void update_history(const Position& pos, Move move, Depth depth, Move movesSearched[], int moveCount) { Move m; + Value bonus = Value(int(depth) * int(depth)); - H.success(pos.piece_on(move_from(move)), move_to(move), depth); + H.update(pos.piece_on(move_from(move)), move_to(move), bonus); for (int i = 0; i < moveCount - 1; i++) { @@ -1918,7 +1920,7 @@ split_point_start: // At split points actual search starts from here assert(m != move); if (!pos.move_is_capture_or_promotion(m)) - H.failure(pos.piece_on(move_from(m)), move_to(m), depth); + H.update(pos.piece_on(move_from(m)), move_to(m), -bonus); } } @@ -1946,7 +1948,7 @@ split_point_start: // At split points actual search starts from here && after != VALUE_NONE && pos.captured_piece_type() == PIECE_TYPE_NONE && !move_is_special(m)) - H.set_gain(pos.piece_on(move_to(m)), move_to(m), -(before + after)); + H.update_gain(pos.piece_on(move_to(m)), move_to(m), -(before + after)); }