Wednesday, 3 July 2019

Study 168

Vlaicu Crişan & Árpád Rusz
The Problemist
2019

Draw

1. f5! 1. a7? Qe7+/Qd8+ 2. Kh6 Qf8+ 3. Kg5 a2 4. Qxa2 Qe7+/Qd8+ 5. Kh6 Qh4#

Main A:
1... Qd8+ 2. f6 Qa5+ 2... Qd5+ 3. Kh6 Qh1+ 4. Kg5 Kh7! 5. Kf4 (5. a7? Qh6#) 5... Qd5 6. a7 a2 7. Qh2(4)+ 7... Kg8 8. Qh6!! Q sacrifice 8... Qd2+ (8... a1=Q?? 9. Qg7#) 9. K~ Qxh6 10. a8=Q+ = 3. Kh6 Qxa6 3... a2 4. Qh2! Qd8 5. Kg5+! (5. Qxa2? Qxf6 6. g5 Qg7#) 5... Kg8 6. Qxa2 +-

4. Qa7!! Q sacrifice 4. Qc5? Qa8! -+ 4... Qxa7 5. g5! a2 stalemate

Main B:
1... Qe7+ 2. f6 Qe5+ 3. Kh4! 3. Kh6? a2! -+ 3... g5+ 4. Kh3! 4. Kh5? a2! 5. Qxa2 Qxf6 6. Qd5 Qg6# 4... Qd5 5. a7 a2

6. Qc5!! Q sacrifice 6. Qd4? Qh1+ 7. Kg3 a1=Q -+ The white queen cannot reach f8. 6... Qxc5 6... Qh1+ 7. Kg3 a1=Q?? 8. Qf8+! Kh7 9. Qg7# 7. a8=Q+ Kh7 8. Qxa2 =

Watch this study on a dynamic board! Click here!

Study 167

Mario Micaloni & Árpád Rusz
Benkő-90 JT
2019
2nd Prize

White wins

1. e5 Nc3 2. Nf6! 1st knight opposition 2. Kd7? Ne4! (2... Nxa4? 3. Kc6 +-) 3. Kc6 Ng5 = 2... Kc4 2... Nxa4 3. Kd6 Kd4 4. e6 Nb6 5. Kc7 Ke5 6. e7 +- 3. Kd6 Ne2 4. Nh5! 2nd knight opposition 4... Nd4 5. Ng7! 3rd knight opposition 5... Kb4 1st cyclic zugzwang - WTM. In order to win, white has to reach the same position but with BTM. A move is lost by a king triangulation (3 moves) plus a knight switchback (2 moves) while the black knight moves only 4 times.


cyclic zugzwang - WTM

6. Kd5 Ne2 7. Nh5! Nc3+ 8. Kc6! Ne2 9. Kd6 Nd4 10. Ng7! White has managed to transfer the move to black but black has a tempo move. 10... a5


cyclic zugzwang - WTM

11. Kd5 Ne2 12. Nh5! Nc3+ 13. Kc6 Ne2 14. Kd6 Nd4 15. Ng7! White ends the second cycle but black has another tempo move. 15... a6 15... Nb5+!? 16. axb5 a4 17. Nf5/Ne6 a3 18. Nd4 Kc3 (18... a2 19. Nc2+ Kc3 20. Na1 Kb2 21. e6 Kxa1 22. e7 Kb2 23. e8=Q +-) 19. b6! axb6 20. Nb5+ +-


cyclic zugzwang - WTM

16. Kd5 Ne2 17. Nh5! Nc3+ 18. Kc6 Ne2 19. Kd6 Nd4 20. Ng7! The third cycle finishes. Black has no more tempo moves...


cyclic zugzwang - BTM

20... Kxa4 21. Kc5 Nb3+ 22. Kc4 Nd2+ 23. Kd5 +- 20... Kc4 21. e6 Nxe6 22. Nxe6 Kb4 23. Nc5 +-

Watch this study on a dynamic board! Click here!

Study 166

Árpád Rusz
Benkő-90 JT
2019
1st Commendation

Draw

1. Rc3! 1. Re4? Kb1! Triangulation 2. Kb3 (2. Rc4 Kb2 -+ mutual zugzwang) 2... Rf3+ 3. Ka4 Kc2 4. Kxa5 Kd3 5. Rh4 Rf5+ 6. Kb4 Ke2 7. Kc3 Kxf2 8. Kd3 Kg3 9. Rh1 h4 -+ 1... Kb2 1... Kb1 2. Kb3 Rxf2 3. Rh3 = 2. Rc4! mutual zugzwang 2... Rg5 2... Rxf2 3. Rh4 (or 3. Kxa5) 3... Rf5 4. Rxh5! Rxh5 stalemate 3. Rc6!! mutual zugzwang 3... Rd5 3... h4 4. Rh6 Rg4+ 5. Kxa5 Kc3 6. Kb6! Kd4 7. Rf6 Ke5 8. Rf3 Ke4 9. Rh3 = 4. Rc8! mutual zugzwang 4. Rc7? Re5! mutual zugzwang 5. Rc6 Rg5! mutual zugzwang 6. Rc7 h4 7. Rh7 Rg4+ 8. Kxa5 Kc2(3) 9. Kb6 Kd3 10. Kc7 Ke4! Now the e4 square was empty! 11. Rf7 Rf4 12. Rh7 Kf3 -+ 4... Re5 5. Rc7! mutual zugzwang 5... h4 5... Rf5 6. Rc4 positional draw on 4 pairs of corresponding squares

6. Rh7 Re4+ 7. Kxa5 Kc3 8. Kb6! Kd3 9. Kc7! The white king is hiding from lateral checks. 9. Kc5? Ke2 10. Rf7 Re5+ 11. Kd4 Rh5 -+ 9... Ke2 The e4 square was blocked! 10. Rf7 h3 11. Rh7 = The pawn cannot be defended.

Watch this study on a dynamic board! Click here!

Study 165

Árpád Rusz
Korányi MT
2018
1st/2nd Prize

White wins

1st thematic try:
1. Qd1+? Bg4 2. Nf3 Bc5+! 2... c2? 3. Bxc6!! Queen sacrifice 3... cxd1=Q 4. Be8# 3. Kb8 3. Kb7 c2! -+ 3... Bd6+ 4. Ka7 Bc5+ perpetual check.

The king cannot escape from the checks because the corner square is blocked.

Solution:
1. Bxc6! Bc5+! 1... Bxc6 2. Qxc6 +-

2nd thematic try:
2. Kb7? h1=Q 3. Qd1+ Bg4 4. Nf3?

4... Bc8+! Bishop sacrifice. Black is unblocking the g4 square before taking the queen! 5. Kxc8 Qxd1 6. Be8+ Kg4! -+; 2. Kb8? h1=Q 3. Qd1+ Bg4 4. Nf3? Qh2+! -+

2. Ka8!! The corner square has been unblocked, so the white king finds a nice hiding place there. 2... h1=Q! Cross-pin

3. Qd1+ 3. Bxh1? Bxa4 -+ 3... Bg4!

4. Nf3!! Cross theme & Queen sacrifice 4... Qxd1 4... Bxf3 5. Bxf3+ +- 5. Be8#

Watch this study on a dynamic board! Click here!

Study 164

Árpád Rusz
Korányi MT
2018

White wins

1. Ra6 Re3 1... Rg4+ 2. Kd5 Rxa6 3. Rxa6 Rf4 4. Ke5 Rf3 5. c4 h3 6. c5 h2 7. Ra2+ Kg3 8. Rxh2! rook sacrifice 8... Kxh2 9. c6 +- 2. Rf1+! rook sacrifice 2... Kxf1 3. Kxe3 Rf2 3... Rxc2 4. f7 Rf2 5. Ra1+ Kg2 6. Ra2! rook sacrifice 6... Rxa2 7. f8=Q +-; 3... h3 4. Ra1#; 3... Re2+ 4. Kf3 Rf2+ 5. Kg4 +- 4. Ra1+ 4. Ra4? h3 5. Rh4 Rxc2! 6. Rxh3 Rc3+ = 4... Kg2

5. Rh1!! rook sacrifice 5... Rf3+ 5... Kxh1 6. Kxf2 +-; 5... Rxf6 6. Rxh4 +- 6. Ke4 h3 6... Rxf6 7. Rxh4 Rc6 8. Kd3 +- 7. Rh2+! rook sacrifice 7... Kg3 8. Rxh3+! rook sacrifice 8... Kxh3 9. Kxf3 +-

Watch this study on a dynamic board! Click here!

Study 163

Árpád Rusz
Chess Olympiad
2018
Special Commendation

White wins

1. Nc2+! 1. Rf2? Rc6+! (1... Rxh6? 2. Rxa2+! bxa2 3. Nc2#; 1... b2+? 2. Rxb2 Rc6+ 3. Rc2 Rxh6 (3... Rxc2+ 4. Nxc2#) 4. Rxa2#) 2. Nxc6 b2+ 3. Rxb2 stalemate 1... bxc2 2. h7 Rf6! 2... Rh6 3. Rf1! Rxh7 4. Kxc2#

3. Rf7!! mutual zugzwang 3. h8=Q? stalemate; 3. h8=R? Rxf8 4. Rxf8 stalemate; 3. Rg8? Rf1+! (3... Rh6? 4. Rg1 Rxh7 5. Kxc2#) 4. Kxc2 Rf2+ 5. Kb3 Rf3+ 6. Kc2 Rf2+ perpetual check 3... Rf1+! 4. Kxc2 Rf6! Black managed to lose a tempo but the position is slightly changed: the first rank now it is open. 4... Rf2+ 5. Kb3 Rb2+ 6. Ka3 (6. Kc3?! Rc2+! 7. Kb3 Rb2+) 6... Kb1 7. Rf1+ Kc2 8. h8=Q +-; 4... Rc1+ 5. Kb3! Kb1 6. h8=Q a1=Q 7. Qh7+ +-

5. h8=R! 5. Rd7? Rc6+ 6. Kb3 Rb6+ 7. Ka3 Ra6+ 8. Kb3 Rb6+ perpetual check 5... Rxf7 6. Rh1+ Rf1 7. Rxf1#

Watch this study on a dynamic board! Click here!

Tuesday, 18 June 2019

WCCI 2016-18 Results

The results of the WCCI has been published.

1st Place: Oleg Pervakov (RUS)
2nd Place: Martin Minski (GER)
3rd Place: Steffen Slumstrup Nielsen (DEN)

Monday, 15 April 2019

Syzygy Endgame Explorer v. 0.2

Syzygy Endgame Explorer v. 0.2 has been released!
Besides bugfixes, it includes some new features like searching for symmetrical positions. SEE now also accepts a pgn file as an input so it can search e.g. the van der Heijden database for anticipations.
You can find the download link here.

Added new features:

  • Comments after any line are allowed
  • Any "sq1-sq2" combination (e.g. "a1-a4", "a1-e1", or "a1-c3") can be used to give a set of squares along a file, rank or diagonal
  • A rectangular region can be given by four squares (e.g. "c5-f5-f3-c3")
  • Use "~e4", "~fileD", "~rank4" to exclude some squares
  • The [BlackKing], [BlackQueen], ..., [WhitePawn] keywords now can use all square collections just like [Piece1], ..., [Piece7]. Additionally, they can use the initial squares of the pieces ("sq1", "sq2",..., "sq7" or "~sq1", "~sq2", ..., "~sq7")
  • New keyword [Symmetry] for setting various symmetry axes
  • New keywords [Identical] and [Different]
  • . These are replacing the functionality of [RememberFEN], [RepeatPosition] and [NotRepeatPosition] which were removed (see the modified Example 22).
  • [InputTXT] was changed to [Input] and now it accepts both text (FEN lists) and pgn files.
  • Now [FEN] and [FENList] accepts both stripped and standard FENs
  • New [Eval] values like "not_draw" and "loss/loss"
  • [OutputScreen "diag"] will output the found positions not only with FENs but also in ASCII diagrams

Example 28

******ex28.txt*******
[Tablebase "KPkp"]

[Position "1"]
[Eval "loss/loss"] //full point mutual zugzwangs
********************


full point mutual zugzwang

Example 29

******ex29.txt*******
[Tablebase "KPkp"]
[OutputScreen "diag"]

[Position "1w"]
[Eval "win"]
[OnlyMove "yes"]
[MovedPiece "K"]
[Capture "no"]
[Check "no"]

[Position "1b"]

[Position "2w"]
[Eval "win"]
[OnlyMove "yes"]
[MovedPiece "K"]
[Capture "no"]

[Position "2b"]
[WhiteKing "sq1"] //Switchback
********************


Switchback

1. Kc6! a5 2. Kb5! +-

Example 30

******ex30.txt*******
//Place interchange
[Tablebase "KPkp"]

[Position "1w"]
[Piece1 "half"]
[Eval "win"]
[OnlyMove "yes"]

[Position "1b"]

[Position "2w"]
[Eval "win"]
[OnlyMove "yes"]

[Position "2b"]

[Position "3w"]
[Eval "win"]
[OnlyMove "yes"]

[Position "3b"]
[WhiteKing "sq2"]
[WhitePawn "sq1"]
********************

1. Kb5! e5 2. c5 e4 3. Kc4! +- Compared to the initial position, the white king and pawn have switched positions.

Example 31

******ex31.txt*******
//During the solution, all white pieces should move.
[Tablebase "KPk"]

[Position "1w"]
[Eval "win"]
[OnlyMove "yes"]

[Position "1b"]

[Position "2w"]
[Eval "win"]
[OnlyMove "yes"]

[Position "2b"]
[WhiteKing "~sq1"] The white king has left its initial square.
[WhitePawn "~sq2"] The white pawn also has left its initial square.
********************

1. Kg7! Kf5 2. h5 +-

Example 32

******ex32.txt*******
//Duplex Excelsior
[Tablebase "KPkp"]

[Position "1w"]
[Piece2 "rank2"]
[Symmetry "d5-e5-e4-d4"] //We are looking for a point symmetric position.
[Eval "win"]
[OnlyMove "yes"]

[Position "1b"]

[Position "2w"]
[WhitePawn "rank4"]
[Eval "win"]
[OnlyMove "yes"]

[Position "2b"]

[Position "3w"]
[WhitePawn "rank5"]
[Eval "win"]
[OnlyMove "yes"]

[Position "3b"]

[Position "4w"]
[WhitePawn "rank6"]
[Eval "win"]
[OnlyMove "yes"]

[Position "4b"]

[Position "5w"]
[WhitePawn "rank7"]
[Eval "win"]
[OnlyMove "yes"]

[Position "5b"]
[WhiteQueen "rank8"] //Excelsior to queen
********************


Win (DUPLEX)

White to move:
1. b4 g5 2. b5 g4 3. b6 g3 4. b7 g2 5. b8=Q g1=Q 6. Qh8+ Kg6 7. Qg8+ +-

Black to move:
1... g5 2. b4 g4 3. b5 g3 4. b6 g2 5. b7 g1=Q 6. b8=Q Qa1+ 7. Kb3 Qb1+ -+

Example 33

******ex33.txt*******
// Finding Saavedra
[Tablebase "KPkr"]
[Input "heijden.pgn"]

[Position "1w"]
[Piece1 "b6"]
[Piece2 "c6"]
[Piece3 "a1"]
[Piece4 "d5"]
********************

With ordinary pgn files, only the initial positions will be searched. One needs a specially prepared pgn file which can be searched everywhere. This has a fen string added as a comment after each move. Use pgn-extract with --fencomments and --commentlines to prepare such a pgn file.

[Event "Glasgow Weekly Citizen#414 (m)"]
[Site "?"]
[Date "1895.05.04"]
[Round "?"]
[White "Saavedra=F Barbier=G"]
[Black "(+0300.10b6a1)"]
[Result "1-0"]
[EventDate "1895.??.??"]
[SetUp "1"]
[FEN "8/8/1KP5/3r4/8/8/8/k7 w - - 0 1"]
[PlyCount "13"]

1. c7
{ 8/2P5/1K6/3r4/8/8/8/k7 b - - 0 1 }
1... Rd6+
{ 8/2P5/1K1r4/8/8/8/8/k7 w - - 1 2 }
2. Kb5
{ 8/2P5/3r4/1K6/8/8/8/k7 b - - 2 2 }
(2. Kb7 $2
{ 8/1KP5/3r4/8/8/8/8/k7 b - - 2 2 }
2... Rd7 $11
{ 8/1KPr4/8/8/8/8/8/k7 w - - 3 3 }
) 2... Rd5+
{ 8/2P5/8/1K1r4/8/8/8/k7 w - - 3 3 }
3. Kb4
{ 8/2P5/8/3r4/1K6/8/8/k7 b - - 4 3 }
3... Rd4+
{ 8/2P5/8/8/1K1r4/8/8/k7 w - - 5 4 }
4. Kb3
{ 8/2P5/8/8/3r4/1K6/8/k7 b - - 6 4 }
(4. Kc3
{ }
{ 8/2P5/8/8/3r4/2K5/8/k7 b - - 6 4 }
4... Rd1
{ 8/2P5/8/8/8/2K5/8/k2r4 w - - 7 5 }
5. Kc2
{ 8/2P5/8/8/8/8/2K5/k2r4 b - - 8 5 }
) 4... Rd3+
{ 8/2P5/8/8/8/1K1r4/8/k7 w - - 7 5 }
5. Kc2
{ 8/2P5/8/8/8/3r4/2K5/k7 b - - 8 5 }
5... Rd4
{ 8/2P5/8/8/3r4/8/2K5/k7 w - - 9 6 }
6. c8=R $1
{ 2R5/8/8/8/3r4/8/2K5/k7 b - - 0 6 }
(6. c8=Q $2
{ 2Q5/8/8/8/3r4/8/2K5/k7 b - - 0 6 }
6... Rc4+ $1
{ 2Q5/8/8/8/2r5/8/2K5/k7 w - - 1 7 }
7. Qxc4
{ stalemate }
{ 8/8/8/8/2Q5/8/2K5/k7 b - - 0 7 }
) 6... Ra4
{ 2R5/8/8/8/r7/8/2K5/k7 w - - 1 7 }
7. Kb3
{ 2R5/8/8/8/r7/1K6/8/k7 b - - 2 7 }
1-0

With a file prepared like this, the search will find two additional examples in the van der Heijden database where the Saavedra position was reached during play.

******ex34.txt*******
// Finding the Conrady positions
[Tablebase "KRknp"]
[OutputPGN "KRknp_D23.pgn"]

Move 1:
[Position "1w"]
[Piece5 "h6"]
[Eval "win"]
[OnlyMove "yes"]
[Position "1b"]
[Eval "loss"]

Move 2:
[Position "2w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "2b"]
[Eval "loss"]

Move 3:
[Position "3w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "3b"]
[Eval "loss"]

Move 4:
[Position "4w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "4b"]
[Eval "loss"]

Move 5:
[Position "5w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "5b"]
[Eval "loss"]

Move 6:
[Position "6w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "6b"]
[Eval "loss"]

Move 7:
[Position "7w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "7b"]
[Eval "loss"]

Move 8:
[Position "8w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "8b"]
[Eval "loss"]

Move 9:
[Position "9w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "9b"]
[Eval "loss"]

Move 10:
[Position "10w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "10b"]
[Eval "loss"]

Move 11:
[Position "11w"]
[Piece1 "half"]
[Eval "win"]
[OnlyMove "yes"]
[Position "11b"]
[Eval "loss"]

Move 12:
[Position "12w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "12b"]
[Eval "loss"]

Move 13:
[Position "13w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "13b"]
[Eval "loss"]

Move 14:
[Position "14w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "14b"]
[Eval "loss"]

Move 15:
[Position "15w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "15b"]
[Eval "loss"]

Move 16:
[Position "16w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "16b"]
[Eval "loss"]

Move 17:
[Position "17w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "17b"]
[Eval "loss"]

Move 18:
[Position "18w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "18b"]
[Eval "loss"]

Move 19:
[Position "19w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "19b"]
[Eval "loss"]

Move 20:
[Position "20w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "20b"]
[Eval "loss"]

Move 21:
[Position "21w"]
[Piece1 "half"]
[Eval "win"]
[OnlyMove "yes"]
[Position "21b"]
[Eval "loss"]

Move 22:
[Position "22w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "22b"]
[Eval "loss"]

Move 23:
[Position "23w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "23b"]
[Eval "loss"]
********************

6 positions were found:
8/8/7p/7n/3R4/8/k7/2K5 w - - 0 1
8/8/7p/7n/3R4/8/k7/3K4 w - - 0 1
8/8/7p/7n/k7/8/2K5/3R4 w - - 0 1
8/8/7p/7n/k7/8/2KR4/8 w - - 0 1
8/8/7p/7n/k7/3R4/2K5/8 w - - 0 1
3R4/8/7p/7n/k7/8/2K5/8 w - - 0 1

One of them is what Helmut Conrady has published in 2003 (Computer Schach und Spiele, Vol. 2, No. iv-v) as being the longest AUM (absolutely unique move) sequence in the tablebases up to 5 men:

Helmut Conrady
Computerschach und Spiele
2003

White wins

1. Rd4+ Ka3 2. Kd3 Kb3 3. Rd6 Kb4 4. Kd4 Nf4 5. Rb6+ Ka5 6. Rf6 Ne2+ 7. Kc4 Ng3 8. Rg6 Ne4 9. Kd4 Nd2 10. Rg2 Nf3+ 11. Kc5 Ka6 12. Rg6+ Kb7 13. Kd5 h5 14. Rh6 h4 15. Rf6 Ne1 16. Rf1 Nc2 17. Rb1+ Ka6 18. Rb2 Ne1 19. Ke4 h3 20. Rb1 Nc2 21. Kd3 Na3 22. Ra1 h2 23. Rxa3+ +-

Thursday, 11 April 2019

Study 162

Árpád Rusz
Internet (RCS blog)
2019

Draw

1. Kb7 Bc1 1... Kb1 2. Ne4! f1=Q 3. Nd2+ =; 1... Be5 2. Nf1 Kb2 3. Kc6 Kc3 4. Kd5 = 2. Kc6 Kb2 2... Bf4 3. Nf1 Kb2 4. Kd5 Kc3 5. Ke4 = 3. Kd5 Kc2 4. Ke4 Kd1 5. Kf3 Ke1 6. Kg2 Bf4 7. Nf1 Ke2 8. Kh1!


corner-to-corner manoeuvre

8... Kf3 8... Kxf1 stalemate

9. Ng3! Be5 9... Kxg3 stalemate; 9... Bxg3 stalemate 10. Nf1 Bf4 11. Ng3! positional draw - fortress

Watch this study on a dynamic board! Click here!

(162a)
J. Kling
1868

Draw

1. Ne5+! Bxe5 2. Ng3! Bf4 2... Bxg3 stalemate 3. Nf1 Ke2 4. Kg2 Ke1 5. Kh1! Kd1 5... Kxf1 stalemate 6. Kg2 Ke2 7. Kh1! Kf3 8. Ng3! Bxg3 stalemate 8... Kxg3 stalemate

(162b)
Mario G. Garcia
Hlinka-65 JT
- Section B -
2019
Special Honourable Mention

Draw

1. Na5+ Kd5 2. Nc6 Bc5 3. Nd8 f5 4. Nf7 Be7 5. Kd7 Bf6 6. Nh6 f4 7. Ng4 Bh4 8. Nh2 Ke4 9. Ke6Be1 10. Kf6 Bg3 11. Ng4 Bh4+ 12. Kg6 f3 13. Kh5 Be7 14. Nh2 f2 15. Kg4 Ke3 16. Kh3 Ke2 17. Kg2 Bd6 18. Nf1 Bf4 19. Kh1! Kf3 19... Kxf1 stalemate 20. Ng3! Bxg3 stalemate

Friday, 22 March 2019

Study 161

Zhukov & Rusz & Arestov
Paul Joita-80 MT
2018
4th Prize

Draw

1. Bc6! Qa7 2. Ra5+ Kb2 3. c5! Kc3 4. Ke2 Kb4

5. Kd3!! Kxa5 6. Kc4! Qxc5+ 7. Kxc5 Ba7+ 8. Kc4! = (8. Kd5? Kb4 -+)

Watch this study on a dynamic board! Click here!

Tuesday, 19 March 2019

VisualSEE by Emil Vlasák

Emil Vlasák has created a GUI for Syzygy Endgame Explorer (SEE). You can download it from his website: VisualSEE

Friday, 8 March 2019

Syzygy Endgame Explorer (SEE) released

For older posts about SEE, please check the posts with label "SEE".

You can download the latest version from here (for Windows):
SEE v 0.2

Syzygy Endgame Explorer (SEE) is a software written by Árpád Rusz for "mining" the Syzygy endgame tablebases. The software is still in the early phases of development but my goal is to write a tool similar to CQL which searches tablebases instead of pgn files.

The tool can find interesting positions (e.g. mutual zugzwangs, checkmates, stalemates, fortresses), it can also identify positions where interesting moves are the only winning or drawing ones (e.g. a piece moves to a corner square or it is sacrificed, minor promotions), and it can find interesting move sequences (e.g. a knight manoeuvres from a corner square to another corner square). It can "compose" a "study" (almost) by itself. An example:


White wins

1. Kf2 Kg4 2. Ke3 Kf5 3. Kd4 Ke6 4. Kc5 Ng5 5. a4 Ke7 6. Kc6 Ne6 7. Nd5+ Kd8 8. a5 Kc8 9. a6 Kb8 10. Kb6 Ka8 11. a7


mutual zugzwang

11... Nf8 12. Nc7#

SEE is written in C++, and currently it is just a Stockfish engine with an additional UCI command "see". Now it only runs from the command line, but I am planning to add a specialized GUI too to this project.

Before you use it, you need to get some Syzygy tablebases. SEE only needs the "wdl" files.
All 3-5 man tablebases can be downloaded from here:
Syzygy345.zip

Unzip the zip file to (for example) C:\Syzygy345.
You can find other links to download the 6 and 7 man tablebases here but the tablebases up to 5 man should be enough to start "mining".

Also, you will need a text file with SEE commands.
E.g we can have a file (zz.txt) with the following pgn-style lines:

[Tablebase "KPk"]

[Position "1"]
[Piece2 "e4"]
[Eval "draw/loss"]

The usage is very simple.

1) Double click on the SEE 0.2.exe file's icon to launch the software.
2) Type in the following line to give the path for the Syzygy Tablebases:

setoption name SyzygyPath value C:\Syzygy345

or (for example)

setoption name SyzygyPath value C:\Syzygy345;D:\Syzygy6;E:\Syzygy7

if you have tablebases in more directories.

3) Type:
see zz.txt + ENTER

4) SEE will output on the screen in FEN notation the 8 possible mutual zugzwang positions from the K + P vs K endgame having the white pawn on e4.

Some other examples:

Example 1

******ex1.txt*******
[Tablebase "KPk"]
[OutputTXT "KPk.txt"]
[OutputScreen "no"]

[Position "1"]
[Piece2 "a-d"]
********************

All positions from the KPvK tablebase will be saved into a text file instead of being showed on the screen. The white pawn ('Piece2') will be placed only on the left side of the board (file a to d). The side to move by default is white.

Example 2

******ex2.txt*******
[Tablebase "KPk"]
[OutputPGN "KPk.pgn"]
[OutputScreen "no"]

[Position "1"]
[Piece1 "rank1"]
[Piece2 "fileA"]
[Eval "win"]
********************

The winning positions will be saved in a pgn file. The white king ('Piece1') will be placed only on the first rank and the white pawn ('Piece2') only on the a-file.

Example 3

******ex3.txt*******
[Tablebase "KPk"]

[Position "1"]
[SideToMove "black"]
[Eval "stalemate"]
********************

SEE will find all positions where Black is in a stalemate.

Example 4

******ex4.txt*******
[Tablebase "kKQ"]

[Position "1"]
[SideToMove "black"]
[Eval "checkmate"]
********************

SEE will find all positions where Black is checkmated. The tablebase now is K + Q vs K. The results will be ordered by the first piece (all checkmates with bKa1, followed by all checkmates with bKb1, etc.). We could enumerate the pieces in the Tablebase tag starting even by the black king because any order of the pieces is allowed.

Example 5

******ex5.txt*******
[Tablebase "Kkq"]

[Position "1"]
[Piece1 "tr"]
[Eval "checkmate"]
********************

SEE will find all positions where the white king is checkmated by the black queen. In a pawnless tablebase, it is advisable to use the constraint [Piece1 "tr"] forcing the first piece to the a1-d1-d4 triangle in order to eliminate positions which are different only by reflections or rotations.

Example 6

******ex6a.txt*******
[Tablebase "KPk"]

[Position "1"]
[Eval "win"]
[OnlyMove "yes"]
[Move "Pb7b8R"]
********************

This time we are searching for positions where the only winning move is a rook promotion on b8! There are two such positions (the wK can also be on b4):

Another way to write the commands is the following:

******ex6b.txt*******
[Tablebase "KPk"]

[Position "1"]
[Eval "win"]
[OnlyMove "yes"]
[MovedPiece "P"]
[From "b7"]
[To "b8"]
[PromotedPiece "R"]
********************

Example 7

******ex7.txt*******
[Tablebase "KBkrp"]

[Position "1"]
[Piece1 "fileE"]
[Piece2 "fileE"]
[Piece3 "fileE"]
[Piece4 "fileE"]
[Piece5 "fileE"]
[Eval "draw"]
[OnlyMove "yes"]
[Capture "no"]
********************

Now all pieces are constrained to the e-file. We are looking for positions with only drawing moves in a symmetrical setup. This move cannot be a capture. SEE will output Martin Minski's study.

Example 8

******ex8.txt*******
[Tablebase "KPk"]

[Position "1"]
The bK attacks the pawn, the wK defends it:
[Attack "3->2 1->2"]
********************

We are looking for positions where the bK attacks the pawn, and the wK defends it. The line after the [Position] keyword is a comment, and it is ignored by SEE. All lines not starting with a keyword are ignored. Don't put comments in a keyword line.

Example 9

******ex9.txt*******
[Tablebase "KPk"]

[Position "1"]
[SideToMove "black"]
[Attack "3->2"]
[NoAttack "1->2"]
[Check "no"]
********************

We are looking for positions where the bK attacks the pawn, and the wK doesn't defend it. The bK shouldn't be in check.

Example 10

******ex10.txt*******
[Tablebase "KPk"]

[Position "1"]
[WhitePawn "e4"]
[AttackedByWhite "a1"]
[NotAttackedByWhite "c3"]
[AttackedByBlack "h8"]
[Empty "g7"]
********************

This will match a position having the square a1 attacked by white, the square h8 attacked by black, the square c3 not attacked by white. The position should have a wP on e4 and an empty square g7.

Example 11

If we want all K + Q vs K positions but we try to eliminate the positions which are different only by reflections or rotations we should use 3 searches in a row:

******ex11a.txt*******
[Tablebase "KkQ"]
[OutputTXT "KQk.txt"]
[OutputScreen "no"]

[Position "1"]
[Piece1 "b1-d1-d3"]
[Piece2 "all"]
[Piece3 "all"]
********************

The lines indicating that a piece can be on all squares of the board can be safely deleted because "all" is the default value.

******ex11b.txt*******
[Tablebase "KkQ"]
[OutputTXT "KQk.txt"]
[OutputScreen "no"]

[Position "1"]
[Piece1 "a1-d4"]
[Piece2 "b1-h1-g8"]
[Piece3 "all"]
********************

******ex11b.txt*******
[Tablebase "KkQ"]
[OutputTXT "KQk.txt"]
[OutputScreen "no"]

[Position "1"]
[Piece1 "a1-d4"]
[Piece2 "a1-h8"]
[Piece3 "a1-h1-h8"]
********************

Example 12

******ex12.txt*******
[Tablebase "KPkb"]

[Position "1"]
[Eval "m1"]
********************

This search finds the "Mate in 1" positions.

Example 13

******ex13.txt*******
[Tablebase "KPkb"]

[Position "1"]
[Piece2 "e-h"]
[Eval "virtual"]
********************

This search finds the "virtual stalemate" positions. These positions look like stalemates but with the wrong side to move. Because of zugzwang, the "stalemated" side will actually win!

Example 14

******ex14.txt*******
[Tablebase "KPk"]

[Position "1"]
[Piece1 "a2-g8"]
[Piece2 "a2-g8"]
[Piece3 "a2-g8"]
********************

All pieces are on the a2-g8 diagonal.

Example 15

******ex15a.txt*******
[Tablebase "KPk"]

[Position "1"]
[Piece1 "a1"]
[Piece1 "h1"]
[Piece1 "a8"]
[Piece1 "h8"]
********************

The wK is on a corner square.

The same effect can be achieved by using the value "corners":

******ex15b.txt*******
[Tablebase "KPk"]

[Position "1"]
[Piece1 "corners"]
********************

Example 16

******ex16.txt*******
[Tablebase "KRPPkrp"]

[Position "1"]
[Piece1 "bb2282620633743360"]
[Piece2 "bb2282620633743360"]
[Piece3 "bb2282620633743360"]
[Piece4 "bb2282620633743360"]
[Piece5 "bb2282620633743360"]
[Piece6 "bb2282620633743360"]
[Piece7 "bb2282620633743360"]
********************

You can even use a bitboard to specify more complex square collections on the board (I use "Bitbord's Little Helper" by Julien Marcel to generate them). Now all pieces will be restricted to a cross-shaped space (squares d7-d3 plus c6 and e6).

Example 17

******ex17.txt*******
[Tablebase "KPkb"]

[Position "1"]
[Piece2 "b6"]
[Eval "win"]
[OnlyMove "yes"]

[Position "2"]
[Eval "checkmate"]
********************

This search finds the "Mate in 1" positions. It is similar to ex12.txt.

Example 18

******ex18.txt*******
[Tablebase "KNkn"]

[Position "1"]
[Eval "win"]
[OnlyMove "yes"]

[Position "2"]
[FEN "k7/n1K5/1N6/8/8/8/8/8"]
********************

The position which was given by the FEN tag is the following:

This search will find all positions from which this checkmate can be reached by an only winning move.

Example 19

******ex19.txt*******
[Tablebase "KRkq"]

[Position "1"]
[Eval "draw"]
[OnlyMove "yes"]
[Capture "no"]

[Position "2"]

[Position "3"]
[Eval "stalemate"]
********************

This search will find stalemate combinations like the following:

1. Re3+! Qxe3 stalemate

Example 20

******ex20a.txt*******
[Tablebase "KRkn"]
[OutputTXT "KRkn_zz.txt"]

[Position "1"]
[Eval "draw/loss"]
********************


mutual zugzwang

This search results in a list of 136 mutual zugzwang positions in the KRkn_zz.txt file. That file can be reused in another search. Let's see if any of the mutual zugzwang positions can be reached by a 10-move-long sequence of only winning moves for white!

******ex20b.txt*******
[Tablebase "KRkn"]
[OutputPGN "KRkn_zz_D10.pgn"]
[FENList "KRkn_zz.txt"]

//Move 1
[Position "1w"]
[Piece1 "a1-d1-d4"]
[Eval "win"]
[OnlyMove "yes"]
[Position "1b"]

//Move 2
[Position "2w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "2b"]

//Move 3
[Position "3w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "3b"]

//Move 4
[Position "4w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "4b"]

//Move 5
[Position "5w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "5b"]

//Move 6
[Position "6w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "6b"]

//Move 7
[Position "7w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "7b"]

//Move 8
[Position "8w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "8b"]

//Move 9
[Position "9w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "9b"]

//Move 10
[Position "10w"]
[Eval "win"]
[OnlyMove "yes"]
[Position "10b"]
[CheckFENList "yes"]
********************

The following position is found:


White wins

The "solution" of this "study" is:

1. Ke2 Ng6 2. Ke3 Kc2 3. Rb5 Kc3 4. Ke4 Nf8 5. Rd5 Ne6 6. Re5 Nd8 7. Re8 Nb7 8. Rc8+ Kd2 9. Kd4 Na5 10. Rc3 +- Now we reach a position from the list!


mutual zugzwang

Example 21

******ex21a.txt*******
[Tablebase "KPk"]
[OutputTXT "KPk.txt"]

[Position "1"]
********************

This search finds all legal positions in this tablebase (with WTM). The output file can be reused in other searches (e.g. to separate wins and draws):

******ex21b.txt*******
[Tablebase "KPk"]
[Input "KPk.txt"]
[OutputTXT "KPk_win.txt"]

[Position "1"]
[Eval "win"]
********************

******ex21c.txt*******
[Tablebase "KPk"]
[Input "KPk.txt"]
[OutputTXT "KPk_draw.txt"]

[Position "1"]
[Eval "draw"]
********************

Example 22

******ex22.txt*******
[Tablebase "KBNkq"]
[OutputPGN "positional_draw.pgn"]

[Position "1w"]
[Piece1 "a1-d1-d4"]
[Eval "draw"]
[OnlyMove "yes"]
[Identical "A"]
[Different "B"]

[Position "1b"]

[Position "2w"]
[Eval "draw"]
[OnlyMove "yes"]

[Position "2b"]

[Position "3w"]
[Eval "draw"]
[OnlyMove "yes"]
[Different "B"]

[Position "3b"]

[Position "4w"]
[Eval "draw"]
[OnlyMove "yes"]

[Position "4b"]

[Position "5w"]
[Eval "draw"]
[OnlyMove "yes"]
[Identical "A"]
********************

This search will find positional draws (fortresses, perpetual threats to build a fortress, and perpetual checks). The position should repeat only after the fifth move, not earlier. Some examples:

1. Bb2 Qh1+ 2. Ka2 Kd3 3. Ba1 Qa8+ 4. Kb1 Kc4 5. Bb2 = Fortress

1. Ka2 Qg8+ 2. Kb1 Qg1+ 3. Ka2 Qa7+ 4. Kb1 Qh7+ 5. Ka2 = Black needs to give further checks, otherwise white will build the classical fortress.

1. Ka2! Qc4+ 2. Kb1! Qf1+ 3. Ka2 Qa6+ 4. Kb1 Qd3+ 5. Ka2 = The bishop cannot be captured due a fork on e2.

1. Nd4+ Ka3 2. Nc2+ Kb3 3. Ne3+ Ka3 4. Nc2+ Ka4 5. Nd4+ = Perpetual check

Example 23

******ex23a.txt*******
[Tablebase "KRkq"]
[OutputTXT "KRkq_pin.txt"]

[Position "1"]
[Piece2 "fileD"]
[Piece3 "fileD"]
[Piece4 "fileD"]
[SideToMove "black"]
[Check "no"]
********************

This search will find all positions where the queen is pinned by the rook along the d-file.

******ex23b.txt*******
[Tablebase "KRkq"]
[OutputTXT "KRkq_pin_in_1.txt"]
[FENList "KRkq_pin.txt"]

[Position "1"]
[Eval "draw"]
[OnlyMove "yes"]

[Position "2"]
[CheckFENList "yes"]
********************

Using the results of the previous search, now we find all positions where the queen is going to be pinned by the rook along the d-file after the first move.

Example 24

******ex24a.txt*******
[Tablebase "KRkq"]
[OutputTXT "KRkq_skewer.txt"]

[Position "1"]
[Piece2 "fileD"]
[Piece3 "fileD"]
[Piece4 "fileD"]
[SideToMove "black"]
[Eval "loss"]
********************

This search will find all positions where the queen is skewered by the rook along the d-file.

******ex24b.txt*******
[Tablebase "KRkq"]
[OutputTXT "KRkq_skewer_in_1.txt"]
[FENList "KRkq_skewer.txt"]

[Position "1"]
[Eval "win"]
[OnlyMove "yes"]

[Position "2"]
[CheckFENList "yes"]
********************

Using the results of the previous search, now we find all positions where the king and queen are going to be skewered by the rook along the d-file after the first move.

Example 25

******ex25a.txt*******
[Tablebase "KRkq"]
[OutputTXT "KRkq_fork.txt"]

[Position "1"]
[Piece2 "fileD"]
[Piece3 "fileD"]
[Piece4 "fileD"]
[SideToMove "black"]
[Eval "draw"]
[Attack "2->3 2->4"]
********************

This search will find all positions where the queen and king are forked by the rook along the d-file.

******ex25b.txt*******
[Tablebase "KRkq"]
[OutputTXT "KRkq_fork_in_1.txt"]
[FENList "KRkq_fork.txt"]

[Position "1"]
[Eval "draw"]
[OnlyMove "yes"]

[Position "2"]
[CheckFENList "yes"]
********************

Using the results of the previous search, now we find all positions where the king and queen are going to be forked by the rook along the d-file after the first move.

Example 26

******ex26.txt*******
[Tablebase "KRNNkq"]
[OutputTXT "KRNNkq_mirrormate.txt"]

[Position "1"]
[Eval "checkmate"]
[SideToMove "black"]
[Piece5 "g6"]
[Empty "f5"]
[Empty "g5"]
[Empty "h5"]
[Empty "f6"]
[Empty "h6"]
[Empty "f7"]
[Empty "g7"]
[Empty "h7"]
********************

The search which uses this file finds all mirrormates with the black king on g6. In a mirrormate the checkmated king is surrounded only by empty squares.


mirrormate (Arestov, 2013)

Example 27

******ex27a.txt*******
[Tablebase "KQkq"]
[OutputTXT "KQkq_M1.txt"]
[OutputScreen "no"]

[Position "1"]
[Eval "m1"]
********************

******ex27b.txt*******
[Tablebase "KQkq"]
[Input "KQkq_M1.txt"]
[OutputTXT "KQkq_M1_double.txt"]
[OutputPGN "KQkq_M1_double.pgn"]
[OutputScreen "no"]

[Position "1"]
[SideToMove "black"]
[Eval "m1"]
********************

Using these files in two searches, we can find all positions where, having the move, both sides win by checkmate in 1.


Mate in 1 (duplex)

Other examples

The list of SEE tags:

  • [Tablebase]
  • [Input]
  • [OutputTXT]
  • [OutputPGN]
  • [OutputScreen]
  • [Position]
  • [Piece1]
  • [Piece2]
  • [Piece3]
  • [Piece4]
  • [Piece5]
  • [Piece6]
  • [Piece7]
  • [BlackKing]
  • [BlackQueen]
  • [BlackRook]
  • [BlackBishop]
  • [BlackKnight]
  • [BlackPawn]
  • [WhiteKing]
  • [WhiteQueen]
  • [WhiteRook]
  • [WhiteBishop]
  • [WhiteKnight]
  • [WhitePawn]
  • [SideToMove]
  • [Eval]
  • [OnlyMove]
  • [Move]
  • [MovedPiece]
  • [To]
  • [From]
  • [PromotedPiece]
  • [CapturedPiece]
  • [Capture]
  • [Check]
  • [Empty]
  • [AttackedByWhite]
  • [AttackedByBlack]
  • [NotAttackedByWhite]
  • [NotAttackedByBlack]
  • [Attack]
  • [NoAttack]
  • [FEN]
  • [FENList]
  • [CheckFENList]
  • [Identical]
  • [Different]
  • [Symmetry]

The list of [Eval] values:

  • "win", "draw", "loss", "not_win", "not_draw", "not_loss"
  • Any eval1/eval2 combination where the two evals takes any value from the above list. E.g. "loss/loss" means a full-point mutual zugzwang
  • "all"
  • "checkmate"
  • "stalemate"
  • "m1"
  • "virtual"

Square collections:

  • "all"
  • "none"
  • "a1", "a2",..., "h8"
  • "~a1", "~a2",..., "~h8" is the set of all squares from the board except the given square
  • "fileA", "fileB",..., "fileH"
  • "~fileA", "~fileB",..., "~fileH" is the set of all squares from the board except the given file
  • "rank1", "rank2",..., "rank8"
  • "~rank1", "~rank2",..., "~rank8" is the set of all squares from the board except the given rank
  • "a1-h8", "a2-h2", "e2-e7" etc. means the squares between two given squares (the end points are included)
  • "a-c" gives all squares from file "a", "b" and "c"
  • "1-2" gives all squares from rank "1" and "2"
  • "a4-d4-d2-a2" gives all square from a rectangular region bounded by the given four squares. Make sure you start with the upper left corner.
  • "half" = "a-d"
  • "tr" = "a1-d1-d4" a triangular region bounded by the given three squares
  • "b1-d1-d3", "a1-h1-h8", "a8-h8-a1", "a1-h1-a8", "a8-h8-h1", "b1-h1-h7", "a8-g8-a2", "a1-g1-a7", "b8-h8-h2" Yet only these predifined values are available for triangular regions.

Symmetry axes and points:

  • "fileA", "fileB",..., "fileH"
  • "rank1", "rank2",..., "rank8"
  • "a1-h8"
  • "h8-a1" (colour symmetry)
  • "d-e" (colour symmetry)
  • "4-5" (colour symmetry)
  • "d5-e5-e4-d4" (colour symmetry)