]> git.sesse.net Git - stockfish/commitdiff
Display fail high/fail low in search log file.
authorTord Romstad <tord@glaurungchess.com>
Tue, 6 Oct 2009 10:51:15 +0000 (12:51 +0200)
committerTord Romstad <tord@glaurungchess.com>
Tue, 6 Oct 2009 10:51:15 +0000 (12:51 +0200)
src/san.cpp
src/san.h
src/search.cpp

index 0aa8318ed7b43968af9c4d018da2c3d69d53f190..0e9b531003cb9c69595b84ee6540aec4d0689532 100644 (file)
@@ -325,14 +325,15 @@ const string line_to_san(const Position& pos, Move line[], int startColumn, bool
 /// when the UCI parameter "Use Search Log" is "true").
 
 const string pretty_pv(const Position& pos, int time, int depth,
-                       uint64_t nodes, Value score, Move pv[]) {
+                       uint64_t nodes, Value score, ValueType type, Move pv[]) {
   std::stringstream s;
 
   // Depth
   s << std::setw(2) << depth << "  ";
 
   // Score
-  s << std::setw(8) << score_string(score);
+  s << ((type == VALUE_TYPE_LOWER)? ">" : ((type == VALUE_TYPE_UPPER)? "<" : " "));
+  s << std::setw(7) << score_string(score);
 
   // Time
   s << std::setw(8) << time_string(time) << " ";
index b4b5bffe0a38cd2778ded7f5baa107892e715d35..42202cfad8d4ec8ad045ad6448e6ec658dd2fe36 100644 (file)
--- a/src/san.h
+++ b/src/san.h
@@ -39,6 +39,6 @@
 extern const std::string move_to_san(const Position& pos, Move m);
 extern Move move_from_san(const Position& pos, const std::string& str);
 extern const std::string line_to_san(const Position& pos, Move line[], int startColumn, bool breakLines);
-extern const std::string pretty_pv(const Position& pos, int time, int depth, uint64_t nodes, Value score, Move pv[]);
+extern const std::string pretty_pv(const Position& pos, int time, int depth, uint64_t nodes, Value score, ValueType type, Move pv[]);
 
 #endif // !defined(SAN_H_INCLUDED)
index 17a1aeab984884b261c08bd858556bcdb8884614..78b85485d1efcf24ac9b53e11eb383c797f8ed05 100644 (file)
@@ -971,7 +971,10 @@ namespace {
                 std::cout << std::endl;
 
                 if (UseLogFile)
-                    LogFile << pretty_pv(pos, current_search_time(), Iteration, nodes_searched(), value, ss[0].pv)
+                    LogFile << pretty_pv(pos, current_search_time(), Iteration, nodes_searched(), value, 
+                                         ((value >= beta)? VALUE_TYPE_LOWER
+                                          : ((value <= alpha)? VALUE_TYPE_UPPER : VALUE_TYPE_EXACT)),
+                                         ss[0].pv)
                             << std::endl;
 
                 if (value > alpha)