Page 4 of 4

Re: Basic endgames

Posted: Thu Oct 03, 2019 3:55 pm
by Sven
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).

Re: Basic endgames

Posted: Sat Oct 05, 2019 1:18 pm
by Henk
Already switching over to legal move generation. Simplest solution is best in my case. Especially when you can't even solve simple endgame problems. Or worse not able to win from Fairy-max

Re: Basic endgames

Posted: Tue Oct 08, 2019 3:51 pm
by Henk
Can't solve this.

[d] 8/4k3/8/R7/4K3/8/8/8 w - -

Re: Basic endgames

Posted: Tue Oct 08, 2019 3:56 pm
by Henk
Sven wrote: 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).
Looks like can't do futility pruning when ub >= MIN_MATE_SCORE because a check may be a check mate.