gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] reading.c / special_rescue_moves


From: Martin Holters
Subject: [gnugo-devel] reading.c / special_rescue_moves
Date: Sun, 28 Dec 2003 16:07:40 +0100

Hi all!

Starting from my aforementioned example looking like

XXXXXO
XO...O
XO.O.O
XXXXXO

I have investigated reading.c to see whether it could be easily modified
to see that the double-bamboo-joint would save the left-most string. I
have stumbled upon special_rescue_moves(), which supposedly adds
second-order liberties as move candidates - exactly what I want.
Unfortunately, it also verifies that an X stone at the respective
first-order liberty could be trivially captured, which is not the case
for my example, but works well for the examples given in the source. As
this test is only meant to optimise away unnecessary branches, removing
it should be a conservative modification.

Indeed, the above example now works out fine, but also

./regress.sh . reading.tst 
174 unexpected PASS!
./regress.sh . owl.tst 
./regress.sh . owl_rot.tst 
./regress.sh . ld_owl.tst 
182 unexpected FAIL: Correct '2 S1', got '1 S1'
./regress.sh . optics.tst 
./regress.sh . filllib.tst 
./regress.sh . atari_atari.tst 
13 unexpected FAIL: Correct 'D8', got 'PASS'
./regress.sh . connection.tst 
102 unexpected PASS!
./regress.sh . break_in.tst 
./regress.sh . blunder.tst 
./regress.sh . trevora.tst 
150 unexpected FAIL: Correct 'F6', got 'E6'
370 unexpected PASS!
./regress.sh . nngs1.tst 
./regress.sh . strategy.tst 
26 unexpected PASS!

That's four unexpected PASSES against three unexpected FAILS - at least
a net gain. What puzzles me, however, is how considering more
possibilities in a brute-force search can worsen the result in any case
at all. Am I missing some assumption here about what defences should
_not_ be found for some reason?

Furthermore, is there a nice possibility to do some automated
benchmarking to get some measure of how big the performance impact of
this modification is?

The respective patch:

--- reading.c   24 Nov 2003 21:15:20 -0000      1.130
+++ reading.c   28 Dec 2003 14:58:50 -0000
@@ -1779,10 +1779,7 @@
  *   O        O        O       ...*.
  *                             -----
  *
- * This will occasionally save a string where no other move will. To
- * reduce the branching caused by these moves, we require that the
- * opponent can be trivially captured when trying to intercept on the
- * corresponding first order liberty.
+ * This will occasionally save a string where no other move will.
  */
 
 static void
@@ -1797,10 +1794,6 @@
     int d = delta[k];
     if (board[lib + d] == EMPTY) {
 
-      /* Use approxlib() to test for trivial capture. */
-      if (approxlib(lib, other, 3, NULL) > 2)
-       continue;
-
       /* Don't play into a self atari. */
       if (is_self_atari(lib + d, color))
        continue;







reply via email to

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