Mate scores from IID

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
ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

Mate scores from IID

Post by ZirconiumX » Tue Aug 16, 2016 6:20 am

I was looking through the Stockfish source code, and noticed that it simply discards the search result. Which, to be fair, seems to be the common thing to do.

But say you get a mate score from IID. Since you're searching with the same window, the score should still be valid, right? So wouldn't it make sense to simply cutoff from this instead of going for a full depth search?
Some believe in the almighty dollar.

I believe in the almighty printf statement.

Dann Corbit
Posts: 10101
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Mate scores from IID

Post by Dann Corbit » Tue Aug 16, 2016 7:04 am

ZirconiumX wrote:I was looking through the Stockfish source code, and noticed that it simply discards the search result. Which, to be fair, seems to be the common thing to do.

But say you get a mate score from IID. Since you're searching with the same window, the score should still be valid, right? So wouldn't it make sense to simply cutoff from this instead of going for a full depth search?
It's already in the hash table. I guess the real search will find it in a snap
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
hgm
Posts: 23714
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Mate scores from IID

Post by hgm » Tue Aug 16, 2016 7:19 am

But the IID result will not have enough depth to satisfy the real search. Unless you correct the draft of mate scores you are certain of to infinite. And you should do that on probing when you use the draft for a depth-preferred replacement scheme, or the whole table would be poisoned with mate scores.

But it should be safe to correct the draft of a mate-in-N score to infinity when it originally was >= 2*N-1, before you compare it with the requested depth.

ZirconiumX
Posts: 1327
Joined: Sun Jul 17, 2011 9:14 am

Re: Mate scores from IID

Post by ZirconiumX » Tue Aug 16, 2016 7:36 am

Dann Corbit wrote:
ZirconiumX wrote:I was looking through the Stockfish source code, and noticed that it simply discards the search result. Which, to be fair, seems to be the common thing to do.

But say you get a mate score from IID. Since you're searching with the same window, the score should still be valid, right? So wouldn't it make sense to simply cutoff from this instead of going for a full depth search?
It's already in the hash table. I guess the real search will find it in a snap
Perhaps so, but the cutoff will still save effort of things like evaluations, pruning and search stack setup. It probably won't save much effort, but it should still be worth something.
Some believe in the almighty dollar.

I believe in the almighty printf statement.

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

Re: Mate scores from IID

Post by hgm » Tue Aug 16, 2016 7:51 am

The IID search should have already done these things, or you would also waste that effort every time IID does not return a mate score.

jdart
Posts: 3824
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Mate scores from IID

Post by jdart » Tue Aug 16, 2016 11:02 am

I set an EXACT flag in the node structure when a search returns an exact score, including mate, stalemate, tablebase hit.

IID searches that return with this flag set return a score immediately and don't search further.

--Jon

Post Reply