Basic endgames

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Sven
Posts: 3826
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: Basic endgames

Post by Sven » Thu Oct 03, 2019 1: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).
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)

Henk
Posts: 5819
Joined: Mon May 27, 2013 8:31 am

Re: Basic endgames

Post by Henk » Sat Oct 05, 2019 11:18 am

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

Henk
Posts: 5819
Joined: Mon May 27, 2013 8:31 am

Re: Basic endgames

Post by Henk » Tue Oct 08, 2019 1:51 pm

Can't solve this.

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

Henk
Posts: 5819
Joined: Mon May 27, 2013 8:31 am

Re: Basic endgames

Post by Henk » Tue Oct 08, 2019 1:56 pm

Sven wrote:
Thu Oct 03, 2019 1: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.

Post Reply