miguel-ambrona / D3-Chess

Chess Unwinnability Analyzer is an implementation of a decision procedure for checking whether there exists a sequence of legal moves that allows a certain player to checkmate their opponent in a given chess position.
https://chasolver.org
GNU General Public License v3.0
51 stars 8 forks source link

En passant target square seems not read #5

Closed dlbbld closed 3 years ago

dlbbld commented 3 years ago

It seems the en passant target square in the FEN is not read.

The below positions are winnable for both sides for the possibility to capture en passant. Without this possibility they would be unwinnable for both sides:

4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - a3 0 50
4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - a3 0 50
4k3/8/8/p1p1p1p1/P1PpPpPp/3P1P1P/8/4K3 b - e3 0 50
4k3/8/7p/p1p2p1P/P1P1pP2/4P3/8/4K3 b - f3 0 50
4k3/8/8/p1p1p3/P1P1Pp1p/1B3P1P/8/4K3 b - e3 0 50

CHA declares them as unwinnable for both sides, It seems it ignores the en passant, so does not read the relevant field from the FEN.

Attention, the below position is unwinnable for both sides, although the en passant target square is set in the FEN, and the en passant capture would unblock the position. The en passant capture however would be illegal, for leaving the own king in check, so not possible:

8/8/6k1/p1p1p3/P1P1Pp1p/5P1P/2B5/4K3 b - e3 0 50
miguel-ambrona commented 3 years ago

CHA is correctly classifying all those positions. Please, install the tool and use it to verify your claims.

dlbbld commented 3 years ago

The observation is from the website.

1) I open the website https://elrubiongamma.ddns.net/chess-unwinnability-analyzer/index.html step 0

2) I paste the below FEN in the input field and click "Analyze (full)" 4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - a3 0 50 step 1

3) The program output is that both sides cannot helpmate (which is incorrect) step 3

Now in the input field for the FEN the value for the en passant target square is "-", not "a3" as input, this is why it looks like the value is not read properly. 4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - -

I see on the interface one can also specify "En passant". But I don't understand how this is meant. 1) I open https://elrubiongamma.ddns.net/chess-unwinnability-analyzer/index.html

2) Under FEN I enter again the below value 4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - a3 0 50

3) For "En passant" I select "a", which corresponds to the example. The input field for the FEN changes automatically to 4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - a step select en passant 1

4) I click "Analyze (full)", the output is "invalid FEN" step select en passant 3

When I use the command line tool all examples are correct.

miguel-ambrona commented 3 years ago

I left you a message on Lichess explaining why that happened. It is a parsing error of the javascript library, which was fixed before you posted those images. Try to hard refresh your window (with Ctrl + F5) and it should work.

I highly appreciate your feedback, but please, note that this is not the right channel to report issues related to the webpage. The webpage is an external resource that I provide for anyone to test the tool without installation, but it should not be considered part of the CHA analyzer.