gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] make --experimental-break-in default


From: Arend Bayer
Subject: Re: [gnugo-devel] make --experimental-break-in default
Date: Wed, 11 Jun 2003 20:29:15 +0200 (CEST)

Gunnar wrote:

> Arend wrote:
> > At this point, this should get it more testing. (It should also be stable
> > enough not to hinder other testing.)
>
> Appended is a test case where the break in code goes wrong. Instead of
> filling the ko in the upper left (last point on the board) it plays
> inside its own solid territory.

Fixed thus (along with the same fix for the readconnect code --
"connect C14 H12" gives the same failure).

It's generally a problem that the break-in code is very fragile with
respect to readconnect.c mistakes.

(I just saw I forgot to add "break_in.tst" to CVS -- will do that
shortly.)

Arend



- fix "no moves tried logic" in various readconnect functions

Index: engine/readconnect.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/readconnect.c,v
retrieving revision 1.53
diff -u -p -r1.53 readconnect.c
--- engine/readconnect.c        9 Jun 2003 16:19:16 -0000       1.53
+++ engine/readconnect.c        11 Jun 2003 18:27:57 -0000
@@ -1922,6 +1922,7 @@ recursive_connect2(int str1, int str2, i
   int savemove = NO_MOVE;
   int savecode = 0;
   int found_read_result;
+  int tried_moves = 0;
   Read_result *read_result = NULL;

   SETUP_TRACE_INFO2("recursive_connect2", str1, str2);
@@ -1987,6 +1988,7 @@ recursive_connect2(int str1, int str2, i
     if (komaster_trymove(xpos, color, "recursive_connect2", str1,
                         komaster, kom_pos, &new_komaster, &new_kom_pos,
                         &ko_move, stackp <= ko_depth && savecode == 0)) {
+      tried_moves++;
       if (!ko_move) {
        int acode = recursive_disconnect2(str1, str2, NULL,
                                          new_komaster, new_kom_pos,
@@ -2013,7 +2015,7 @@ recursive_connect2(int str1, int str2, i
     }
   }

-  if (num_moves == 0 && distance < 1.0) {
+  if (tried_moves == 0 && distance < 1.0) {
     SGFTRACE2(NO_MOVE, WIN, "no move, probably connected");
     READ_RETURN_CONN(read_result, move, NO_MOVE, WIN);
   }
@@ -2059,6 +2061,7 @@ recursive_disconnect2(int str1, int str2
   int savemove = NO_MOVE;
   int savecode = 0;
   int found_read_result;
+  int tried_moves = 0;
   Read_result *read_result = NULL;

   SETUP_TRACE_INFO2("recursive_disconnect2", str1, str2);
@@ -2127,6 +2130,7 @@ recursive_disconnect2(int str1, int str2
     if (komaster_trymove(xpos, other, "recursive_disconnect2", str1,
                         komaster, kom_pos, &new_komaster, &new_kom_pos,
                         &ko_move, stackp <= ko_depth && savecode == 0)) {
+      tried_moves++;
       if (!ko_move) {
        int dcode = recursive_connect2(str1, str2, NULL,
                                       new_komaster, new_kom_pos, has_passed);
@@ -2152,7 +2156,7 @@ recursive_disconnect2(int str1, int str2
     }
   }

-  if (num_moves == 0
+  if (tried_moves == 0
       && distance >= 1.0
       && (has_passed
          || !recursive_connect2(str1, str2, NULL, komaster, kom_pos, 1))) {
@@ -2194,7 +2198,8 @@ find_connection_moves(int str1, int str2
                      struct connection_data *conn1,
                      struct connection_data *conn2,
                      float max_dist1, float max_dist2,
-                     int moves[MAX_MOVES], float total_distance)
+                     int moves[MAX_MOVES], float total_distance,
+                     float cutoff)
 {
   int color = board[str1];
   int other = OTHER_COLOR(color);
@@ -2666,6 +2684,7 @@ recursive_break(int str, const char goal
   int savemove = NO_MOVE;
   int savecode = 0;
   int found_read_result;
+  int tried_moves = 0;
   Read_result *read_result = NULL;

   SETUP_TRACE_INFO("recursive_break", str);
@@ -2728,6 +2747,7 @@ recursive_break(int str, const char goal
     if (komaster_trymove(xpos, color, "recursive_break", str,
                         komaster, kom_pos, &new_komaster, &new_kom_pos,
                         &ko_move, stackp <= ko_depth && savecode == 0)) {
+      tried_moves++;
       if (!ko_move) {
        int acode = recursive_block(str, goal, NULL,
                                    new_komaster, new_kom_pos,
@@ -2753,7 +2773,7 @@ recursive_break(int str, const char goal
     }
   }

-  if (num_moves == 0 && distance < 1.0) {
+  if (tried_moves == 0 && distance < 1.0) {
     SGFTRACE(NO_MOVE, WIN, "no move, probably connected");
     READ_RETURN(read_result, move, NO_MOVE, WIN);
   }
@@ -2784,6 +2804,7 @@ recursive_block(int str, const char goal
   int savemove = NO_MOVE;
   int savecode = 0;
   int found_read_result;
+  int tried_moves = 0;
   Read_result *read_result = NULL;
   SETUP_TRACE_INFO("recursive_block", str);

@@ -2848,6 +2869,7 @@ recursive_block(int str, const char goal
     if (komaster_trymove(xpos, other, "recursive_block", str,
                         komaster, kom_pos, &new_komaster, &new_kom_pos,
                         &ko_move, stackp <= ko_depth && savecode == 0)) {
+      tried_moves++;
       if (!ko_move) {
        int dcode = recursive_break(str, goal, NULL,
                                    new_komaster, new_kom_pos, has_passed,
@@ -2873,7 +2895,7 @@ recursive_block(int str, const char goal
     }
   }

-  if (num_moves == 0
+  if (tried_moves == 0
       && distance >= 1.0
       && (has_passed
          || !recursive_break(str, goal, NULL, komaster, kom_pos, 1,
@@ -2893,7 +2915,7 @@ recursive_block(int str, const char goal



-/* Externably callable frontend to recursive_break_in.
+/* Externably callable frontend to recursive_break.
  * Returns WIN if (str) can connect to the area goal[] (which may or may
  * not contain stones), if he gets the first move.
  */
Index: regression/connection.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/connection.tst,v
retrieving revision 1.60
diff -u -p -r1.60 connection.tst
--- regression/connection.tst   10 Jun 2003 04:59:49 -0000      1.60
+++ regression/connection.tst   11 Jun 2003 18:27:58 -0000
@@ -365,6 +365,9 @@ trymove white P16
 popgo
 popgo

+loadsgf games/gunnar/gunnar11.sgf
+107 connect C14 H12
+#? [0]

 # Report number of nodes visited by the tactical reading
 10000 get_reading_node_counter





reply via email to

[Prev in Thread] Current Thread [Next in Thread]