gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Miscounted game


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Miscounted game
Date: Mon, 03 Mar 2003 21:41:21 +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)

Dan wrote:
> The game record gnugo-3.3.16-ccwills-200303030550.sgf gives B a 49.5
> point win. A comment at the end of the sgf file gives B an 8.5 point
> win.
> 
> But according to my count at the end of the game W is ahead by 
> 3.5 points.
> 
> What happened?

A key to understanding what happened is to notice that the game ended
in a hot position:

   A B C D E F G H J K L M N O P Q R S T
19 . . . O O O X . . . . . . . . O O X . 19
18 O O O . O X . X O . . . . . . O X . X 18
17 O X X O O X X O O O . . . . O O X . . 17
16 O X X X X O O X . + . . . O O X . . . 16
15 O X . X . X O O . O . O . . O X . . . 15
14 X . . X . X O . . . . . . O X X . . . 14
13 X X X X X X X O . O . X O O X . . . . 13
12 . . . X . X O O . . . O X O X X . . . 12
11 . . X O X X X O . X . O X O O X X X . 11     WHITE has captured 5 stones
10 . . X O O X X O . O . O X X O O X . X 10     BLACK has captured 9 stones
 9 . . X O . O O O O X O O O X X X X X O 9
 8 X X X O O O O X X X X O X X X X O O O 8
 7 X O O X X X X . . X X X O X O O . . . 7
 6 X O X X . X . . . . X O O O O . O . . 6
 5 O O O X X X O . . X X X O X X O O . . 5
 4 . O O X X O . O . X O O O X . X O . . 4
 3 O . . O X X O . . X O O X . . X X O . 3
 2 O O O O X O X . O X X X . X . X O O . 2
 1 . . . O X . . . . . . . . . X O O . . 1
   A B C D E F G H J K L M N O P Q R S T

Black has a combination attack at L10. Running the aftermath scoring
we get

244 black (X) move L10
245 white (O) move L13
246 black (X) move L11
247 white (O) move M14
248 black (X) move J10
249 white (O) move L12
250 black (X) move J11
251 white (O) move J12
252 black (X) move K10
253 white (O) move K12
254 black (X) move : PASS!
255 white (O) move : PASS!
Black wins by 8.5 points
Result from file: 49.5
GNU Go result and result from file are different

so the 8.5 points relate to the position (notice that you can use -o
with the --score option)

   A B C D E F G H J K L M N O P Q R S T
19 . . . O O O X . . . . . . . . O O X . 19
18 O O O . O X . X O . . . . . . O X . X 18
17 O X X O O X X O O O . . . . O O X . . 17
16 O X X X X O O X . + . . . O O X . . . 16
15 O X . X . X O O . O . O . . O X . . . 15
14 X . . X . X O . . . . O . O X X . . . 14
13 X X X X X X X O . O O . O O X . . . . 13
12 . . . X . X O O O O O O X O X X . . . 12
11 . . X O X X X O X X X O X O O X X X . 11     WHITE has captured 1 stones
10 . . X O O X X O X X X O X X O O X . X 10     BLACK has captured 1 stones
 9 . . X O . O O O O X O O O X X X X X O 9
 8 X X X O O O O X X X X O X X X X O O O 8
 7 X O O X X X X . . X X X O X O O . . . 7
 6 X O X X . X . . . . X O O O O . O . . 6
 5 O O O X X X O . . X X X O X X O O . . 5
 4 . O O X X O . O . X O O O X . X O . . 4
 3 O . . O X X O . . X O O X . . X X O . 3
 2 O O O O X O X . O X X X . X . X O O . 2
 1 . . . O X . . . . . . . . . X O O . . 1
   A B C D E F G H J K L M N O P Q R S T

The 49.5 points on the server come from the fact that GNU Go marked
K10 as dead (since it was captured while finishing the game), causing
the entire upper side to count as dame.

At another level the problem is that GNU Go finds the L10 combination
attack as black but not as white. The move is generated by
find_double_threats() in combination.c, which should be modified to
also find defenses against such attacks.

Furthermore the atari_atari code should find this attack. Then we
would automatically get both attack and defense moves.

- improved output files from scoring mode
- traces added to find_double_threats()
- new test case

/Gunnar

Index: engine/combination.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
retrieving revision 1.44
diff -u -r1.44 combination.c
--- engine/combination.c        9 Feb 2003 15:29:10 -0000       1.44
+++ engine/combination.c        3 Mar 2003 20:36:34 -0000
@@ -136,7 +136,9 @@
            if (board[a_threatened_groups[k]] == EMPTY
                || board[a_threatened_groups[l]] == EMPTY) {
              if (!attack(ii, NULL)) {
-               add_either_move(ii, ATTACK_STRING, a_threatened_groups[k], 
+               TRACE("Double threat at %1m, either %1m or %1m attacked.\n",
+                     ii, a_threatened_groups[k], a_threatened_groups[l]);
+               add_either_move(ii, ATTACK_STRING, a_threatened_groups[k],
                                ATTACK_STRING, a_threatened_groups[l]);
                remove_attack_threat_move(ii, a_threatened_groups[k]);
                remove_attack_threat_move(ii, a_threatened_groups[l]);
@@ -144,7 +146,9 @@
            }
            else if (!defend_both(a_threatened_groups[k],
                                  a_threatened_groups[l])) {
-             add_either_move(ii, ATTACK_STRING, a_threatened_groups[k], 
+             TRACE("Double threat at %1m, either %1m or %1m attacked.\n",
+                   ii, a_threatened_groups[k], a_threatened_groups[l]);
+             add_either_move(ii, ATTACK_STRING, a_threatened_groups[k],
                              ATTACK_STRING, a_threatened_groups[l]);
              remove_attack_threat_move(ii, a_threatened_groups[k]);
              remove_attack_threat_move(ii, a_threatened_groups[l]);
Index: interface/play_solo.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_solo.c,v
retrieving revision 1.24
diff -u -r1.24 play_solo.c
--- interface/play_solo.c       18 Jan 2003 03:05:31 -0000      1.24
+++ interface/play_solo.c       3 Mar 2003 20:36:55 -0000
@@ -200,8 +200,16 @@
   SGFTree score_tree;
   
   sgftree_clear(&score_tree);
-  sgftreeCreateHeaderNode(&score_tree, board_size, komi);
+  /* Modify komi to compensate for captured stones. We start at a
+   * setup position and since there is no standard sgf property to
+   * tell the number of captured stones, a modified komi is the best
+   * available solution.
+   */
+  sgftreeCreateHeaderNode(&score_tree, board_size,
+                         komi + black_captured - white_captured);
   sgffile_printboard(&score_tree);
+  sgfAddProperty(score_tree.lastnode, "PL",
+                gameinfo->to_move == WHITE ? "W" : "B");  
   
   next = gameinfo->to_move;
   doing_scoring = 1;
Index: regression/atari_atari.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/atari_atari.tst,v
retrieving revision 1.30
diff -u -r1.30 atari_atari.tst
--- regression/atari_atari.tst  3 Mar 2003 04:30:50 -0000       1.30
+++ regression/atari_atari.tst  3 Mar 2003 20:37:16 -0000
@@ -91,3 +91,7 @@
 loadsgf games/nngs/leftd-gnugo-3.3.16-200302252226.sgf -L 256
 21 combination_attack black
 #? [Q9|N13|O13]*
+
+loadsgf games/nngs/gnugo-3.3.16-ccwills-200303030550.sgf
+22 combination_attack black
+#? [L10]




reply via email to

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