[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] regarding paul_3_13.8a
From: |
Paul Pogonyshev |
Subject: |
[gnugo-devel] regarding paul_3_13.8a |
Date: |
Thu, 26 Dec 2002 20:11:01 +0200 |
well, the reason why the patch affected regression was simple
(and as far as i remember Dan made a correct guess). when a
part of a dragon is captured, the goal array is not updated.
so the (empty) intersections of the board where the captured
worm resided are considered part of the goal dragon.
note this piece of code from do_matchpat():
if (goal != NULL && board[pos] != EMPTY) {
if (goal[pos])
found_goal = 1;
else if (board[pos] == color)
found_nongoal = 1;
}
so, the common pattern matcher doesn't try to find the goal in
empty intersections. it even seems to be unnecessary, since
(as far as i understand) all matching with stackp > 0 is done
using the dfa matcher (or the tree matcher in experimental
reading).
but the dfa matcher currently doesn't check that board[pos] !=
EMPTY. and i think that matching against captured parts of a
dragon is wrong.
strange, but the patch below doesn't seem to cause any
regression changes. the only unexpected result was a fail in
strategy2:55, but the current cvs fails there too. unless
there are more unexpected results with the cvs version, the
patch'es delta is zero.
- dfa pattern matcher never looks for the goal in empty
intersections
- unnecessary patval elements dropped in owl databases
(using the machinery provided by paul_3_13.8b)
after the patch the number of matched patterns decreased
slightly. i've checked it only on owl.tst:
BEFORE AFTER
reading nodes 20209392 20207381
owl nodes 20152 20152
apparently, some constraint(s) were not checked since the
corresponding pattern(s) didn't match themselves.
this patch also decreases the size of the executable by 45k
and must give a small speedup. these results can be improved
by adding "discarding rules" to the rest of pattern databases.
Paul
Index: engine/matchpat.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/matchpat.c,v
retrieving revision 1.44
diff -u -p -r1.44 matchpat.c
--- engine/matchpat.c 9 Dec 2002 23:04:16 -0000 1.44
+++ engine/matchpat.c 26 Dec 2002 17:59:02 -0000
@@ -1052,7 +1052,7 @@ check_pattern_light(int anchor, matchpat
if (!anchor_in_goal) {
/* goal check */
- if (goal != NULL) {
+ if (goal != NULL && board[pos] != EMPTY) {
if (goal[pos])
found_goal = 1;
else if (board[pos] == color)
Index: patterns/owl_attackpats.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/owl_attackpats.db,v
retrieving revision 1.72
diff -u -p -r1.72 owl_attackpats.db
--- patterns/owl_attackpats.db 25 Dec 2002 20:26:44 -0000 1.72
+++ patterns/owl_attackpats.db 26 Dec 2002 17:59:41 -0000
@@ -80,7 +80,12 @@
# A14xx Invasion patterns
# A15xx Ko patterns
# A16xx Specific edge attacks
-#
+
+
+goal_elements Xx
+callback_data none
+
+
#########################################################
# #
# Limiting moves on the fourth line #
Index: patterns/owl_defendpats.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/owl_defendpats.db,v
retrieving revision 1.79
diff -u -p -r1.79 owl_defendpats.db
--- patterns/owl_defendpats.db 21 Dec 2002 18:30:07 -0000 1.79
+++ patterns/owl_defendpats.db 26 Dec 2002 18:00:38 -0000
@@ -80,7 +80,12 @@
# D12xx Kikashi
# D13xx Escape
# D14xx Ko
-#
+
+
+goal_elements Oo
+callback_data none
+
+
#########################################################
# #
# Expanding moves on the fourth line #
Index: patterns/owl_vital_apats.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/owl_vital_apats.db,v
retrieving revision 1.34
diff -u -p -r1.34 owl_vital_apats.db
--- patterns/owl_vital_apats.db 25 Dec 2002 20:26:45 -0000 1.34
+++ patterns/owl_vital_apats.db 26 Dec 2002 18:01:59 -0000
@@ -60,6 +60,11 @@
# captured, check also that an X move cannot be captured.
#
+
+goal_elements Xx
+callback_data !
+
+
Pattern VA1
?x?? threaten two eyes simultaneously
- [gnugo-devel] regarding paul_3_13.8a,
Paul Pogonyshev <=