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.
More Crafty hash thoughts.
Moderator: Ras
-
Sven
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: More Crafty hash thoughts.
Doesn't Crafty have an "avoid null move" flag in the hash entry exactly for this case?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.
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.
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.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.
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.
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?Sven Schüle wrote:Doesn't Crafty have an "avoid null move" flag in the hash entry exactly for this case?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.
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. *
-
jwes
- Posts: 778
- Joined: Sat Jul 01, 2006 7:11 am
Re: More Crafty hash thoughts.
Yes. I put a flag in the else of:bob wrote: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.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.
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???
if (depth - null_depth - depth / null_divisor - 1 <= draft && val < beta)
and measured how often null move gave cutoffs when the flag is set.