exact transposition table entries

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

zenpawn
Posts: 349
Joined: Sat Aug 06, 2016 8:31 pm
Location: United States

exact transposition table entries

Post by zenpawn »

My understanding is when an Exact type hash entry is found with adequate depth, it can be compared against beta to return a cutoff, and it can be compared with alpha to get a move and score. Shouldn't it also work to return alpha in the case that neither of those conditions is met? I tried this and it made my engine play much worse.
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: exact transposition table entries

Post by Dann Corbit »

zenpawn wrote:My understanding is when an Exact type hash entry is found with adequate depth, it can be compared against beta to return a cutoff, and it can be compared with alpha to get a move and score. Shouldn't it also work to return alpha in the case that neither of those conditions is met? I tried this and it made my engine play much worse.
If it hasn't met adequate depth, then you may be doing a zero ply search instead of what you requested. That unintentional pruning is rather savage, wouldn't you admit?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: exact transposition table entries

Post by Evert »

If you have an exact entry of sufficient depth, you should be able to return the score regardless of alpha and beta (modified for fail hard/fail soft).
Only in the case where the score is a bound do you need to compare against alpha and beta. If you do not have sufficient depth you do not return regardless of bounds (you need to search).
zenpawn
Posts: 349
Joined: Sat Aug 06, 2016 8:31 pm
Location: United States

Re: exact transposition table entries

Post by zenpawn »

Dann Corbit wrote: If it hasn't met adequate depth, then you may be doing a zero ply search instead of what you requested. That unintentional pruning is rather savage, wouldn't you admit?
I'm referring to the case where I have an Exact type entry with sufficient depth. When both score >= beta and score > alpha are not met, it would seem I should then be able to return alpha.
zenpawn
Posts: 349
Joined: Sat Aug 06, 2016 8:31 pm
Location: United States

Re: exact transposition table entries

Post by zenpawn »

Evert wrote:If you have an exact entry of sufficient depth, you should be able to return the score regardless of alpha and beta (modified for fail hard/fail soft).
Only in the case where the score is a bound do you need to compare against alpha and beta. If you do not have sufficient depth you do not return regardless of bounds (you need to search).
That's what I thought too. Since I use fail hard, I return beta if score >= beta, score if score > alpha, and to date have just fallen through and tried the move first otherwise. But, it occurred to me since it's an exact score of sufficient depth, I should know that it's already going to be worse than alpha and can save time by just returning alpha right there. Unfortunately, for some reason, this causes my engine to play much worse.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: exact transposition table entries

Post by bob »

zenpawn wrote:My understanding is when an Exact type hash entry is found with adequate depth, it can be compared against beta to return a cutoff, and it can be compared with alpha to get a move and score. Shouldn't it also work to return alpha in the case that neither of those conditions is met? I tried this and it made my engine play much worse.
Too complicated. When you get an EXACT match, you return that score as if the current search had been executed and that was the final best score. The cutoff stuff should happen after you return. EXACT means "no searching or decisions need to be made here, just return the score and we are done."
zenpawn
Posts: 349
Joined: Sat Aug 06, 2016 8:31 pm
Location: United States

Re: exact transposition table entries

Post by zenpawn »

bob wrote: Too complicated. When you get an EXACT match, you return that score as if the current search had been executed and that was the final best score. The cutoff stuff should happen after you return. EXACT means "no searching or decisions need to be made here, just return the score and we are done."
I'm using fail hard though, not fail soft.

Edit: Just tested this way and got the same results as my test of returning alpha should the other two conditions fail, so apparently it's equivalent. Not sure why it plays so much worse when the alpha case is not allowed to fall through.