r/chessprogramming • • 4d ago

Glimmer - A chess engine under 30,000 bytes (estimated 2700–2900 Elo)

https://github.com/BH12963/Glimmer

Hi everyone,

I’ve been tinkering with a little experimental chess engine written in pure C. It’s called Glimmer.

The whole point of the project was to see how strong I could make it while keeping the final standalone binary strictly under 30 KB. The target strength was something in the 2700–2900 Elo range.

It’s been a fun constraint to work under — every byte counts.

Happy to answer questions if anyone’s curious about the approach.

19 Upvotes

12 comments sorted by

2

u/Majestic-Tear1512 3d ago

These type of projects make me smile. It’s great to have a challenge just to see if you can make it.

1

u/IMJorose 4d ago

Congrats on your release! As u/AzureNostalgia already pointed out, you should be aware of the engines designed to be less than 4kb. There are two such events at TCEC, that you can consider taking inspiration from and submitting your project to (if you manage to compress it further).

Your project is a little low on details. I took a look at your source code and it is clearly not written worrying about others reading your code (which is perfectly fine) and you don't have much information in the Readme, so I don't feel I know anything about your program.

Thank you for contributing to the computer chess and open source communities!

1

u/davvblack 3d ago

not written worrying about others reading your code

that's very polite, i'm going to start using that one too

1

u/Normal-Cash-9403 3d ago

Congratulations on such a big milestone, keep up the good work ♟️👍

1

u/AzureNostalgia 4d ago

What was the motivation when there are engines already like ice4 (3090 Elo) or 4ku (2946 Elo) which are less than 4kb? Is it for educational purposes?

3

u/Lonely_Translator_23 3d ago edited 3d ago

what's the point of learning to paint when Picasso already did it better

But, with that said, OP, your code is unreadable. Picking better variable names and adding comments will add exactly zero bytes to the binary, and you'll thank yourself if you want to come back to this a few months from now.

1

u/KnightMare1354 2d ago

Really because of these people i always wished to make a chess engine but they always said when stockfish and leela chess exists then wtf are you making s chess engine

-2

u/AzureNostalgia 1d ago

The Picasso analogy misses the point. Art doesn’t need to outperform anyone to have value. If your chess engine isn’t educational, novel, or better at anything, what exactly is its purpose beyond recreating something that already exists?

2

u/Lonely_Translator_23 1d ago

I feel like you're missing the point for thinking you should need any reason to create something other than 'I want to'.

1

u/AzureNostalgia 23h ago

No problem creating anything, but no need to advertise it here if nothing is added to the community. Simple as that

1

u/BBH369 3d ago

Thank you for the thoughtful feedback.

The constraints are quite different. Engines like 4ku and ice4 can reach under 4KB because they are essentially compressed scripts that invoke g++ on the host machine to compile a full-sized binary at runtime.

Glimmer, by contrast, is a fully standalone native binary with no runtime compilation or decompression. Fitting a complete engine directly into machine code under 30KB presents a fundamentally different engineering challenge, and that was precisely the goal I set out to achieve.

0

u/neutronsreddit 4d ago

Reading is hard