Mate score from the transposition table

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
Evert
Posts: 2923
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Mate score from the transposition table

Post by Evert » Sat Oct 25, 2014 8:56 pm

Quick question.

I probe the transposition table, and get an entry back. Sadly, the depth is lower than the remaining search depth, so I can't take the cut-off. I salvage what I can from the entry (whatever move it says I should search first, maybe I do something with the information that it was an ALL node last time it was searched, maybe I disable the NULL move) and do a normal search.

Now suppose that the score that was returned from the table is a mate score. Can I simply ignore the stored depth in that case? I mean, it's not like a remaining depth of 10 ever makes sense for a position that is mate-in-four. A different way of asking the same question is: can I simply store a mate position with "infinite" remaining depth?

Rein Halbersma
Posts: 685
Joined: Tue May 22, 2007 9:13 am

Re: Mate score from the transposition table

Post by Rein Halbersma » Sat Oct 25, 2014 9:21 pm

Evert wrote:Quick question.

I probe the transposition table, and get an entry back. Sadly, the depth is lower than the remaining search depth, so I can't take the cut-off. I salvage what I can from the entry (whatever move it says I should search first, maybe I do something with the information that it was an ALL node last time it was searched, maybe I disable the NULL move) and do a normal search.

Now suppose that the score that was returned from the table is a mate score. Can I simply ignore the stored depth in that case? I mean, it's not like a remaining depth of 10 ever makes sense for a position that is mate-in-four. A different way of asking the same question is: can I simply store a mate position with "infinite" remaining depth?
It should always be save (not cost game points), since mate is not a heuristic score that could improve at greater depth. If your mate scores are depth encoded (M1 > M2 etc.), then it should even be efficient (find the fastest win) because if you already know you are winning, a slower win will fall outside the search window. Grafting issues ignored of course.

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Mate score from the transposition table

Post by hgm » Sat Oct 25, 2014 10:48 pm

You should be careful with that. Matescores can improve with search depth, due to grafting and reductions. Even when you search 11 ply there is no guarantee you would have seen ever mate faster than mate in 6, and it can very well be that the mate in 4 is only found at 15 ply, if it starts with 3 quiet (heavily reduced) moves. So the M6 score at 11 ply was not valid to infinite depth.

It will of course be a valid lower bound to the score, so if you could achieve a cutoff with it, you would not have to worry about depth.

Be careful to not upgrade the depth in what you store, but take the decision when you probe. Or it would wreck your depth-preferred replacement, which would start to protect relatively easy to obtain search results at the expense of very deep searches.

bob
Posts: 20555
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Mate score from the transposition table

Post by bob » Sun Oct 26, 2014 10:56 pm

Evert wrote:Quick question.

I probe the transposition table, and get an entry back. Sadly, the depth is lower than the remaining search depth, so I can't take the cut-off. I salvage what I can from the entry (whatever move it says I should search first, maybe I do something with the information that it was an ALL node last time it was searched, maybe I disable the NULL move) and do a normal search.

Now suppose that the score that was returned from the table is a mate score. Can I simply ignore the stored depth in that case? I mean, it's not like a remaining depth of 10 ever makes sense for a position that is mate-in-four. A different way of asking the same question is: can I simply store a mate position with "infinite" remaining depth?
A mate ought to be good, period. Depth of the entry should not matter. The only issue is that this will not always let you find the shortest mate due to the way extensions work.

Post Reply