Computer Chess Club Archives


Search

Terms

Messages

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

Author: Bo Persson

Date: 03:49:49 01/03/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.

You can gain some additional bits by not storing the entire hash key. If you,
for example, always have at least 2^16 entries in your hash table and use the
lower 16 bits as the address, you then know that these bits always match so you
only have to store the remaning 48 bits in the hash entry.


Bo Persson



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.