Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: regular hash key & pawn hash key together--good idea?

Author: Robert Hyatt

Date: 19:51:14 09/16/99

Go up one level in this thread


On September 16, 1999 at 20:36:36, Andrew Dados wrote:

>On September 16, 1999 at 20:24:45, Robert Hyatt wrote:
>
>>On September 16, 1999 at 12:38:41, Andrew Dados wrote:
>>
>>>On September 16, 1999 at 12:19:24, Tom Kerrigan wrote:
>>>
>>>>The overhead of separating 24 bits is trivial:
>>>>
>>>>(hash_key >> 40)
>>>>
>>>>-Tom
>>>
>>> Well.. you have to detect pawn moves/captures exactly as in 'normal, 2-key
>>>way', separate that, xor, mask topmost bits and finally combine back. No real
>>>gain when you think of that. (otherwise xor would screw both 'parts' of key).
>>>But that of course only for xor way...
>>> -Andrew-
>>
>>
>>You probably wouldn't have to do this...  you would just put bits in the right
>>part of each of the random numbers you xor in/out.  IE pawns only have bits on
>>the right end, pieces only on the left.. then you would ignore which is which.
>
> If I did that, I would end up with a pawn signature dependant on what pieces
>was moved and where...  because even xoring with all zeroes would change pawn
>signature part bits (talking 24 pawn bits here).
>


No...  if you xor anything with zero you get the original value again.  If you
set the random numbers so that pieces only have random numbers in the right 32
bits, and pawns only have bits in the left 32 bits, they would _never_ affect
each other.

This would be poor for random addressing however... it would probably be
necessary to take the right and left 32 bits, xor them together, and use that
to produce the random probe address.

But keeping the pawns in 1/2 of the signature and piece in the other half
would work perfectly in crafty as is, if you just AND off the random numbers
as they are generated...




>>
>>However, on a PC, if I did this, I would just do two 32 bit values separately
>>to avoid the overhead...
>
> That's only way to make this efficiency idea efficient, imo (or 64/32 separate
>signatures, but then 96 bit divide (or modulo) operation is needed - so I'll
>wait for merced with that :)


we don't do divides.  we do ANDs to extract the rightmost N bits for the probe
address.  Divide is evil...



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.