Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: I need your opinion about this hash entry structure

Author: Robert Hyatt

Date: 20:25:11 01/02/04

Go up one level in this thread


On January 02, 2004 at 21:52:56, Federico Corigliano wrote:

>My current hash entry uses a struct and needs 40 bits. I calculated that I can
>optimize the size using two unsigned 64 bits integers with the following
>distribution:
>
>struct hashEntry {
>    uint64  a;
>    uint64  b;
>};
>
>Name       Bits    Description                       Access
>--------------------------------------------------------------------------------
>Hash key   64      Hash key signature                (entry.a)
>Depth      10      Position's search depth*          (entry.b >> 54)
>Score      16      Position's score (-32767...32767) (entry.b >> 38) & 0xffff
>Move       32      Position's best move              (entry.b >> 6) & 0xffffffff
>Age        3       Position's age                    (entry.b >> 3) & 0x7
>Threat     1       Threat's extension flag           (entry.b >> 2) & 0x1
>Type       2       Upper, lower, exact or none       (entry.b & 0x3)
>---------------
>Total:     128 (16 bytes)
>
>* I use a value of 16 for a full ply, so the max search depth is 63, pretty
>sufficient.
>
>There is a high possibility of errors, because I don't implemented yet.
>I need your opinion about it, and if is needed to optimize it, how to do it.
>
>Thanks in advance
>Federico

Looks very similar to what I do in Crafty.  I shrink "move" and expand "depth"
as I use ply=60, not 16.


*     bits     name  SL  description                                           *
*       3       age  61  search id to identify old trans/ref entries.          *
*       2      type  59  0->value is worthless; 1-> value represents a fail-   *
*                        low bound; 2-> value represents a fail-high bound;    *
*                        3-> value is an exact score.                          *
*       1    threat  58  threat extension flag, 1 -> extend this position.     *
*       5    unused  53  unused at present time.                               *
*      21      move  32  best move from the current position, according to the *
*                        search at the time this position was stored.          *
*      15     draft  17  the depth of the search below this position, which is *
*                        used to see if we can use this entry at the current   *
*                        position.  note that this is in units of 1/60th of a  *
*                        ply.                                                  *
*      17     value   0  unsigned integer value of this position + 65536.      *
*                        this might be a good score or search bound.           *
*                                                                              *
*      64       key   0  64 bit hash signature, used to verify that this entry *
*                        goes with the current board position.                 *




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.