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?
Mate scores from IID
Moderators: hgm, Rebel, chrisw
-
- Posts: 1334
- Joined: Sun Jul 17, 2011 11:14 am
Mate scores from IID
Some believe in the almighty dollar.
I believe in the almighty printf statement.
I believe in the almighty printf statement.
-
- Posts: 12541
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Mate scores from IID
It's already in the hash table. I guess the real search will find it in a snapZirconiumX 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?
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.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Mate scores from IID
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.
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.
-
- Posts: 1334
- Joined: Sun Jul 17, 2011 11:14 am
Re: Mate scores from IID
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.Dann Corbit wrote:It's already in the hash table. I guess the real search will find it in a snapZirconiumX 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?
Some believe in the almighty dollar.
I believe in the almighty printf statement.
I believe in the almighty printf statement.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Mate scores from IID
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.
-
- Posts: 4367
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: Mate scores from IID
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
IID searches that return with this flag set return a score immediately and don't search further.
--Jon