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

Fix error when parsing UCI options #1113

Merged
merged 4 commits into from
Oct 8, 2024
Merged

Conversation

MarkZH
Copy link
Contributor

@MarkZH MarkZH commented Oct 8, 2024

The regex that splits a UCI option into parts did not include word boundries, so words like "mini" would be split into "min" and "i", leading to parse errors. This commit puts word boundries into the regex to fix this.

Fixes #1112

The regex that splits a UCI option into parts did not include word
boundries, so words like "mini" would be split into "min" and "i",
leading to parse errors. This commit puts word boundries into the regex
to fix this.

Fixes niklasf#1112
@niklasf
Copy link
Owner

niklasf commented Oct 8, 2024

Looks good. Let's also add a test for this.

@MarkZH
Copy link
Contributor Author

MarkZH commented Oct 8, 2024

Test added that passes with this PR and fails on master.

Test uses fairy-stockfish since that engine revealed the original bug.
@MarkZH
Copy link
Contributor Author

MarkZH commented Oct 8, 2024

Not yet. I need to add fairy-stockfish to the test installation.

@niklasf
Copy link
Owner

niklasf commented Oct 8, 2024

We could also use MockTransport with output from fairy-stockfish.

@MarkZH
Copy link
Contributor Author

MarkZH commented Oct 8, 2024

Do you want to keep both tests or should I delete the fairy-stockfish test to reduce the external dependencies?

@Torom
Copy link

Torom commented Oct 8, 2024

I can confirm that this fixes my test case.

@niklasf niklasf merged commit ab0e066 into niklasf:master Oct 8, 2024
22 checks passed
@niklasf
Copy link
Owner

niklasf commented Oct 8, 2024

Let's keep it for now, since you already wrote the installation script and it looks like it should be pretty stable. Thank you, both!

@MarkZH MarkZH deleted the options-fix branch October 8, 2024 20:52
@Torom
Copy link

Torom commented Oct 9, 2024

@niklasf Are you planning a 1.11.1 release with this fix or will we have to wait until 2.0?

niklasf added a commit that referenced this pull request Oct 9, 2024
Fix error when parsing UCI options
@niklasf
Copy link
Owner

niklasf commented Oct 9, 2024

I suppose 2.0.0 may be quite a while out, so published 1.11.1.

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

Successfully merging this pull request may close these issues.

Error while parsing UCI options
3 participants