Jimbo - Chess Engine banner

Jimbo - Chess Engine

14 devlogs
20h 24m 35s

A UCI chess engine in C++ with Lichess API integration in python.
Challenge bot at https://lichess.org/@/M8000_bot (when online).
To download the engine : Github Release
Only accepts casual(unrated) challenges for now.

Loading README...

abhijato.c

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
abhijato.c

Updated the Lichess Bot script for better usability.

Attachment
0
abhijato.c

Shipped this project!

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

If you just 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.

abhijato.c

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

almartdev
almartdev 4 days ago

ngl this is pretty cool fr

abhijato.c

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
abhijato.c

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
abhijato.c

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
abhijato.c

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
abhijato.c

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
abhijato.c

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 11 days ago

lichess? did u build it in java

Picklerick
Picklerick 11 days ago

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

abhijato.c
abhijato.c 10 days 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.

abhijato.c

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
abhijato.c

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
abhijato.c

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
abhijato.c

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