Gentelmen, check your engines.

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Gentelmen, check your engines.

Post by Chessnut1071 »

JVMerlino wrote: Sun Sep 05, 2021 6:13 pm The King from CM9000, of course, finds it almost instantly:

Code: Select all

Time	Depth	Score	Positions	Moves
0:00	1/3	17.19	10326		1.exf6+ Kxe6 2.Rxd6+ Kf5 3.Ng3+
					Kg6 4.Rg8+ Kh7 5.Rg7+ Kh6 6.Nxf1
					dxe3 7.Nxe3 fxe3 8.Qxe3+ Kh5
0:00	1/4	20.33	97909		1.exf6+ Kxe6 2.Rxd6+ Kf5 3.Nxd4+
					Ke5 4.Rfd8 Qa6+ 5.Kxa6
0:00	1/4	Mate08	219097		1.Nxd6 Qa6+ 2.Kxa6 Kxe6 3.Rxf6+
					Ke7 4.Re8+ Kd7 5.Rf7+ Kc6 6.Rc8+
					Kd5 7.Nxf4+ Kxe5 8.Nc4#
0:00	1/5	Mate07	274326		1.Nxd6 Qa6+ 2.Kxa6 Kxe6 3.Rde8+
					Be7 4.Nxf4+ Kd7 5.Rxe7+ Kxe7 6.Rf7+
					Kd8 7.Ne6#
0:00	1/5	Mate05	651400		1.Qe2 Qxe2 2.Ng7 Nxb5+ 3.Kb7 Nc5+
					4.bxc5 Bxg7 5.Rfe8#
CM9000 must be using a hardware chip, that can't be software with that kind of speed. Any ideas how they {he} achieved that speed
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Gentelmen, check your engines.

Post by Ras »

amanjpro wrote: Sun Sep 05, 2021 12:19 am Zahak:

Code: Select all

info depth 26 seldepth 9 hashfull 579 nodes 62594746 nps 1527214 score mate +4 time 40986 pv e1e2 d6b5 e2b5 f1b5 e5f6 e7e6 h5g7 e6e5 e3d4
The mate distance looks off: it displays the score as mate +4, but has a mate in 5 as PV.
Rasmus Althoff
https://www.ct800.net
R. Tomasi
Posts: 307
Joined: Wed Sep 01, 2021 4:08 pm
Location: Germany
Full name: Roland Tomasi

Re: Gentelmen, check your engines.

Post by R. Tomasi »

Chessnut1071 wrote: Sun Sep 05, 2021 6:24 pm
JVMerlino wrote: Sun Sep 05, 2021 6:13 pm The King from CM9000, of course, finds it almost instantly:

Code: Select all

Time	Depth	Score	Positions	Moves
0:00	1/3	17.19	10326		1.exf6+ Kxe6 2.Rxd6+ Kf5 3.Ng3+
					Kg6 4.Rg8+ Kh7 5.Rg7+ Kh6 6.Nxf1
					dxe3 7.Nxe3 fxe3 8.Qxe3+ Kh5
0:00	1/4	20.33	97909		1.exf6+ Kxe6 2.Rxd6+ Kf5 3.Nxd4+
					Ke5 4.Rfd8 Qa6+ 5.Kxa6
0:00	1/4	Mate08	219097		1.Nxd6 Qa6+ 2.Kxa6 Kxe6 3.Rxf6+
					Ke7 4.Re8+ Kd7 5.Rf7+ Kc6 6.Rc8+
					Kd5 7.Nxf4+ Kxe5 8.Nc4#
0:00	1/5	Mate07	274326		1.Nxd6 Qa6+ 2.Kxa6 Kxe6 3.Rde8+
					Be7 4.Nxf4+ Kd7 5.Rxe7+ Kxe7 6.Rf7+
					Kd8 7.Ne6#
0:00	1/5	Mate05	651400		1.Qe2 Qxe2 2.Ng7 Nxb5+ 3.Kb7 Nc5+
					4.bxc5 Bxg7 5.Rfe8#
CM9000 must be using a hardware chip, that can't be software with that kind of speed. Any ideas how they {he} achieved that speed
Is that the node count listed under "Positions"? If so, it seems ridiculously low to me - really wonder how they get such a slim tree.
amanjpro
Posts: 883
Joined: Sat Mar 13, 2021 1:47 am
Full name: Amanj Sherwany

Re: Gentelmen, check your engines.

Post by amanjpro »

Ras wrote: Sun Sep 05, 2021 8:39 pm
amanjpro wrote: Sun Sep 05, 2021 12:19 am Zahak:

Code: Select all

info depth 26 seldepth 9 hashfull 579 nodes 62594746 nps 1527214 score mate +4 time 40986 pv e1e2 d6b5 e2b5 f1b5 e5f6 e7e6 h5g7 e6e5 e3d4
The mate distance looks off: it displays the score as mate +4, but has a mate in 5 as PV.
The PV is odd number of plies, I should probably add one in such cases... Thanks for reporting it
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Gentelmen, check your engines.

Post by JVMerlino »

Chessnut1071 wrote: Sun Sep 05, 2021 6:24 pm
JVMerlino wrote: Sun Sep 05, 2021 6:13 pm The King from CM9000, of course, finds it almost instantly:

Code: Select all

Time	Depth	Score	Positions	Moves
0:00	1/5	Mate05	651400		1.Qe2 Qxe2 2.Ng7 Nxb5+ 3.Kb7 Nc5+
					4.bxc5 Bxg7 5.Rfe8#
CM9000 must be using a hardware chip, that can't be software with that kind of speed. Any ideas how they {he} achieved that speed
The engine was written in 2002, so obviously no "hardware chip". Johan was very conservative about reductions, particularly in mate situations.
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Gentelmen, check your engines.

Post by JVMerlino »

R. Tomasi wrote: Sun Sep 05, 2021 9:10 pm
JVMerlino wrote: Sun Sep 05, 2021 6:13 pm The King from CM9000, of course, finds it almost instantly:

Code: Select all

0:00	1/5	Mate05	651400		1.Qe2 Qxe2 2.Ng7 Nxb5+ 3.Kb7 Nc5+
					4.bxc5 Bxg7 5.Rfe8#
Is that the node count listed under "Positions"? If so, it seems ridiculously low to me - really wonder how they get such a slim tree.
Yes, that is node count.
User avatar
lithander
Posts: 880
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Gentelmen, check your engines.

Post by lithander »

Motivated by these mate puzzles this weekend I embedded mate distance in the score and removed the early-return once a mate was found.
MinimalChess now gives the correct answer after 12 seconds.

Code: Select all

position fen 3R1R2/K3k3/1p1nPb2/pN2P2N/nP1ppp2/4P3/6P1/4Qq1r w - -
go
info string Search scheduled to take 715827862ms!
info depth 1 score cp 947 nodes 1762 nps 65259 time 27 pv e5d6
info depth 2 score cp 947 nodes 3430 nps 51969 time 66 pv e1f1 h1f1
info depth 3 score cp 942 nodes 6020 nps 84788 time 71 pv e1f1 h1f1 e5d6
info depth 4 score cp 873 nodes 8741 nps 115013 time 76 pv e1f1 h1f1 e5d6 e7e6
info depth 5 score cp 913 nodes 24476 nps 222509 time 110 pv e5f6 e7e6 d8d6 e6f5 b5d4
info depth 6 score cp 904 nodes 35769 nps 275146 time 130 pv e5f6 e7e6 d8d6 e6f5 b5d4 f5g5
info depth 7 score cp 966 nodes 91069 nps 385885 time 236 pv e5f6 e7e6 d8d6 e6f5 d6d5 f5g6 e1f1
info depth 8 score cp 971 nodes 116449 nps 405745 time 287 pv e5f6 e7e6 d8d6 e6f5 d6d5 f5g6 e1f1 h1f1
info depth 9 score cp 1296 nodes 291349 nps 605715 time 481 pv e5d6 e7e6 b5c7 e6e5 e3f4 f1f4 e1h1 f6d8 h5f4
info depth 10 score cp 1279 nodes 401712 nps 691414 time 581 pv e5d6 e7e6 b5c7 e6f5 f8f6 f5g4 d8g8 g4h5 g2g4 f4g3
info depth 11 score cp 1668 nodes 1003195 nps 876152 time 1145 pv e5f6 e7e6 d8d6 e6f5 h5g3 f5g6 f8g8 g6h7 g8g7 h7h6 g3f1
info depth 12 score cp 1667 nodes 1435103 nps 921118 time 1558 pv e5f6 e7e6 d8d6 e6f5 h5g3 f5g6 f8g8 g6h7 g8g7 h7h6 g3f1 d4e3
info depth 13 score mate 5 nodes 11872297 nps 968692 time 12256 pv e1e2 f1e2 h5g7 d6b5 a7b7 f6e5 f8f7 e7d8 f7d7
info depth 14 score mate 5 nodes 16261385 nps 994580 time 16350 pv e1e2 f1e2 h5g7 d6b5 a7b7 f6e5 f8f7 e7d8 f7d7
stop
bestmove e1e2
And also the other mate in 7 problem is now solved in the 17th iteration within 20 seconds:

Code: Select all

position fen 5k2/ppp2r1p/2p2ppP/8/2Q5/2P1bN2/PP4P1/1K1R4/ w - -
go
info string Search scheduled to take 715827862ms!
info depth 1 score cp 1001 nodes 127 nps 127000 time 0 pv c4b4
info depth 2 score cp 906 nodes 257 nps 128500 time 2 pv d1d8 f8e7
info depth 3 score cp 986 nodes 411 nps 137000 time 3 pv d1d8 f8e7 d8d7
info depth 4 score cp 926 nodes 905 nps 301666 time 3 pv d1d8 f8e7 d8d7 e7d7
info depth 5 score cp 987 nodes 2753 nps 458833 time 6 pv c4b4 c6c5 b4b7 e3h6 b7a8
info depth 6 score cp 904 nodes 4399 nps 628428 time 7 pv c4b4 c6c5 b4b7 e3h6 d1d8 f8g7
info depth 7 score cp 1003 nodes 7555 nps 629583 time 12 pv d1d8 f8e7 d8d7 e7d7 c4f7 d7d6 f7f6
info depth 8 score cp 928 nodes 12415 nps 689722 time 18 pv d1d8 f8e7 d8d7 e7d7 c4f7 d7d6 f7f6 d6c5
info depth 9 score cp 1234 nodes 25475 nps 727857 time 35 pv d1d8 f8e7 c4d3 f6f5 f3e5 e3h6 d3d7 e7f6 d7f7
info depth 10 score cp 1182 nodes 36403 nps 713784 time 51 pv d1d8 f8e7 c4d3 f6f5 f3e5 e3h6 d3d7 e7f6 e5f7 h6f4
info depth 11 score cp 1559 nodes 184650 nps 820666 time 225 pv d1d8 f8e7 d8c8 e7d6 c4f7 e3b6 f7f6 d6d5 c8d8 d5c4 f6f7
info depth 12 score cp 1486 nodes 265176 nps 839164 time 316 pv d1d8 f8e7 d8c8 f7f8 c4e4 e7d7 c8f8 e3b6 f8f6 d7d8 e4e6 a7a6
info depth 13 score cp 1727 nodes 645731 nps 853013 time 757 pv d1d8 f8e7 d8c8 a7a5 c8c7 e7d6 c7f7 e3f2 f7b7 a5a4 b7h7 g6g5 c4b4
info depth 14 score cp 1680 nodes 813915 nps 835641 time 974 pv d1d8 f8e7 d8c8 a7a5 c8c7 e7d6 c7f7 e3f2 f7b7 a5a4 c4f4 d6e6 f4a4 e6d6
info depth 15 score cp 2130 nodes 2030292 nps 859201 time 2363 pv d1d8 f8e7 d8c8 a7a5 c8c7 e7d6 c4f7 d6c5 c7b7 a5a4 f7e7 c5c4 e7e3 c4d5 e3d4
info depth 16 score cp 2130 nodes 2360247 nps 824108 time 2864 pv d1d8 f8e7 d8c8 a7a5 c8c7 e7d6 c4f7 d6c5 c7b7 a5a4 f7e7 c5c4 e7e4 c4c5 e4e7 c5c4
info depth 17 score mate 7 nodes 15327343 nps 783286 time 19568 pv c4e4 e3h6 d1d8 f8g7 f3d4 h6f4 d4e6 g7h6 d8d1 f7e7 d1h1 f4h2 h1h2
info depth 18 score mate 7 nodes 27915224 nps 817286 time 34156 pv c4e4 e3h6 d1d8 f8g7 f3d4 h6f4 d4e6 g7h6 d8d1 f7e7 d1h1 f4h2 h1h2
info depth 19 score mate 7 nodes 79425088 nps 591585 time 134258 pv c4e4 e3h6 d1d8 f8g7 f3d4 h6f4 d4e6 g7h6 d8d1 f7e7 d1h1 f4h2 h1h2
info depth 20 score mate 7 nodes 239550846 nps 754685 time 317418 pv c4e4 e3h6 d1d8 f8g7 f3d4 h6f4 d4e6 g7h6 d8d1 f7e7 d1h1 f4h2 h1h2
But to be sure that my engine is now decent in mate-finding having just two testcases isn't a solid foundation. Does anyone have a a few more annotated test positions similar to this one?
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
klx
Posts: 179
Joined: Tue Jun 15, 2021 8:11 pm
Full name: Emanuel Torres

Re: Gentelmen, check your engines.

Post by klx »

So there appears to be the same kind of misunderstanding going on in this thread as in the previous mate-finder thread. Unless your program has proven that there's no shorter mate, it's not really relevant to compare elapsed time or how many moves you found it in. Your engine has found a mate, but you have no clue whether it's the shortest one or not.
[Moderation warning] This signature violated the rule against commercial exhortations.
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Gentelmen, check your engines.

Post by JVMerlino »

klx wrote: Mon Sep 06, 2021 2:19 am So there appears to be the same kind of misunderstanding going on in this thread as in the previous mate-finder thread. Unless your program has proven that there's no shorter mate, it's not really relevant to compare elapsed time or how many moves you found it in. Your engine has found a mate, but you have no clue whether it's the shortest one or not.
That's not how engines work in their normal mode. All they report is "I have found a Mate in N". They never report "and I'm certain there is no shorter mate" unless they're in a special mate-finder mode. Standard analysis mode is not the same thing. So if you want people to find a Mate in N AND "prove" that their is no shorter mate, then you need to specify that.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Gentelmen, check your engines.

Post by Ras »

klx wrote: Mon Sep 06, 2021 2:19 amYour engine has found a mate, but you have no clue whether it's the shortest one or not.
I do because mine finds a mate in 5, but no mate in 4:

Code: Select all

position fen 3R1R2/K3k3/1p1nPb2/pN2P2N/nP1ppp2/4P3/6P1/4Qq1r w 0 1
go mate 5
info depth 9 seldepth 9 score mate 5 time 3248 nodes 1799115 nps 553914 hashfull 0 tbhits 0 pv e1e2 d6c8 d8c8 e7e6 e2g4 e6e5 c8e8 e5d5 g4e6
bestmove e1e2
go mate 4
info depth 7 seldepth 7 score cp 0 time 221 nodes 86838 nps 392932 hashfull 0 tbhits 0
info string error (no mate found)
bestmove 0000
Rasmus Althoff
https://www.ct800.net