If you prove one subtree leads to a forced draw, that will be used as the minimum score to search all other subtrees here, and once you finish and store the result in the hash table, this will be used whenever the same position is reached again, assuming sufficient draft in the hash entry.jwes wrote:jwes wrote:It would be good to know if one or both sides could force stalemate or repetition in all branches of a sub-tree. This could allow not searching this sub-tree on deeper iterations.syzygy wrote:As Bob already wrote, you want to continue searching.kdjones wrote:I am working on my first chess engine after learning C++. It uses iterative deepening and a principal variation search (PVS). When a stalemate occurs in the PV, I want to cut the search short, but the score of zero is not unique (as in a checkmate). Since I added the transposition table, the principal variation may not be complete, so I can't use it's length to detect end of game. How do I signal a stalemate otherwise? The iterations keep going until the depth or time runs out.
If the search returns a winning or losing mate score, then that is "proof" that the position is won or lost. But if the search returns a 0.00 score, then everything is still possible even if that 0.00 came from a stalemate or from a draw by repetition or even from a 50-move draw. The position may still turn out to be a win and it may still turn out to be a loss. So a draw score is no reason to stop searching.bob wrote:alpha/beta does that already...I'm confused.syzygy wrote: But alpha-beta won't give you that information.
In any case, such subtrees will not take long to search at higher iterations anyway.
When you search, draws/stalemates cut the tree off instantly at that point, which will then trigger alpha/beta cutoffs elsewhere.