How to submit python engine?

Questions and comments related to CCRL testing study
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

How to submit python engine?

Post by cristiv »

Hello,

I wrote a hobby Python/C++ hybrid chess engine and I am curious if it is possible to submit it here.

If yes, there are several options, please advise what works best, I can:

1) provide the Python scripts, the compiled binary module (for Python3.9 or 3.10 for Linux or Windows), and a requirements.txt file
(the Python side has dependencies on python-chess and psutils); or

2) look into creating a single file self-extracting binary built with PyInstaller, for Linux or Windows.
(based on experiments this seems to work but there's a slow startup due to the self-decompression step).

Also, the engine works best when compiled for AVX2, or even better AVX-512. Should I make separate binaries with/without SSE/AVX, etc?

I do not have and official release ready just yet, but you can see the work in progress here:
https://github.com/cristivlas/sturddle-chess-engine (most recent work is in the beta branch), and you can check out some stats here: https://lichess.org/@/Sturddle.

There's also a companion app for Android: https://github.com/cristivlas/sturddle-chess-app
with a (pre-release) binary
https://github.com/cristivlas/sturddle- ... -debug.apk
if anyone is curious.

Best regards,
Cristian
User avatar
Graham Banks
Posts: 26926
Joined: Sun Dec 18, 2005 5:47 pm
Sign-up code: 0
Location: Auckland, NZ

Re: How to submit python engine?

Post by Graham Banks »

Best to provide an avx2 exe all ready to go.
Single file for Windows.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

64-bit, all-in-one Windows binary:
https://github.com/cristivlas/sturddle- ... 9-avx2.exe

There's also a non-AVX2 build under the assets, just in case, at https://github.com/cristivlas/sturddle- ... e/releases

Is this sufficient or do I need to post a new engine "official announcement"?

Best regards,
Cristian
User avatar
Graham Banks
Posts: 26926
Joined: Sun Dec 18, 2005 5:47 pm
Sign-up code: 0
Location: Auckland, NZ

Re: How to submit python engine?

Post by Graham Banks »

cristiv wrote: Sat Nov 05, 2022 3:48 am 64-bit, all-in-one Windows binary:
https://github.com/cristivlas/sturddle- ... 9-avx2.exe

There's also a non-AVX2 build under the assets, just in case, at https://github.com/cristivlas/sturddle- ... e/releases

Is this sufficient or do I need to post a new engine "official announcement"?

Best regards,
Cristian
Your name and nationalty would be useful for our engine notes.

Roughly how strong do you estimate your engine to be in CCRL terms?
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Going by the games played on https://lichess.org/@/Sturddle, I would estimate the strength at around 2500.

Cristian Vlasceanu, USA
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

Hi Cristian,

What NNUE do you use?
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Hi Gabor,

For the code itself I forked nnue-probe, and modified it slightly to better fit with the rest of the engine. I can talk more about the code modifications if you are interested.

As for the network, for now I am using an older file (I think it is from 2020) from the Stockfish community.
I do some "post-processing" on the number that I get back from NNUE, mainly scale it by a value (chosen by running experiments under Chess Tuning Tools).

I have some ideas I want to explore about changing the NNUE architecture, and provide my own trained network at some point; for this 0.99 pre-release however I have to live with the nnue-probe fork.

Best regards,
Cristian
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

Thanks Cristian. No, I don't want you to talk more on code modifications, you can be sure I would not understand a single word.

You have answered my question fully. I can see that the SF net is a starting point for you and I am looking forward to developments. Good luck!
bastiball
Posts: 1957
Joined: Thu Aug 05, 2021 2:35 pm
Sign-up code: 10159
Location: Cavite, Philippines
Contact:

Re: How to submit python engine?

Post by bastiball »

Any chances it plays FRC?
CCRL Testing Group
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

bastiball wrote: Sat Nov 05, 2022 1:30 pm Any chances it plays FRC?
Standard chess only.

It would not be terribly hard to add FRC, just not a priority for me at this moment, and... the project is open source ;)
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Gabor Szots wrote: Sat Nov 05, 2022 9:34 am Thanks Cristian. No, I don't want you to talk more on code modifications, you can be sure I would not understand a single word.

You have answered my question fully. I can see that the SF net is a starting point for you and I am looking forward to developments. Good luck!
Hi Gabor,
Just to clarify, did you mean you will only be accepting this engine for testing in the future when the nnue architecture is fully original? Or is it fine the way it is?
Thanks,
Cristian
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

cristiv wrote: Sun Nov 06, 2022 4:16 am Just to clarify, did you mean you will only be accepting this engine for testing in the future when the nnue architecture is fully original? Or is it fine the way it is?
Hi Cristian,

What I am writing here is my personal view. I think the engine is fine because the search is original (Is it?) and it is the first version you release so that it may serve as an 'origo' for future versions. If it were a new version with HCE replaced by NNUE evaluation I'd show little interest.

What all this means is that I have put it in my testing queue. However, as I have limited resources and many engines to test, it will have to wait a bit till I can start with testing. Some other tester might pick it up sooner, though.

Best,
Gabor

PS. I might make an exception and put it in top of the queue because it is new.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Gabor Szots wrote: Sun Nov 06, 2022 7:15 am
cristiv wrote: Sun Nov 06, 2022 4:16 am Just to clarify, did you mean you will only be accepting this engine for testing in the future when the nnue architecture is fully original? Or is it fine the way it is?
Hi Cristian,

What I am writing here is my personal view. I think the engine is fine because the search is original (Is it?) and it is the first version you release so that it may serve as an 'origo' for future versions. If it were a new version with HCE replaced by NNUE evaluation I'd show little interest.

What all this means is that I have put it in my testing queue. However, as I have limited resources and many engines to test, it will have to wait a bit till I can start with testing. Some other tester might pick it up sooner, though.

Best,
Gabor

PS. I might make an exception and put it in top of the queue because it is new.
Hi Gabor,
Thank you for the clarifications. Yes the search is quite original, the most interesting idea IMO being that its "personality" can be changed via the UCI "Algorithm" parameter from mtdf, (default) to negascout or negamax.
After you asked me about NNUE I poked around a bit and saw there were some controversies around the topic. Personally I think that building original ideas on top of existing components is good engineering, but I do understand that some people may think it is unethical to use pre-trained NNUEs from SF, and I respect that point of view. My engine can be built without NNUE and retain complete functionality, it will just fail over to HCEs (and play a weaker game, of course); just saying there's a bit more to it than just a search function slapped on top of nnue-probe :)

Newbie question: is there a "setup recipe" that I can follow to replicate your "official" test environment and run my own tournaments?
Thanks again,
Cristian
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

cristiv wrote: Sun Nov 06, 2022 3:44 pmAfter you asked me about NNUE I poked around a bit and saw there were some controversies around the topic. Personally I think that building original ideas on top of existing components is good engineering, but I do understand that some people may think it is unethical to use pre-trained NNUEs from SF, and I respect that point of view. My engine can be built without NNUE and retain complete functionality, it will just fail over to HCEs (and play a weaker game, of course); just saying there's a bit more to it than just a search function slapped on top of nnue-probe :)

Newbie question: is there a "setup recipe" that I can follow to replicate your "official" test environment and run my own tournaments?
Thanks again,
Cristian
I don't think it's unethical to use SF NNUE's, only I don't find that interesting. I did test one such engine (BBC) with the only goal to see how much improvement NNUE constitutes over HCE (it was huge). In the case of BBC there had been versions with HCE only so a comparison could be made.

Now that you say Sturddle can be compiled not to use NNUE, let me ask you what you would prefer: to test it with HCE or with NNUE? I am not going to do both, one reference version will be enough in my opinion. Again, this is only my point of view, my fellow testers might have different opinions.

If you want to simulate the conditions of our testing environment here is a thread dealing with that: viewtopic.php?f=7&t=1486
You are welcomed to ask any questions if you find something is missing there.


PS. I tried to compile the source but failed. The libpopcnt folder is empty. There might be other problems too. These are the errors:

In file included from captures.cpp:29:
chess.h:48:10: fatal error: libpopcnt.h: No such file or directory
48 | #include "libpopcnt.h"
| ^~~~~~~~~~~~~
compilation terminated.
In file included from chess.cpp:29:
chess.h:48:10: fatal error: libpopcnt.h: No such file or directory
48 | #include "libpopcnt.h"
| ^~~~~~~~~~~~~
compilation terminated.
In file included from context.cpp:32:
chess.h:48:10: fatal error: libpopcnt.h: No such file or directory
48 | #include "libpopcnt.h"
| ^~~~~~~~~~~~~
compilation terminated.
In file included from search.cpp:34:
context.h:30:10: fatal error: Python.h: No such file or directory
30 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

My preference is to test the NNUE build.
Your compilation failed because the git repo needs to be cloned recursively to get the submodules, to fix:
git submodule update —init —recursive

You also need the Python development libraries and header file.

Regards
Cristian
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

OK, I have started a gauntlet.

A small problem: when invoking the program a window pops up which must be iconized not to be there all the time.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Gabor Szots wrote: Sun Nov 06, 2022 7:19 pm OK, I have started a gauntlet.

A small problem: when invoking the program a window pops up which must be iconized not to be there all the time.
Do you get this behavior with the build that I provided or with binaries built by you?

I tested my build with Arena 3.5.1 and Cutechess under Windows 10 and have not seen any window popping up.
What GUI are you running?
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

cristiv wrote: Sun Nov 06, 2022 8:09 pm
Gabor Szots wrote: Sun Nov 06, 2022 7:19 pm OK, I have started a gauntlet.

A small problem: when invoking the program a window pops up which must be iconized not to be there all the time.
Do you get this behavior with the build that I provided or with binaries built by you?

I tested my build with Arena 3.5.1 and Cutechess under Windows 10 and have not seen any window popping up.
What GUI are you running?
I use your build. It's under the Shredder 13 GUI, haven't tried Arena. This is also Win10.

EDIT: Just tried Arena. The window does not pop up.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Shredder 13 is commercial. I don't know if there is a trial version.
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

Sorry, I have inadvertently overwritten your last post.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

cristiv wrote: Sun Nov 06, 2022 8:30 pm Shredder 13 is commercial. I don't know if there is a trial version.
Looks reasonably priced though. I was about to ask this question on the other thread but have not finished going through all the posts: is there a technical reason (such as accuracy of results) for testing under Windows versus say, Cutechess under Linux? Or just a simple matter of convenience / personal preference?
User avatar
Graham Banks
Posts: 26926
Joined: Sun Dec 18, 2005 5:47 pm
Sign-up code: 0
Location: Auckland, NZ

Re: How to submit python engine?

Post by Graham Banks »

cristiv wrote: Sun Nov 06, 2022 9:08 pm
cristiv wrote: Sun Nov 06, 2022 8:30 pm Shredder 13 is commercial. I don't know if there is a trial version.
Looks reasonably priced though. I was about to ask this question on the other thread but have not finished going through all the posts: is there a technical reason (such as accuracy of results) for testing under Windows versus say, Cutechess under Linux? Or just a simple matter of convenience / personal preference?
All CCRL testers use Windows and AVX2 at present.
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

cristiv wrote: Sun Nov 06, 2022 9:08 pm
cristiv wrote: Sun Nov 06, 2022 8:30 pm Shredder 13 is commercial. I don't know if there is a trial version.
Looks reasonably priced though. I was about to ask this question on the other thread but have not finished going through all the posts: is there a technical reason (such as accuracy of results) for testing under Windows versus say, Cutechess under Linux? Or just a simple matter of convenience / personal preference?
Well, reasonably priced for an ancient and user-unfriendly GUI.

I test under Windows because I don't have Linux. Neither of CCRL testers has. And I don't use Cute Chess because it lacks one of the for me most important features: interrupting/resuming a tournament.
User avatar
cristiv
Posts: 16
Joined: Tue Nov 01, 2022 9:33 pm
Sign-up code: 10159
Location: Seattle, USA

Re: How to submit python engine?

Post by cristiv »

Gabor Szots wrote: Sun Nov 06, 2022 9:12 pm
cristiv wrote: Sun Nov 06, 2022 9:08 pm
cristiv wrote: Sun Nov 06, 2022 8:30 pm Shredder 13 is commercial. I don't know if there is a trial version.
Looks reasonably priced though. I was about to ask this question on the other thread but have not finished going through all the posts: is there a technical reason (such as accuracy of results) for testing under Windows versus say, Cutechess under Linux? Or just a simple matter of convenience / personal preference?
Well, reasonably priced for an ancient and user-unfriendly GUI.

I test under Windows because I don't have Linux. Neither of CCRL testers has. And I don't use Cute Chess because it lacks one of the for me most important features: interrupting/resuming a tournament.
According to https://github.com/cutechess/cutechess/pull/591 there is a fix available at https://rwbc-chess.de/download.htm, I am going to check it out.
EDIT1: Looks like cutechess can pause/resume in memory but NOT save/resume tournament to/from a file :(
EDIT2: Added build instructions to beta branch, new beta-1.1 with Windows exe with fix for the extraneous window pop-up under Shredder:
https://github.com/cristivlas/sturddle- ... g/beta-1.1
User avatar
Gabor Szots
Posts: 12855
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: How to submit python engine?

Post by Gabor Szots »

I can see you have released beta 1.1 which is 'no-console' and indeed it does not run from the command line. It's a pity because the first thing I try with a new engine is to run it from the command line, issuing uci then go depth n, to see it works and how fast it is. No big deal.

Anyway, I'm already into a tournament with 1.0 so I'm not going to switch.
Post Reply