gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] winning and forced moves


From: Arend Bayer
Subject: [gnugo-devel] winning and forced moves
Date: Thu, 8 May 2003 00:47:10 +0200 (CEST)


In owl.c, we currently do 3 sorts of special-casing pattern values:

1. An attack pattern with value 100 is considered a direct win.
2. An attack pattern with value 99 is considered a forced move.
3. A defense pattern with value 100 is considered a win.

I suggest to remtir all three heuristics, they were probably introduced
at a time when owl was still much weaker than now.  I could be persuaded
to keep 2.), however.

1.) is unused. 3.) is used by one pattern, but it never triggers, because
it captures a lunch and the same move is therefore tried as a vital move
before.

Removing all three has no regression changes. With node counts being:
Total nodes: 1233926885 2257079 5542424
I don't have up to date figures to compare with, but that seems to a
0.5% increase in reading nodes and 1% in owl nodes.

2.) is used in A105, where it seems pretty irrelevant (just saving some
5-20 owl nodes each time), and patterns A113 and A114, where it is
actually more important, as I found out using kombilo:

Pattern A113
|..xX         prevent connection
|....
|..*O
|..Y?
:8,-,value(99)


Pattern A114
|..X.         prevent connection
|....
|..*O
|..Y?
:8,-,value(99)

They help save nodes, but either
- the safe is negligeable
- the situation is not so clear after all (i.e. the patterns are wrong)
- gnugo does badly in defending later.

Examples of bad defense:
|...X.
|.....
|...O.
|..XO.
|..1..
|.....
|.....
+-----

|..X..
|.....
|..1O.
|..XO.
|.....
|.....
|.....
+-----
1 is the right move, but the other black stone does not get added to the
dragon.

The first example would be solved by a more flexible move ordering
(which could use a very high valued pattern _before_ B1 which is played
as a moderately high scoring vital move in pass 0), and I have a
(still very experimental) patch that does already address the 2nd
part.




Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.156
diff -u -p -r1.156 owl.c
--- engine/owl.c        4 May 2003 11:39:48 -0000       1.156
+++ engine/owl.c        7 May 2003 21:32:27 -0000
@@ -1411,19 +1411,6 @@ do_owl_attack(int str, int *move, int *w
        continue;

       owl_shapes(&shape_patterns, shape_moves, other, owl, &owl_attackpat_db);
-      /* A move of value 100 is considered a win */
-      if (get_next_move_from_list(&shape_patterns, other, shape_moves, 100)) {
-       /* to make sure this move is recorded in the sgf file */
-       if (trymove(shape_moves[0].pos, other,
-                   shape_moves[0].name, str, komaster, kom_pos))
-         popgo();
-       TRACE("%oVariation %d: DEAD (Winning owl_attackpat)\n",
-             this_variation_number);
-       SGFTRACE(shape_moves[0].pos, WIN, "winning attack pattern");
-       close_pattern_list(other, &shape_patterns);
-       READ_RETURN(read_result, move, shape_moves[0].pos, WIN);
-      }
-
       moves = shape_moves;
       break;

@@ -1569,21 +1556,6 @@ do_owl_attack(int str, int *move, int *w
         if (!get_next_move_from_list(&shape_patterns, other,
                                     shape_moves, move_cutoff))
           break;
-       /* A move of value 99 is considered a forced move. No other move
-        * needs to be considered. If there are two of them, we loose.
-        */
-       if (moves[k].value == 99) {
-         gg_assert(k == 0);
-          if (get_next_move_from_list(&shape_patterns, other,
-                                     shape_moves, 99)) {
-           TRACE("%oVariation %d: ALIVE (multiple forced moves)\n",
-                 this_variation_number);
-           SGFTRACE(0, 0, "multiple forced moves");
-           close_pattern_list(other, &shape_patterns);
-           READ_RETURN0(read_result);
-         }
-         move_cutoff = 99;
-       }
       }
       else
        if (moves[k].value < move_cutoff)
@@ -2062,18 +2034,6 @@ do_owl_defend(int str, int *move, int *w
        continue;

       owl_shapes(&shape_patterns, shape_moves, color, owl, &owl_defendpat_db);
-      /* A move of value 100 is considered a win */
-      if (get_next_move_from_list(&shape_patterns, color, shape_moves, 100)) {
-       /* to make sure this move is recorded in the sgf file */
-       if (trymove(shape_moves[0].pos, color, shape_moves[0].name, str,
-                   komaster, kom_pos))
-         popgo();
-       TRACE("%oVariation %d: ALIVE (Winning owl_defendpat)\n",
-             this_variation_number);
-       SGFTRACE(shape_moves[0].pos, WIN, "winning defense pattern");
-       close_pattern_list(color, &shape_patterns);
-       READ_RETURN(read_result, move, shape_moves[0].pos, WIN);
-      }
       moves = shape_moves;
       break;






reply via email to

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