[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] problem with score feature of 3.2
From: |
bump |
Subject: |
Re: [gnugo-devel] problem with score feature of 3.2 |
Date: |
Fri, 21 May 2004 16:53:19 -0700 |
Adam wrote:
> I applied Gunnar's patch to my copy of 3.4 and added KM[0] to my 12 test
> cases, then I ran "gnugo --score finish -l file.sgf --quiet" on them. The
> patch fixed the integer result/non-integer komi problem. However, counting
> manually I found errors in 4 of the tests (hopefully I counted accurately!).
> Here are the four problem games:
The first two positions involve sekis. I looked at the
third. At the end of the game, the problem is that the
D2 stone is not considered ``captured territory''
because the status of its neighbor the A8 dragon is not
ALIVE. The position looks like this:
A B C D E F G H J
9 . . . . X . O O X 9
8 O O O O X X X O . 8
7 X O X O O X X X X 7
6 X X X X O O O X O 6
5 . . X . X X O O . 5
4 X . X X X O . . . 4
3 X X O O O . O . . 3
2 O X O X . . . . . 2
1 O O O . . . . . . 1
A B C D E F G H J
The A8 dragon has:
crude_status critical
owl_status unchecked
status unknown
safety alive
weakness 0.00
Evidently the owl code has not run. I propose the
following patch (which includes Gunnar's). According
to this patch, stones are captured territory if
they are dead and has a neighbor whose status is
unknown (because the owl code didn't run for them)
but whose weakness is small.
Dan
Index: engine/score.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/score.c,v
retrieving revision 1.23
diff -u -r1.23 score.c
--- engine/score.c 24 Jan 2004 04:04:56 -0000 1.23
+++ engine/score.c 21 May 2004 23:44:38 -0000
@@ -68,8 +68,11 @@
if (!ON_BOARD(ii))
continue;
- if (board[ii] && dragon[ii].status == CRITICAL)
+ if (board[ii] && dragon[ii].status == CRITICAL
+ && DRAGON2(ii).safety != INESSENTIAL) {
+ DEBUG(DEBUG_SCORING, "critical dragon found at %1m\n", ii);
critical_found = 1;
+ }
if (board[ii] == WHITE && !captured_territory(ii, color))
gb[ii] = 128;
else if (board[ii] == BLACK && !captured_territory(ii, color))
@@ -549,10 +552,11 @@
for (d = 0; d < DRAGON2(pos).neighbors; d++)
if (DRAGON(DRAGON2(pos).adjacent[d]).color == OTHER_COLOR(board[pos])
&& (DRAGON(DRAGON2(pos).adjacent[d]).status == ALIVE
- || (board[pos] != color
- && DRAGON(DRAGON2(pos).adjacent[d]).status == CRITICAL)))
+ || (DRAGON(DRAGON2(pos).adjacent[d]).status == UNKNOWN &&
+ dragon2[DRAGON2(pos).adjacent[d]].weakness < .1)
+ || (board[pos] != color
+ && DRAGON(DRAGON2(pos).adjacent[d]).status == CRITICAL)))
return 1;
-
return 0;
}