Page 1 of 1

Hash Key

PostPosted: 02 Mar 2008, 21:15
by Mateusz Luksik
Hi,
When should be updated next keys?

1. pawnKey after every pawn move and promotion and pawn was captured?
2. materialKey after every change of material, including pawns??

Re: Hash Key

PostPosted: 03 Mar 2008, 09:41
by Harald Johnsen
What do you have in your hask key ?

- pieces*squares signatures
- pawn*square signatures
- castling right
- en passant flag
- side to move

Obviously your transposition table key also contains the pawn key.
You need to update the parts of the key whenever they change.

HJ.

Re: Hash Key

PostPosted: 03 Mar 2008, 10:43
by Mateusz Luksik
1.
keyMaterial
- pieces*squares signatures

keyPawn
- pawn*square signatures


- side to move ... I don't have it.

Re: Hash Key

PostPosted: 03 Mar 2008, 20:09
by bob
Mateusz Luksik wrote:1.
keyMaterial
- pieces*squares signatures

keyPawn
- pawn*square signatures


- side to move ... I don't have it.


You are headed for disaster then. lots of positions depend on side to move, particularly in endgames, but even in the middlegame, where with white to move, white can force mate, but with black to move, it is an equal position. Your scores, bounds, cutoffs, etc are going to be broken without wtm included.

normal hash signature is updated after every move is made, pawn hash signature is updated only after a pawn move or a pawn is captured or promoted.

Re: Hash Key

PostPosted: 03 Mar 2008, 22:19
by Mateusz Luksik
"normal hash signature is updated after every move is made"
I did this with side to move, ep, castling etc...

I was asking about pawn hash and I get good answer.
"pawn hash signature is updated only after a pawn move or a pawn is captured or promoted"

I still don't have answer on material hash. I think this signature should be updated after capture or promote, yes?

Re: Hash Key

PostPosted: 04 Mar 2008, 01:56
by bob
Mateusz Luksik wrote:"normal hash signature is updated after every move is made"
I did this with side to move, ep, castling etc...

I was asking about pawn hash and I get good answer.
"pawn hash signature is updated only after a pawn move or a pawn is captured or promoted"

I still don't have answer on material hash. I think this signature should be updated after capture or promote, yes?


I don't use such a thing, but if it is a hash that is based only on the pieces on the board, and not the squares they are on, then yes, anytime material changes the hash should be updated. On a capture, or on a promotion.