Crystal Palace 9
AI on 8-bit hardware
A Commodore 64 tic-tac-toe game whose AI moves come from a real neural network running in 6502 assembly; now powered by Falken-9, a complete AI-vs-AI game takes just over a minute.
Executive summary
Why it exists
Could the original Crystal-9 neural-network weights run on a Commodore 64 from a 1541 disk? The repository, called Crystal Palace 64 (CP64), treats this as a feasibility project, with no substitute move table, hand-written policy, distilled model, or requantized weights.
Outcome
The first version ran the original Crystal-9 weights on the C64: 436 passing tests, and 13 complete output vectors that matched byte for byte between Py65 and real-ROM VICE, over full human-against-model and AI-vs-AI games. It proved the idea but took roughly 20 minutes for a self-play game. The game now runs Falken-9, a model designed for the C64, and a complete AI-vs-AI game takes just over a minute in an emulator, with progress feedback, console animation and sound during each move's thinking.
My role
Designer, director and maintainer. AI coding assistants: GPT-5.6-terra, then GPT-6.1 Sol from mid-October, through Hermes.
Technical overview
How it works
A command-room interface and presentation assets drawn for the machine's 8 x 8 multicolor graphics, a disk-backed INFO archive, a playable human board, and 6502 assembly with an isolated module that materializes the original tokens. Python scripts export 48 pageable model packets from the verified Crystal-9 release and package everything into a D64 disk image. A static GitHub Pages asset editor supports the artwork.
Hard parts
Memory and disk. Crystal-9 didn't fit in the C64's memory, so its original INT4 weights travel as 48 disk packets and load during each move, run in fixed-point 6502 math. Testing in VICE with the real C64 and 1541 ROMs found bugs a simpler emulator hid: a disk load that relocated to the wrong address, and an eight-bit memory offset that wrapped later history slots onto earlier ones. Later releases grouped tensors to cut disk loads per move from many to 12.
How it was made
I chose the Commodore 64 because I enjoy the 6502 processor and many emulators exist for it. I often watch The 8-Bit Guy's videos about the chip, and I built Ben Eater's 6502 computer, which still sits on a breadboard in my basement (my 6502 practice code has its files). Most of the work on the first version went into loading each layer from disk, because Crystal-9 was too big for the C64's memory.
The name joins the two models, Palace-9 and Crystal-9, both named for Crystal Palace, the NORAD call sign in WarGames where an AI plays against itself. Like the Palace-9 website, the game has a Cold War theme: the computer plays itself over maps of the USA and USSR. Lessons from it went into Falken-9, which now powers the game.