Page 1 of 1

Checking for mate/stalemate before nullmove, eval, ect..

PostPosted: 30 Sep 2006, 16:16
by Pradu
In my old engine, I didn't check for mate/stalemate until I actually generated the moves for the current position. I generate the moves when I actually start iterating through the moves when searching. This could be a mistake because you might nullmove on a stalemate or return an eval on a mate/stalemate. You will get some speed loss if you generate moves before eval, nullmove and whatever else; but I know this is the "correct" thing to do. What do you guys do to handle this problem -- go with the extra speed or with less speed but bug-free handling of the position?

Re: Checking for mate/stalemate before nullmove, eval, ect..

PostPosted: 30 Sep 2006, 19:04
by Daniel Shawul
I think that some do a check for mate/stalemate in the quiescence search when attack tables are used there (which might make detection of mate/stalemate easier), but in the main search it might be costly to try it before doing null move.