From: Marco Costalba Date: Wed, 14 Jul 2010 12:21:28 +0000 (+0200) Subject: Retire LSN machinery X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=605b3aedd5b2cc530db417fc8bb57cc45200cca1 Retire LSN machinery Now that we use cutechess-cli we can set the auto-resign parameter that makes LSN less effective. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 0ef2f600..ab778ec1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -233,12 +233,6 @@ namespace { // better than the second best move. const Value EasyMoveMargin = Value(0x200); - // Last seconds noise filtering (LSN) - const bool UseLSNFiltering = true; - const int LSNTime = 100; // In milliseconds - const Value LSNValue = value_from_centipawns(200); - bool loseOnTime = false; - /// Global variables @@ -448,10 +442,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, } } - // Reset loseOnTime flag at the beginning of a new game - if (button_was_pressed("New Game")) - loseOnTime = false; - // Read UCI option values TT.set_size(get_option_value_int("Hash")); if (button_was_pressed("Clear Hash")) @@ -551,36 +541,8 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, << " increment: " << myIncrement << " moves to go: " << movesToGo << endl; - // LSN filtering. Used only for developing purposes, disabled by default - if ( UseLSNFiltering - && loseOnTime) - { - // Step 2. If after last move we decided to lose on time, do it now! - while (SearchStartTime + myTime + 1000 > get_system_time()) - /* wait here */; - } - // We're ready to start thinking. Call the iterative deepening loop function - Value v = id_loop(pos, searchMoves); - - if (UseLSNFiltering) - { - // Step 1. If this is sudden death game and our position is hopeless, - // decide to lose on time. - if ( !loseOnTime // If we already lost on time, go to step 3. - && myTime < LSNTime - && myIncrement == 0 - && movesToGo == 0 - && v < -LSNValue) - { - loseOnTime = true; - } - else if (loseOnTime) - { - // Step 3. Now after stepping over the time limit, reset flag for next match. - loseOnTime = false; - } - } + id_loop(pos, searchMoves); if (UseLogFile) LogFile.close();