Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Organizing the Opening Book -- File Format

Author: John Stanback

Date: 12:21:39 06/20/00

Go up one level in this thread


On June 20, 2000 at 08:22:20, William Bryant wrote:

>Thank you Andrew.
>
>I had actually saved this post but it is nice to have it again.
>
>Part of my question involves the structure of the opening book file
>to allow rapid indexing into all the position records.
>
>What binary format do you use, and how do you efficiently index into the
>file to find all the moves once you have established hash records for
>them.  Theoretically, the moves for a given position will be spread out
>over the entire file if organized by hash signature.
>
>Thanks again.
>
>William
>wbryant@ix.netcom.com

In Zarkov, I store the positions in a binary file sorted by the
hash signature for each record.  I have 48 bits of hash for each position
with the high order 16 bits depending only on the piece locations for the
side on move and the low order 32 bits depending on piece locations for
both sides. The positions are sorted from largest 48 bit hash to smallest.

Before going thru each possible move from the current position, I
read all the positions with the correct high order 16 bits of hash
into memory.  Since the top 16 bits depend only on the piece locations
for the side on move AFTER a move is made from the current position,
the memory array will contain any potential book moves from this position.
Then I make each of the moves and do a binary search (in memory) to see
if the position is in the book.  This method requires only one disk
access and the binary book file can be huge.

John




This page took 0 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.