gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Extremely bad mistake


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Extremely bad mistake
Date: Fri, 13 Jun 2003 17:41:35 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

SP Lee wrote:
> I was indeed misled by the tracing messages. It was not started by
> attacking C19 at A18 and A16 was at that moment indeed suicidal. Sorry
> for my misleading message.

Good that we got that sorted out. The appended patch removes those
trace messages.

> Now I have found the right sequence of what GNUGO thought. It is A18,
> A16, A17. After this the group C19 (and A19) has again 2 liberties and
> is in turn to make a defensive move. However, the reading process
> seems not to be aware of the PASS move (tenuki) and by filling any of
> the liberty, the group C19 was announced 'dead'. Yet the only choice
> at this moment is tenuki.

No, white should play E11 to reduce the potential liberties for the
surrounding string at B16.

> I had tried to add some code to do the PASS move, but I was not
> succeeded. Do you have a good solution?

The real problem is to find E11 and as I understand it Paul has an
almost finished patch for that.

The issue with passing is that the defense functions are NOT allowed
to pass. Instead the attack functions have to verify that they do have
an attack, even if the opponent could not find a defense. Effectively
this amounts to the same thing as allowing the defense functions to
pass.

I might add that once upon a time GNU Go did indeed have the problem
that it did not allow the defender to pass, neither directly nor
indirectly, in the tactical reading. That bug was last fixed four
years ago.

- RTRACE and VTRACE retired

/Gunnar

Index: engine/board.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.75
diff -u -r1.75 board.c
--- engine/board.c      27 May 2003 08:48:24 -0000      1.75
+++ engine/board.c      13 Jun 2003 13:01:03 -0000
@@ -650,16 +650,13 @@
   if (!ignore_ko && pos == board_ko_pos) {
     if (board[WEST(pos)] == OTHER_COLOR(color)
        || board[EAST(pos)] == OTHER_COLOR(color)) {
-      RTRACE("%1m would violate the ko rule\n", pos);
       return 0;
     }
   }
 
   /* 4. Test for suicide. */
-  if (is_suicide(pos, color)) {
-    RTRACE("%1m would be suicide\n", pos);
+  if (is_suicide(pos, color))
     return 0;
-  }
   
   /* Check for stack overflow. */
   if (stackp >= MAXSTACK-2) {
@@ -1103,7 +1100,6 @@
   if (pos == board_ko_pos)
     if (board[WEST(pos)] == OTHER_COLOR(color)
        || board[EAST(pos)] == OTHER_COLOR(color)) {
-      RTRACE("%1m would violate the ko rule\n", pos);
       return 0;
     }
 
@@ -1119,10 +1115,8 @@
   }
 
   /* Check for suicide. */
-  if (!allow_suicide && is_suicide(pos, color)) {
-    RTRACE("%1m would be suicide\n", pos);
+  if (!allow_suicide && is_suicide(pos, color))
     return 0;
-  }
   
   return 1;
 }
Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.96
diff -u -r1.96 gnugo.h
--- engine/gnugo.h      4 Jun 2003 12:48:50 -0000       1.96
+++ engine/gnugo.h      13 Jun 2003 13:01:03 -0000
@@ -359,8 +359,6 @@
 
 
 #define TRACE  (!(verbose)) ? (void)0 : (void)gprintf
-#define RTRACE (!(verbose >= 3)) ? (void)0 : (void)gprintf
-#define VTRACE (!(verbose >= 4)) ? (void)0 : (void)gprintf
 
 #ifdef HAVE_VARIADIC_DEFINE
 
Index: engine/reading.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
retrieving revision 1.113
diff -u -r1.113 reading.c
--- engine/reading.c    29 Apr 2003 13:36:56 -0000      1.113
+++ engine/reading.c    13 Jun 2003 13:01:06 -0000
@@ -1055,8 +1055,6 @@
   
   SETUP_TRACE_INFO("find_defense", str);
   
-  RTRACE("Can we rescue %1m?\n", str);
-
   if (move)
     xpos = *move;
 
@@ -1110,7 +1108,6 @@
     dcode = defend4(str, &xpos, komaster, kom_pos);
 
   if (dcode) {
-    RTRACE("saving move for %1m found at %1m!\n", str, xpos);
     READ_RETURN(read_result, move, xpos, dcode);
   }
     
@@ -1183,7 +1180,6 @@
   
   ASSERT1(IS_STONE(board[str]), str);
   ASSERT1(countlib(str) == 1, str);
-  RTRACE("try to escape atari on %1m.\n", str);
 
   /* lib will be the liberty of the string. */
   liberties = findlib(str, 1, &lib);
@@ -1292,7 +1288,6 @@
   SETUP_TRACE_INFO("defend2", str);
   reading_node_counter++;
 
-  RTRACE("trying to rescue %1m\n", str);
   color = board[str];
   other = OTHER_COLOR(color);
 
@@ -1473,7 +1468,6 @@
   if (savecode != 0)
     RETURN_RESULT(savecode, savemove, move, "saved move");
 
-  RTRACE("failed to find rescuing move.\n");
   RETURN_RESULT(savecode, savemove, move, NULL);
 }
 
@@ -1500,7 +1494,6 @@
   SETUP_TRACE_INFO("defend3", str);
   reading_node_counter++;
 
-  RTRACE("trying to rescue %1m\n", str);
   color = board[str];
   other = OTHER_COLOR(color);
 
@@ -1720,7 +1713,6 @@
   if (savecode != 0)
     RETURN_RESULT(savecode, savemove, move, "saved move");
 
-  RTRACE("failed to find rescuing move.\n");
   RETURN_RESULT(0, 0, move, NULL);
 }
 
@@ -1747,7 +1739,6 @@
   SETUP_TRACE_INFO("defend4", str);
   reading_node_counter++;
 
-  RTRACE("trying to rescue %1m\n", str);
   color = board[str];
   other = OTHER_COLOR(color);
 
@@ -1815,7 +1806,6 @@
   if (savecode != 0)
     RETURN_RESULT(savecode, savemove, move, "saved move");
 
-  RTRACE("failed to find rescuing move.\n");
   RETURN_RESULT(0, 0, move, NULL);
 }
 
@@ -2826,8 +2816,6 @@
                         stackp <= ko_depth && best_other_tactic == WIN)) {
       int other_tactic;
       ASSERT1(countlib(str) >= 1, str);
-      RTRACE("%sing %1m at %1m (Pattern %s)\n", attack_defend_str, str, 
-            moves[k].pos, moves[k].name);
       if (sgf_dumptree) {
         char buf[500];
         sprintf(buf, "tactical_pat komaster: %d %s  new_komaster: %d %s 
ko_move: %d", 
@@ -3255,8 +3243,6 @@
   ASSERT1(IS_STONE(board[str]), str);
   ASSERT1(countlib(str) == 2, str);
 
-  RTRACE("checking attack on %1m with 2 liberties\n", str);
-
   for (pass = 0; pass < 4; pass++) {
     
     switch (pass) {
@@ -3430,7 +3416,6 @@
 
 
   if (savecode == 0) {
-    RTRACE("ALIVE!!\n");
     RETURN_RESULT(0, 0, move, NULL);
   }
 
@@ -4559,7 +4544,6 @@
 
   memset(mw, 0, sizeof(mw));
   
-  RTRACE("in break_chain3 at %1m\n", str);
   adj = chainlinks2(str, adjs, 3);
   for (r = 0; r < adj; r++) {
     int lib1 = 0, lib2 = 0, lib3 = 0;
@@ -4741,8 +4725,6 @@
   ASSERT1(IS_STONE(board[str]), str);
   ASSERT1(countlib(str) == 1, str);
 
-  RTRACE("try to escape atari on %1m.\n", str);
-
   /* (lib) will be the liberty of the string. */
   liberties = findlib(str, 1, &lib);
   ASSERT1(liberties == 1, str);
@@ -4871,8 +4853,6 @@
   str = find_origin(str);
   ASSERT1(IS_STONE(board[str]), str);
   ASSERT1(countlib(str) == 2, str);
-
-  RTRACE("restricted attack on %1m with 2 liberties\n", str);
 
   /* The attack may fail if a boundary string is in atari and cannot 
    * be defended.  First we must try defending such a string. 




reply via email to

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