Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hashing

Author: Sune Fischer

Date: 17:46:21 04/04/03

Go up one level in this thread


On April 04, 2003 at 20:23:44, Russell Reagan wrote:

>On April 04, 2003 at 20:02:16, Sune Fischer wrote:
>
>>A movelist hash won't work at all.
>>Suppose you have two positions with identical movelists, in one position there
>>is e.g. a trapped knight, in the other position with the same movelist there is
>>no knight.
>
>If there is no knight, the lower 32-bits of the hash key will be different. The
>move list hash is only the upper 32-bits. The lower 32-bits is a "normal" hash
>key (but it's only the board data, no side to move, no castling rights, no ep,
>etc.). I think that they should complement each other correctly.
>
>For instance, if the board arrangement is the same, but the side to move is
>different, the move list hash key will be different, causing the 64-bit key to
>be different. If the most lists are the same, but one side has an extra piece
>that can't move, then the board hash key will be different.

It's a bad idea, using the movelist doesn't describe the position well enough,
it's too ambigious. Besides, the normal hashkey you can compute incrementally
very cheap, if you want a movelist key you have to generate it from scratch all
the time, AFAIK.

>Regarding castling rights and en passant squares, as far as I can tell, they
>should only modify the hash key when they matter. IE if white plays 1. e4, the
>fact that e3 is technically an en passant capture square is irrelevant and it
>shouldn't be hashed as such. Since there is no ep capture, the move list hash
>won't be stored as the same position as if there was a valid ep capture. So, if
>two positions have an identical board arrangement, and one has a valid ep
>capture (different paths led to this position), then they will be hashed
>differently since they move list hash key will be different.
>
>But I may well be overlooking something...

If you hash the ep square only when the capture is possible, you have solved the
problem, you don't need a movelist hash to tell them apart.

Like Dieter said, there are only two real problems with hashing, the repetition
and 50 move rule.
That's because they depend on the path and not only on the position.
I have no fix for this, I'm not sure there is a solution (one that is
efficient), but it doesn't seem to destabilize the search very much so the
effect must be small.

-S.



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.