official-stockfish / Stockfish

A free and strong UCI chess engine
https://stockfishchess.org/
GNU General Public License v3.0
11.31k stars 2.25k forks source link

Mate in #4 is not detected stockfish 7 64 POPCNT (move sequence is same) #615

Closed ChameleonRed closed 8 years ago

ChameleonRed commented 8 years ago

For this position there is no mate detected ...

1Q6/p4pkp/4p1p1/1Np4q/2P1nP2/4P1P1/P5KP/8 b - - 6 35

Now is mate in #5 still not detected ...

1Q6/p4pkp/4p1p1/1Np5/2P1nP2/4P1P1/P3q1KP/8 w - - 7 36

Now mate in #4, #7, #8, #8 is possible - why???

1Q6/p4pkp/4p1p1/1Np5/2P1nP2/4P1PK/P3q2P/8 b - - 8 36

mcostalba commented 8 years ago

I am not able to reproduce: with position 1Q6/p4pkp/4p1p1/1Np4q/2P1nP2/4P1P1/P5KP/8 b - - 6 35

I got mate in 5: h5e2 g2h3 e4f2 h3g2 f2g4 g2h3 e2h2 h3g4 h2h5

pb00068 commented 8 years ago

A possible explanation could be that move 35...Qh5e2 in your specific game led to a position repetition, which Stockfish (and most other engines too) considers draw. Can it be that position 1Q6/p4pkp/4p1p1/1Np5/2P1nP2/4P1P1/P3q1KP/8 w - - was already on board earlier in your game?

ChameleonRed commented 8 years ago

I can send PGN - that was not repetition - it is second repetition it was still time to mate. I am programmer so I can send you detailed log if you need. By the way I finished it with draw because not saw mates :)

ChameleonRed commented 8 years ago
This is PGN - see move 34:
Analysis says 28 [-6.22]  35.Kg2 a6 36.Nd4 cxd4 37.Qb2 e5 38.Qc2 Nd6 39.exd4 Nf5 40.Qd3 exf4 41.gxf4 Qg4+ 42.Kf2 Qxf4+ 43.Ke1 Nxd4 44.Kd1 Nc6 45.Qc3+ f6 46.h3 Ne5 47.c5 Qe4 48.Kc1 Nc4 49.a3 Qd5 50.Kc2 Qxc5 51.Kb3 Qb5+ 52.Ka2  (136.99)

[Annotator "Stockfish 7 64 POPCNT"]
[Depth "20"]

1.d4 d5 2.Nf3 e6 3.Bg5 Be7 $201 4.e3 $4 $19 $201 
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kd3 Nxa3 46.Kc3 Kf6 47.Kb3 Nb5 48.Kc4 Kf5 49.Kxc5 Ke4 50.Kb6 Kxe3 51.Kxa6 Nd4 52.Kb7 Nf3 53.Kc6 Nxh2 54.Kd6 Nf1 $19 )
38.Kh3 $201 Qh5+ $4 $10 
    {+0.00 / -327.46}
    ( 38...Nf2+ 39.Kg2 Ng4+ 40.Kg1 Qxh2+ 41.Kf1 Qf2# $19 )
39.Kg2 Qe2+ 
    ( 39...Qe2+ { 20:+0.00} 40.Kh3 )
*
pb00068 commented 8 years ago

it is second repetition, it was still time to mate.

Indeed move 35...Qh5e2 in your specific game led to a position repetition. As I tried to explain above, most chess engines (Stockfish included) behave different on position repetition and don't follow the official chess rules, they adjudicate a position repetition directly as draw. This is because implementing a correct 3-fold repetition detection so far always made the engine loose in playing strength by some elo-points.

zamar commented 8 years ago

Closing as non-issue.

ChameleonRed commented 8 years ago

I think that was helpful to send you some position whatever I am not chess programmer but playing chess and program a lot so nice to learn something about how it works.