gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] a reading test


From: Gunnar Farneback
Subject: Re: [gnugo-devel] a reading test
Date: Wed, 08 Oct 2003 22:54:05 +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)

Paul wrote:
> A reading test from a game (not GNU Go's) on NNGS Gunnar and i observed
> on NNGS tonight.  Gunnar already has a fix and will send it separately.

The patch below makes two small tweaks in reading.c. The first is a
modification of the heuristics whether to give up a ladder at big
depth in attack2(), which solves Paul's test case. The second change
is that break_chain3() and break_chain4() are called from defend4().
This is primarily intended to solve the recently added reading:189
plus related test cases.

The increase in reading nodes for the full regressions is 0.3%, of
which most (somewhat surprisingly) is caused by the changed ladder
heuristics. The breakage is:

reading:189     pass (FAIL in current CVS)
reading:190     pass (FAIL in current CVS)
strategy3:114   PASS D7 [D7]
owl1:332        pass (FAIL in current CVS)
nngs2:140       FAIL E9 [P5]
nngs3:390       PASS O11 [O11]
nngs4:750       pass (FAIL in current CVS)
gunnar:40       pass (FAIL in current CVS)

A closer look at the FAIL shows that E9 actually is a good move and
that the test case would be better as a restricted_genmove test. This
is changed in the patch, making the test case pass again.

- attack2() revised
- defend4() revised
- revised test case

/Gunnar

Index: engine/reading.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
retrieving revision 1.123
diff -u -r1.123 reading.c
--- engine/reading.c    15 Aug 2003 07:21:22 -0000      1.123
+++ engine/reading.c    8 Oct 2003 20:45:46 -0000
@@ -1816,6 +1816,8 @@
 
   if (stackp <= backfill_depth) {
     break_chain2_defense_moves(str, &moves, 0);
+    break_chain3_moves(str, &moves, 0);
+    break_chain4_moves(str, &moves, 0);
 #if 0 
     hane_rescue_moves(str, libs, &moves);
 #endif
@@ -3336,11 +3338,16 @@
        */
       adj = chainlinks2(str, adjs, 1);
       for (r = 0; r < adj; r++) {
-        /* if stackp > depth and any boundary chain is in atari, assume safe.
+        /* If stackp > depth and any boundary chain is in atari, assume safe.
          * However, if the captured chain is only of size 1, there can still
          * be a working ladder, so continue if that is the case.
+        * Also if the string in atari shares its liberty with the
+        * attacked string, drawing it out may enable the ladder to
+        * continue.
          */
-        if (stackp > depth && countstones(adjs[r]) > 1) {
+        if (stackp > depth
+           && countstones(adjs[r]) > 1
+           && !have_common_lib(str, adjs[r], NULL)) {
           RETURN_RESULT(0, 0, move, "boundary in atari");
         }
 
Index: regression/nngs2.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/nngs2.tst,v
retrieving revision 1.38
diff -u -r1.38 nngs2.tst
--- regression/nngs2.tst        5 Sep 2003 13:35:23 -0000       1.38
+++ regression/nngs2.tst        8 Oct 2003 20:45:46 -0000
@@ -69,7 +69,7 @@
 #? [S13]*
 
 loadsgf games/nngs/silverado-gnugo-3.3.5-200208061810.sgf 130
-140 reg_genmove black
+140 restricted_genmove black O5 P5 Q5 Q6
 #? [P5]
 
 loadsgf games/nngs/silverado-gnugo-3.3.5-200208061810.sgf 138




reply via email to

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