gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] engine reset?


From: Kenneth Owen Stanley
Subject: [gnugo-devel] engine reset?
Date: Sun, 9 Nov 2003 16:33:19 -0600 (CST)

I have been using the GNUGo 3.2 libraries inside of my own
machine learning application and training against
GNUGo.  For this project, many many games must
be played against gnugo in one run.

I have noticed that gnugo does not always play the
same after calling gnugo_clear_board.

For example, in a 5x5 game that starts off with X passing, 
gnugo should play, and sometimes does:

   A B C D E
 5 . . . . . 5
 4 . + . + . 4
 3 . . O . . 3
 2 . + . + . 2     WHITE has captured 0 stones
 1 . . . . . 1     BLACK has captured 0 stones
   A B C D E


However, sometimes gnugo will start by passing
as well, which doesn't make sense.  It seems
there is something wrong with the way the
working memory is allocated after a prior game has
been completed.  It seems to affect future games.

I have found that calling init_gnugo(8) 
between games fixes this problem: reiniting
the engine causes it to always play the same.

However, init_gnugo is clearly not meant to
be called multiple times.  If it is called
several hundred times, eventually there
is a segmentations fault.  If you backtrace
in gdb to see what happened, you see:

#0  0x403d3e90 in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x40575a8b in free () from /lib/libc.so.6
#2  0x0810eda9 in hashtable_new (tablesize=324301, num_nodes=216201,
    num_results=302681) at cache.c:260
#3  0x0810f38b in reading_cache_init (bytes=8388608) at cache.c:614
#4  0x080e5a6a in init_gnugo (memory=8) at interface.c:41

In other words, it looks like calling init_gnugo multiple
times results in some kind of memory leak.  I have a
feeling the function was not meant for this kind of use.

But if calling gnugo_clear_board isn't sufficient to
ensure consistent play, and init_gnugo can't be
used multiple times, what can be used?  Is there
some way to reinitialize so that play is consistent?

Thanks for any advice,

Kenneth Stanley
address@hidden





reply via email to

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