KNNNKN without tablebases

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

muxecoid
Posts: 150
Joined: Sat Jan 30, 2010 10:54 am
Location: Israel

KNNNKN without tablebases

Post by muxecoid »

[d] 8/4K1n1/8/8/3NN1k1/8/4N3/8 w - - 65 34

Does your engine see mate in 13 without tablebase here?

I played with it a little:
Spark 0.3a is blind here
Stockfish gives +327.00 quickly but needs a few minutes to find shortest mate in 13
User avatar
David Dahlem
Posts: 900
Joined: Wed Mar 08, 2006 9:06 pm

Re: KNNNKN without tablebases

Post by David Dahlem »

Chest 5.1:

No Mate in -13 found ! (00:03)
13/13 00:06 879.415 /8/239.557 +M0 Ne4f6+

Edit: oops, ignore this, Chest was set for defender moves, so was looking for black to mate. :oops:
rlsuth
Posts: 322
Joined: Wed Mar 08, 2006 9:37 pm

Re: KNNNKN without tablebases

Post by rlsuth »

Analysis by Zappa Mexico II x64:

1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3 4.Neg1+ Kg2 5.Nxh5 Kf2 6.Nf6 Kg2 7.Ne4 Kf1 8.Kf6 Kg2 9.Ke6 Kf1
+- (7.08) Depth: 12/27 00:00:00 2365kN
1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3 4.Neg1+ Kg2 5.Nxh5 Kf2 6.Nf6 Kg2 7.Ne4 Kf1 8.Kf6 Kg2 9.Ke6 Kf1
+- (7.08) Depth: 12/27 00:00:00 2721kN
1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3 4.Neg1+ Kg2 5.Nxh5 Kf2 6.Nf6 Kg2 7.Ne4 Kf1 8.Kf6 Kg2 9.Ke6 Kf1
+- (7.09) Depth: 13/28 00:00:01 3961kN
1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3 4.Neg1+ Kg2 5.Nxh5 Kf2 6.Nf6 Kg2 7.Ne4 Kf1 8.Kf6 Kg2 9.Ke6 Kf1
+- (7.09) Depth: 13/28 00:00:01 4683kN
1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ne6 7.Ng3+ Kf2 8.Nxe6 Kg2 9.Kf4 Kh3 10.Neg5+ Kg2 11.N5e4 Kh3 12.Nf1 Kg2 13.Ne3+ Kh1 14.Nf2#
+- (#14) Depth: 19/43 00:01:51 946mN
1.Kf6 Ne8+ 2.Kg6 Kh3 3.Kg5 Kg2 4.Kg4 Kf1 5.Kf3 Nf6 6.Nxf6 Ke1 7.Ne4 Kf1 8.Nf4 Ke1 9.Nf5 Kf1 10.Ne3+ Kg1 11.Ne2+ Kh2 12.Nf5 Kh3 13.Nf2+ Kh2 14.Ng4+ Kh1 15.Nfg3#
+- (#13) Depth: 20/43 00:02:11 1122mN
User avatar
Eelco de Groot
Posts: 4681
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: KNNNKN without tablebases

Post by Eelco de Groot »

Vey impressive that Zappa Mexico can find this, I assume without using EGTBs, the only thing confusing there is, it gives the correct Mate in 13 but the line given at that point is still 15 moves long? Odd PV from Anthony's Zappa.

Rainbow Serpent can't come close to Zappa Mexico, but after giving it some brand new chess endgame knowledge from Harm Muller about the superiority of multiple Knights over even multiple Queens, it almost found the right answer, and it did find the right move 1. Kf6 8-) I am happy with that answer, even if #14 should be a mate in 13 according to the Shredder 6 men tablebases, because I know there are some nagging bugs somewhere that could completely annihilate this new found knowledge of Rainbow Serpent. The residence of said bugs is however a known unknown...


[d]8/4K1n1/8/8/3NN1k1/8/4N3/8 w - -

Engine: Rainbow Serpent 1.6.3s(dc) Build 285 (Athlon 2009 MHz, 256 MB)
by Tord Romstad, Marco Costalba, Joona Kiiski Modifications: Dann Corbit

1.00 0:00 +9.09 1.Kd7 (303) 1

2.00 0:00 +9.33 1.Kf6 Ne8+ 2.Ke5 (364) 1

3.00 0:00 +9.33 1.Kf6 Ne8+ 2.Kg6 Kh4 (5.423) 20

4.00 0:00 +9.73 1.Kf6 Ne8+ 2.Kg6 Kh3 3.Kg5 Kh2 (16.846) 59

5.00 0:00 +9.85 1.Kf6 Ne8+ 2.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ka5 14.Kc4 (89.221.806) 1034

20.01 2:37 +89.09 1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3
4.Neg1+ Kg3 5.Nxh5+ Kg4 6.Nf6+ Kf4
7.Ke6 Ke3 8.Ne5 Kd2 9.Ngf3+ Ke2
10.Kf5 Kd1 11.Nd5 Kc2 12.Ke4 Kb2
13.Kd3 Kb3 (168.321.614) 1069

21.01 8:40 +89.14 1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3
4.Neg1+ Kg3 5.Nxh5+ Kg4 6.Nf6+ Kf4
7.Ke6 Ke3 8.Ne5 Kd2 9.Ngf3+ Ke2
10.Ne4 Ke3 11.Kf5 Ke2 12.Kf4 Kd1
13.Nd4 Kc1 14.Ke3 (587.878.668) 1129

22.01 20:53 +89.17 1.Nf6+ Kh4 2.Kf7 Nh5 3.Nf3+ Kh3
4.Neg1+ Kg3 5.Nxh5+ Kg4 6.Nf6+ Kf4
7.Ke6 Ke3 8.Ne5 Kd2 9.Ngf3+ Kc2
10.Kd5 Kc3 11.Ne4+ Kb4 12.Nd4 Ka5
13.Kc5 Ka6 14.Nc3 (1.404.960.346) 1121

22.05 48:49 +M14 1.Kf6 Ne8+ 2.Kg6 Kh3 3.Kg5 Kg2 4.Kg4 Ng7
5.Nf4+ Kf1 6.Kg3 Nh5+ 7.Nxh5 Ke1
8.Nf4 Kd1 9.Nfe2 Ke1 10.N2c3 Kf1
11.Nd2+ Kg1 12.Nce4 Kh1 13.Nf2+ Kg1
14.N4f3+ (2.724.772.542) 930


best move: Ke7-f6 time: 95:21.812 min n/s: 812.828 nodes: 4.650.840.086
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
rlsuth
Posts: 322
Joined: Wed Mar 08, 2006 9:37 pm

Re: KNNNKN without tablebases

Post by rlsuth »

Eelco de Groot wrote:Vey impressive that Zappa Mexico can find this, I assume without using EGTBs, the only thing confusing there is, it gives the correct Mate in 13 but the line given at that point is still 15 moves long? Odd PV from Anthony's Zappa.


That's probably my fault. I snatched the eval out as soon as it showed #13 without letting it finish thinking.

I'm using 8 cores and Spark 0.3a is showing this after about 11 minutes:


Analysis by spark-0.3a:

1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3
= (0.04) Depth: 6/13 00:00:00 25kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3 6.Ned3+ Ke3
= (0.04) Depth: 7/13 00:00:00 77kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3 6.Ned3+ Ke3 7.Nd1+ Kxd3
= (0.04) Depth: 8/17 00:00:00 247kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3 6.Ned3+ Ke3 7.Nc2+ Kf3 8.Nce1+ Ke3
= (0.04) Depth: 9/18 00:00:00 777kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3 6.Ned3+ Ke3 7.Nc2+ Kf3 8.Nce1+ Ke3 9.Nd1+ Kd4
= (0.04) Depth: 10/20 00:00:00 2461kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3 6.Ned3+ Ke3 7.Nb5 Nf1 8.Ne4 Kxd3
= (0.04) Depth: 11/22 00:00:00 7017kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5.Ne1 Ng3 6.Ned3+ Ke3 7.Nb5 Nf1 8.Ne4 Kxd3 9.Nf2+ Ke3
= (0.04) Depth: 12/24 00:00:01 19252kN
1.Kf7 Nh5 2.Nf2+ Kg5 3.Nf3+ Kf5 4.Ned4+ Kf4 5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7.Ne3 Kh1 8.Kf6 Kg1 9.Nd3 Kh1 10.Ne5 Kh2
= (0.04) Depth: 18/43 00:02:37 2772mN
1.Kf6
+- (#38) Depth: 19/46 00:04:40 5012mN
1.Kf6 Nh5+ 2.Kf7 Kh3 3.Kg6 Ng7 4.Kxg7 Kg2 5.Nf4+ Kg1 6.Nde2+ Kf1 7.Kf6 Ke1 8.Nd4 Kd1 9.Nfe2 Ke1 10.N2g3 Kd1 11.Ngf5 Kc1
= (0.04) Depth: 19/46 00:05:17 5630mN
1.Kf6
+- (#48) Depth: 20/48 00:10:06 10898mN
1.Kf6 Nh5+ 2.Kf7 Kh3 3.Kg6 Ng7 4.Kxg7 Kg2 5.Kf6 Kh1 6.N2g3+ Kg2 7.Kg5 Kh2 8.Nf3+ Kh3 9.Kf5 Kg2 10.Kf4 Kh3 11.Nf1 Kg2 12.Ne3+ Kh3 13.Nf2#
+- (#13) Depth: 20/48 00:11:20 12271mN
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: KNNNKN without tablebases

Post by Sven »

Eelco de Groot wrote:22.05 48:49 +M14 1.Kf6 Ne8+ 2.Kg6 Kh3 3.Kg5 Kg2 4.Kg4 Ng7 5.Nf4+ Kf1 6.Kg3 Nh5+ 7.Nxh5 Ke1 8.Nf4 Kd1 9.Nfe2 Ke1 10.N2c3 Kf1 11.Nd2+ Kg1 12.Nce4 Kh1 13.Nf2+ Kg1 14.N4f3+ (2.724.772.542) 930
In that analysis above from Rainbow Serpent, 6.Kg3 is not optimal while the better move 6.Kf3 allows +M13. So 1...Ne8+ is not "better" than 1...Nh5+, both are +M13 for white.

Sven
User avatar
Eelco de Groot
Posts: 4681
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: KNNNKN without tablebases

Post by Eelco de Groot »

Sven Schüle wrote:
Eelco de Groot wrote:22.05 48:49 +M14 1.Kf6 Ne8+ 2.Kg6 Kh3 3.Kg5 Kg2 4.Kg4 Ng7 5.Nf4+ Kf1 6.Kg3 Nh5+ 7.Nxh5 Ke1 8.Nf4 Kd1 9.Nfe2 Ke1 10.N2c3 Kf1 11.Nd2+ Kg1 12.Nce4 Kh1 13.Nf2+ Kg1 14.N4f3+ (2.724.772.542) 930
In that analysis above from Rainbow Serpent, 6.Kg3 is not optimal while the better move 6.Kf3 allows +M13. So 1...Ne8+ is not "better" than 1...Nh5+, both are +M13 for white.

Sven
Yes, I know Sven, the Shredder online tablebases say it's a mate in 13, giving all the possible moves in any position with six pieces and distance to mate from them, that is really a great tool. Rainbow Serpent is not really an exhaustive searcher like Zappa is, Zappa is a 'Truth Seeker' in endgames I think, at least that was Anthony's philosophy with Zappa, but the Rainbow Serpent can be very selective so even finding 1. Kf6! I had not really expected from it, only after teaching it that three Knights against a lone King is a known win this apparently came into reach. Maybe because of search windows with a higher alpha because of VALUE_KNOWN_WIN,

In endgame.cpp:

Code: Select all

    if (   pos.piece_count(strongerSide, QUEEN) > 0
            || pos.piece_count(strongerSide, ROOK) > 0
            || pos.piece_count(strongerSide, BISHOP) > 1
            || pos.piece_count(strongerSide, KNIGHT) >= 3) 
        // Last line is meant for the Knight endgames from H.G. Muller etc. EdG
        // TODO: check for two equal-colored bishops!
        result += VALUE_KNOWN_WIN;
the search is a bit more effective. But it still leaves quite wrong searches like the one below, which maybe is something to do with wrong pawn coding because the three Knights endgame is not affected, but it could also be somewhere in the search proper:


[FEN "8/5k2/6p1/7p/7P/5BK1/8/8 w - -"]

1. Kf4 Kg7 2. Be4 Kh6 3. Bd3 Kg7 4. Kg5 Kh7 5. Bxg6+ Kg8
6. Bxh5 Kg7 7. Kf5 Kh8 8. Bg6 Kg7 9. h5 Kg8 10. h6 Kh8
11. Kg5 Kg8 12. Kf4 Kh8 13. Bf5 Kg8 14. Ke3 *


[d]6k1/8/7P/5B2/8/4K3/8/8 b - -

Engine: Rainbow Serpent 1.6.3s(dc) Build 280 (Athlon 2009 MHz, 256 MB)
by Tord Rom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d3 Kg8
20.Bg6 Kh8 21.Bf5 Kg8 22.Kd4 Kf7
23.Kc4 Kg8 24.Be4 Kf7 25.Kb5 Kg8
26.Bg6 Kf8 27.Ka4 Kg8 (486.907) 1248

16.00 0:00 -13.01-- 14...Kh8 15.Be4 Kg8 16.Kd3 Kf7
17.Kc4 Kg8 18.Kc3 Kf7 19.Bd3 Kg8
20.Bg6 Kh8 21.Kd4 Kg8 22.Kd5 Kh8
23.Kc5 Kg8 24.Kb6 Kh8 25.Kc7 Kg8
26.Kd8 Kf8 27.Bh7 Kf7 (489.194) 1204

17.00 0:01 -8.56 14...Kh8 15.Be4 Kg8 16.Kd3 Kf7
17.Kc4 Kg8 18.Kc3 Kf7 19.Bd3 Kg8
20.Bc2 Kh8 21.Kd4 Kg8 22.Kc4 Kf7
23.Bf5 Kf6 24.Kd4 Kf7 25.Bd3 Kg8
26.Be4 Kf7 27.Bb1 Kg8 (1.488.499) 1305

18.01 0:04 -8.56 14...Kh8 15.Be4 Kg8 16.Kd3 Kf7
17.Kc3 Kg8 18.Bg6 Kh8 19.Kd4 Kg8
20.Ke5 Kh8 21.Bd3 Kg8 22.Kd5 Kf7
23.Bh7 Kf6 24.Bf5 Kf7 25.Kc6 Kg8
26.Kc7 Kf7 27.Bh7 Kf6 (6.045.046) 1417

19.01 0:13 -8.56 14...Kh8 15.Be4 Kg8 16.Kd3 Kf7
17.Kc3 Kg8 18.Bg6 Kh8 19.Kd4 Kg8
20.Ke5 Kh8 21.Bd3 Kg8 22.Kd5 Kf7
23.Bh7 Kf6 24.Bf5 Kf7 25.Ke4 Kg8
26.Kd4 Kf7 27.Bh7 Kf6 (19.719.192) 1500


best move: Kg8-h8 time: 0:15.531 min n/s: 1.506.696 nodes: 23.400.510

It is a draw... :( Older versions, about 100 versions earlier, just repeat moves very quickly, that is another possibility, the repetition code for which I have not yet implemented Marco's new Stockfish patch but only a partial change. It is a simple endgame, few pieces so you do not expect the program to go so easily wrong on this.

Regards, Eelco
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan