Buckets for pawn hash?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: Buckets for pawn hash?

Post by syzygy »

bob wrote:
tpetzke wrote:I don't get a 99,5% hit rate even with more slots. Last time I measured I had something like 97% which went down to 93% when I included the kings into the hash.

http://macechess.blogspot.de/2013/07/po ... -pawn.html
Why would you include kings in a "pawn hash"???
Why ask the obvious?
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Buckets for pawn hash?

Post by tpetzke »

Why would you include kings in a "pawn hash"???
Because then I can hash in terms that are dependent on the king position too. If you look in my blog you find a comment from Don Daily that Komodo does/did it as well, so it is not as crazy as you think.
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Buckets for pawn hash?

Post by PK »

Why would you include kings in a "pawn hash"???
If pawn shield/pawn storm is evaluated separately from piece attacks on the king (which I know not to be the case in Crafty), then it can as well be hashed.

My engine goes a bit further, doing some additional evaluation of king's indian pawn chain, taking into account king's position - and I know that it is a slight gain, but only if this is hashed. Otherwhise would be too slow.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Buckets for pawn hash?

Post by bob »

syzygy wrote:
bob wrote:
tpetzke wrote:I don't get a 99,5% hit rate even with more slots. Last time I measured I had something like 97% which went down to 93% when I included the kings into the hash.

http://macechess.blogspot.de/2013/07/po ... -pawn.html
Why would you include kings in a "pawn hash"???
Why ask the obvious?
Because I can't think of a single reason???
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Buckets for pawn hash?

Post by PK »

As I said before, there's no reason to add pawn hash to Crafty's eval, but it can help in engines that use different approach to king safety. In Rodent pawn hash was useless until I started hashing king-related stuff.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Buckets for pawn hash?

Post by bob »

PK wrote:As I said before, there's no reason to add pawn hash to Crafty's eval, but it can help in engines that use different approach to king safety. In Rodent pawn hash was useless until I started hashing king-related stuff.
That was why I asked. I only consider pawns for one multiplier of king safety, and it is trivial to hash all potential castled king positions and store this without the king affecting the hash signature. All the other work to produce the other multiplier is dependent on pieces which can't be hashed unless they are folded into the hash signature. King positions basically multiple total pawn positions by a factor of 2^12, which reduces hash hits significantly, or increases the memory required for the "pawn" hash by that size.