Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash table allocation

Author: Ricardo Gibert

Date: 16:05:44 08/26/03

Go up one level in this thread


On August 26, 2003 at 18:26:41, Dieter Buerssner wrote:

>On August 26, 2003 at 18:03:30, Gerd Isenberg wrote:
>
>>oups, sorry for my awkwardness.
>
>Not at all. I really meant it. Perhaps my smiley was wrong.
>
>>May be you consider this method inferior.
>
>No. The only drawback, it will not work on platforms, that don't support 64-bit
>ints. The modulo method will even work on old 16-bit DOS compilers (I use 2
>seperate unsigned longs for hash key manipulation by default, same for the few
>bitboards I use. The multiplication method is of course also possible by
>explicit coding of the multiplication - but that will be messy).
>
>>With modulo all 32-bits of the extracted hashkey have influence on the index.
>>With multiply some least significant bits in hashkey are not relevant. No idea
>>what does it mean for a "almost uniformly distribution".
>
>It won't have an influence. The indices will be equally well distributed, when
>you start with slightly decent random values for creating the key.


In general, this technique is sensitive to the relative sizes of the truncated
hash key and the number of entries. If they are too close, some of the indices
could occur with as much as twice the frequency of some others. In this case,
using modulo divsion would work better. For TT's it should be fine until the
number of entries gets into the billions. That's still a ways off, but not so
far a ways off that it can be forgotten about.


>
>>>One should perhaps check the assembler output, and might need to add a cast to
>>>convince the compiler to produce good code (so that it sees, that really that
>>>32*32-bit -> 64-bit multiplication is needed).
>>
>>Yes - index directly in edx.
>
>Whit Gcc, it produced that shift at the end sometimes (instead of directly using
>edx). With MSVC, the problem seemed rather to convince it, to not use some
>internal library call for 64*64-bit multiplication.
>
>Regards,
>Dieter



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.