Relay fail-lo/fail-high info
authorH.G. Muller <h.g.muller@hccnet.nl>
Tue, 14 Jan 2014 21:18:56 +0000 (22:18 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Tue, 14 Jan 2014 21:18:56 +0000 (22:18 +0100)
The UCI upperbound and lowerbound keywords with a score now lead to suffixing
of the PV with ? or !, respectively.

uci.c
uci.h
xboard2uci.c

diff --git a/uci.c b/uci.c
index eafefe4..716c8cb 100644 (file)
--- a/uci.c
+++ b/uci.c
@@ -899,6 +899,8 @@ static void parse_score(uci_t * uci, const char string[]) {
    parse_add_keyword(parse,"mate");
    parse_add_keyword(parse,"upperbound");
 
+   uci->bound_type = '\0'; // [HGM] bound: assume exact score
+
    // loop
 
    while (parse_get_word(parse,option,StringSize)) {
@@ -921,6 +923,8 @@ static void parse_score(uci_t * uci, const char string[]) {
 
          ASSERT(my_string_empty(argument));
 
+         uci->bound_type = '!';
+
       } else if (my_string_equal(option,"mate")) {
 
          ASSERT(!my_string_empty(argument));
@@ -934,6 +938,8 @@ static void parse_score(uci_t * uci, const char string[]) {
 
          ASSERT(my_string_empty(argument));
 
+         uci->bound_type = '?';
+
       } else {
 
          my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command);
diff --git a/uci.h b/uci.h
index b163616..01c5fe7 100644 (file)
--- a/uci.h
+++ b/uci.h
@@ -42,6 +42,7 @@ typedef struct {
   int best_move;
   int ponder_move;
   
+  char bound_type;
   int score;
   int depth;
   int sel_depth;
index adbaa5f..f4c894d 100644 (file)
@@ -1738,10 +1738,10 @@ static void send_pv() {
                 if(Uci->depth==-1) //hack to clear the engine output window
              gui_send(GUI,"%d %+d %.0f "S64_FORMAT" ",0,report_best_score(),Uci->time*100.0,Uci->node_nb);
                if(option_get_bool(Option,"ShowTbHits"))
-                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" {%d,%.0f,"S64_FORMAT"} %s",
-                       Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,Uci->sel_depth,Uci->speed/1e3,Uci->tbhit_nb,pv_string);
+                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" {%d,%.0f,"S64_FORMAT"} %s%c",Uci->best_depth,report_best_score(),
+                       Uci->time*100.0,Uci->node_nb,Uci->sel_depth,Uci->speed/1e3,Uci->tbhit_nb,pv_string,Uci->bound_type);
                else
-                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,pv_string);
+                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s%c",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,pv_string,Uci->bound_type);
 
       } else if (State->state == PONDER &&
                  option_get_bool(Option,"ShowPonder")) {
@@ -1752,11 +1752,12 @@ static void send_pv() {
          if (move != MoveNone && move_is_legal(move,board)) {
             move_to_san(move,board,move_string,256);
             line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize);
-               if(option_get_bool(Option,"ShowTbHits"))
-                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" {%d,%.0f,"S64_FORMAT"} (%s) %s",Uci->best_depth,
-                       report_best_score(),Uci->time*100.0,Uci->node_nb,Uci->sel_depth,Uci->speed/1e3,Uci->tbhit_nb,move_string,pv_string);
-               else
-            gui_send(GUI,"%d %+d %.0f "S64_FORMAT" (%s) %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,move_string,pv_string);
+           if(option_get_bool(Option,"ShowTbHits"))
+                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" {%d,%.0f,"S64_FORMAT"} (%s) %s%c",Uci->best_depth,report_best_score(),
+                       Uci->time*100.0,Uci->node_nb,Uci->sel_depth,Uci->speed/1e3,Uci->tbhit_nb,move_string,pv_string,Uci->bound_type);
+           else
+               gui_send(GUI,"%d %+d %.0f "S64_FORMAT" (%s) %s%c",Uci->best_depth,report_best_score(),
+                       Uci->time*100.0,Uci->node_nb,move_string,pv_string,Uci->bound_type);
          }
       }
    }