-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Invalid fen detection and crash prevention #4720
Conversation
It does not seem nice to impersonate "Kasparov Chess" (unless we have the honor of meeting the Boss from Baku himself in this PR). Anyway, assuming this is not some troll account/PR and this is meant to make some sense: C++ raw string literals can be used here to limit the number of escape backslashes in the regex string. See (6) of this link. |
I compiled the source code on my local system via clang and mingw compiler but there is no error on my pc! Click to view
|
https://github.com/official-stockfish/Stockfish/actions/runs/5766936758/job/15635825086#step:17:72
The CI stops because the PR changes the bench, so you should add in the last line of the commit message:
You can update the commit message with:
By the way, in your previous post |
just a question: why should bench change? considering how the regex only detects illegal fens and all the fens in |
mmm, master does nothing on positions 45 and 46, I don't know if this is expected: Click to view
PR computes positions 45 and 46: Click to view
|
it detects the invalid fen afterwards I think |
The output of first 44 positions are equal, master and PR diverge after the first
|
probably should move the invalid fen detection to below this line https://github.com/official-stockfish/Stockfish/pull/4720/files#diff-350299875b3703a90df4eb97b9b09083c2de8f6a0cf8bdfe10a4f546d809adddR65 |
It got the master bench 1350831 commenting out the EDIT: 45 (stalemate) and 46 (checkmate) are sanity check positions, master correctly doesn't find a bestmove, so the PR seems to be a regression. |
Thanks to @ppigazzini , the problem quickly resolved. I corrected the incomplete fens. - 8/8/8/8/8/6k1/6p1/6K1 w - -
+ 8/8/8/8/8/6k1/6p1/6K1 w - - 0 1
- 7k/7P/6K1/8/3B4/8/8/8 b - -
+ 7k/7P/6K1/8/3B4/8/8/8 b - - 0 1 |
hmm, I don't think this PR is necessary, so I'm inclined to close. Thanks anyway! |
I thank you for helping to find these two ways to improve the SF project:
About the FEN regex PR I have this point of view (please I'm not a SF dev so I could miss some details):
"8/8/8/8/8/6k1/6p1/6K1 w - -",
"7k/7P/6K1/8/3B4/8/8/8 b - -",
|
This regex can detect all valid fen and prevent Stockfish from crashing.