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.
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:
ChessEngine
. This is a .NETLibrary
project, so it is ingestible from other .NET projects, which brings us toSpan
s is much better than the existingList
- andArray
-based implementations I've found. It wasn't a deep survey, though, so I could be missing something.ChessEngine
project as a dependency. Still works great :)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.