Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Efficient buffering

Author: Robert Hyatt

Date: 21:05:26 03/08/01

Go up one level in this thread


On March 08, 2001 at 19:44:58, Andrew Dados wrote:

>On March 08, 2001 at 15:23:45, Robert Hyatt wrote:
>
>>On March 08, 2001 at 11:31:32, Peter Fendrich wrote:
>>
>>>I'm completly reorganising my book and also trying to speed it up.
>>>
>>>Using the fread(buf,....) how can I find out the most
>>>efficient buffer size to use?
>>>
>>>Currently I'm using an index, that I'm maintaining, to find a place
>>>somewhere "near" in front of the searched book move where I will start and
>>>read forward in sequence until the right move is found.
>>>
>>>//Peter
>>
>>
>>If you want to go fast, I can suggest the approach I use.  My 64 bit hash key
>>is used to produce book keys, but a book position uses the leftmost 16 bits
>>of the _parent_ position, and the rightmost 48 bits of the resulting position
>>after playing the "book move".  That much is easy.  Now sort all these keys.
>>That will put all the book moves with the same "parent 16 bits" together.
>>
>>I then store a big index on the front of the book file, at present 32768
>>indices, with each index pointing to the first move in the book with the
>>same common parent bits.
>>
>>The benefit is that if you read in a complete "cluster" (all positions with
>>the same 16 parent bits) then you get _all_ the possible book moves from this
>>position (plus other positions since other parent positions will have the same
>>16 upper bits of course).  But since it takes _one_ I/O you are done.  Now you
>>just search for the right 64 bit key and if you find it you know that move is
>>a book move...
>
>I have to admit I never understood that. What if your 'board parent position' is
>different from 'book parent position' due to transposition?


Then I miss that transposition.  But I also miss the ugly transposition that
occurs after e4 e5 Bb5 a6 Nf3

you _might_ be tempted to play Nc6 as that transposes back into a known book
line.  I would personally play axb5 myself and chalk up a win.  :)

Crafty will usually find a reasonable move where it misses the transposition,
and then transpose back into the book the _next_ move usually...



>
>I.e. on board you got 1. d4 c6 . Now both positions  2. e4 and 2. c4 can be
>found in the book but from different parents - so they're not in same cluster.
>Now suppose craftys book does not have such a parent (1. d4 c6) but has entries
>for both slav and caro-cann defense. How does it choose a book move (and tell
>that 2. e4 is still book position)? Or does it do many I/O in that case?
>
>-Andrew-
>
>>
>>fast, easy, efficient.



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.