Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the is_fen_valid function #9

Open
johndoknjas opened this issue Mar 8, 2023 · 0 comments
Open

Improve the is_fen_valid function #9

johndoknjas opened this issue Mar 8, 2023 · 0 comments

Comments

@johndoknjas
Copy link

johndoknjas commented Mar 8, 2023

Note: this issue was originally posted in the old stockfish repo here: zhelyabuzhsky#125

Some discussion of this function in PR zhelyabuzhsky#124. If possible, would be good to make this function more accurate, although this may be challenging. The function works by checking if the fen syntax is valid, and also by giving a temporary SF executable the FEN and seeing if it crashes. This seems to work well for most use cases but it's not completely accurate.

See the discussion in zhelyabuzhsky#124 for a test case that the function is inconsistent with (it's a position with both kings next to each other: 8/8/8/3k4/3K4/8/8/8 b - - 0 1). If some improvements can be made for the function, this test case should ideally pass for any version of Stockfish being used.

In addition, the 2k2q2/8/8/8/8/8/8/2Q2K2 w - - 0 1 test case now fails for a recent Stockfish development build (May 30), since the is_fen_valid function incorrectly returns True. This is because SF now gives a bestmove, even though the position is illegal. See #41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant