Study extreme code size optimization techniques used in low level assembly programming.
Learn about the history and lineage of the smallest-chess-program competition.
Reproduce and verify the claimed 276 byte program size by building it from source.
| nicholas-afk/attochess | kirindenis/wire-city-2 | mytechnotalent/stm32f401_eeprom_driver | |
|---|---|---|---|
| Stars | 13 | 12 | 10 |
| Language | Assembly | Assembly | Assembly |
| Last pushed | — | — | 2025-11-26 |
| Maintenance | — | — | Quiet |
| Setup difficulty | hard | moderate | hard |
| Complexity | 5/5 | 5/5 | 5/5 |
| Audience | researcher | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires an x86 assembler (TASM) and a DOS environment or emulator to build and run.
AttoChess is a complete, playable chess program written to be as small as possible. The whole program, including the logic to draw the board, read your move, and calculate a reply, fits into 276 bytes. To put that in perspective, that is smaller than this paragraph of text stored on a computer. It runs on old 16 bit DOS computers, the kind that predate modern Windows. This project is part of a long running competition among programmers to build the smallest working chess program. The README includes a table showing the history of this record, starting with a 672 byte chess game from 1982 and moving down through several increasingly tiny versions built by different people over the decades. AttoChess currently holds the record at 276 bytes, beating the previous record holder called LeanChess by 12 bytes. The author is clear that this is not just a program that draws a chessboard and stops there. It actually works: it sets up the starting position, displays it, waits for you to type a move, thinks about its own move by searching several moves ahead, plays a legal reply, and repeats this cycle. AttoChess builds directly on the ideas from LeanChess, an earlier tiny chess program by a different author, and keeps that author's original license and credit intact. The README walks through, in detail, exactly which small changes were made to shave off those 12 bytes, such as changing how the board is displayed on screen and how typed moves are converted into board positions internally. To verify the program actually is as small as claimed, the README includes the exact commands used to build it from source code and check the resulting file size, so anyone can reproduce the result themselves rather than just take the claim on faith. This project would mainly interest people curious about extreme low level programming, retro computing, or the history of tiny computer programs, rather than anyone looking for a chess program to actually play with day to day.
An extremely small, fully working chess program that fits in 276 bytes, currently the record holder in a decades-long contest to build the tiniest chess engine.
Mainly Assembly. The stack also includes Assembly, x86 DOS.
Based on LeanChess and keeps its MIT license and original author's copyright intact.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.