gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] new testcase


From: Gunnar Farneback
Subject: Re: [gnugo-devel] new testcase
Date: Mon, 21 Oct 2002 21:00:07 +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)

I wrote:
> > loadsgf games/nngs/gnugo-3.3.9-RikiTiki-200210170706.sgf 230
> > owl_defend D4
> > #? [1 A1|B1|B3]
> > 
> > The problem is that the owl code sees a defense at C4, which is actually
> > only a defense in ko.
> 
> The real problem is that there's no owl attack in the first place.
> Black can't do anything until white fills a liberty. Below is a
> revision of this test.

I was too quick with this. Black can't do better than seki even if
white plays C4.

Paul wrote:
> here is a patch which solves this test and has no impact on the rest
> of the test suite (two patterns):
> [...]
> +Pattern VA50
> +# pp New pattern (3.3.10)
> +
> +|xx??
> +|Ox??        try to kill with bent four in the corner
> +|OXXx
> +|X*.x
> ++----
> +
> +:8,s,value(45)

This pattern is probably okay.

> +Pattern 6004
> +# Bent four in the corner. The attack depends on a ko and sufficiently
> +# few outer liberties. Both dots are defense points, but the marked
> +# one is clearly better.
> +
> + .
> +|X
> +|X
> +|.*X
> ++---
> +
> +:1122

This pattern is wrong. Black can at best make seki.

The patch below revises one of the test cases for this problem and
adds another two related ones in blunder.tst. Moreover it revises the
criterion for inessential lunches in owl.c, properly solving the owl
test cases for this problem. The bad eye pattern is removed.

- new and revised test cases
- owl_find_lunches() revised
- eye tuning

Regression results:
blunder:28    FAIL   new testcase
strategy4:209 PASS   probably properly solved
owl1:287      PASS   properly solved
strategy5:275 PASS   probably properly solved
safety:3      FAIL   accidental

I'm not entirely sure why strategy4:209 and strategy5:275 pass, but it
looks like it has to do with the patch and that it's good.

/Gunnar

Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.113
diff -u -r1.113 owl.c
--- engine/owl.c        14 Oct 2002 17:48:38 -0000      1.113
+++ engine/owl.c        21 Oct 2002 18:50:53 -0000
@@ -4041,11 +4041,12 @@
  * hold:
  *
  * 1. At least one neighbor of the liberty is the goal dragon.
- * 2. No neighbor of the liberty is the same color as the tested string.
+ * 2. No neighbor of the liberty is the same color as the tested string,
+ *    unless part of the same superstring.
  * 3. No neighbor of the liberty of the same color as the goal dragon
  *    does not belong to the goal dragon.
  * 4. No neighbor of the liberty belonging to the goal dragon can be
- *     tactically captured.
+ *    tactically captured.
  *
  * There is a weakness with this characterization though, which can be
  * seen in this position:
@@ -4064,7 +4065,23 @@
  * themself:
  *
  * 5. No neighbor of the stones does not belong to the goal or can be
- * tactically captured.
+ *    tactically captured.
+ *
+ * A second weakness can be noticed in this position:
+ *
+ * |OOOO.
+ * |XXXO.
+ * |O.XOO
+ * |OXXXO
+ * |.O.XO
+ * +-----
+ *
+ * The white stones in the corner should qualify as inessential but
+ * the corner liberty doesn't satisfy requirement 1. Therefore we add
+ * an alternative requirement:
+ *
+ * 1b. The liberty is a topologically false eye with respect to the
+ *     goal dragon.
  */
 
 static void
@@ -4190,9 +4207,23 @@
                  break;
                }
              }
-             if (!goal_found)
-               essential = 1;
-             
+             if (!goal_found) {
+               /* Requirement 1 not satisfied. Test requirement 1b.
+                * N.B. This is a simplified topological eye test.
+                * The simplification may be good, bad, or neutral.
+                */
+               int off_board = 0;
+               int diagonal_goal = 0;
+               for (s = 4; s < 8; s++) {
+                 if (!ON_BOARD(bpos + delta[s]))
+                   off_board++;
+                 else if (owl->goal[bpos + delta[s]])
+                   diagonal_goal++;
+               }
+               if (diagonal_goal + (off_board >= 2) < 2)
+                 essential = 1;
+             }
+
              if (essential)
                break;
            }
Index: patterns/eyes.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/eyes.db,v
retrieving revision 1.23
diff -u -r1.23 eyes.db
--- patterns/eyes.db    20 Oct 2002 10:43:25 -0000      1.23
+++ patterns/eyes.db    21 Oct 2002 18:51:05 -0000
@@ -2017,20 +2017,6 @@
 :1122
 
 
-Pattern 6004
-# Bent four in the corner. The attack depends on a ko and sufficiently
-# few outer liberties. Both dots are defense points, but the marked
-# one is clearly better.
-
- .
-|X
-|X
-|.*X
-+---
-
-:1122
-
-
 Pattern 6011
 
 xxxxxx
Index: regression/blunder.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/blunder.tst,v
retrieving revision 1.22
diff -u -r1.22 blunder.tst
--- regression/blunder.tst      25 Sep 2002 06:15:19 -0000      1.22
+++ regression/blunder.tst      21 Oct 2002 18:51:34 -0000
@@ -127,3 +127,13 @@
 27 gg_genmove white
 #? [!R3]*
 
+# C4 lets black make seki with B1. E1 is even worse.
+loadsgf games/blunder22.sgf 1
+28 gg_genmove white
+#? [!(C4|E1)]
+
+# C1 gives a ko that white can't win. Pass gives life in seki. B3 dies
+# right out.
+loadsgf games/blunder22.sgf 5
+29 gg_genmove white
+#? [!(C1|B3)]
Index: regression/owl1.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/owl1.tst,v
retrieving revision 1.24
diff -u -r1.24 owl1.tst
--- regression/owl1.tst 20 Oct 2002 23:48:29 -0000      1.24
+++ regression/owl1.tst 21 Oct 2002 18:51:35 -0000
@@ -108,12 +108,14 @@
 286 owl_attack A6
 #? [1 B3]*
 
-# White C4 is a blunder.
 loadsgf games/nngs/gnugo-3.3.9-RikiTiki-200210170706.sgf 230
 287 owl_attack D4
 #? [0]*
-288 owl_defend D4
-#? [1 (PASS|A1|B1|B3)]
+
+# Seki.
+loadsgf games/nngs/gnugo-3.3.9-RikiTiki-200210170706.sgf 234
+288 owl_attack D4
+#? [0]
 
 
 ########### end of tests #####################




reply via email to

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