kbhearn wrote:Depends what % correct you want to be. if you can accept both some false-draws and false-wins that take a couple ply of search to resolve correctly the rules for that are pretty well codified in books.
OK, thanks. The distance rule to the key squares given by Ferdinand summarizes this quite compactly, and makes it very easy to test.
I can accept some false wins, but no false draws, as the idea of the recognizer is that it immedialy prunes the branch with a hefty reduction factor when it detects a draw. False wins just keep the naive eval score of +8 and will search on, and presumably will then quickly see that a draw position can be forcibly reached.
The test is not done in the root, so in a drawn situation it will do one of the moves that preserves the draw, without caring which. The idea is that in situations like this (KPK, KBPK, KQKP) the defending side cannot possibly achieve anything more than a draw, so any drawing move is good enough. You don't want the strong side to needlessly give away its material; KBPK is better than KK w.r.t. the possibility of the defende making a mistake. (E.g. if it is an engine that doesn't know about under-promotion!) If the position is a win, however, you cannot just do any move that keeps the win, but you must work to make progress. It would be needlessly complex (and very bug prone) to let the recognizer define progress, the naive eval should be much better at that. (Or you'd better tune it!)
So I am afraid that when I use these distance rules, I will really have to test for the discovered check if the King is just one step further away then the win zone.