Goal

Know what each tool on this site computes, where its code came from, and how to run it yourself.

The original course pointed students to five programs: the PokerStars client, PokerTracker, Universal Replayer, PokerStove and an online ICM calculator. None of them shipped with the course, two are commercial, and one link is dead. These notes therefore come with their own toolset, written in Rust. It is a single codebase that powers the command-line tool poker, the figures in every module, and the interactive calculators on these pages, which run as WebAssembly in your browser.

What replaces what

Course softwareReplacementHow it was built
PokerStove (equity calculator, BSD-3 open source)poker-core, poker-equity, poker equityPort. A local build of PokerStove was reverse-engineered with the rea tool and the Ghidra decompiler, checked against its source, and re-implemented
ICM calculatorpoker-icm, poker icmClean-room, from the published Malmuth–Harville model
Universal Replayerpoker-hh::replay, poker replayClean-room, from the public PokerStars hand-history text format
PokerTracker (statistics)poker-hh::compute_stats, poker statsClean-room subset: VPIP, PFR, 3-bet, AF, WTSD, W$SD, bb/100
PokerStars clientnoneNot reverse-engineered (terms of service; a real-money client)

Try it in the browser

The equity calculator below runs the ported PokerStove engine. Small matchups are enumerated exhaustively, and larger range-versus-range spots use seeded Monte Carlo.

Try it: replace the second range with random and watch the first range’s equity rise. Add a board such as Ks7d2c to see how the flop changes the picture.

Try it: give one player most of the chips. Their ICM share grows much more slowly than their chip share. Module 5 explains why.

How the PokerStove port was verified

The equity engine is the part where small mistakes would silently corrupt every number in the notes, so it was checked against the original program.

  1. PokerStove was built from its open-source code with debug symbols, giving the reference binary ps-eval.
  2. The binary was analysed with rea (backed by Ghidra 12.1): its hand evaluator, its 32-bit hand-value encoding, its lookup tables and its enumeration loop. Each finding cites a function address from the decompiler and the matching source line. The spec also records PokerStove’s quirks; for example, a duplicate board card silently empties the board, and the port reports an error instead.
  3. The Rust engine reproduces PokerStove’s hand-value encoding bit for bit on 318 test hands, and its ordering agrees on 20,112 seven-card hands.
  4. Equity was compared on 42 matchups (two-, three- and four-way, with and without boards). All agree to within percentage points. The largest, a suited ace-king against a random hand, deals about 2.1 billion boards: 63 seconds in PokerStove and 2.3 seconds in Rust.
$ poker equity AcAd KhKs
hand/range  equity %    win %   tie %
----------  --------  -------  ------
AcAd         81.2555  81.0646  0.1909
KhKs         18.7445  18.5536  0.1909
mode: exhaustive   samples: 1712304

The same engine also settles a small mystery in the Module 4 slides. The lecture quotes 34.26% for nine-six offsuit against a calling range written 22+, A2+, JT+ (27.60% of hands). Read literally, that range gives 34.50%. The slide’s figure is reproduced exactly (34.2631%) only when JT+ means every two-broadway hand (KQ, KJ, KT, QJ, QT, JT), which is also the only reading that makes the range 27.60%.

Run it yourself

cd rust && cargo build --release
target/release/poker equity "TT+,AK" "22+,A2s+,KTs+,QJs" --seed 7
target/release/poker icm --stacks 5000,3000,2000 --payouts 50,30,20
target/release/poker stats hands.txt
target/release/poker replay hands.txt          # terminal replayer
target/release/poker plot preflop-heatmap --out heatmap.svg

The source, the reverse-engineering notes (re/re-spec.md) and the cross-check table (re/cross-check.md) are in the project repository.

What breaks

Range-versus-range equity on the site uses Monte Carlo when exhaustive enumeration would take too long, so the last digit can move between seeds. The hand-history parser understands the PokerStars text format only, and the statistics cover a small part of what a full tracker offers.

Why it matters

Every equity and ICM number in Modules 3 to 5 can be reproduced with one command. The calculators let you change an assumption, such as the opponent’s range or the payout structure, and see the effect immediately. That is the habit the course tries to build.

Licences

The equity engine is a port of PokerStove, BSD 3-Clause, (c) 2012 Andrew C. Prock. The ICM and hand-history code is clean-room. The hand histories used in examples are synthetic, with made-up player names. Course material is adapted from MIT OCW 15.S50 under CC BY-NC-SA 4.0.