Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect stalemate in KXK endgames #2

Closed
wants to merge 7 commits into from

Conversation

glinscott
Copy link
Contributor

Also, handle cases where there are 2 bishops of the same color.

Shouldn't be much effect on ELO, as bench remains the same:
Before:
Total time (ms) : 3911
Nodes searched : 5001819
Nodes/second : 1278910

After:
Total time (ms) : 3895
Nodes searched : 5001819
Nodes/second : 1284164

Handles the cases in http://www.talkchess.com/forum/viewtopic.php?t=42335.

position fen K7/Q7/8/8/8/8/5p2/7k w - - 0 1
go depth 1
K7/8/8/8/8/8/5Q2/7k b - - 0 1
info depth 1 seldepth 2 score cp 678 nodes 66 nps 3000 time 22 multipv 1 pv a7f7
bestmove a7f7 ponder (none)

position fen 8/1p4p1/2k2R1p/8/8/8/1r5r/K7 b - - 0 1
go infinite
...
info depth 33 seldepth 76 score cp 1074 upperbound nodes 6348446 nps 2106319 time 3014 multipv 1 pv c6d5 f6f5 d5e4 f5e5 e4f4 e5f5 f4g3 f5g5 g3f3 g5f5 f3g3

Sample of FENs detected as stalemate:
K7/8/8/8/8/4N1Q1/8/7k b - - 0 1
K7/8/8/8/3Q4/6N1/8/4k3 b - - 0 1
K7/8/8/8/5Q2/7k/8/4N3 b - - 0 1
K7/8/8/8/5N1k/8/6Q1/8 b - - 0 1
K5Q1/8/8/8/8/8/5N1k/8 b - - 0 1
K7/8/8/8/4N3/5Q2/8/4k3 b - - 0 1
K7/8/1q6/8/8/8/k7/8 w - - 0 1
K7/8/1q6/8/8/8/8/k7 w - - 0 1
K7/8/1q6/8/8/k7/8/8 w - - 0 1
K7/8/1qk5/8/8/8/8/8 w - - 0 1

Also, handle cases where there are 2 bishops of the same color.
@glinscott
Copy link
Contributor Author

Much simpler! Works on all the examples, and bench is the same still. No effect on ELO predicted :).

Tuned on bench:
Total time (ms) : 3704
Nodes searched  : 5689260
Nodes/second    : 1535977

vs vanilla
Total time (ms) : 3911
Nodes searched  : 5001819
Nodes/second    : 1278910
@glinscott
Copy link
Contributor Author

Oops, did not intend to include these commits.

This reverts commit 0986c26, reversing
changes made to b46bf29.
@glinscott
Copy link
Contributor Author

Probably easiest to close this pull request, and open a new one.

@glinscott glinscott closed this Feb 6, 2012
@glinscott glinscott mentioned this pull request Mar 27, 2012
mcostalba pushed a commit that referenced this pull request Dec 4, 2012
@mcostalba mcostalba mentioned this pull request Jun 17, 2013
glinscott added a commit to glinscott/Stockfish that referenced this pull request Sep 11, 2013
This was referenced Mar 4, 2014
joergoster referenced this pull request in joergoster/Stockfish-old Nov 29, 2014
bench: 7615038
lucabrivio referenced this pull request in lucabrivio/Stockfish Nov 19, 2015
alwey pushed a commit to alwey/Stockfish that referenced this pull request Nov 23, 2016
locutus2 referenced this pull request in locutus2/Stockfish-old Nov 30, 2016
lp-- pushed a commit to lp--/Stockfish that referenced this pull request Dec 28, 2017
Rocky640 referenced this pull request in tomtor/Stockfish Jan 29, 2018
locutus2 referenced this pull request in locutus2/Stockfish-old Apr 12, 2020
Bench: 8172023
glinscott pushed a commit to glinscott/Stockfish that referenced this pull request Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants