gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] reading patch


From: Gunnar Farneback
Subject: [gnugo-devel] reading patch
Date: Sun, 18 Jan 2004 15:52:24 +0100
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)

Readers with good memory will recognize this reading patch. Current
regression results are

reading:164     PASS 1 C7 [1 C7]
strategy:27     PASS C3 [C3]
nngs:330        PASS B15 [B15|B16]

The number of reading nodes is reduced by 0.26%, on the other hand
there's an increase of owl nodes by 0.23%. There's probably some
logical explanation for this but in any case it's not a significant
performance problem.

/Gunnar

Index: engine/reading.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
retrieving revision 1.133
diff -u -r1.133 reading.c
--- engine/reading.c    14 Jan 2004 22:22:36 -0000      1.133
+++ engine/reading.c    16 Jan 2004 13:09:35 -0000
@@ -2191,6 +2191,16 @@
  * |.X.   |.c*
  * |.O?   |ab?
  *
+ * It also adds the * move in these configurations:
+ * 
+ * |.X.   |.c*
+ * |.OX   |abX
+ *
+ * |.X.   |.c*
+ * |.O.   |ab.
+ *
+ * Provided that * is not a self atari and that the X strings have
+ * sufficiently few liberties.
  */
 static void
 special_rescue6_moves(int str, int libs[3], struct reading_moves *moves)
@@ -2232,20 +2242,19 @@
        if (board[cpos + right] != EMPTY)
          continue;
 
-       if (board[apos + up + up] != EMPTY)
-         continue;
-       
-       if (board[cpos + up] != EMPTY)
-         continue;
-       
-       if (board[cpos + up + right] != color)
-         continue;
-       
-       
-       if (!is_self_atari(cpos + right, color))
+       if (board[apos + up + up] == EMPTY
+           && board[cpos + up] == EMPTY
+           && board[cpos + up + right] == color) {
          ADD_CANDIDATE_MOVE(cpos + right, 0, *moves, "special_rescue6-A");
-       if (!is_self_atari(cpos + up, color))
          ADD_CANDIDATE_MOVE(cpos + up, 0, *moves, "special_rescue6-B");
+       }
+       else if (countlib(cpos) <= 3
+                && (board[bpos + right] == EMPTY
+                    || (board[bpos + right] == other
+                        && countlib(bpos + right) <= 4))
+                && !is_self_atari(cpos + right, color)) {
+         ADD_CANDIDATE_MOVE(cpos + right, 0, *moves, "special_rescue6-C");
+       }
       }
     }
   }




reply via email to

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