gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Assertion failure in the semeai code.


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Assertion failure in the semeai code.
Date: Sat, 01 Feb 2003 11:52:22 +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)

I wrote:
> > The following patch prevents it. I'm running the regressions
> > on it before adding it to the CVS.
> 
> Another crash on NNGS. Same problem at a different place in the code.

And here is the similar patch to solve it. I don't think there are any
more instances of this bug left now.

/Gunnar

Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.141
diff -u -r1.141 owl.c
--- engine/owl.c        28 Jan 2003 05:42:01 -0000      1.141
+++ engine/owl.c        1 Feb 2003 10:50:05 -0000
@@ -607,9 +607,18 @@
        }
        READ_RETURN_SEMEAI(read_result, move, PASS_MOVE, ALIVE, DEAD);
       }
-      else if (min_eyes(&probable_eyes_b) < 2) {
+      else if (min_eyes(&probable_eyes_b) >= 2) {
+       /* both live */
+       *resulta = ALIVE;
+       *resultb = ALIVE;
+       if (move) *move = PASS_MOVE;
+       sgf_dumptree = save_sgf_dumptree;
+       count_variations = save_count_variations;
+       SGFTRACE2(PASS_MOVE, ALIVE, "Both live");
+       READ_RETURN_SEMEAI(read_result, move, PASS_MOVE, ALIVE, ALIVE);
+      }
+      else if (vital_offensive_moves[0].pos != NO_MOVE){
        /* I can kill */
-       gg_assert(vital_offensive_moves[0].pos != NO_MOVE);
        *resulta = ALIVE;
        *resultb = DEAD;
        if (move) *move = vital_offensive_moves[0].pos;
@@ -625,16 +634,11 @@
        READ_RETURN_SEMEAI(read_result, move, vital_offensive_moves[0].pos,
                           ALIVE, DEAD);
       }
-      else {
-       /* both live */
-       *resulta = ALIVE;
-       *resultb = ALIVE;
-       if (move) *move = PASS_MOVE;
-       sgf_dumptree = save_sgf_dumptree;
-       count_variations = save_count_variations;
-       SGFTRACE2(PASS_MOVE, ALIVE, "Both live");
-       READ_RETURN_SEMEAI(read_result, move, PASS_MOVE, ALIVE, ALIVE);
-      }
+      /* If here, compute_eyes_pessimistic has returned min_eyes<2 
+       * and max_eyes>=2 yet produced no defensive move.
+       */
+      else
+       DEBUG(DEBUG_SEMEAI, "inconsistent eyevalue\n");
     }
     if (min_eyes(&probable_eyes_b) >= 2
        || (stackp > 2 && owl_escape_route(owlb) >= 5)) {
@@ -674,7 +678,8 @@
       /* If here, compute_eyes_pessimistic has returned min_eyes<2 
        * and max_eyes>=2 yet produced no defensive move.
        */
-      else DEBUG(DEBUG_SEMEAI, "inconsistent eyevalue\n");
+      else
+       DEBUG(DEBUG_SEMEAI, "inconsistent eyevalue\n");
     }
     
     /* Next the shape moves. */




reply via email to

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