gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] escape bug in owl.c


From: Gunnar Farneback
Subject: [gnugo-devel] escape bug in owl.c
Date: Sun, 23 Jun 2002 23:55:04 +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 believe the escape move counting feature in owl.c that Dan recently
implemented is slightly buggy. Currently the increment of the escape
parameter not only affects child nodes but also later visited sibling
nodes. The appended patch solves the problem.

However, the regression results are two failures, namely lazarus:16
and trevorb:660. I haven't investigated these closer, but I think the
patched behaviour makes more sense anyway.

I leave it to Dan to decide whether to use the patch.

/Gunnar

Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.92
diff -u -r1.92 owl.c
--- engine/owl.c        19 Jun 2002 22:30:04 -0000      1.92
+++ engine/owl.c        23 Jun 2002 21:52:22 -0000
@@ -1972,6 +1972,7 @@
       int mpos;
       int new_komaster, new_kom_pos;
       int ko_move = -1;
+      int new_escape;
       
       /* Consider only the highest scoring move if we're deeper than
        * owl_branch_depth.
@@ -2004,8 +2005,9 @@
                            &ko_move, savecode == 0))
        continue;
 
+      new_escape = escape;
       if (moves[k].escape)
-       escape++;
+       new_escape++;
 
       TRACE("Trying %C %1m.  Current stack: ", color, mpos);
       if (verbose)
@@ -2024,7 +2026,7 @@
 
       if (!ko_move) {
        acode = do_owl_attack(str, NULL, owl, new_komaster, 
-                             new_kom_pos, escape);
+                             new_kom_pos, new_escape);
        if (!acode) {
          pop_owl(&owl);
          popgo();
@@ -2041,7 +2043,7 @@
       }
       else {
        if (do_owl_attack(str, NULL, owl, 
-                         new_komaster, new_kom_pos, escape) != WIN) {
+                         new_komaster, new_kom_pos, new_escape) != WIN) {
          savemove = mpos;
          savecode = KO_B;
        }



reply via email to

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