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: bump
Subject: Re: [gnugo-devel] Assertion failure in the semeai code.
Date: Mon, 27 Jan 2003 19:04:01 -0800

> The appended game crashed on NNGS with an assertion failure in the
> semeai code. Apparently the semeai code and the optics code disagree
> on whether compute_eyes_pessimistic() can return an 1122 eyevalue
> without providing a move. (The owl code is fine with this.)

A slightly older version of GNU Go does not show this crash,
so some recent change must bear on it.

The following patch prevents it. I'm running the regressions
on it before adding it to the CVS.

Dan


Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.140
diff -u -r1.140 owl.c
--- engine/owl.c        23 Jan 2003 21:59:03 -0000      1.140
+++ engine/owl.c        28 Jan 2003 02:26:16 -0000
@@ -649,9 +649,18 @@
        SGFTRACE2(PASS_MOVE, DEAD, "You live, I die");
        READ_RETURN_SEMEAI(read_result, move, PASS_MOVE, DEAD, ALIVE);
       }
-      else if (min_eyes(&probable_eyes_a) < 2) {
+      else if (min_eyes(&probable_eyes_a) >= 2) {
+       /* I am already alive */
+       *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_defensive_moves[0].pos != NO_MOVE) {
        /* I can live */
-       gg_assert(vital_defensive_moves[0].pos != NO_MOVE);
        *resulta = ALIVE;
        *resultb = ALIVE;
        if (move) *move = vital_defensive_moves[0].pos;
@@ -662,16 +671,10 @@
        READ_RETURN_SEMEAI(read_result, move, vital_defensive_moves[0].pos,
                           ALIVE, ALIVE);
       }
-      else {
-       /* I am already alive */
-       *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");
     }
     
     /* Next the shape moves. */





reply via email to

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