Yeah, I noticed so myself. They didn't appear in preview when I wrote the post, however…
Position Causes Stockfish and Komodo To Crash
Moderators: hgm, Rebel, chrisw
-
- Posts: 300
- Joined: Mon Apr 30, 2018 11:51 pm
Re: Position Causes Stockfish and Komodo To Crash
-
- Posts: 2272
- Joined: Mon Sep 29, 2008 1:50 am
Re: Position Causes Stockfish and Komodo To Crash
An interesting issue here https://github.com/official-stockfish/S ... ssues/3270
SF move generation assumes (correctly it seems) that in a game an escape move can never be an ep move. But of course one can create positions (without parent) in which there is an escape move which is indeed an ep move.
[d]8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3 0 1
SF move generation assumes (correctly it seems) that in a game an escape move can never be an ep move. But of course one can create positions (without parent) in which there is an escape move which is indeed an ep move.
[d]8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3 0 1
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.
-
- Posts: 300
- Joined: Mon Apr 30, 2018 11:51 pm
Re: Position Causes Stockfish and Komodo To Crash
This just makes me even more convinced you'll need to just brute-force the possible unmoves to see if there are any.
-
- Posts: 1971
- Joined: Wed Jul 13, 2011 9:04 pm
- Location: Madrid, Spain.
Re: Position causes StockFish and Komodo to crash.
Hello Michel:
[d]8/8/8/4k3/2p5/8/3P4/4K3 w - - 0 1
Then 1.- d4+, cxd3 e.p. is possible and perfectly legal. It is true that the own moving pawn gives check, which might not fall in the same category as the example of Ke1, Qf1, Pd4; kb5, pe4 without legal previous move of d2-d4 because the black king was already in check by the white queen and the white pawn itself does not give check. A definition of 'escape move' would be useful. Avoiding check given by any opposite piece regardless if it has just moved or not?
Regards from Spain.
Ajedrecista.
What about?Michel wrote: ↑Tue Dec 22, 2020 10:36 am An interesting issue here https://github.com/official-stockfish/S ... ssues/3270
SF move generation assumes (correctly it seems) that in a game an escape move can never be an ep move. But of course one can create positions (without parent) in which there is an escape move which is indeed an ep move.
[d]8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3 0 1
[d]8/8/8/4k3/2p5/8/3P4/4K3 w - - 0 1
Then 1.- d4+, cxd3 e.p. is possible and perfectly legal. It is true that the own moving pawn gives check, which might not fall in the same category as the example of Ke1, Qf1, Pd4; kb5, pe4 without legal previous move of d2-d4 because the black king was already in check by the white queen and the white pawn itself does not give check. A definition of 'escape move' would be useful. Avoiding check given by any opposite piece regardless if it has just moved or not?
Regards from Spain.
Ajedrecista.
-
- Posts: 2272
- Joined: Mon Sep 29, 2008 1:50 am
Re: Position causes StockFish and Komodo to crash.
Thanks. It seems I was wrong. In your position SF does find the ep move. Then I wonder why it does not consider the ep move in the parentless position...Ajedrecista wrote: ↑Tue Dec 22, 2020 6:35 pm Hello Michel:
What about?Michel wrote: ↑Tue Dec 22, 2020 10:36 am An interesting issue here https://github.com/official-stockfish/S ... ssues/3270
SF move generation assumes (correctly it seems) that in a game an escape move can never be an ep move. But of course one can create positions (without parent) in which there is an escape move which is indeed an ep move.
[d]8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3 0 1
[d]8/8/8/4k3/2p5/8/3P4/4K3 w - - 0 1
Then 1.- d4+, cxd3 e.p. is possible and perfectly legal. It is true that the own moving pawn gives check, which might not fall in the same category as the example of Ke1, Qf1, Pd4; kb5, pe4 without legal previous move of d2-d4 because the black king was already in check by the white queen and the white pawn itself does not give check. A definition of 'escape move' would be useful. Avoiding check given by any opposite piece regardless if it has just moved or not?
Regards from Spain.
Ajedrecista.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Position Causes Stockfish and Komodo To Crash
Consider the following position:
[d]8/6Q1/8/7k/7p/8/6P1/7K w - - 0 1
If White now plays g2-g4+, then the only legal move for Black will be hxg3 e.p., and Stockfish 11 and 12 find that move if given as:
Code: Select all
position fen 8/6Q1/8/7k/7p/8/6P1/7K w - - 0 1 moves g2g4
Code: Select all
position fen 8/6Q1/8/7k/6Pp/8/8/7K b - g3 1 1
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 937
- Joined: Fri Mar 10, 2006 4:29 pm
- Location: Germany
Re: Position causes StockFish and Komodo to crash.
Why generating an illegal move?Michel wrote: ↑Tue Dec 22, 2020 7:37 pmThanks. It seems I was wrong. In your position SF does find the ep move. Then I wonder why it does not consider the ep move in the parentless position...Ajedrecista wrote: ↑Tue Dec 22, 2020 6:35 pm Hello Michel:
What about?Michel wrote: ↑Tue Dec 22, 2020 10:36 am An interesting issue here https://github.com/official-stockfish/S ... ssues/3270
SF move generation assumes (correctly it seems) that in a game an escape move can never be an ep move. But of course one can create positions (without parent) in which there is an escape move which is indeed an ep move.
[d]8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3 0 1
[d]8/8/8/4k3/2p5/8/3P4/4K3 w - - 0 1
Then 1.- d4+, cxd3 e.p. is possible and perfectly legal. It is true that the own moving pawn gives check, which might not fall in the same category as the example of Ke1, Qf1, Pd4; kb5, pe4 without legal previous move of d2-d4 because the black king was already in check by the white queen and the white pawn itself does not give check. A definition of 'escape move' would be useful. Avoiding check given by any opposite piece regardless if it has just moved or not?
Regards from Spain.
Ajedrecista.
Jörg Oster
-
- Posts: 1971
- Joined: Wed Jul 13, 2011 9:04 pm
- Location: Madrid, Spain.
Re: Position causes StockFish and Komodo to crash.
Hello again:
Which might explain the feature. A programmer opinion is valuable since I am not a programmer.
Regards from Spain.
Ajedrecista.
The key could be in movegen.cpp. There is a three-line comment at current lines 159-161:
Code: Select all
// An en passant capture can be an evasion only if the checking piece
// is the double pushed pawn and so is in the target. Otherwise this
// is a discovery check and we are forced to do otherwise.
Regards from Spain.
Ajedrecista.
-
- Posts: 2272
- Joined: Mon Sep 29, 2008 1:50 am
Re: Position causes StockFish and Komodo to crash.
Why do you consider the ep move illegal?Joerg Oster wrote: ↑Tue Dec 22, 2020 7:55 pmWhy generating an illegal move?Michel wrote: ↑Tue Dec 22, 2020 7:37 pmThanks. It seems I was wrong. In your position SF does find the ep move. Then I wonder why it does not consider the ep move in the parentless position...Ajedrecista wrote: ↑Tue Dec 22, 2020 6:35 pm Hello Michel:
What about?Michel wrote: ↑Tue Dec 22, 2020 10:36 am An interesting issue here https://github.com/official-stockfish/S ... ssues/3270
SF move generation assumes (correctly it seems) that in a game an escape move can never be an ep move. But of course one can create positions (without parent) in which there is an escape move which is indeed an ep move.
[d]8/8/8/1k6/3Pp3/8/8/4KQ2 b - d3 0 1
[d]8/8/8/4k3/2p5/8/3P4/4K3 w - - 0 1
Then 1.- d4+, cxd3 e.p. is possible and perfectly legal. It is true that the own moving pawn gives check, which might not fall in the same category as the example of Ke1, Qf1, Pd4; kb5, pe4 without legal previous move of d2-d4 because the black king was already in check by the white queen and the white pawn itself does not give check. A definition of 'escape move' would be useful. Avoiding check given by any opposite piece regardless if it has just moved or not?
Regards from Spain.
Ajedrecista.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Without ideas there is nothing to simplify.
-
- Posts: 937
- Joined: Fri Mar 10, 2006 4:29 pm
- Location: Germany
Re: Position causes StockFish and Komodo to crash.
Because this kind of move can NEVER occur in a legal game of chess.Michel wrote: ↑Tue Dec 22, 2020 8:48 pmWhy do you consider the ep move illegal?
So I can only conclude it must be an illegal move.
The illegal position makes it look like a valid move, doesn't it?
Jörg Oster