LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.47k stars 534 forks source link

LC0 gives error processing a certain valid FEN string #1348

Closed rontant closed 4 years ago

rontant commented 4 years ago

BUG REPORT

Describe the bug lc0 cannot handle a valid FEN of certain board position where the rook on the king side doesn't exist

Steps to Reproduce

  1. Launch lc0 in command prompt
  2. Paste and enter the following 2 UCI commands: "position fen rnb1kb1Q/1p1qp2p/p3p1p1/2pp4/8/8/PPPP1PPP/RNB1K1NR b KQkq - 1 10" and "go movetime 5000"

Expected behavior: should compute and return a best move Observed behavior: lc0 will give error message "error Bad fen string (no king side rook)"

Lc0 version Include Lc0 version/operating system/backend type. v0.25.1+git.69105b4 built Apr 30 2020/ Windows 10 64bit version 1909

Lc0 parameters Command line, if not default. Include screenshot of configuration window, if using through GUI.

Hardware MSI B450I Gaming Plus AC

Lc0 logs C:\Leela>lc0 | | | | | |_| v0.25.1+git.69105b4 built Apr 30 2020 position fen rnb1kb1Q/1p1qp2p/p3p1p1/2pp4/8/8/PPPP1PPP/RNB1K1NR b KQkq - 1 10 go movetime 5000 Found pb network file: C:\Leela/62438.gz Creating backend [cudnn-auto]... Switching to [cudnn-fp16]... CUDA Runtime version: 10.0.0 Cudnn version: 7.4.2 Latest version of CUDA supported by the driver: 10.2.0 GPU: GeForce RTX 2060 GPU memory: 6 Gb GPU clock frequency: 1755 MHz GPU compute capability: 7.5 error Bad fen string (no kingside rook): rnb1kb1Q/1p1qp2p/p3p1p1/2pp4/8/8/PPPP1PPP/RNB1K1NR b KQkq - 1 10

Notes:

  1. The FEN tested OK on other engines, i.e. Stockfish and Komodo11
  2. lc0 on Rock64 SBC also gives the same error, so this indicates inherent bug of lc0
brianprichardson commented 4 years ago

There is a conflict between the castle status and no rook.

rontant commented 4 years ago

Thanks Brian! That was a indeed the problem with the FEN. Good catch! The castling field should be KQq instead of KQkq.

I tested the FEN on Komodo-11 and Stockfish and it was accepted. I guess the other engines are not as stringent as Lc0.

I am hereby closing the case.

Again, thanks.