More Crafty hash thoughts.

Discussion of chess software programming and technical issues.

Moderator: Ras

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

More Crafty hash thoughts.

Post by jwes »

I was testing my hash implementation and was surprised that more than 60% of hash hits caused cutoffs. Suspecting a bug, I put counters in Crafty, and found that for Crafty about 50% of hash hits cause cutoffs. Is this a known result?

I also put in counters on the case where the hash entry has an upper bound, but Crafty tries null move anyway. Null move caused a cutoff less than 2% of the time here, which I believe means it would be better not to do null move.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: More Crafty hash thoughts.

Post by Sven »

jwes wrote:I was testing my hash implementation and was surprised that more than 60% of hash hits caused cutoffs. Suspecting a bug, I put counters in Crafty, and found that for Crafty about 50% of hash hits cause cutoffs. Is this a known result?

I also put in counters on the case where the hash entry has an upper bound, but Crafty tries null move anyway. Null move caused a cutoff less than 2% of the time here, which I believe means it would be better not to do null move.
Doesn't Crafty have an "avoid null move" flag in the hash entry exactly for this case?

EDIT: Now I see that it is not part of the hash entry but is set under certain conditions when probing (see hash.c):

Code: Select all

 *  We also return an "avoid_null" status if the matched    *
 *  entry does not have enough draft to terminate the       *
 *  current search but does have enough draft to prove that *
 *  a null-move search would not fail high.  This avoids    *
 *  the null-move search overhead in positions where it is  *
 *  simply a waste of time to try it.                       *
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: More Crafty hash thoughts.

Post by bob »

jwes wrote:I was testing my hash implementation and was surprised that more than 60% of hash hits caused cutoffs. Suspecting a bug, I put counters in Crafty, and found that for Crafty about 50% of hash hits cause cutoffs. Is this a known result?

I also put in counters on the case where the hash entry has an upper bound, but Crafty tries null move anyway. Null move caused a cutoff less than 2% of the time here, which I believe means it would be better not to do null move.
Since only a modest percentage of positions are hash hits in the first place (signature match) the fact that half of them are beneficial is not a surprise.

I didn't follow your last question. Crafty already has the "avoid null move" trick implemented. Or do you mean making the test whether the draft is useful or not???
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: More Crafty hash thoughts.

Post by bob »

Sven Schüle wrote:
jwes wrote:I was testing my hash implementation and was surprised that more than 60% of hash hits caused cutoffs. Suspecting a bug, I put counters in Crafty, and found that for Crafty about 50% of hash hits cause cutoffs. Is this a known result?

I also put in counters on the case where the hash entry has an upper bound, but Crafty tries null move anyway. Null move caused a cutoff less than 2% of the time here, which I believe means it would be better not to do null move.
Doesn't Crafty have an "avoid null move" flag in the hash entry exactly for this case?

EDIT: Now I see that it is not part of the hash entry but is set under certain conditions when probing (see hash.c):

Code: Select all

 *  We also return an "avoid_null" status if the matched    *
 *  entry does not have enough draft to terminate the       *
 *  current search but does have enough draft to prove that *
 *  a null-move search would not fail high.  This avoids    *
 *  the null-move search overhead in positions where it is  *
 *  simply a waste of time to try it.                       *
Yes it does, but it does limit it to the cases where the hash entry draft is >= the depth the null-move search would use. I sort of assume maybe he is talking about removing this restriction completely?
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: More Crafty hash thoughts.

Post by jwes »

bob wrote:
jwes wrote:I was testing my hash implementation and was surprised that more than 60% of hash hits caused cutoffs. Suspecting a bug, I put counters in Crafty, and found that for Crafty about 50% of hash hits cause cutoffs. Is this a known result?

I also put in counters on the case where the hash entry has an upper bound, but Crafty tries null move anyway. Null move caused a cutoff less than 2% of the time here, which I believe means it would be better not to do null move.
Since only a modest percentage of positions are hash hits in the first place (signature match) the fact that half of them are beneficial is not a surprise.

I didn't follow your last question. Crafty already has the "avoid null move" trick implemented. Or do you mean making the test whether the draft is useful or not???
Yes. I put a flag in the else of:
if (depth - null_depth - depth / null_divisor - 1 <= draft && val < beta)
and measured how often null move gave cutoffs when the flag is set.