Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Binary Book Creation

Author: Gian-Carlo Pascutto

Date: 10:20:30 06/19/00

Go up one level in this thread


On June 19, 2000 at 11:54:05, Adrien Regimbald wrote:

>Hrm.. I call my movegen inside of move generation too..

Duh ;)

>I don't think this is
>your problem - even if I were to call my movegen 10 times/move, it'd still be a
>lot faster than what you're getting..  maybe I'll have a peek at your book code
>and see if anything funky is immediately obvious.. :P

I call movegen for every move in the game, then again for each move for
that move (disambiguation in the convertor - sp?), and if the move is a check
again for each move for each move (check or mate?).

So I'm really calling movegen at least 40-50 times per move in the game.
If there are some checks this can go up to about 1200 times per move.

With movegen being quite slow in Faile/Sjeng, the penalty is enormous.

The reason why it's like that is that it was quick and straightforward
to code and I wanted to test the book ASAP. I don't mind having a bookgen
running overnight myself, so I didn't care either. Of course, if I want to
distribute this thingy to anybody I'd better fix that.

>Hmm .. you were mentioning to me that you thought my scheme looked okay except
>for the collisions .. well, I'll look into the possibility of doing some
>collision resolution later today ;)

I think I might go for a hybrid solution. Part of the slowness is that the
GDBM database can get large as every move is added, even if it is played only
once.

Now, if we were to use a small hashed keycache, say 4 or 8Megs, and store the
keys in there. We keep doing this untill we need to store a key in a slot
thats already filled (not a strict collision, as this can happen with identical
keys too).
At this point, this move has been played before, or (10-15% chance)
we have a real collision. Either way we store the position in the GDBM database.

The net result is that most of the positions only end up in the memory, and
only the ones that were played twice or more end up in the database. Except
for the collisions, but there's not that much of those, and we can easily
weed those out in the GDBM database.

--
GCP



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.