Secret Hitler XL
Sep 2026 – ongoing · LiveAn online board-game platform for 5 to 19 players with ML bot players, built and run solo. I owned product, architecture, plans and reviews; AI coding agents implemented under that direction.
- decisions in the latest self-play set
- 38.2M
- decisions in the latest self-play set
- model generations trained and gated
- 8
- model generations trained and gated
- bot calls replayed identically, Python vs Rust
- 1.84M
- bot calls replayed identically, Python vs Rust
- test cases across the main suites
- ~9,600
- test cases across the main suites
Platform
- Event-sourced, deterministic Python engine: live games resume after a restart, replays are exact, and each player receives only what they may know.
- FastAPI and WebSockets with a long-poll fallback, idempotent retries and an offline queue, on SQLite (WAL) with versioned migrations.
- Installable PWA from 320 px to desktop; OAuth with only an HMAC of the provider id stored, self-service GDPR erasure, moderation and an audit log.
ML bot players
- A heuristic teacher at three difficulty levels generates self-play data: 1.01M games, 38.2M decisions in the latest set.
- Eight model generations so far; the latest plays every difficulty level, in the base game and XL.
- Transformer policy and value networks trained by behaviour cloning, from ~1M to ~4.7M parameters, tracked in MLflow.
- Each generation is promoted only through a pre-registered statistical gate: A/A baseline, bootstrap confidence intervals, margins fixed before any candidate game.
- Exported to ONNX (parity checked to 5e-4) and served from a separate bot service with leases, heartbeats and capacity limits.
- A live bot decision takes 15 ms median and 82 ms p99 on one CPU thread; a load test with 72 bot seats at 4x pace held p99 at 140 ms with no late moves.
- PPO self-play on top of the cloned policy, anchored to it with a KL penalty and trained against a league of past snapshots, one difficulty level at a time.
- Switching Kaggle T4 training from emulated bf16 to native fp16 made it 4.5x faster (231 to 1,029 rows/s) and cut peak GPU memory from 7.0 to 1.5 GB.
Table talk
- Bots talk at the table through an LLM with provider fallbacks, or a small local model fine-tuned for the job.
- Distillation: a 27B open-weights teacher wrote lines for 8,898 statements, filtered by strict screens and a fact judge. A 2B student was fine-tuned on them with LoRA (rank 16) in 16 minutes.
- Merged and quantised from 4.6 GB to a 1.2 GB GGUF, it runs on llama.cpp at a 259 ms median with 81.8 % of lines judged correct.
Rust port, in progress
- Game engine 65 to 80 times faster than Python on the engine kernel.
- Heuristic bot ported with byte-exact parity: 1.84M recorded calls replay identically and 60+ planted mutants are each caught by a named check.
- Native data generation merged: the Rust loop reproduces the Python training data byte for byte (1.28M rows, 603 MB). The encoder runs 3.35x faster and the legal-move mask 12.4x.
- A typed bot port was stopped by its own gate: it measured 1.22x where the pre-registered rule needed about 10x, and two reviewers confirmed the no-go.
Operations
- Self-hosted on my homelab; the public site runs on a Raspberry Pi 5.
- Multi-arch Docker images in a self-hosted registry. Every merge passes a public-export leak gate.
- Two independent model reviewers check every plan and diff; fixes come with tests that fail first.