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

DRAFT: Breaking out the library from the challenge. #496

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

b4ux1t3
Copy link

@b4ux1t3 b4ux1t3 commented Dec 22, 2023

Okay, this is the result of a few hours work last night. I'm pretty pleased with it.

I did this all in my own mirror of the code which is the core of a lichess bot I deployed a few months ago. That bot is currently live, using the changes in this PR.

Let me lay out what I did:

  • Updated to .NET 8. It fully supports everything as written, so I figured it was an easy win.
  • Chess Logic
    • The "chessiness" has been separated out into its own project, ChessEngine. This is a .NET Library project, so it is ingestible from other .NET projects, which brings us to
    • This could easily be packaged as a NuGet package. From a quick survey of alternatives, it would be the only one that supports .NET 8 and it i seemingly a little more optimized; your use of Spans is much better than the existing List- and Array-based implementations I've found. It wasn't a deep survey, though, so I could be missing something.
  • Challenge application:
    • Now a fully-separate project. Consumes the ChessEngine project as a dependency. Still works great :)
    • Bots:
      • Moved bots into their own namespace.
      • Renamed things a little.
      • Includes fixing the token counter pointer.

I still have a lot of cleanup I want to do, mostly around naming conventions and things like that. I don't like that the ChessEngine doesn't have one, singular interface into it, but that's a larger architectural change to the engine itself. It's also not technically an engine, since an engine actually plays chess, whereas this is just the board/move logic.

Merging this will make it easier, I think, to address #409. As you can see from my linked GitLab repo, I already have a working UCI implementation for this, so I'm very confident merging this would be beneficial, of only to make it easier for folks to use their own UCI wrappers.

I'd love to see this engine published as a package. It's been mentioned before in #360, and probably others. I'd love to see this merged in and pushed up to NuGet, though I can totally understand if that's not something that you want to maintain going forward.

If you decide not to publish a package, I'd be interested in using this work as an upstream to my repo, where I would publish it as a package; I just have no interest in maintaining the "chess" parts of it, haha!

However you'd like to move forward with that, I'm happy with.

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.

1 participant