]> git.sesse.net Git - stockfish/commitdiff
Restore calling insert_pv after search is aborted + small clean-up
authorJoona Kiiski <joona.kiiski@gmail.com>
Wed, 15 Apr 2009 15:14:06 +0000 (18:14 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 18 Apr 2009 08:12:18 +0000 (09:12 +0100)
Restore old behaviour that after search is aborted we call insert_pv,
before breaking out from the iterative deepening loop.

Remove one useless FIXME and document other better.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 8414e32901b769bd9ec1a93989478923063ab12d..d769619d0f2abba82d5b25d113b52b2bd806ee42 100644 (file)
@@ -712,13 +712,14 @@ namespace {
 
         // Search to the current depth
         Value value = root_search(p, ss, rml, alpha, beta);
-        if (AbortSearch)
-            break; // Value cannot be trusted. Break out immediately!
 
         // Write PV to transposition table, in case the relevant entries have
         // been overwritten during the search.
         TT.insert_pv(p, ss[0].pv);
 
+        if (AbortSearch)
+            break; // Value cannot be trusted. Break out immediately!
+
         //Save info about search result
         Value speculatedValue;
         bool fHigh = false;
@@ -857,7 +858,6 @@ namespace {
 
   Value root_search(Position &pos, SearchStack ss[], RootMoveList &rml, Value alpha, Value beta) {
 
-    //FIXME: Implement bestValue
     Value oldAlpha = alpha;
     Value value;
     Bitboard dcCandidates = pos.discovered_check_candidates(pos.side_to_move());
@@ -2507,7 +2507,7 @@ namespace {
         return;
 
     bool overTime =     t > AbsoluteMaxSearchTime
-                     || (RootMoveNumber == 1 && t > MaxSearchTime + ExtraSearchTime && !FailLow) //FIXME: BUG??
+                     || (RootMoveNumber == 1 && t > MaxSearchTime + ExtraSearchTime && !FailLow) //FIXME: We are not checking any problem flags, BUG?
                      || (  !FailHigh && !FailLow && !fail_high_ply_1() && !Problem
                          && t > 6*(MaxSearchTime + ExtraSearchTime));