Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Discussion of chess software programming and technical issues.

Moderator: Ras

Chessnut1071
Posts: 313
Joined: Tue Aug 03, 2021 2:41 pm
Full name: Bill Beame

Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by Chessnut1071 »

[fen]4r1b1/1p4B1/pN2pR2/RB2k3/1P2N2p/2p3b1/n2P1p1r/5K1n w -- 0 1[/fen]

This one is a good test for pawn promotion, double check and discovered check. try it without the computer first to appreciate it. enjoy
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by mvanthoor »

The development version of my engine finds it at depth 5 (it seems a hash table of 1GB was a bit overdone):

Code: Select all

info score cp 16 depth 1 seldepth 5 time 0 nodes 220 nps 0 pv b5e8 e5e4 a5a2
info score cp 86 depth 2 seldepth 14 time 2 nodes 2802 nps 1401000 pv b5c6 e5d4 f6e6 d4d3 e6e8 b7c6 e8g8 d3e4 a5a2
info score cp 334 depth 3 seldepth 14 time 17 nodes 21075 nps 1239706 pv b5e8 e5d4 f6f2 e6e5 f2h2 g3h2
info score cp 371 depth 4 seldepth 17 time 39 nodes 166114 nps 4259333 pv b5e8 e5d4 e4c5 c3d2 f6e6 g3e5 g7e5
info score mate 3 depth 5 seldepth 17 time 169 nodes 1071759 nps 6341769 hashfull 1 pv f1e2 e8d8 e2e3 a6b5 f6f2
...
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
User avatar
Ras
Posts: 2720
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by Ras »

Please post correct FEN strings. There has to be a space between the two '-' characters:
4r1b1/1p4B1/pN2pR2/RB2k3/1P2N2p/2p3b1/n2P1p1r/5K1n w - - 0 1

CT800V1.43:

Code: Select all

info depth 2 seldepth 3 score cp 78 time 6 nodes 2558 nps 426333 hashfull 0 tbhits 0 pv b5e8 e5d4 e4f2
info depth 3 seldepth 5 score cp 93 time 12 nodes 6834 nps 569500 hashfull 2 tbhits 0 pv b5e8 e5d4 f6f2 e6e5 f2h2
info depth 4 seldepth 8 score cp 247 time 27 nodes 24161 nps 894851 hashfull 10 tbhits 0 pv f6e6 e5f4 g7h6 f4f5 b5d7 f5g4 e6e8 g4f3
info depth 5 seldepth 9 score mate 5 time 57 nodes 48842 nps 856877 hashfull 25 tbhits 0 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
info depth 6 seldepth 9 score mate 5 time 79 nodes 66086 nps 836531 hashfull 25 tbhits 0 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
info depth 7 seldepth 9 score mate 5 time 80 nodes 67183 nps 839787 hashfull 25 tbhits 0 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
info depth 8 seldepth 9 score mate 5 time 116 nodes 111162 nps 958293 hashfull 30 tbhits 0 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
info depth 9 seldepth 9 score mate 5 time 126 nodes 121782 nps 966523 hashfull 35 tbhits 0 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
sinfo depth 10 seldepth 10 score mate 5 time 206 nodes 212685 nps 1032451 hashfull 56 tbhits 0 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
info depth 11 seldepth 11 score mate 3 time 250 nodes 262832 nps 1051328 hashfull 80 tbhits 0 pv f1e2 f2f1q e2e3 f1f6 b5f1
info depth 12 seldepth 12 score mate 3 time 267 nodes 279473 nps 1046715 hashfull 86 tbhits 0 pv f1e2 f2f1q e2e3 f1f6 b5f1
Engines with more pruning often have more trouble with unnatural positions because they require moves that are resonable to prune or reduce in normal play.
Rasmus Althoff
https://www.ct800.net
User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by algerbrex »

Ras wrote: Wed Oct 20, 2021 6:17 pm Engines with more pruning often have more trouble with unnatural positions because they require moves that are resonable to prune or reduce in normal play.
This is also true in Blunder. With null-move pruning Blunder doesn't find the mate-in-3 until the 7th ply:

Code: Select all

position fen 4r1b1/1p4B1/pN2pR2/RB2k3/1P2N2p/2p3b1/n2P1p1r/5K1n w - - 0 1
go
info depth 1 score cp 43 nodes 249 nps 4695 time 53 pv b5e8 e5e4
info depth 2 score cp 127 nodes 2194 nps 51972 time 42 pv b5c6 e5d4 f6e6 d4d3
info depth 3 score cp 353 nodes 12681 nps 1182739 time 10 pv b5e8 e5d4 f6e6 d4d3 e4c5 d3d2
info depth 4 score cp 558 nodes 49309 nps 1568881 time 31 pv f6e6 e5f4 g7h6 f4f5 b5c4 g3e5 a5e5 f5g4
info depth 5 score mate 5 nodes 263968 nps 1943845 time 135 pv b5e2 e5e4 d2d3 e4d4 f6e6 g3e5 g7e5 d4e3 b6c4
info depth 6 score mate 4 nodes 2395973 nps 2030774 time 1179 pv b5e8 e5d4 e4c5 c3d2 f6f3 e6e5 f3d3
info depth 7 score mate 3 nodes 12132987 nps 2072036 time 5855 pv f1e2 f2f1b e2e3 a2c1 b5f1
info depth 8 score mate 3 nodes 49391949 nps 2085182 time 23687 pv f1e2 f2f1b e2e3 a2c1 b5f1
With null-move pruning disabled, it finds the mate at the 5th ply, like Rustic:

Code: Select all

position fen 4r1b1/1p4B1/pN2pR2/RB2k3/1P2N2p/2p3b1/n2P1p1r/5K1n w - - 0 1
go
info depth 1 score cp 43 nodes 249 nps 23430 time 10 pv b5e8 e5e4
info depth 2 score cp 127 nodes 2194 nps 73610 time 29 pv b5c6 e5d4 f6e6 d4d3
info depth 3 score cp 353 nodes 12681 nps 1011787 time 12 pv b5e8 e5d4 f6e6 d4d3 e4c5 d3d2
info depth 4 score cp 558 nodes 49286 nps 1536228 time 32 pv f6e6 e5f4 g7h6 f4f5 b5c4 g3e5 a5e5 f5g4
info depth 5 score mate 3 nodes 461268 nps 1963455 time 234 pv f1e2 a2b4 b5d3 e5d4 d2c3
info depth 6 score mate 3 nodes 3274583 nps 2011647 time 1627 pv f1e2 a2b4 b5d3 e5d4 d2c3
info depth 7 score mate 3 nodes 14474541 nps 1956544 time 7398 pv f1e2 a2b4 b5d3 e5d4 d2c3
info depth 8 score mate 3 nodes 68522480 nps 1938569 time 35346 pv f1e2 a2b4 b5d3 e5d4 d2c3
User avatar
Ajedrecista
Posts: 2164
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Engine test: 3-move checkmate by Sam Loyd (1903) masterpiece 1.- Ke2!

Post by Ajedrecista »

Hello Bill:
Chessnut1071 wrote: Wed Oct 20, 2021 12:38 pm [fen]4r1b1/1p4B1/pN2pR2/RB2k3/1P2N2p/2p3b1/n2P1p1r/5K1n w -- 0 1[/fen]

This one is a good test for pawn promotion, double check and discovered check. try it without the computer first to appreciate it. enjoy
This is another scandal of position. It is needless to say that I would not find 1.- Ke2 on my own never. Like other times, I found the problem at YACPDB (such a wonderful web!) and sources where it was published and reprinted are available:

https://yacpdb.org/#47470

I was unaware of this problem, but it looks like it is so famous that even has a motto: 'The Steinitz Gambit'. I found a scanning of the exact page of the magazine where it was first printed thanks to the information given at YACPDB:

https://www.chesshistory.com/winter/winter186.html (A web about chess history with very interesting information).

https://www.chesshistory.com/winter/pic ... 6_loyd.jpg (The scanning, not posted here as image for being to large for a post).

Loyd won $10 as the first prize, but was announced some months later. The website of the scanning seems to have great, great stuff also.

Regards from Spain.

Ajedrecista.
User avatar
Ras
Posts: 2720
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by Ras »

algerbrex wrote: Wed Oct 20, 2021 6:53 pmThis is also true in Blunder.
The interesting thing is that with null-move, it finds the first mate line after 135ms while without, it finds the first mate line after 234ms. In regular play, the former is better because it doesn't matter whether it's the shortest mate - but finding some mate faster can matter.
Rasmus Althoff
https://www.ct800.net
JVMerlino
Posts: 1407
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by JVMerlino »

Ras wrote: Wed Oct 20, 2021 6:17 pm Please post correct FEN strings. There has to be a space between the two '-' characters:
It seems he does not care about using the correct FEN format. Apparently he thinks we should do extra work to appreciate his posts.
User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by algerbrex »

Ras wrote: Wed Oct 20, 2021 8:21 pm
algerbrex wrote: Wed Oct 20, 2021 6:53 pmThis is also true in Blunder.
The interesting thing is that with null-move, it finds the first mate line after 135ms while without, it finds the first mate line after 234ms. In regular play, the former is better because it doesn't matter whether it's the shortest mate - but finding some mate faster can matter.
Very true. The primary goal of writing Blunder is to create a strong engine, and null-move pruning on average helps with that, even if it chokes on mate puzzles. Because as you said in an actual game, a forced mate is a forced mate, whether it's in 3 moves or 5.

Probably in a future version of Blunder, I'll add a UCI option to put Blunder in analysis or mate-finder mode where "risky" pruning techniques are disabled.
User avatar
Ras
Posts: 2720
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by Ras »

algerbrex wrote: Wed Oct 20, 2021 9:33 pmI'll add a UCI option to put Blunder in analysis or mate-finder mode where "risky" pruning techniques are disabled.
That is already in UCI - "go mate X" is in the spec.
Rasmus Althoff
https://www.ct800.net
User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Engine test- 3-move mate Sam Loyd (1903) masterpiece Ke2!

Post by algerbrex »

Ras wrote: Wed Oct 20, 2021 11:27 pm
algerbrex wrote: Wed Oct 20, 2021 9:33 pmI'll add a UCI option to put Blunder in analysis or mate-finder mode where "risky" pruning techniques are disabled.
That is already in UCI - "go mate X" is in the spec.
Thanks, didn't realize that. I'll mark it down to add to a future version of Blunder.