Dedicated mate finders

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Vinvin
Posts: 5228
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: Mate-in-4 sample extrema

Post by Vinvin »

sje wrote:
Dann Corbit wrote:Here is the slowest one with a single solution for a mate in 6:
[d]3qkrbn/1p1nq1qp/2n2rr1/1q2p3/q4P2/2B5/PPN1N2P/NB2KRBN b - - acd 13; acs 1056; bm exf4; ce 32756; dm 6; id "Leonid.388012"; pm exf4; pv exf4 Nhg3 fxg3 Be5 Rxf1+ Kd2 Ndxe5+ Ncd4 Nf3+ Kc3 Qec5#;
Symbolic says: Position is not reachable from the starting array.
6 promotions + 3 pawns is too much ;-)
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Mate-in-4 sample extrema

Post by sje »

Vinvin wrote:
sje wrote:
Dann Corbit wrote:Here is the slowest one with a single solution for a mate in 6:
[d]3qkrbn/1p1nq1qp/2n2rr1/1q2p3/q4P2/2B5/PPN1N2P/NB2KRBN b - - acd 13; acs 1056; bm exf4; ce 32756; dm 6; id "Leonid.388012"; pm exf4; pv exf4 Nhg3 fxg3 Be5 Rxf1+ Kd2 Ndxe5+ Ncd4 Nf3+ Kc3 Qec5#;
Symbolic says: Position is not reachable from the starting array.
6 promotions + 3 pawns is too much ;-)
Symbolic maxes a decent attempt to keep bogus data from getting inside the program. It's very careful with en passant and castling data, more so than some other programs I've tested.

Symbolic's FEN reader also tests for the number of checks on the STM king; more than two is invalid. I've used sneaky triple check positions to crash unsuspecting programs.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

18 MateIn4 in 225.69 seconds, RasPi model 1 @1GHz

Post by sje »

18 MateIn4 in 225.69 seconds, Raspberry Pi model B1 @1GHz with identical output other than processing time. Slow down factor of 13.4 compared to 2.66 GHz 5150 Xeon made in 2006.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Mate-in-4 sample extrema

Post by sje »

Dann Corbit wrote:
Dann Corbit wrote:How does your mate solver perform with this mate in 6:
[d]5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - -
It takes Chest "quite a while."
5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - - acd 13; acs 2514; bm Na4 Nc4 Nd1 Nd7 Ne8 Nxd3 Nxh5 Q1g1 Qaa3 Qbb4 Qbd4 Qd8 a8=Q a8=R b8=Q b8=R; ce 32756; dm 6; id "Leonid.391101"; pm Na4 Nc4 Nd1 Nd7 Ne8 Nxd3 Nxh5 Q1g1 Qaa3 Qbb4 Qbd4 Qd8 a8=Q a8=R b8=Q b8=R; pv b8=Q Bce8 Q8d6 Ne6 Qxf8+ Bhg8 Nd7+ Nd4 Qcxd4+ Kh7 Qfg7#;
[d]5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - - 0 1[/d]
One hour thirteen minutes seven seconds:

Code: Select all

[MateIn6/11/1:13:07.060/4,711,533,792] 1. Nxd3 Nf5 2. Ng4+ Kg8 3. Q1b2 Bxa2 4. Qh8+ Kf7 5. Qbf6+ Ke8 6. Qbd8#
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: 18 MateIn4 in 225.69 seconds, RasPi model 1 @1GHz

Post by Dann Corbit »

That is not bad time.
If your mate search can be made SMP, it will be a big leap forward.

All the dedicated mate engines I know of are single threaded.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

On a 3.0 GHz Core i7-5960

Post by sje »

On a 3.0 GHz Core i7-5960, Symbolic's single threaded mate search solves the 100,000 position MateIn3 set in 113.34 seconds, about 882 positions per second. The same machine solves the MateIn4 problem sat a rate of about 31 positions per second.

What I'd like to see are some well-tested FEN/EPD test suites with mate-in-N problems where N equals five or more.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: On a 3.0 GHz Core i7-5960

Post by Dann Corbit »

sje wrote:On a 3.0 GHz Core i7-5960, Symbolic's single threaded mate search solves the 100,000 position MateIn3 set in 113.34 seconds, about 882 positions per second. The same machine solves the MateIn4 problem sat a rate of about 31 positions per second.

What I'd like to see are some well-tested FEN/EPD test suites with mate-in-N problems where N equals five or more.
I have lots and lots and lots of them.
I will post some sets tomorrow.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Mate-in-4 sample extrema

Post by Dann Corbit »

Composers often create positions outside the normal bounds of chess.
Personally, I cannot see any reason why a position such as this should not be allowed:
[d]qqqkqqqq/qqqqqqqq/qqqqqqqq/qqqqqqqq/QQQQQQQQ/QQQQQQQQ/QQQQQQQQ/QQQKQQQQ w - -

Yes, you would have to make your chessmen arrays larger (unless you use bitboards for your piece lists, in which case they are already large enough).

You will find thousands of position on YACPDB that are either not legal because of too many chessmen or are not reachable in a real game.

There are also positions with pawns on the first and eighth ranks. I will draw the line there and say that this should not be allowed because it is ambiguous what to do from there.

In addition, more than one king of the same color should be a naughty no-no. After all, would we have to checkmate both kings at the same time, capture the first king, or mate only one of the kings
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Mate-in-4 sample extrema

Post by Dann Corbit »

Or even:
[d]QrbkbrQQ/QnpppnQQ/QQQQQQQQ/QQQQQQQQ/QQQQQQQQ/QQQQQQQQ/QQQQQQQQ/QQQKQQQQ w - -
User avatar
Ajedrecista
Posts: 1969
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Mate-in-6 sample extrema.

Post by Ajedrecista »

Hello Dann:
Dann Corbit wrote:
Dann Corbit wrote:How does your mate solver perform with this mate in 6:
[d]5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - -
It takes Chest "quite a while."
5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - - acd 13; acs 2514; bm Na4 Nc4 Nd1 Nd7 Ne8 Nxd3 Nxh5 Q1g1 Qaa3 Qbb4 Qbd4 Qd8 a8=Q a8=R b8=Q b8=R; ce 32756; dm 6; id "Leonid.391101"; pm Na4 Nc4 Nd1 Nd7 Ne8 Nxd3 Nxh5 Q1g1 Qaa3 Qbb4 Qbd4 Qd8 a8=Q a8=R b8=Q b8=R; pv b8=Q Bce8 Q8d6 Ne6 Qxf8+ Bhg8 Nd7+ Nd4 Qcxd4+ Kh7 Qfg7#;
JetChess solves it in less than 20 mintes in my PC of 9 years old! However, JetChess does not show pv.

JetChess 1.0.0.0 (single core, 32-bit). Hash = 1 GB. Intel Pentium D930 (3 GHz) of year 2006:

Code: Select all

5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - -

  1  Qb1-c2   0
  2  Qb1*d3   0
  3  Qb1-c1   0
  4  Qb1-d1   0
  5  Qb1-e1   0
  6  Qb1-f1   0
  7  Qb1-g1   Mate
  8  Qb1-h1   0
  9  Qa2-b3   0
 10  Qa2-c4   0
 11  Qa2-d5   0
 12  Qa2-e6   0
 13  Qa2*f7   0
 14  Qa2-a3   Mate
 15  Qa2-a4   0
 16  Qa2-a5   0
 17  Qa2-a6   0
 18  Qc3-b4   0
 19  Qc3-a5   0
 20  Qc3-d4   0
 21  Qc3-e5   0
 22  Qc3-d2   0
 23  Qc3-e1   0
 24  Qc3-c4   0
 25  Qc3-c5   0
 26  Qc3*c6   0
 27  Qc3*d3   0
 28  Qc3-b3   0
 29  Qc3-a3   0
 30  Qc3-c2   0
 31  Qc3-c1   0
 32  Qb6-c7   0
 33  Qb6-d8   Mate
 34  Qb6-c5   0
 35  Qb6-d4   Mate
 36  Qb6-e3   0
 37  Qb6-f2   0
 38  Qb6-g1   0
 39  Qb6-a5   0
 40  Qb6*c6   0
 41  Qb6-a6   0
 42  Qb6-b5   0
 43  Qb6-b4   Mate
 44  Qb6-b3   0
 45  Nb2-a4   Mate
 46  Nb2-c4   Mate
 47  Nb2*d3   Mate
 48  Nb2-d1   Mate
 49  Ne2-d4   0
 50  Ne2-g3   0
 51  Ne2-c1   0
 52  Ne2-g1   0
 53  Nf6-d7   Mate
 54  Nf6-e8   Mate
 55  Nf6-g8   0
 56  Nf6*h7   0
 57  Nf6-d5   0
 58  Nf6*e4   0
 59  Nf6-g4   0
 60  Nf6*h5   Mate
 61   f4-f5   0
 62   a7-a8Q  Mate
 63   a7-a8N  0
 64   a7-a8R  Mate
 65   a7-a8B  0
 66   b7-b8Q  Mate
 67   b7-b8N  0
 68   b7-b8R  Mate
 69   b7-b8B  0

Multiple Solutions (checkmate in 6).

Time: 1119.326 s (0:18:39.326)
Perft results:

Code: Select all

5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - -

perft(1) =             69
perft(2) =          2,722
perft(3) =        187,614
perft(4) =      7,223,934
perft(5) =    497,393,135
perft(6) = 18,912,611,910
Unique positions (en passant flag checked):

Code: Select all

5b1k/PP3bnb/1Qb2N2/7b/4bP2/2Qb4/QN2N3/KQ6 w - -

positions(1) =         69
positions(2) =      2,721
positions(3) =    103,763
positions(4) =  2,253,365
positions(5) = 58,386,326
It is the first time I see JetChess reporting perft(2) =/= positions(2). I hope it is not a bug.

Regards from Spain.

Ajedrecista.