gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] tuning patch


From: Gunnar Farneback
Subject: [gnugo-devel] tuning patch
Date: Thu, 02 Jan 2003 15:09:12 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

This patch does some mixed tuning. The biggest news is the new
autohelper functions {ox}_visible_along_edge. These scan the board
along the edge until the first stone is found. One use of these is to
determine whether to pincer or not, depending on who has support
further away along the edge.

The only effect on the regressions is a FAIL in viking:2. This is due
to the new eye pattern accidentally pushing an owl read from 992 nodes
past the 10000 limit, getting the wrong result.

- new function visible_along_edge and corresponding autohelper
  functions
- tuning
- endgame tuning
- eye tuning

/Gunnar

Index: engine/liberty.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/liberty.h,v
retrieving revision 1.147
diff -u -r1.147 liberty.h
--- engine/liberty.h    1 Jan 2003 12:41:25 -0000       1.147
+++ engine/liberty.h    2 Jan 2003 06:09:16 -0000
@@ -581,6 +581,7 @@
 int cut_possible(int pos, int color);
 int defend_against(int move, int color, int apos);
 int somewhere(int color, int check_alive, int num_moves, ...);
+int visible_along_edge(int color, int apos, int bpos);
 
 /* Printmoyo values, specified by -m flag. */
 #define PRINTMOYO_TERRITORY         0x01
Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.63
diff -u -r1.63 utils.c
--- engine/utils.c      1 Jan 2003 12:41:26 -0000       1.63
+++ engine/utils.c      2 Jan 2003 06:09:16 -0000
@@ -207,6 +207,70 @@
   return 0;
 }
 
+/* Search along the edge for the first visible stone. Start at apos
+ * and move in the direction of bpos. Return 1 if the first visible
+ * stone is of the given color. It is required that apos and bpos are
+ * at the same distance from the edge.
+ *
+ * FIXME: The detection of the first visible stone is quite crude and
+ * probably needs to be improved.
+ */
+int
+visible_along_edge(int color, int apos, int bpos)
+{
+  int ai = I(apos);
+  int aj = J(apos);
+  int bi = I(bpos);
+  int bj = J(bpos);
+  int pos;
+  int forward;
+  int up;
+  ASSERT1((ai == bi) ^ (aj == bj), apos);
+
+  if (ai == bi) {
+    if (aj > bj)
+      forward = WEST(0);
+    else
+      forward = EAST(0);
+
+    if (ai < board_size/2) {
+      pos = POS(0, bj);
+      up = SOUTH(0);
+    }
+    else {
+      pos = POS(board_size - 1, bj);
+      up = NORTH(0);
+    }
+  }
+  else {
+    if (ai > bi)
+      forward = NORTH(0);
+    else
+      forward = SOUTH(0);
+
+    if (aj < board_size/2) {
+      pos = POS(bi, 0);
+      up = EAST(0);
+    }
+    else {
+      pos = POS(bi, board_size - 1);
+      up = WEST(0);
+    }
+  }
+  
+  for (; ON_BOARD(pos); pos += forward) {
+    int k;
+    for (k = 4; k >= 0; k--) {
+      ASSERT_ON_BOARD1(pos + k * up);
+      if (board[pos + k * up] == color)
+       return 1;
+      else if (board[pos + k * up] == OTHER_COLOR(color))
+       return 0;
+    }
+  }
+
+  return 0;
+}
 
 /* The function play_break_through_n() plays a sequence of moves,
  * alternating between the players and starting with color. After
Index: patterns/endgame.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/endgame.db,v
retrieving revision 1.40
diff -u -r1.40 endgame.db
--- patterns/endgame.db 1 Dec 2002 19:44:35 -0000       1.40
+++ patterns/endgame.db 2 Jan 2003 06:09:21 -0000
@@ -626,12 +626,14 @@
 
 
 Pattern EE407
+# gf Increased value. (3.3.14)
+# Give it a little more than 0.5 points in order to fill before capturing.
 
 |OX?     fill ko at end of game
 |*OX     1/2 point gote
 +---
 
-:8,X,terri(0.5)
+:8,X,terri(0.6)
 
 |aX?
 |*OX
@@ -641,12 +643,14 @@
 
 
 Pattern EE408
+# gf Increased value. (3.3.14)
+# Give it a little more than 0.5 points in order to fill before capturing.
 
 |XO?     fill ko at end of game
 |O*O     1/2 point gote
 +---
 
-:8,X,terri(0.5)
+:8,X,terri(0.6)
 
 |Xa?
 |O*O
@@ -730,12 +734,14 @@
 ################################
 
 Pattern EE501
+# gf Increased value. (3.3.14)
+# Give it a little more than 0.5 points in order to fill before capturing.
 
 ?OX?     fill ko at end of game
 O*OX     1/2 point gote
 ----
 
-:8,X,terri(0.5)
+:8,X,terri(0.6)
 
 ?aX?
 O*OX
@@ -1043,12 +1049,14 @@
 ######################################################################
 
 Pattern CE1
+# gf Increased value. (3.3.14)
+# Give it a little more than 0.5 points in order to fill before capturing.
 
 ?OX?     fill ko at end of game
 O*OX     1/2 point gote
 ?OX?
 
-:-,X,terri(0.5)
+:-,X,terri(0.6)
 
 ?OX?
 a*OX
Index: patterns/eyes.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/eyes.db,v
retrieving revision 1.30
diff -u -r1.30 eyes.db
--- patterns/eyes.db    1 Jan 2003 20:05:25 -0000       1.30
+++ patterns/eyes.db    2 Jan 2003 06:09:23 -0000
@@ -2000,6 +2000,18 @@
 
 
 Pattern 6003
+# Bent four in the corner.
+
+ !
+|.
+|X
+|.*.
++---
+
+:1122
+
+
+Pattern 6004
 # Special corner shape
 
 |*X.
Index: patterns/hoshi.sgf
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/hoshi.sgf,v
retrieving revision 1.14
diff -u -r1.14 hoshi.sgf
--- patterns/hoshi.sgf  31 Dec 2002 17:13:09 -0000      1.14
+++ patterns/hoshi.sgf  2 Jan 2003 06:09:24 -0000
@@ -227,7 +227,7 @@
 (;B[pj]C[0]PL[B];B[pf]MA[ml];C[#tsuke nobi 6-9 stone games];W[pg]
 MA[mi]C[U];B[of]MA[ml]C[U];C[#tsuke nobi 6-9 stone games])
 
-(;B[pf]MA[mi]C[j
+(;B[pf]MA[mj]C[j
 ];C[#tsuke nobi normal]
 (;W[pg]MA[mi]C[U]
 (;B[of]MA[mh]C[U];C[#nobi]
Index: patterns/mkpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.105
diff -u -r1.105 mkpat.c
--- patterns/mkpat.c    1 Jan 2003 12:41:26 -0000       1.105
+++ patterns/mkpat.c    2 Jan 2003 06:09:29 -0000
@@ -346,6 +346,9 @@
                "does_capture_something(%s, OTHER_COLOR(color))"},
   {"false_eye_territory",      1, 0, 0.0, "false_eye_territory[%s]"},
   {"false_eye",                        1, 0, 0.01, "is_false_eye(half_eye, 
%s)"},
+  {"o_visible_along_edge",     2, 0, 0.05, "visible_along_edge(color,%s,%s)"},
+  {"x_visible_along_edge",     2, 0, 0.05, 
+                "visible_along_edge(OTHER_COLOR(color),%s,%s)"},
   {"is_surrounded",            1, 0, 0.01, "is_surrounded(%s)"},
   {"does_surround",            2, 0, 1.00, "does_surround(%s, %s)"},
   {"surround_map",             2, 0, 0.01, "surround_map(%s, %s)"},
Index: patterns/patterns.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.db,v
retrieving revision 1.94
diff -u -r1.94 patterns.db
--- patterns/patterns.db        1 Jan 2003 20:05:25 -0000       1.94
+++ patterns/patterns.db        2 Jan 2003 06:09:38 -0000
@@ -10681,6 +10681,19 @@
 ;!attack(D) && !xplay_defend_both(a,b,c)
 
 
+Pattern ED95
+# gf New pattern. (3.3.14)
+
+...xx
+.O.Xx      fourth line sente kosumi
+..*..
+.....
+.....
+-----
+
+:8,OXea
+
+
 #####################################################################
 #
 # Center defend/attack patterns
@@ -11131,13 +11144,14 @@
 
 
 Pattern CD94
+# gf Split and revised. (3.3.14)
 
 ????????       jump out
 ????????
 ........
 ..*.....
 X...????
-?.O..???
+x.O..???
 
 :8,OXEad,shape(4)
 
@@ -11146,11 +11160,33 @@
 ........
 ..*.....
 X...abcd
-?.O..???
+x.O..???
 
 ; x_alive_somewhere(a,b,c,d)
 
 
+Pattern CD94b
+# gf Split and revised. (3.3.14)
+
+????????       jump out
+????????
+........
+..*.....
+X...????
+O.O..???
+
+:8,OXEad,shape(4)
+
+????????
+????????
+........
+..*.....
+Xe..abcd
+f.O..???
+
+; x_alive_somewhere(a,b,c,d) && oplay_connect(*,e,*,f)
+
+
 Pattern CD95
 # One point to the left is sometimes better
 
@@ -12198,7 +12234,7 @@
 .........
 ---------
 
-:8,seEd,shape(3)
+:8,sed,shape(3)
 
 
 Pattern EJ51
@@ -12687,16 +12723,71 @@
 
 Pattern EJ81
 # db added (3.1.4)
+# gf Revised. (3.3.14)
 
-?....x.       seal the side      
-?O.O...
-o..*.X.
-.......
-.......
--------
+?....x..       seal the side
+?O.O....
+o..*.X.x
+........
+........
+--------
 
 :8,j
 
+?....x..
+?O.O....
+o..*.Abx
+........
+........
+--------
+
+;x_visible_along_edge(A,b)
+
+
+Pattern EJ81b
+# gf New pattern. (3.3.14)
+
+?....X....      seal the side to attack
+?O.O...ooo
+o..*.X.ooo
+..........
+..........
+----------
+
+:8,j
+
+?....X....
+?O.O...def
+o..*.X.abc
+..........
+..........
+----------
+
+;o_somewhere(a,b,c,d,e,f)
+
+
+Pattern EJ81c
+# gf New pattern. (3.3.14)
+# FIXME: May wish to prefer other pincers in some situations.
+
+?.........      pincer
+?O.O......
+o....X.*..
+..........
+..........
+----------
+
+:8,j
+
+?.........
+?O.O......
+o....Ab*..
+..........
+..........
+----------
+
+;o_visible_along_edge(A,b)
+
 
 Pattern EJ82
 # db added (3.1.4)
@@ -13546,7 +13637,7 @@
 ....
 ----
 
-:8,OXeE
+:8,OXe
 
 
 Pattern LE2
Index: patterns/patterns2.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns2.db,v
retrieving revision 1.49
diff -u -r1.49 patterns2.db
--- patterns/patterns2.db       1 Dec 2002 19:44:35 -0000       1.49
+++ patterns/patterns2.db       2 Jan 2003 06:09:40 -0000
@@ -3087,6 +3087,7 @@
 
 
 Pattern DD5
+# gf Exclude this pattern when scoring. (3.3.14)
 # This is somewhat wimpy. We should do more exact reading to verify
 # whether it really is necessary.
 
@@ -3100,7 +3101,8 @@
 ba.
 b.*
 
-;lib(c)<=4 && xplay_attack(a,b) && safe_xmove(a) && odefend_against(*,a)
+;!doing_scoring
+;&& lib(c)<=4 && xplay_attack(a,b) && safe_xmove(a) && odefend_against(*,a)
 
 >add_defend_both_move(b,c);
 



reply via email to

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