gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] Another levels patch


From: bump
Subject: [gnugo-devel] Another levels patch
Date: Sun, 13 Jul 2003 12:37:24 -0700

It was the intention of the patch breakin_3_23.1 that the
only difference between levels 9 and 10 would be the turning
off of the breakin code. However this goal was not quite
attained because the superstring level was set to 0 at
level 10. After the following patch, a few levels are set
differently.

                        before patch       after patch
superstring depth
   level 9                   0                 7
   level 8                   0                 7
ko_depth
   level 6                   5                 6
     ...
aa_depth
   level 9                   5                 6
   level 8                   4                 5
   level 7                   4                 5
   level 6                   3                 4
     ...

ko_depth and aa_depth are also increased by one at levels < 6.

This affects mainly the speed of level 9. On strategy.tst we
get the following times:

level 10: 275 seconds
level  9: 249 seconds 
level  8: 174 seconds
level  7: 138 seconds

Speeds at levels < 7 should be as reported in
http://mail.gnu.org/archive/html/gnugo-devel/2003-07/msg00071.html .

There is a rather big jump between levels 8 and 9. But only level
9 is a little slower than before the patch. It is about 10% faster
than level 10 on strategy.tst, just from turning off the breakin
code.

Dan



Index: engine/utils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/utils.c,v
retrieving revision 1.79
diff -u -r1.79 utils.c
--- engine/utils.c      13 Jul 2003 17:57:59 -0000      1.79
+++ engine/utils.c      13 Jul 2003 19:20:35 -0000
@@ -675,39 +675,46 @@
    */
   if (level >= 10)
     depth_level = level - 10;
-  else if (level >= 8)
-    depth_level = level - 9;
+  else if (level == 9)
+    depth_level = 0;
+  else if (level == 8)
+    depth_level = -1;
   else 
     depth_level = level - 8;
 
-  depth               = gg_max(6, DEPTH            + depth_level);
-  branch_depth        = gg_max(3, BRANCH_DEPTH     + depth_level);
-  backfill_depth      = gg_max(2, BACKFILL_DEPTH    + depth_level);
-  backfill2_depth     = gg_max(1, BACKFILL2_DEPTH   + depth_level);
-  break_chain_depth   = gg_max(2, BREAK_CHAIN_DEPTH + depth_level);
+  depth                = gg_max(6, DEPTH           + depth_level);
+  branch_depth         = gg_max(3, BRANCH_DEPTH            + depth_level);
+  backfill_depth       = gg_max(2, BACKFILL_DEPTH    + depth_level);
+  backfill2_depth      = gg_max(1, BACKFILL2_DEPTH   + depth_level);
+  break_chain_depth    = gg_max(2, BREAK_CHAIN_DEPTH + depth_level);
   if (level >= 8)
-    owl_distrust_depth  = gg_max(1, (2 * OWL_DISTRUST_DEPTH + depth_level) / 
2);
-  else
-    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);
+    owl_distrust_depth = gg_max(1, (2 * OWL_DISTRUST_DEPTH + depth_level) / 2);
+  else 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);
 
-  /* Atari-atari depth levels are unchanged only between levels 7/8: */
-  if (level >= 8)
-    aa_depth            = gg_max(0, AA_DEPTH        + (level - 10));
+  /* Atari-atari depth levels are unchanged only between levels 7/8, 9/10: */
+  if (level >= 10)
+    aa_depth = gg_max(0, AA_DEPTH + (level - 10));
+  else if (level == 9)
+    aa_depth = gg_max(0, AA_DEPTH);
+  else if (level >= 7)
+    aa_depth = gg_max(0, AA_DEPTH -1);
   else
-    aa_depth            = gg_max(0, AA_DEPTH        + (level - 9));
+    aa_depth = gg_max(0, AA_DEPTH - (8 - level));
 
   /* Exceptions:
    * fourlib_depth: This is constant from levels 7 to 10.
-   * FIXME: ko_depth: jumps strangely at level 7.
-   * superstring_depth: set to 0 below level 10.
+   * superstring_depth: set to 0 below level 8.
    */
   if (level >= 10)
     ko_depth            = gg_max(1, KO_DEPTH + (level - 10));
-  else if (level != 7)
-    ko_depth            = gg_max(1, KO_DEPTH + (level - 9));
-  else /* level == 7 -- FIXME */ 
+  else if (level == 9)
+    ko_depth            = gg_max(1, KO_DEPTH);
+  else if (level >= 7)
+    ko_depth            = gg_max(1, KO_DEPTH - 1);
+  else
     ko_depth            = gg_max(1, KO_DEPTH + (level - 8));
 
   if (level >= 10)
@@ -717,12 +724,14 @@
   else
     fourlib_depth       = gg_max(1, FOURLIB_DEPTH + (level - 7));
 
-  if (level >= 10) {
-    superstring_depth   = gg_max(1, SUPERSTRING_DEPTH + (level - 10));
+  if (level >= 8)
+    superstring_depth = gg_max(1, SUPERSTRING_DEPTH);
+  else
+    superstring_depth = 0;
+
+  if (level >= 10)
     owl_node_limit      = OWL_NODE_LIMIT * pow(1.5, depth_level);
-  }
   else {
-    superstring_depth   = 0;
     owl_node_limit      = (OWL_NODE_LIMIT * node_limits[10 - level] /
                           node_limits[0]);
     owl_node_limit      = gg_max(20, owl_node_limit);





reply via email to

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