Re: Basic endgames
Posted: Thu Oct 03, 2019 3:55 pm
I think your node counts are way too high for these simple endgames. May I assume that you detect K vs K as an immediate draw and return 0?
Independent from that remark, node counters should always be 64 bit integers since 2^32 will be exceeded frequently.
Regarding your king capture scoring, I have to admit that I never developped a "king capture engine" myself but if I did so then I would return a score that differs from normal mate scores by not depending on the current ply count within the tree (e.g. +MATE_SCORE) so that the parent node can detect illegal moves without any doubt. That way, if you always initialize your "best score" with -MATE_SCORE and all pseudo-legal moves return from their subtree with +MATE_SCORE (turned into -MATE_SCORE by negamax), telling you that they were in fact illegal, then you know you are either checkmated or stalemate and can return the appropriate score. I am pretty sure HGM knows an easier way to achieve the same but at least it should work that way.
Also thanks a lot for posting these test positions, that made me aware of a minor but annoying bug that I had introduced recently into Jumbo, leading to being unable to mate quickly with KQK or KRK without EGTB support (it turned out to be a futility pruning problem).
Independent from that remark, node counters should always be 64 bit integers since 2^32 will be exceeded frequently.
Regarding your king capture scoring, I have to admit that I never developped a "king capture engine" myself but if I did so then I would return a score that differs from normal mate scores by not depending on the current ply count within the tree (e.g. +MATE_SCORE) so that the parent node can detect illegal moves without any doubt. That way, if you always initialize your "best score" with -MATE_SCORE and all pseudo-legal moves return from their subtree with +MATE_SCORE (turned into -MATE_SCORE by negamax), telling you that they were in fact illegal, then you know you are either checkmated or stalemate and can return the appropriate score. I am pretty sure HGM knows an easier way to achieve the same but at least it should work that way.
Also thanks a lot for posting these test positions, that made me aware of a minor but annoying bug that I had introduced recently into Jumbo, leading to being unable to mate quickly with KQK or KRK without EGTB support (it turned out to be a futility pruning problem).