Jimbo - Chess Engine banner

Jimbo - Chess Engine

21 devlogs
32h 52m 25s

A UCI chess engine in C++ with Lichess API integration in python.
To play against the engine, challenge the Lichess Bot when it is online.
Download the engine from the latest [Github Release](https://github.co

A UCI chess engine in C++ with Lichess API integration in python.
To play against the engine, challenge the Lichess Bot when it is online.
Download the engine from the latest Github Release

Demo Repository

Loading README...

M8000

Shipped this project!

Hours: 11.97
Cookies: 🍪 185
Multiplier: 15.42 cookies/hr

Jimbo is a chess engine, provided as a UCI-compliant binary.

To play against the bot

Challenge the lichess bot, same as the demo link. WARNING: The bot may not always be online, since it runs on the free version of google colab. You can wait for it to come online, or you could directly download the engine binary(CLI), as described below.


To download the binary

Download a suitable version from the latest Github release. Please read the release notes, it has detailed instructions on which binary to download for your specific machine. The app itself is a UCI-compliant CLI, it can accept UCI commands. It is not meant to be used by users directly - usually, you’d use the binary in a chess GUI/Lichess bot. You can still try it out manually by writing UCI commands, as described in the readme.

M8000
  1. Switched opening book to Cerebellum, which is WAY better than the previous one
  2. Fixed an issue in the time taken to play moves for the lichess bot.

Will ship soon!

Attachment
1

Comments

chefpenguino
chefpenguino about 1 month ago

this is so sick

M8000
  1. Internal logic improvement - use Unmake move, instead of storing a copy of each board.
  2. Use compiler intrinsic blsr, instead of the previous, inefficient alternative.
Attachment
0
M8000

Engine now stops search after it finds a forced checkmate, cutting out the delay in those situations.
Currently getting my bot rated on lichess, so it’s playing matches against as many other bots as possible. Will enable rated matches soon.

Attachment
0
M8000

Made move searching a separate thread, so now you can pass the UCI “stop” command to terminate the search at that point and return the best move!

Attachment
0
M8000
  1. Cleaned up and reduced the file count
  2. Improvements in SPEEEEEED(therefore performance)!
  3. Outputs “Illegal command” when required, rather than ignoring.
Attachment
0
M8000

Refactored code to use a standard build (with .h header files) instead of my old “unity” build method.

Attachment
0
M8000

Shipped this project!

Hours: 2.98
Cookies: 🍪 84
Multiplier: 28.26 cookies/hr

#IMPORTANT NOTE FOR SHIPWRIGHTS
##(and anyone who wants to try this)

If you want to play against the bot, you can click on the demo link which will take you to lichess, and you can challenge the bot from the popup. The bot runs on google colab, and I will try to keep it online as long as possible. However, the bot being online is not guaranteed (especially at night, eastern time zone), as google colab doesn’t run code indefinitely. You can try sending a challenge again later, when the bot comes online.

If you wish to try out the UCI engine yourself on your machine, go to https://github.com/abhijato-c/Chess-Engine/releases/tag/v2.0.0 and download the appropriate binary(details in the release log). To run the binary, the readme has details on what commands the engine accepts. The readme also has instructions on how to get this running as your own lichess bot.

M8000

Completely refactored and revamped the Lichess bot code! Now with -

  1. Proper logs with python logging
  2. Handle multiple games without freezing
  3. Accept all time controls
  4. Use streaming instead of polling, comes with massive latency improvements.
  5. Use the standard chess.SimpleEngine to handle engines, so multiple engines work with it.
Attachment
0
M8000

Updated the Lichess Bot script for better usability.

Attachment
0
M8000

Added magic bitboards implementation, so now it can compile on CPU’s without BMI2 architecture!
Now working on compiling all binaries and releasing them in a manner similar to how stockfish releases.
Another match won against stockfish level 4, this time with the new magic bitboard implementation! (I should seriously start playing against higher levels now)

Attachment
1

Comments

aloyak
aloyak about 2 months ago

ngl this is pretty cool fr

M8000

Added a few lines that will allow this to compile (mostly)everywhere. All it needs now is support for magic bitboards, as the pext instruction(current implementation) is available only on certain cpu’s.
Will work on that tomorrow.
Attached screenshot below of Jimbo crushing Stockfish lvl 4!(after many losses, that is)

Attachment
0
M8000

Added a file MakeOpeningBook.py that parses all PGN files in the ‘pgns’ directory, and makes an opening book from them.
I have downloaded around 250 PGN files for cow, containing a whopping 500K games from pgn mentor! This makes my opening book go from around 10mb to ~30mb, and I hope this version is more comprehensive.
Attached yet another screenshot of matches against stockfish for testing.

Attachment
0
M8000

Minor speed & efficiency improvements. I’m burned out working on this engine, so I will now spend some time improving the opening book, and working on other projects.

Attachment
0
M8000

Officially the longest I’ve spent hunting down a bug. A verry tiny and nearly insignificat bug in the evaluation code took me 6 entire hours to resolve. The original plan was for me to add castling to the bot(yes, the bot can’t castle yet), but looks like that’s postponed to tomorrow. For now, at least, the bot plays ever so slightly better.
Attached below is the one of dozens of games I made the bot play trying to debug…

Attachment
0
M8000

Edited the bot to accept only unrated correspondence challenges. Code is now running on google collab, so it should be online more often.
Working on making it accept more time controls.
Challenge at https://lichess.org/@/M8000_bot with correspondence time control and casual, not rated.

Attachment
0
M8000

Realized I hadn’t touched the Lichess API bot code for a while, so I improved it a bit, and made it more readable!
Also ran some additional tests, and realized that tho it wins pretty consistently against stockfish level 4, it loses REALLY bad against lvl 5 ;c
I know exactly why this is happening(Static evaluation needs to be done using positional advantages, not just absolute material advantages), but fixing it makes my engine perform much WORSE as it reduces performance.

Attachment
3

Comments

Legndary26
Legndary26 2 months ago

lichess? did u build it in java

Picklerick
Picklerick 2 months ago

Love the idea of a chess bot for a project haha.

M8000
M8000 2 months ago

The bot is written in python, and the engine is in C++. Also sorry for anybody who challenged me and didn’t get to play, I have now hosted the code on google colab so it can be online for longer.

M8000

Added some UCI support to make it standardized!
The support is still minimal, and it only handles a fraction of commands, but I will keep adding more commands in the future.

Attachment
Attachment
0
M8000

Found bug that was causing engine to play bad. The move generation code for knights had a typo in it, causing it to not generate all possible moves for the knight. This caused the engine to “forget” that the knight can move in a certain way, therefore missing crucial moves.
Now can beat stockfish level 4 consistently when given 3 seconds per move.
Pasted image of a game that it had previously blundered away, but now won(when given the position where it started losing pieces)

Attachment
0
M8000

Cleaned up some buggy code and got the engine running on Lichess, it performs decently well. Beat Stockfish level 4 at 3 seconds per move, but otherwise, performance is underwhelming. Looking into ways to make the engine stronger. Possible inefficiencies in iterative deepening code.

Attachment
0
M8000

This is an old, buggy project that I recently started fixing. It is a really basic chess engine that can play on lichess bot API via python.

Attachment
Attachment
0