gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] pogonyshev_3_10.7x


From: bump
Subject: [gnugo-devel] pogonyshev_3_10.7x
Date: Mon, 21 Oct 2002 14:00:35 -0700

The patch pogonyshev_3_10.7 was partly merged in 3.3.10 but
the function accurate_approxlib was left up, and the calls
to accuratelib were left pointing to accurate_approxlib.

The revisions to fastlib() and is_self_atari() went in.

Paul ran some tests to check the correctness of the patch
but he only told us in general terms what he did.

The following patch causes the two functions to be compared.
I find that there are some instances where accuratelib() and
accurate_approxlib() return different values, but only within
the flexibility allowed within maxlib.

The following patch does not cause any crashes in the
regressions.

Dan



Index: engine/board.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.54
diff -u -r1.54 board.c
--- engine/board.c      21 Oct 2002 03:31:35 -0000      1.54
+++ engine/board.c      21 Oct 2002 20:56:50 -0000
@@ -2459,6 +2459,8 @@
   int liberties = 0;
   SGFTree *save_sgf_dumptree = sgf_dumptree;
   int save_count_variations = count_variations;
+  int dlibs[MAXLIBS];
+  int accuratelib_result = accuratelib(pos, color, maxlib, dlibs);
 
   ASSERT1(board[pos] == EMPTY, pos);
   ASSERT1(IS_STONE(color), pos);
@@ -2466,6 +2468,10 @@
   if (!libs) {
     fast_liberties = fastlib(pos, color, 0);
     if (fast_liberties >= 0) {
+      if (1) {
+       ASSERT1(gg_min(maxlib, fast_liberties)
+               == gg_min(maxlib, accuratelib_result), pos);
+      }
       return fast_liberties;
     } 
   }
@@ -2489,6 +2495,10 @@
   sgf_dumptree = save_sgf_dumptree;
   count_variations = save_count_variations;
 
+  if (1) {
+    ASSERT1(gg_min(maxlib, liberties)
+           == gg_min(maxlib, accuratelib_result), pos);
+  }
   return liberties;
 }
 





reply via email to

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