Inspiration
Poker is the classic testbed for decision-making under uncertainty: hidden information, a live adversary, and a hard clock. The tournament gave us a brutal constraint — 10 ms per decision, standard-library Python only, one file — which turned "write a good poker bot" into "write a good poker bot that fits in a matchbox." That constraint was the whole appeal. We also had something most poker-AI projects don't: the organisers streamed back every hand our bot actually played, so we could treat our own results as a dataset and let real opponents tell us where we were wrong.
What we learned
- A real field beats a textbook. Our opponents folded far more than game theory says they should, and they almost never bluffed big. The money came from exploiting those tendencies, not from playing a "correct" equilibrium — a tighter, more standard style actually did worse.
- Measure, don't guess. Every instinct we had about a leak was worth checking against the hand histories. Some were real; some were coolers (losing with a strong hand to a stronger one) that no strategy would avoid.
- Variance is the enemy of judgement. A single round swings about ±39 bb/100 on luck alone, so we learned to trust paired simulations over single live results, and to validate changes on ~25,000 real decisions rather than on vibes.
How we built it
The bot is an equity-vs-range engine. For each decision it:
- Narrows every live opponent to a range of hands from their actions so far (pre-computed hand-strength and all-in-equity tables keep this cheap).
- Runs a time-boxed Monte-Carlo simulation to estimate our win probability.
- Compares betting each size against checking/folding using that opponent's measured fold frequencies, and takes the highest-EV action.
Around that core sits a live opponent model, updated after every hand, and a set of data-driven corrections we fit offline from our own hand histories: a logistic fold-prediction model, a big-pot discipline rule, and a "checked hands are weak" range adjustment. We built a parallel simulation lab to A/B test every change on identical deals, and an analysis pipeline that turns raw hand histories into per-opponent and field-wide statistics.
Challenges we faced
- The 10 ms budget. A naive equity simulation was far too slow. We wrote an incremental hand evaluator that extends a pre-computed board state two cards at a time, and a time-boxed sampler that spends more thinking on bigger pots.
- Learning from partial information. We only see opponents' cards at showdown, so every range estimate is inferred from betting patterns and a handful of revealed hands.
- Separating signal from luck. With ±39 bb/100 per-round noise, telling a real improvement from variance meant paired simulations over hundreds of tables and careful held-out validation of every fitted model.
- One file, no dependencies. No NumPy, no files, no network, no threads — every table and model had to be embedded as literal Python and stay under 200 KB.