gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] hang in owl.tst


From: Arend Bayer
Subject: [gnugo-devel] hang in owl.tst
Date: Tue, 25 Mar 2003 22:46:45 +0100 (CET)

Current CVS hangs in owl.tst after test 237. The culprit seems to be
paul_3_18.5a, and the patch below fixes the hang.

I haven't completely investigated what happened, but I think the problem
was caused by the call of remove_liberty() from do_play_move in the case
where s->liberties > MAX_LIBERTIES.
In this case, the liberties are recomputed from scratch. However, the
newly placed stone didn't get added at that point yet, so the new list
is inconsistent with the board state after do_play_move finishes.

It would be useful to have a compiler switch in board.c to enable
aggressive consistency checking of the incremental variables. That would
certainly have made debugging of this case quicker.

Arend


Index: engine/board.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.69
diff -u -p -r1.69 board.c
--- engine/board.c      23 Mar 2003 21:56:46 -0000      1.69
+++ engine/board.c      25 Mar 2003 17:33:21 -0000
@@ -4322,6 +4335,9 @@ do_play_move(int pos, int color)
   /* Clear string mark. */
   string_mark++;

+  /* Put down the stone. */
+  DO_ADD_STONE(pos, color);
+
   /* Look in all directions. Count the number of neighbor strings of the same
    * color, remove captured strings and remove `pos' as liberty for opponent
    * strings that are not captured.
@@ -4385,9 +4401,6 @@ do_play_move(int pos, int color)
     else
       captured_stones += do_remove_string(string_number[EAST(pos)]);
   }
-
-  /* Put down the stone. */
-  DO_ADD_STONE(pos, color);

   /* Choose strategy depending on the number of friendly neighbors. */
   if (neighbor_allies == 0)






reply via email to

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