Possible 8bit chess record

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

astrange
Posts: 3
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Possible 8bit chess record

Post by astrange »

Hi all :D

I'd like to introduce Quirkafleeg, a chess engine I've been writing for the original 48K ZX Spectrum. The goal was to find out how strong chess can get inside 48 KB of RAM on a 3.5 MHz Z80 with no multiply instruction. The name is a Jet Set Willy room, for those who remember.

As far as I can tell, it is quite possibly the strongest chess program ever written for the 48K Spectrum, and perhaps for any Z80 at classic 8-bit speeds. I'd be glad to be proven wrong, so if you know of a stronger one, please tell me and I'll test against it.

Hardware constraints
- Z80 at 3.5469 MHz, about 25,000 T-states per node, i.e. ~140 nodes/s
- 48 KB RAM shared with the screen; the release has roughly 100 bytes left
- At ~10 s/move it reaches about 3.5–4 ply nominal depth

How it was built
- A C reference model of the engine is used for all testing and tuning. The Z80 code is verified against it node for node (perft, eval and search trees identical).
- Testing in a cycle-exact Z80 emulator running at real Spectrum speed, plus a virtual Spectrum clock in the C model for large self-play and Stockfish matches.
- Development was assisted by an AI (Claude), especially the tooling, testing and parts of the Z80 code.

Search
PVS with iterative deepening, 512-entry TT, null move, reverse futility, frontier futility, late-move pruning, LMR, threat-aware exemptions from pruning, SEE, MVV/LVA + killers + history, lazy eval, check detection from the last move, pondering, repetition detection including game history.

Evaluation
Texel-tuned tapered PSTs, pawn hash, simple opening rules, a Colossus-style penalty for early king/rook/queen moves, and some endgame knowledge: drawish-material scaling, the rule of the square, and mop-up for KRK/KQK. A small opening book.

A tribute to Colossus
Martin Bryant's Colossus Chess 4 has been the yardstick throughout this project. To me it is still the benchmark of what was achieved on the Spectrum in the 1980s, and an impressive piece of work given the tools of the time. Some of its ideas live on in Quirkafleeg, for example the penalty for early king, rook and queen moves along the search line. Beating it was the goal from day one, and it took modern testing methods (hundreds of thousands of games, Texel tuning, an emulator running far faster than real time) that simply weren't available in 1984. The comparison is a tribute, not a put-down.

Results
- vs the original Colossus Chess 4, real Z80 code at emulated Spectrum speed, equal time (~10 s/move), both pondering, 200 games: +109 =30 −61, 62% (≈ +85 Elo)
- Stockfish anchor: at Spectrum speed (C model on the virtual Spectrum clock, 1,000 games) Quirkafleeg scores about 50% against Stockfish with UCI_Elo 2100, i.e. roughly 2100 on Stockfish's UCI_Elo scale. In an earlier measurement against Stockfish's UCI_Elo levels, Colossus 4 came out around 1890. UCI_Elo is Stockfish's own calibration, so please read this as a relative scale, not FIDE or CCRL.
- On Lichess as the bot Quirkafleeg-ZX48K (UCI build that runs the engine on a Spectrum-speed clock): currently around 1830–1850 rapid against other bots

Try it
Play it in the browser, or download .tap/.tzx/.sna for an emulator or real hardware:
https://frontpoint-sport.com/quirkafleeg/
Lichess: https://lichess.org/@/Quirkafleeg-ZX48K

UCI version for testers
For anyone who wants to test more, there is a Windows UCI build of the 48K engine. It is the C reference model running on a virtual Spectrum clock, so it searches as much as the real 48K would in the given time, regardless of how fast your PC is. It is the same engine and evaluation as the Z80 code (node-identical at fixed depth), so results should reflect the real Spectrum version. It works in the usual GUIs and in cutechess/fastchess. It's the build the Lichess bot uses.
Download it from my page: https://frontpoint-sport.com/quirkafleeg/

There is also a ZX Spectrum Next version (28 MHz Z80N, big TT, KPK bitbase, around 2000 rapid on Lichess as Quirkafleeg-ZXNext) and a PC spin-off (Quirkafleeg-PC).

Comments, test results and games against other 8-bit programs are very welcome. If anyone has results for other Spectrum chess programs under controlled conditions, I'd love to compare.

Anders
User avatar
towforce
Posts: 13413
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK
Full name: Graham Laight

Re: Possible 8bit chess record

Post by towforce »

https://frontpoint-sport.com/quirkafleeg/ works - but how do I get it into a faster time control than 2 hours per player?
Human chess is partly about tactics and strategy, but mostly about memory
astrange
Posts: 3
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Re: Possible 8bit chess record

Post by astrange »

Just pres <t> and <enter> and it will change time controls. Otherwise just press <SPACE> while it thinks and it will move :D
astrange
Posts: 3
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Re: Possible 8bit chess record

Post by astrange »

You can also check the manual on the same page under the commands TAB
https://frontpoint-sport.com/quirkafleeg/#howto