Hi Everyone,
It has been a long time, 8-9 years I think. In the context of my day job I recently decided I needed to better understand what agentic AI is capable of, how to use it efficiently, etc. Immediate I thought of my old chess program, EXchess, and perhaps trying to use claude code to bring it into a more modern era: first by implementing NNUE networks and second by building a learning mechanism. Because I was familiar with it from years ago, I chose TDLeaf for 'online' learning (learning in real time from games as they are played).
Quite honestly I was blown away by what claude code is capable of, and we had a working implementation very quickly. There was some initial frustration until I learned I needed to be very specific with claude, always ask it to 'plan' something so I could review, and then test. But once I did that it created a NNUE implementation compatible with stockfish 15.1 era networks, and a full TDLeaf learning pipeline, including proper gradient backpropagation through the neural network. It wrote all of the documentation (as *.md files), created a logo for the project (with my input), wrote scripts to accelerate testing and visual comparison of the network properties, and even keeps a TODO.md file with ideas to pursue. If I think of something, I just ask claude to write it up and put it in the TODO file.
Anyway, the code works nicely... at least in the early stages of learning. I've created a public github for the new program, renamed "Leaf".
https://github.com/dan-homan/Leaf/blob/main/README.md
See the docs/TRAINING.md file for details on early tests. This has been super fun over the last few days, and I might keep going. I've got a 15000 game learning run going now, so we'll see. If I ever get a net that is competitive, I might make a more formal release. Until then, it will live as a github for other coders to explore.
Because it is compatitable (for now) with stockfish 15.1 era networks, please don't compile and use it with those networks for any kind of rating list comparisons. Yes, it is way stronger than the old EXchess with a pre-trained network, but I expected that... no news there, and I am really interested in seeing what TDLeaf can do in the NNUE space. I would be interested to hear if anyone has experience with TDLeaf in training neural networks game by game.
- Dan
A claude code experiment, EXchess reborn as "Leaf"
Moderator: Ras
-
dchoman
- Posts: 172
- Joined: Wed Dec 28, 2011 8:44 pm
- Location: United States
-
nionita
- Posts: 181
- Joined: Fri Oct 22, 2010 9:47 pm
- Location: Austria
- Full name: Niculae Ionita
Re: A claude code experiment, EXchess reborn as "Leaf"
I tried since about 3 weeks Antigravity (which includes also some credits for Claude models) and Codex (model GPT-5.3-Codex). I want to try Claude Code too. But they are amazing, really! I even did a refactoring for my engine Barbarossa, which is in Haskell (this was with GPT Codex). I have not expect to be that good, specially with Haskell, but it is, although there is not so much training material as for C, C++, JS or TS.