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

compile and run ? #1

Open
tissatussa opened this issue Dec 2, 2022 · 2 comments
Open

compile and run ? #1

tissatussa opened this issue Dec 2, 2022 · 2 comments

Comments

@tissatussa
Copy link

i just discovered your engine, but i can not use it in CuteChess (on Linux) .. this is what i did : python3 ./uci.py but CuteChess can not initialise, its message is "Chess protocol was not started in time" .. however, when i try to do the same in terminal, i can use UCI commands and let the engine play -- at start it shows "compiling.." and this process takes about 100 seconds to complete .. that's why CuteChess fails.

is Black_Numba only a LiChess bot ?

and how does the compilation work ? I know some Python, but i'm not familiar with Numba .. can a binary be compiled once and then run that in CuteChess, much faster ? Or is this "compilation" temporary, only in memory ?

btw. you could update the README to explain how to run the engine : python3 ./uci.py (am i right?)

@Avo-k
Copy link
Owner

Avo-k commented Dec 7, 2022

Hi tissatussa,
Thanks for your interest in the project !
I won't lie it has been a while since I ran black_numba, but yes I had problems when trying to run it in arena with uci.
Numba is a just-in-time compiler, meaning when you execute the code it compiles it in machine language (for bn it takes approximately 100 sec for me too). So yes I think it is this too-long delay which makes it impossible for chess softwares to communicate with it. That being said, there is a way to do ahead-of-time compilation with numba to compile "once and for all" the code (see documentation) getting rid of the compilation time.
If I have enough time someday I'll implement it with pleasure :)
about the read me, as you may have noticed it is a work in progress (that I kind of forget) but yes adding a "how to use uci" part could be a quick win for people to be able to use the engine, I'll do it soon

@Alex2262
Copy link

Hi Avo-k, In my Antares chess engine project I actually use Numba also to JIT compile python. I think I have the initialization time down to like 5-20 seconds depending on the computer. I have to say that I used your engine as reference a lot for figuring out how to use Numba and thank you for that. What I've realized is that the ahead-of-time compilation with Numba won't work because of recursion; at least the last time I tried it failed. To get my initialization times down I used Numba struct-refs instead of JIT-classes which helped. I've now transitioned to using c++ instead because Numba can be a pain to deal with from my experience. Thanks for this great engine and resource.

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

No branches or pull requests

3 participants