Computer Chess Club Archives




Subject: Re: What approach do you use to handle castling/en passant for repetition?

Author: Robert Hyatt

Date: 19:04:05 02/28/00

Go up one level in this thread

On February 28, 2000 at 20:28:56, Bruce Moreland wrote:

>On February 28, 2000 at 17:04:13, William Bryant wrote:
>>I am curious,
>>do you hash a different constant for each of the 16 possible ep squares, or
>>simply a single constant if ep is possible.
>>I have sixteen different values that are XOR'ed into the hash signature
>>depending on which square is the ep square.
>>It is intersting that Bruce made a comment about this a while back.  He noted
>>that the same opening position reached by a different order of moves will
>>produce a different hash signature doing ep squares in this way.  Therefore it
>>does create a degree of inefficiency because (except for the ep move) the rest
>>of the position may have already been evaluated and in the hash table.
>If you hash in en-passant square mindlessly you get a surprising amount of hash
>1. e4 e5 2. c4 and 1. c4 e5 2. e4 produce the same position, and an en-passant
>capture is not possible in either.  Yet I bet that some people hash in the
>d-file code in the first case and the e-file code in the second case.
>I found that it made more sense to check for an adjacent pawn.  In that case the
>en-passant capture is at least pseudo-legal.

This is what I do.  I have even seen "EPD" records with an en passant target
set simply because the last move was a double-move for a pawn.  Even though
no possible EP capture was possible (this used to break my code, in fact, but
now I screen this out as I set up the 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.