[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] Level patch
From: |
bump |
Subject: |
[gnugo-devel] Level patch |
Date: |
Tue, 8 Jul 2003 15:47:01 -0700 |
Arend may have made a good case for the breakin code finding
enough good moves to warrant leaving it the default in 3.4.
I will assume in the following that we intend to do this. I will suggest
a modification that only affects levels 9 and 8.
Here are some times for running strategy.tst at different levels.
With the current engine:
Breakin code enabled
Level 10: 279 seconds
Level 9: 268 seconds
Level 8: 146 seconds (1 FAIL: 26 Correct 'D3', got 'G3')
Level 7: 139 seconds (2 FAIL: 45 Correct 'G17|G18|C1', got 'H1')
Level 6: 113 seconds (3 FAIL: 18 Correct 'E4|F3', got 'E5')
Level 5: 83 seconds (3 FAIL)
Level 4: 71 seconds (5 FAIL)
Level 3: 59 seconds (7 FAIL)
Level 2: 51 seconds (6 FAIL 2 PASS)
Level 1: 41 seconds (6 FAIL)
Breakin code disabled
Level 10: 253 seconds
Level 9: 238 seconds
[There are no more results because below level 9 the breakin
code is disabled anyway.]
The level 9 depths are the same as the level 10 ones,
so all of the speedup between levels 9 and 10 are
obtained by turning off some services. These consist
mainly of superstring reading and increasing the depth in
owl_substantial.
Currently the breakin code is turned off below level 9, but
clearly it should be turned off below level 10, because
levels 9 and 10 are much too close.
Assuming this, I suggest that we should then restore the
superstring and owl_substantial services at level 9. This
is done by this patch. This means in practice that these
services should be shut off below level 8, because the
level 7/8 speedup is obtained by shutting off services.
This will make level 8 slower, but the gap between
level 8 and 9 is big and the gap between level 7 and
8 is small, so we can afford to do this.
See the patch.
After such a change, level 9 will be the same as the current
level 10 with just the breakin code turned off, in other
words, the engine that ran strategy.tst in 253 seconds.
I think we can claim that Level 9 is stronger and faster
than GNU Go 3.2, and that Level 10 is stronger still and
comparable in speed. I expect Level 9 is about 2 stones
stronger than GNU Go 3.2 based on recent testing.
After the patch, here are the times:
Level 10: 279 seconds
Level 9: 248 seconds
Level 8: 173 seconds (1 FAIL: 26 Correct 'D3', got 'G3')
Level 7: 140 seconds (2 FAIL: 45 Correct 'G17|G18|C1', got 'H1'
The engine below Level 8 should be unchanged.
Dan
Index: engine/breakin.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/breakin.c,v
retrieving revision 1.6
diff -u -r1.6 breakin.c
--- engine/breakin.c 28 Jun 2003 13:05:30 -0000 1.6
+++ engine/breakin.c 8 Jul 2003 22:09:33 -0000
@@ -42,9 +42,9 @@
* - break_in(str, territory) if the opponent is assumed to be next to move,
* or
* - block_off(str, territory) if the territory owner is next.
- * If the break in is successful resp. the blocking insuccessful, we
+ * If the break in is successful resp. the blocking unsuccessful, we
* shrink the territory, and see whether the opponent can still break in.
- * We repeat this until the territory is shrinked so much that the opponent
+ * We repeat this until the territory is shrunk so much that the opponent
* can no longer reach it.
*/
@@ -381,7 +381,7 @@
struct moyo_data territories;
int k;
- if (!experimental_break_in || level < 9)
+ if (!experimental_break_in || level < 10)
return;
influence_get_territory_segmentation(q, &territories);
Index: engine/owl.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
retrieving revision 1.171
diff -u -r1.171 owl.c
--- engine/owl.c 21 Jun 2003 06:02:14 -0000 1.171
+++ engine/owl.c 8 Jul 2003 22:11:30 -0000
@@ -697,7 +697,7 @@
critical_semeai_worms);
}
- if (level < 10) {
+ if (level < 8) {
/* If no owl moves were found on two consecutive moves,
* turn off the owl phase.
*/
@@ -2468,7 +2468,7 @@
matches_found = 0;
memset(found_matches, 0, sizeof(found_matches));
- if (level >= 9) {
+ if (level >= 8) {
if (!does_attack) {
clear_owl_move_data(dummy_moves);
matchpat(owl_shapes_callback, other,
@@ -4870,7 +4870,7 @@
/* fill all the liberties */
for (k = 0; k < liberties; k++) {
if (trymove(libs[k], owl->color, NULL, 0, EMPTY, 0)) {
- if (level >= 10)
+ if (level >= 8)
increase_depth_values();
owl->goal[libs[k]] = 1;
}
@@ -4878,7 +4878,7 @@
/* if we can't fill, try swapping with the next liberty */
if (k < liberties-1
&& trymove(libs[k+1], owl->color, NULL, 0, EMPTY, 0)) {
- if (level >= 10)
+ if (level >= 8)
increase_depth_values();
owl->goal[libs[k+1]] = 1;
libs[k+1] = libs[k];
@@ -4886,7 +4886,7 @@
else {
/* Can't fill the liberties. Give up! */
while (stackp > 0) {
- if (level >= 10)
+ if (level >= 8)
decrease_depth_values();
popgo();
}
@@ -4906,7 +4906,7 @@
else
result = 1;
while (stackp > 0) {
- if (level >= 10)
+ if (level >= 8)
decrease_depth_values();
popgo();
}
Index: engine/reading.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/reading.c,v
retrieving revision 1.116
diff -u -r1.116 reading.c
--- engine/reading.c 21 Jun 2003 06:02:14 -0000 1.116
+++ engine/reading.c 8 Jul 2003 22:13:39 -0000
@@ -1651,7 +1651,7 @@
special_rescue_moves(str, libs[k], &moves);
}
- if (level >= 10 && stackp <= backfill2_depth)
+ if (level >= 8 && stackp <= backfill2_depth)
superstring_break_chain_moves(str, 4, &moves);
if (stackp <= break_chain_depth)
@@ -1695,7 +1695,7 @@
/* If nothing else works, we try playing a liberty of the
* super_string.
*/
- if (level >= 10 && stackp <= backfill2_depth)
+ if (level >= 8 && stackp <= backfill2_depth)
superstring_moves(str, &moves, 3, 0);
if (stackp <= break_chain_depth)
@@ -3381,7 +3381,7 @@
/* If it is not possible to make a direct atari, we try filling
* a liberty of the superstring.
*/
- if (level >= 10
+ if (level >= 8
&& stackp <= backfill_depth
&& (stackp <= superstring_depth || !atari_possible)) {
int liberty_cap = 2;
@@ -3573,7 +3573,7 @@
/* If nothing else works, we try filling a liberty of the
* super_string.
*/
- if (level >= 10 && stackp <= backfill2_depth)
+ if (level >= 8 && stackp <= backfill2_depth)
superstring_moves(str, &moves, 3, 1);
break;
Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.75
diff -u -r1.75 utils.c
--- engine/utils.c 24 Jun 2003 22:21:25 -0000 1.75
+++ engine/utils.c 8 Jul 2003 22:13:58 -0000
@@ -655,22 +655,23 @@
/*
* Other policies depending on level:
* aftermath.c: >= 8: call estimate_score().
- * dragon.c: >= 8: compute owl threats (currently disabled) (*)
+ * dragon.c: >= 8: compute owl threats (currently disabled)
* >= 8: call owl analysis of semeai (currently disabled)
* genmove.c: >= 8: call estimate_score().
* owl.c: >= 9: use vital attack pattern database
- * >= 10: increase depth values in owl_substantial
- * >= 10: don't turn off owl_phase in semeai reading
- * reading.c: >= 10: Use superstrings and do more backfilling. (*)
+ * >= 8: increase depth values in owl_substantial
+ * >= 8: don't turn off owl_phase in semeai reading
+ * reading.c: >= 8: Use superstrings and do more backfilling.
* value_moves.c: >= 6: try to find more owl attacks/defenses
+ * breakin.c: >= 10: try to find break-ins. (*)
*
- * Those two marked (*) are particular expensive. Hence we don't change
- * most depth values between levels 7 and 8 resp. 9 and 10.
- * FIXME: This isn't correct. Owl threats are turned off anyway, and
- * superstring doesn't cause a big time difference.
+ * The break-in code (*) is particularly expensive.
*
- * depth_level indicates the correction compared to the default settings
- * at level 10 for most reading depths.
+ * Speedups between levels 9 and 10 and between levels 7 and 8
+ * are obtained by turning off services, and between these
+ * levels no changes are made in the depths. The parameter
+ * depth_level is the correction compared to the default settings at level
+ * 10 for most reading depths.
*/
if (level >= 10)
depth_level = level - 10;
- [gnugo-devel] Level patch,
bump <=