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: Sun, 16 Mar 2003 20:12:57 +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 tuning

- reevaluate_ko_threats() revised
- new helper backfill_replace
- influence tuning
- tuning
- joseki tuning

Regression delta:

strategy3:123   PASS P4 [P4]
global:27       PASS T18 [T18]
gunnar:20       PASS F16 [F16|K14]
gunnar:23       PASS N5 [N5]

/Gunnar

Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.82
diff -u -r1.82 value_moves.c
--- engine/value_moves.c        13 Feb 2003 20:09:42 -0000      1.82
+++ engine/value_moves.c        16 Mar 2003 19:08:06 -0000
@@ -2896,7 +2896,7 @@
        */
       if (type == -1)
         threat_does_work = 1;
-      else
+      else {
         if (trymove(pos, color, "reevaluate_ko_threats", ko_move,
                     EMPTY, ko_move)) {
          ASSERT_ON_BOARD1(ko_stone);
@@ -2923,10 +2923,21 @@
                 threat_does_work = (ko_move_target != what);
               }
               popgo();
+
+             /* Is this a losing ko threat? */
+             if (threat_does_work && type == ATTACK_THREAT) {
+               int apos;
+               if (attack(pos, &apos)
+                   && does_defend(apos, what)
+                   && !is_proper_eye_space(apos)) {
+                 threat_does_work = 0;
+               }
+             }
             }
           }
           popgo();
         }
+      }
  
       if (threat_does_work) {
        TRACE("%1m: %f + %f = %f\n", pos, move[pos].value,
Index: patterns/barriers.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/barriers.db,v
retrieving revision 1.49
diff -u -r1.49 barriers.db
--- patterns/barriers.db        3 Feb 2003 13:12:50 -0000       1.49
+++ patterns/barriers.db        16 Mar 2003 19:08:06 -0000
@@ -2061,7 +2061,7 @@
 !Q
 X?
 
-:8,BF,value(30)
+:8,B,value(30)
 
 xX
 ab
@@ -2072,6 +2072,24 @@
 >return !xplay_attack(a,b);
 
 
+Pattern Intrusion58
+# gf New pattern (3.3.17)
+
+XOoo
+.XQo
+..X!
+?..!
+
+:8,B,value(30)
+
+Xgoo
+bXfo
+.aXc
+?.de
+
+;!oplay_disconnect(f,g) && !oplay_disconnect(a,b,c,d,e,c,f)
+
+
 Pattern Nonterritory1
 # gf Revised constraint. (3.3.10)
 
@@ -3032,6 +3050,22 @@
 >non_xterritory(d);
 >non_xterritory(e);
 >non_xterritory(f);
+
+
+Pattern Nonterritory47
+# gf New pattern. (3.3.17)
+
+?ooo?
+X...X
+
+:|,t
+
+?ooo?
+CaebD
+
+;!oplay_attack(a,C) && !oplay_attack(b,D)
+
+>non_oterritory(e);
 
 
 # END OF FILE
Index: patterns/endgame.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/endgame.db,v
retrieving revision 1.45
diff -u -r1.45 endgame.db
--- patterns/endgame.db 3 Feb 2003 13:12:50 -0000       1.45
+++ patterns/endgame.db 16 Mar 2003 19:08:06 -0000
@@ -1513,7 +1513,7 @@
 ?*?
 ?O?
 
-:|,OXe
+:|,OXe,terri(0.1)
 
 
 ######################################################################
Index: patterns/fuseki.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/fuseki.db,v
retrieving revision 1.28
diff -u -r1.28 fuseki.db
--- patterns/fuseki.db  3 Feb 2003 13:12:50 -0000       1.28
+++ patterns/fuseki.db  16 Mar 2003 19:08:08 -0000
@@ -1185,8 +1185,9 @@
 
 
 Pattern F411
+# gf Revised pattern. (3.3.17)
 
-??...??       extend between two stones on 4-th line
+.......       extend between two stones on 4-th line
 O..*..O
 .......
 .......
Index: patterns/helpers.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/helpers.c,v
retrieving revision 1.48
diff -u -r1.48 helpers.c
--- patterns/helpers.c  19 Feb 2003 19:21:35 -0000      1.48
+++ patterns/helpers.c  16 Mar 2003 19:08:09 -0000
@@ -792,6 +792,23 @@
   return 0;
 }
 
+
+void
+backfill_replace(int move, int str)
+{
+  int defense_move = NO_MOVE;
+
+  if (TRYMOVE(move, OTHER_COLOR(board[str]))) {
+    if (attack_and_defend(str, NULL, NULL, NULL, &defense_move)) {
+      /* Must undo the trymove before adding the replacement move. */
+      popgo();
+      add_replacement_move(move, defense_move);
+    }
+    else
+      popgo();
+  }
+}
+
 /*
  * LOCAL Variables:
  * tab-width: 8
Index: patterns/hoshi.sgf
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/hoshi.sgf,v
retrieving revision 1.19
diff -u -r1.19 hoshi.sgf
--- patterns/hoshi.sgf  3 Mar 2003 19:57:12 -0000       1.19
+++ patterns/hoshi.sgf  16 Mar 2003 19:08:10 -0000
@@ -406,9 +406,16 @@
 
 (;W[pe]
 (;B[qe]LB[oe:A][qd:B][pf:C]MA[mi]C[;!oplay_attack(*,A,B,C)
-];W[oe];
-B[qd]MA[mi];W[qg];B[nd]MA[mi];W[ne];B[me]MA[li];W[od];B[oc]MA[li];
+];W[oe]
+(;B[qd]MA[mi];W[qg];B[nd]MA[mi];W[ne];B[me]MA[li];W[od];B[oc]MA[li];
 W[og];B[md]MA[li])
+
+(;B[re]MA[mi]C[0
+])
+
+(;B[pg]MA[mi]C[0
+])
+)
 
 (;B[oe]MA[mi]LB[qe:A][qd:B][pf:C]C[;!oplay_attack(A,*,B,C)
 ];W[qe]
Index: patterns/mkpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.115
diff -u -r1.115 mkpat.c
--- patterns/mkpat.c    22 Feb 2003 10:54:24 -0000      1.115
+++ patterns/mkpat.c    16 Mar 2003 19:08:17 -0000
@@ -341,6 +341,7 @@
   {"connect_and_cut_helper",   3, 0, 3.00, "connect_and_cut_helper(%s, %s, 
%s)"},
   {"owl_threatens",            2, 0, 0.01, "owl_threatens_attack(%s, %s)"},
   {"replace",                  2, 0, 0.0,  "add_replacement_move(%s, %s)"},
+  {"backfill_replace",         2, 0, 0.0,  "backfill_replace(%s, %s)"},
   {"non_oterritory",           1, 0, 0.0,
                "influence_mark_non_territory(%s, color)"},
   {"non_xterritory",           1, 0, 0.0,
Index: patterns/patterns.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.db,v
retrieving revision 1.102
diff -u -r1.102 patterns.db
--- patterns/patterns.db        22 Feb 2003 10:54:24 -0000      1.102
+++ patterns/patterns.db        16 Mar 2003 19:08:49 -0000
@@ -10755,6 +10755,7 @@
 
 Pattern ED95
 # gf New pattern. (3.3.14)
+# gf Added constraint. (3.3.17)
 
 ...xx
 .O.Xx      fourth line sente kosumi
@@ -10765,6 +10766,15 @@
 
 :8,OXea
 
+...xx
+.a.Xx
+..*..
+.....
+.....
+-----
+
+;!weak(a)
+
 
 #####################################################################
 #
@@ -11326,6 +11336,8 @@
 
 Pattern CD99
 # gf Revised constraint. (3.1.14)
+# gf Added !doing_scoring since this can generate a losing ko threat.
+#    We might want to take it out entirely. (3.3.17)
 
 OX        if a cutting stone can't be caught, 
 X*        play in opponent's territory
@@ -11335,7 +11347,7 @@
 OA
 B*
 
-;!attack(A) && !attack(B) && xterri(*)
+;!doing_scoring && !attack(A) && !attack(B) && xterri(*)
 
 
 # FIXME: The two following patterns may be superfluous due to the
@@ -14184,6 +14196,24 @@
 
 ; lib(a)==2 && lib(B)>=2 && !oplay_attack(*,a)
 > replace(c,*)
+
+
+Pattern RE13
+# gf New pattern. (3.3.17)
+# See gunnar:20.
+
+?XXO       backfill before playing into bamboo joint in gote (dame filling)
+O*..
+?XXO
+
+:-,OX
+
+?XXO
+a*b.
+?XXO
+
+;oplay_attack(*,b,*) && oplay_defend(*,b,*)
+>backfill_replace(*,a)
 
 
 # END OF FILE
Index: patterns/patterns.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.h,v
retrieving revision 1.52
diff -u -r1.52 patterns.h
--- patterns/patterns.h 19 Feb 2003 19:21:35 -0000      1.52
+++ patterns/patterns.h 16 Mar 2003 19:08:49 -0000
@@ -300,6 +300,7 @@
 int edge_double_sente_helper(int move, int apos, int bpos, int cpos);
 void test_attack_either_move(int move, int color, int worma, int wormb);
 int adjacent_to_defendable_stone_in_atari(int str);
+void backfill_replace(int move, int str);
 
 
 void init_tree_conn(void);
Index: patterns/patterns2.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns2.db,v
retrieving revision 1.55
diff -u -r1.55 patterns2.db
--- patterns/patterns2.db       22 Feb 2003 10:54:24 -0000      1.55
+++ patterns/patterns2.db       16 Mar 2003 19:08:49 -0000
@@ -1329,6 +1329,7 @@
 Pattern Shape3
 # tm modified (3.1.23) (reduce shape penalty)
 #  see blunder:15, trevord:800
+# gf Revised constraint. (3.3.17)
 
 O*      dango
 OO
@@ -1338,7 +1339,7 @@
 O*
 OO
 
-;!ko(*)
+;!ko(*) && !o_captures_something(*)
 
 
 Pattern Shape4
@@ -2961,6 +2962,29 @@
 ;&& (safe_xmove(b) || safe_xmove(c))
 ;&& oplay_attack(*,b,b)==WIN
 ;&& oplay_attack(*,c,c)==WIN
+# Action adds a reverse followup value.
+>defend_against_atari(a)
+
+
+Pattern Sente13d
+# gf New pattern. (3.3.17)
+
+..X
+*.O
+..O
+oOX
+
+:8,sO
+
+..X
+*ca
+.ba
+oOX
+
+;lib(a) == 2 && !attack(a) && safe_omove(*)
+;&& safe_xmove(*)
+;&& !oplay_defend(*,b,c,b)
+;&& xplay_attack(*,a)
 # Action adds a reverse followup value.
 >defend_against_atari(a)
 




reply via email to

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