gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] changed board_hash after reading


From: Gunnar Farnebäck
Subject: Re: [gnugo-devel] changed board_hash after reading
Date: Sat, 27 Aug 2005 23:04:14 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.3 (sparc-sun-solaris2.9) MULE/5.0 (SAKAKI)

Martin wrote:
> I do not really understand the komaster business, so I would
> appreciate some verification of these changes by someone who has more
> insight.

The general purpose is to make the reading reasonably focused with
respect to playing ko. Basically, if you have captured a ko out of
turn, you can't start capturing a new ko elsewhere until the first ko
is settled, simply because the opponent can use the first ko as a ko
threat. There is a lot of subtlety to the exact rules and there are no
guarantees that they are strictly correct, but they have been working
quite well.

The laborious way to really understand it is to temporarily remove it,
do tactical reading on some positions with many potential kos, and see
how the reading trees change when komaster is reintroduced.

> Regression breakage is
> arb:210         PASS D8 [D8]
> ninestones:570  FAIL A2 [A9|B10|D11|F11|J15|A16]
> 
> Reading nodes increase by 2.2% (!), changes to owl and connection nodes
> are below 0.1%. And of course, the assertions do not fire.

The increase in reading nodes is annoying, but certainly the current
code is wrong. I haven't tried to determine the correctness of this
patch yet, but it seems to me that the small patch below should be a
quick fix to evaluate the main problem. It's totally inappropriate as
a permanent solution of course, pointlessly slowing down the entire
board hash system. I'm running regressions for it now.

/Gunnar

Index: engine/board.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.111
diff -u -r1.111 board.c
--- engine/board.c      12 Jun 2005 09:34:13 -0000      1.111
+++ engine/board.c      27 Aug 2005 20:25:26 -0000
@@ -705,6 +705,9 @@
   undo_trymove();
   
   memcpy(&board_hash, &(board_hash_stack[stackp]), sizeof(board_hash));
+  hashdata_recalc(&board_hash, board, board_ko_pos);
+  hashdata_invert_komaster(&board_hash, komaster);
+  hashdata_invert_kom_pos(&board_hash, kom_pos);
 
   if (sgf_dumptree) {
     char buf[100];




reply via email to

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