[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] hoshi josekis
From: |
Gunnar Farneback |
Subject: |
Re: [gnugo-devel] hoshi josekis |
Date: |
Tue, 22 Apr 2003 19:31:58 +0200 |
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) |
Evan wrote (on April 7):
> - continuations for tsuke-nobi with diagonal move
> - continuations for tsuke-nobi with belly attachment
> - continuations for pincer on high approach move
>
> hoshi.sgf is growing rather large. Would breaking it up be appropriate?
> eg, a file for hoshi and keima kakari, and a file for other variations?
Sounds like a good idea to me.
> +(;B[tt];W[nd]
> +C[U
> +#applicable in isolation or if b makes a pincer on the right
> +]
Looking at nngs4:540 I can say that this is not an appropriate U
pattern. In hoshi.db the pattern looks like this:
> Pattern JH684
> #applicable in isolation or if b makes a pincer on the right
>
> ----------+
> ..........|
> ..........|
> ..........|
> ....*.X...|
> ..........|
> ......O...|
> ..........|
>
> :8,sFU
To begin with I don't think it's exactly urgent to respond to a pincer
after the high kakari. But this pattern matches also if X tenukis
after the kakari and then it's absolutely not urgent to make a double
kakari. This is exactly what happens in nngs4:540,
A B C D E F G H J K L M N O P Q R S T
19 . . . . . . . . . . . . . . . . . . . 19
18 . . . . . . . . . . . . . . . . . . . 18
17 . . . . . . . . . . . . . . . . . . . 17
16 . . . X . O . . . + . . . . . X . . . 16
15 . . . . . . . . . . . . . . . . . . . 15
14 . . . . . . . . . . . . . . . . . . . 14
13 . . . . . . . . . . . . . . . . . . . 13
12 . . . . . . . . . . . . . . . . . . . 12
11 . . . . . . . . . . . . . . . . . . . 11
10 . . . + . . . . . + . . . . . + . . . 10
9 . . . . . . . . . . . . . . . . . . . 9
8 . . . . . . . . . . . . . . . . . . . 8
7 . . . . . . . . . . . . . . . . . . . 7
6 . . . . . . . . . . . . . . . X . . . 6
5 . . . . . . . . . . . . . . X O . . . 5
4 . . . X . . . . . + O . . . X O . . . 4
3 . . . . . . . . . . . . . X . X O . . 3
2 . . . . . . . . . . . . . . . . . . . 2
1 . . . . . . . . . . . . . . . . . . . 1
A B C D E F G H J K L M N O P Q R S T
After F16 black played Q6. Now a defense of the lower right corner is
a lot more urgent than making a double kakari in the upper left. So
the pattern should more appropriately be marked j. As a rule of thumb,
a U pattern and usually also a J pattern should never apply in
positions where the opponent has played tenuki.
Now to a different problem that appears in this position. The current
top moves are all various kakaris, not a mention of moves to save the
lower right corner,
Top moves:
1. F16 40.00
2. D6 24.89
3. R14 24.88
4. F3 24.88
5. O17 24.88
6. Q14 24.88
7. F4 24.87
8. C6 24.87
9. O16 24.86
10. G4 24.16
If we degrade the double kakari to j, we instead get
Top moves:
1. S4 41.57
2. R2 40.25
3. S5 36.99
4. S3 36.76
5. R4 36.27
6. R5 34.88
7. C6 24.89
8. Q14 24.88
9. D6 24.86
10. F3 24.86
Notice how the defense moves are now found and some of them even
valued higher than the previous 40 points for the double kakari.
What's up with this?
The source of this problem can be found early in value_move_reasons(),
> /* If this move has no reason at all, we can skip some steps. */
> if ((!urgent || allpats)
> && (move[pos].reason[0] >= 0
> || move[pos].min_territory > 0.0)) {
If a U pattern has been found, other moves won't be evaluated. This is
obviously intended as a speedup but
1) This doesn't happen often enough to be really interesting and
almost only in early positions where the engine usually is fast
anyway.
2) All expensive owl reading has already been made at earlier stages
of the analysis.
3) It's dangerous, as nngs4:540 shows. In fact, if GNU Go 3.3.18 plays
a high kakari against hoshi, the opponent can make an arbitrarily
large threat and be certain (unless the move is in the joseki
database and has a U response) that GNU Go won't answer but
happily play the double kakari instead.
The appended patch solves both these issues.
- global variable urgent retired
- joseki tuning
/Gunnar
Index: engine/globals.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/globals.c,v
retrieving revision 1.43
diff -u -r1.43 globals.c
--- engine/globals.c 26 Feb 2003 19:43:50 -0000 1.43
+++ engine/globals.c 22 Apr 2003 17:23:43 -0000
@@ -113,7 +113,6 @@
float lower_bound = 0.0;
float upper_bound = 0.0;
int level = DEFAULT_LEVEL; /* strength; up to 10 supported */
-int urgent = 0; /* urgent move on board */
int debug = 0; /* controls debug output */
int verbose = 0; /* trace level */
char outfilename[128] = ""; /* output file (-o option) */
Index: engine/gnugo.h
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/gnugo.h,v
retrieving revision 1.92
diff -u -r1.92 gnugo.h
--- engine/gnugo.h 22 Apr 2003 02:48:04 -0000 1.92
+++ engine/gnugo.h 22 Apr 2003 17:23:43 -0000
@@ -270,7 +270,6 @@
extern int josekidb; /* use joseki database */
extern int level; /* controls depth of reading */
extern int semeai_variations; /* max variations considered reading semeai */
-extern int urgent; /* urgent move on board */
extern int showtime; /* print genmove time */
extern int showscore; /* print score */
extern float score;
Index: engine/shapes.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/shapes.c,v
retrieving revision 1.44
diff -u -r1.44 shapes.c
--- engine/shapes.c 3 Feb 2003 23:33:05 -0000 1.44
+++ engine/shapes.c 22 Apr 2003 17:23:43 -0000
@@ -451,7 +451,6 @@
add_strategical_defense_move(move, my_dragons[k]);
TRACE("...strategical defense of %1m\n", my_dragons[k]);
}
- urgent = 1;
for (k = 0; k < your_ndragons; k++) {
add_strategical_attack_move(move, your_dragons[k]);
TRACE("...strategical attack on %1m\n", your_dragons[k]);
@@ -688,7 +687,6 @@
add_strategical_defense_move(move, my_dragons[k]);
TRACE("...strategical defense of %1m\n", my_dragons[k]);
}
- urgent = 1;
for (k = 0; k < your_ndragons; k++) {
add_strategical_attack_move(move, your_dragons[k]);
TRACE("...strategical attack on %1m\n", your_dragons[k]);
Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.66
diff -u -r1.66 utils.c
--- engine/utils.c 22 Feb 2003 10:54:24 -0000 1.66
+++ engine/utils.c 22 Apr 2003 17:23:43 -0000
@@ -676,7 +676,6 @@
owl_distrust_depth = gg_max(1, (2*OWL_DISTRUST_DEPTH-1 + depth_level) /
2);
owl_branch_depth = gg_max(2, (2 * OWL_BRANCH_DEPTH + depth_level) / 2);
owl_reading_depth = gg_max(5, (2 * OWL_READING_DEPTH + depth_level) / 2);
- urgent = 0;
/* Atari-atari depth levels are unchanged only between levels 7/8: */
if (level >= 8)
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.88
diff -u -r1.88 value_moves.c
--- engine/value_moves.c 22 Apr 2003 02:48:05 -0000 1.88
+++ engine/value_moves.c 22 Apr 2003 17:23:43 -0000
@@ -2527,9 +2527,8 @@
return 0.0;
/* If this move has no reason at all, we can skip some steps. */
- if ((!urgent || allpats)
- && (move[pos].reason[0] >= 0
- || move[pos].min_territory > 0.0)) {
+ if (move[pos].reason[0] >= 0
+ || move[pos].min_territory > 0.0) {
int num_reasons;
/* Sort the move reasons. This makes it easier to visually compare
@@ -3138,10 +3137,8 @@
int save_verbose;
start_timer(2);
- if (!urgent || allpats) {
- find_more_attack_and_defense_moves(color);
- time_report(2, " find_more_attack_and_defense_moves", NO_MOVE, 1.0);
- }
+ find_more_attack_and_defense_moves(color);
+ time_report(2, " find_more_attack_and_defense_moves", NO_MOVE, 1.0);
save_verbose = verbose;
if (verbose > 0)
Index: patterns/hoshi.sgf
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/hoshi.sgf,v
retrieving revision 1.24
diff -u -r1.24 hoshi.sgf
--- patterns/hoshi.sgf 16 Apr 2003 21:34:54 -0000 1.24
+++ patterns/hoshi.sgf 22 Apr 2003 17:23:44 -0000
@@ -652,7 +652,7 @@
)
(;B[tt];W[nd]
-C[U
+C[j
#applicable in isolation or if b makes a pincer on the right
]
MA[jg]