Rasmus Suonio

A poker research lab, from exact equity to exploiting an opponent model

Solvers that measure their own error, a Bayesian model of how opponents play, the strategy that exploits it, hand-history analysis, and an interactive lab that runs in the browser.

River solves
0.1% of the pot in about 150 iterations
Browser engine vs Rust engine
26,612 parity checks, all equal
Ranges read from actions
true hand 2× as likely; 90% regions hold it 94% of the time
Automated tests
74 Rust, 109 Python
  • Rust
  • Python
  • JavaScript
Two 13 by 13 grids of the big blind's river strategy on Q-8-5-3-2. At equilibrium every hand checks; against a button that folds 70% of the time to bets, the exploiting strategy bets 94% of its range.

Most poker tools answer one question: what is the equilibrium play? This project asks the next one as well. How far is a given answer from equilibrium, and what should change when you know how an opponent actually plays? It brings together exact hand evaluation and equity, a family of game-theory solvers that report their own error, a Bayesian model of opponents, exploitative strategies built on that model, and hand-history analysis, in one codebase with one test suite.

Try it #

The lab below is the real engine running in your browser. Pick a spot and press Solve: the convergence chart shows how far the strategy is from equilibrium after each batch of iterations, and the grid shows what every hand does. Then describe how an opponent plays (say, the button folds 70% of the time to river bets), press Compare GTO and exploit, and watch the strategy change and what that change costs in safety. The default spot and opponent are the ones behind the exploitation results below, so the lab reproduces those numbers. In the Hand histories tab, pick a hand to see each player’s range street by street and a review of the river decisions against an equilibrium. Open it full screen for more room.

What it does #

  • Exact evaluation and equity. Hold’em, Short Deck (both rule sets), Omaha, Five-Card Omaha and Omaha Hi-Lo. Equity by full enumeration for any number of players, on one or two boards, or by Monte Carlo with standard errors. Running it twice is computed exactly: it never changes equity, but it cuts the variance by more than half, because the second run is dealt from what the first left.
  • The CFR family. CFR (counterfactual regret minimisation: the strategy plays against itself and shifts towards the moves it regrets not making), CFR+, Linear, Discounted and Predictive CFR, and two Monte Carlo versions, compared on games with known answers.
  • Range-against-range solving on the river and turn for Hold’em, Omaha and Short Deck, with exact card removal (who can hold which cards given what everyone else holds), double boards, rake and the 7-2 game’s bounty. It also solves three- and four-way rivers.
  • Opponent modelling. Statistics such as how often a player folds to a river bet, estimated with a hierarchical Bayesian model: small samples lean on the player population and every estimate comes with a 90% credible interval. Players are then clustered into types.
  • Exploitation. A best response to the model (the most it can win) and restricted Nash responses, which trust the model only partly and so trade some of the gain for safety against being wrong.
  • Hand histories. A PokerStars parser that rebuilds every pot, including side pots, rake and straddles (a Mississippi straddle from the button acts last before the flop), works out all-in equity and the luck in each hand, and feeds a searchable database.
  • Ranges, street by street. Every action is evidence about the cards behind it. Bayes’ rule with a model of play, built from each player’s own frequencies, turns a hand’s actions into a range for every player at every street.
  • River review. Each heads-up river decision is replayed against an equilibrium of that river, solved with the reconstructed ranges and the bet sizes actually used: what the equilibrium does with that hand, what each action is worth, and what the action taken cost.

What is exact, and what is not #

Every result says what it is. Hand values and enumerated equities are exact. A heads-up solve is an approximate equilibrium of the game with the listed bet sizes, and how far it is from equilibrium in that game is computed exactly, as a share of the pot. With three or more players, CFR has no guarantee of reaching an equilibrium at all; those results report NashConv (the total that all players could gain by switching to their best responses) and are labelled as approximations. The opponent model and the street-by-street ranges are checked against simulated players, whose true habits and cards are known; real players’ are not. A river review’s costs are measured against an opponent who plays the equilibrium of that river, not against the real opponent.

What I measured #

  • Known answers. Kuhn poker’s value comes out at −1/18 to within 5 × 10⁻¹², Leduc hold’em’s at −0.0856, and a river with a closed-form solution (the nuts or air against bluff-catchers) matches the theory’s bluffing and calling frequencies to four decimal places.
  • Algorithms. On Leduc, after 1,000 iterations, plain CFR is 0.012 chips a hand from equilibrium and Discounted CFR 0.0002. On real river spots Discounted CFR reaches 0.1% of the pot in about 150 iterations, including an Omaha river with 32,352 against 41,844 four-card hands.
  • Abstraction. Grouping river hands into strength buckets costs 16% of the pot with 2 buckets and 0.16% with 40, against 0.003% for the exact solve.
  • More players. Exact three- and four-way rivers cost about twelve times more per added player. NashConv still fell to about 0.03% of the pot, an observation rather than a guarantee.
  • Exploitation. Against a button that folds 70% of the time to river bets, a restricted Nash response wins 37% of the pot more than equilibrium play and stays exploitable for 20% of the pot. The pure best response wins 42% more but is exploitable for 45%.
  • Opponent model. Across 24 simulated players, the average error of the estimates falls from 0.077 after 50 hands each to 0.019 after 2,500, about half the error of raw frequencies. The 90% intervals contain the truth 88-93% of the time, and the clustering recovers all six playing styles.
  • Ranges from actions. On 1,903 simulated hands, scored on the half not used for fitting, the reconstructed ranges make each player’s true hand twice as likely as a uniform range would, against 1.5 times with population frequencies alone. The 90% most likely part of a range contains the true hand 94% of the time. Treating every action as fully revealing gets that down to 51%: players slow-play and float, so the model counts half of all actions as uninformative, a share fitted on the data.
  • River review. Replaying 1,945 heads-up rivers from 6,000 simulated hands against their equilibria, the typical decision costs nothing (the median is zero) and a few cost tens of big blinds. Maniacs give up the most per decision (1.5 big blinds on average) and tight-aggressive players the least (0.7). Decisions the equilibrium would rarely reach are flagged rather than scored, because the solver explores them too little for their numbers to mean much.

The full reports, with method, tables and figures, are on GitHub.

How it’s built #

The engine is a Rust workspace of seven crates: cards and ranges, evaluators, equity, the CFR family, the range solver, hand histories, and a command-line tool whose JSON output everything else reads. Its only outside dependencies are serde, serde_json and rayon. The research layer is Python with nothing beyond the standard library: statistics, the opponent model, clustering, a SQLite hand database and the charts. The lab is a JavaScript port of the engine with no build step. The JavaScript and Rust engines are tied together by 26,612 automatic checks, so the browser shows exactly what the Rust code computes; the range probabilities agree to the last bit.

Limits #

  • It starts on the turn or river with ranges you give it; there is no preflop or flop solver here. My No-Limit Hold’em and Pot-Limit Omaha solvers cover full flops and preflop.
  • Bet sizes are an abstraction. A solution is an equilibrium of the game with the listed sizes; an opponent using other sizes is outside it.
  • Multiway solving is exact only for small ranges, and carries no equilibrium guarantee.
  • The opponent data is simulated. Real players adapt and are less tidy than the bots, so read the model’s accuracy, and the ranges’ calibration, as a best case.
  • The river review covers heads-up hold’em rivers, one board at a time; earlier streets are not reviewed.
  • Mixed games here means flop games. Hold’em, Omaha, Omaha Hi-Lo, Big O and Short Deck are covered; stud and draw games are not.

It sits next to my No-Limit Hold’em solver, my Pot-Limit Omaha solver, the Figgie trading bot and Game Tree Studio.