[Top][All Lists]
[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: |
Wed, 27 Mar 2002 22:32:06 +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) |
With this tuning patch at least nngs1:40,41 pass. I don't yet know how
it does with the rest of the regressions. The patch also removes some
dead patterns.
/Gunnar
Index: patterns/barriers.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/barriers.db,v
retrieving revision 1.29
diff -u -r1.29 barriers.db
--- patterns/barriers.db 26 Mar 2002 21:32:59 -0000 1.29
+++ patterns/barriers.db 27 Mar 2002 16:37:25 -0000
@@ -1917,6 +1917,8 @@
Pattern Nonterritory7b
+# gf The old constraint was no good, as can be seen in nngs1:40. After
+# black R6 this pattern declared S5 non-territory. (3.1.30)
.X?
..O
@@ -1928,7 +1930,7 @@
baO
---
-;safe_omove(a) && oplay_attack(a,b,c,a) && oplay_defend_both(a,b,c,a,c)
+;safe_omove(a) && oplay_attack(a,b,c,a) && connect_and_cut_helper2(a,b,c)
>non_xterritory(c);
@@ -2416,6 +2418,48 @@
>non_oterritory(a);
>non_oterritory(c);
>non_oterritory(e);
+
+
+Pattern Nonterritory33
+# gf New pattern. (3.1.30)
+
+X.O
+...
+..X
+
+:/,t
+
+X.O
+ca.
+dbX
+
+;!oplay_attack(a,b,c,a) && !oplay_attack(a,c,b,a)
+
+>non_xterritory(b);
+>non_xterritory(c);
+>non_xterritory(d);
+
+
+Pattern Nonterritory34
+# gf New pattern. (3.1.30)
+
+x.O
+.XO
+.xO
+---
+
+:8,t
+
+xaO
+cXO
+.bO
+---
+
+;safe_omove(a)
+;&& ((x_somewhere(b) && oplay_attack(a,b))
+; || (!x_somewhere(b) && oplay_attack(a,b,b)))
+
+>non_xterritory(c);
# END OF FILE
Index: patterns/helpers.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/helpers.c,v
retrieving revision 1.31
diff -u -r1.31 helpers.c
--- patterns/helpers.c 25 Mar 2002 07:39:18 -0000 1.31
+++ patterns/helpers.c 27 Mar 2002 16:37:25 -0000
@@ -663,6 +663,66 @@
+/*
+ * This is identical to connect_and_cut_helper(), except that d is
+ * found as a general defense point for A. A is no longer restricted
+ * to two liberties.
+ *
+ * |.X |dX
+ * |XO |AO
+ * |XO |Ae
+ * |.. |bc
+ */
+
+int
+connect_and_cut_helper2(int Apos, int bpos, int cpos, int color)
+{
+ int dpos;
+ int epos = NO_MOVE;
+ int other = OTHER_COLOR(color);
+ int result = 0;
+ int k;
+
+ gg_assert(IS_STONE(color));
+
+
+ if (TRYMOVE(Apos, color)) {
+ for (k = 0; k < 4; k++)
+ if (board[cpos + delta[k]] == other
+ && neighbor_of_string(cpos + delta[k], Apos)) {
+ epos = cpos + delta[k];
+ break;
+ }
+
+ gg_assert(epos != NO_MOVE);
+
+ if (TRYMOVE(bpos, other)) {
+ if (!find_defense(Apos, &dpos) || dpos == NO_MOVE) {
+ popgo();
+ popgo();
+ return 0;
+ }
+
+ if (TRYMOVE(dpos, color)) {
+ if (TRYMOVE(cpos, color)) {
+ if (board[bpos] == EMPTY
+ || board[epos] == EMPTY
+ || !defend_both(bpos, epos))
+ result = 1;
+ popgo();
+ }
+ popgo();
+ }
+ popgo();
+ }
+ popgo();
+ }
+
+ return result;
+}
+
+
+
/* replaces macro with assert-enabled function */
int
dragon_weak(int pos)
Index: patterns/mkpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/mkpat.c,v
retrieving revision 1.63
diff -u -r1.63 mkpat.c
--- patterns/mkpat.c 25 Mar 2002 07:39:18 -0000 1.63
+++ patterns/mkpat.c 27 Mar 2002 16:37:27 -0000
@@ -289,6 +289,8 @@
{"finish_ko_helper", 1, 0.05, "finish_ko_helper(%s)"},
{"squeeze_ko_helper", 1, 0.03, "squeeze_ko_helper(%s)"},
{"backfill_helper", 3, 1.50, "backfill_helper(%s, %s, %s)"},
+ {"connect_and_cut_helper2", 3, 3.00,
+ "connect_and_cut_helper2(%s, %s, %s, color)"},
{"connect_and_cut_helper", 3, 3.00, "connect_and_cut_helper(%s, %s, %s)"},
{"owl_threatens", 2, 0.01, "owl_threatens_attack(%s,%s)"},
{"replace", 2, 0.0, "add_replacement_move(%s,%s)"},
Index: patterns/patterns.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.db,v
retrieving revision 1.61
diff -u -r1.61 patterns.db
--- patterns/patterns.db 26 Mar 2002 21:32:59 -0000 1.61
+++ patterns/patterns.db 27 Mar 2002 16:37:28 -0000
@@ -5557,18 +5557,6 @@
:8,OXe
-# Pattern EB1002
-# # gf Redundant, strict subset of EB1001. (3.1.23)
-#
-# ?X.?.. extend if opponent attaches!
-# .X.O..
-# *O....
-# ......
-# ------
-#
-# :8,OXe
-
-
Pattern EB1003
XX.. move out on second line
@@ -5681,17 +5669,6 @@
:8,OXe
-# Pattern EB1010
-# # gf Redundant, strict subset of EB1007. (3.1.23)
-#
-# X... extend on second line
-# O*..
-# ....
-# ----
-#
-# :8,OXe
-
-
Pattern EB1011
?XX.?? reverse sente extend
@@ -7237,18 +7214,6 @@
# Miscellaneous
###############
-# Pattern CB201
-# # Too specific and probably redundant anyway. (3.1.23)
-#
-# .O.? large value to override defender
-# .*XX
-# OXO.
-# ...X
-# ..O?
-#
-# :8,bE
-
-
Pattern CB202
?o.? hane if attached
@@ -7363,22 +7328,6 @@
;(lib(a)>1) && (!attack(b) || defend(b))
-# Pattern CB208
-# # gf Merged with CB207 and reduced shape value. (3.1.23)
-#
-# ??x threaten connection
-# O*.
-# .XO
-#
-# :8,nOX,shape(3)
-#
-# ??x
-# O*.
-# .ba
-#
-# ;(lib(a)>1) && (!attack(b) || defend(b))
-
-
Pattern CB209
??O threaten connection
@@ -7767,22 +7716,6 @@
:8,OXbe
-# Pattern CB239
-# gf Redundant, strict subset of CB238
-#
-# ... block off area
-# O*O
-# ?X?
-#
-# :8,OXb
-#
-# cab
-# O*O
-# ?X?
-#
-# ;omoyo(b) && omoyo(c) && !xplay_attack(*,a,b,b)
-
-
Pattern CB240
.. block off area
@@ -7966,15 +7899,6 @@
OX?
:8,OXe
-
-
-# Pattern CB253
-#
-# ... bend around
-# O*.
-# OXX
-#
-# :8,OXe
Pattern CB254
Index: patterns/patterns.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns.h,v
retrieving revision 1.28
diff -u -r1.28 patterns.h
--- patterns/patterns.h 22 Mar 2002 08:18:32 -0000 1.28
+++ patterns/patterns.h 27 Mar 2002 16:37:28 -0000
@@ -305,6 +305,7 @@
int backfill_helper(int apos, int bpos, int cpos);
int owl_threatens_attack(int apos, int bpos);
int connect_and_cut_helper(int Apos, int bpos, int cpos);
+int connect_and_cut_helper2(int Apos, int bpos, int cpos, int color);
int edge_double_sente_helper(int move, int apos, int bpos, int cpos);
int dragon_weak(int pos);
Index: patterns/patterns2.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/patterns2.db,v
retrieving revision 1.33
diff -u -r1.33 patterns2.db
--- patterns/patterns2.db 4 Mar 2002 06:49:09 -0000 1.33
+++ patterns/patterns2.db 27 Mar 2002 16:37:30 -0000
@@ -674,6 +674,22 @@
;!oplay_break_through(*,a,b,*,b,c)
+Pattern Conn603b
+# gf New experimental pattern. Useful in nngs1:41. (3.1.30)
+
+...o Block across large knight's move
+O.*.
+?.XO
+
+:8,C
+
+...o
+a.*.
+?.Xb
+
+;!oplay_disconnect(*,a,b)
+
+
Pattern Conn604
O...
- [gnugo-devel] Tuning patch, Daniel Bump, 2002/03/20
- [gnugo-devel] tuning patch,
Gunnar Farneback <=
- Re: [gnugo-devel] tuning patch, bump, 2002/03/27
- [gnugo-devel] Handtalk vs GnuGo: Game 1, Jessie Annala, 2002/03/28
- Re: [gnugo-devel] Handtalk vs GnuGo: Game 1, Gunnar Farneback, 2002/03/28
- Re: [gnugo-devel] Handtalk vs GnuGo: Game 1, Daniel Bump, 2002/03/28
- Re: [gnugo-devel] Handtalk vs GnuGo: Game 1, Jessie Annala, 2002/03/28
- Re: [gnugo-devel] Handtalk vs GnuGo: Game 1, Arend Bayer, 2002/03/28
- Re: [gnugo-devel] Handtalk vs GnuGo: Game 1, Jessie Annala, 2002/03/29
[gnugo-devel] Tuning patch, bump, 2002/03/29