# exploit: strongest adversary against a frozen blueprint All numbers are mbb/game (1000 mbb = 1 big blind), positive = the adversary wins = the target is exploitable. `±` is the 95% CI. Exploiter figures are a duplicate match of the trained exploiter (average strategy) vs copies of the target through `bench::matchrun` with full AIVAT, the exploiter rotated through every seat on identical deals. Reproduce with `cargo test --release -p exploit -- --nocapture` (about 80 s on an idle 14-core Mac; the tests use ~1 GB). Training is hogwild-parallel, so rerunning moves the numbers by a few percent. ## 1. Exploitability vs blueprint training (heads-up, `tiny` sizing, 9-category postflop buckets) Targets: paper-style toy blueprints (Linear CFR, preflop average, postflop average of 5 snapshots), `exploit::train_blueprint(2, N, 11)`. `ABR same` = exploiter with the target's buckets and menu (150k iterations, ~3 s). `ABR fine` = hand-strength-refined buckets (x12 levels) and a bigger menu {0.33, 0.66, 1, 1.5 pot, all-in} translated into the target's menu (50k iterations, ~10 s). LBR = `bench::lbr` on 300 deals (strong = 8 bet sizes, weak = bench default). | blueprint iters | ABR same | ABR fine | strong LBR | weak LBR | |---:|---:|---:|---:|---:| | 1,000 | +11122 ± 442 | +15413 ± 444 | +2046 ± 3498 | +3748 ± 3265 | | 30,000 | +3346 ± 258 | +10247 ± 381 | +5326 ± 2908 | +3173 ± 2431 | | 300,000 | +2467 ± 254 | +9918 ± 372 | +7732 ± 3128 | +1528 ± 2039 | * **The key curve is the `ABR same` column: 11.1 -> 3.3 -> 2.5 bb/game, strictly decreasing** (asserted in `tests/curve.rs`). It is the abstract-game exploitability: how much a player who sees exactly what the target sees can win. It falls as the blueprint converges. * `ABR fine` does **not** fall monotonically after 30k, by construction: it also exploits the *abstraction* (the target cannot tell a pair of deuces from a pair of aces), which more CFR iterations in the same abstraction do not remove. It is the better estimate of real-game exploitability and the number to track for "how far from unexploitable". It is also still under-trained (50k iterations over ~400k infosets). * The fine exploiter beats the best LBR in every row, as required. The same-information exploiter does not always beat LBR (LBR sees exact cards and off-tree sizes), so "exploiter >= LBR" holds for the exploiter that is allowed the same information, not for the info-matched one. * LBR needs far more deals than the exploiter evaluation for a usable CI (here +-3000 mbb on 300 deals vs +-250-450 for 15,000 AIVAT deals). ## 2. Push/fold sanity (HU, 10 bb, fold/shove vs fold/call, 169 classes) Equity matrix by Monte Carlo (25k boards per class pair), solved with CFR+ (20k iterations); the matrix game's exact exploitability is computed by best response over the 169x169 matrix. Exploiter: 400k iterations, 200k AIVAT deals, both seats. | target | exact exploitability (matrix) | exploiter wins (AIVAT) | |---|---:|---:| | CFR+ equilibrium (SB shoves 58.3%) | 0.00003 | -9.5 ± 1.7 (SB -56, BB +37) | | equilibrium blended 40% to always-shove / never-call | 226.3 | +222.3 ± 2.8 | Against the equilibrium the exploiter wins ~0 (slightly negative: its average strategy is not an exact best response, and an equilibrium cannot lose); against the perturbed copy it recovers 98% of the exact exploitability. The residual -10 mbb is the 400k-iteration convergence error of the learner, not an equity-matrix artifact (exact exploitability of the target is 0.00003 mbb on the sampled matrix; MC equity error of ~0.2% per cell averages out). ## 3. Exploiter vs LBR Section 1: on the same targets the fine exploiter is 2-7x the strong LBR (LBR is a greedy check/call-continuation lower bound; the exploiter is a trained policy over the whole tree). LBR rows are noisy; the ordering holds in all three rows. ## 4. Not done / caveats * **No river-exact LBR.** `bench::lbr::decide` is MC over opponent holes and runouts; an exact river best response against the Bayes range needs a change inside bench (enumerate the <= 1081 opponent holes weighted by the posterior instead of sampling, no runout). `exploit::lbr` only wraps it with a richer menu and more samples. The trained exploiter already plays the river (and everything else) as an MCCFR best response, so it subsumes this. * 6-max numbers are a **profile** best response (one deviator vs 5 target copies), not an equilibrium-gap bound (3+ player equilibria are not unique). A 6-player toy run works end to end. * Exploiter quality is bounded by its abstraction: use `--fine L` (or a finer bucket table) and more iterations; a larger menu works through deterministic translation, which the target's `BlueprintPolicy` also uses in the evaluation match, so training and evaluation agree. * AIVAT variance reduction uses bench's default equity estimator; both exploiter and target expose exact probabilities. ## 5. CLI and memory ``` exploit --target blueprint.bin --sizing local|paper|tiny --buckets DIR|coarse --players 6 \ --iters 2000000000 --threads 128 --mem-gb 40 --seat all --eval-deals 20000 \ [--fine 12] [--extract average|argmax] [--lbr-deals 500] [--seed 1] [--out result.json] ``` JSON on stdout: per-seat and average exploitation (AIVAT and raw), learner store size / fullness / miss rate, optional LBR. Memory = loaded target (index ~29 B + 4 B per slot per infoset, i.e. exactly the checkpoint's size class) + learner store (`--mem-gb`, split ~1:1 between the 16 B / 0.7 load index and the regret+average arena; ~50 B per learner infoset with 3 actions, average on all streets) + a few GB for the evaluation match. Keep target + `--mem-gb` below ~60 GB. If the learner store fills it plays uniformly at unseen infosets and reports `store_full: true` (raise `--mem-gb` or fix fewer seats with `--seat S`; one store serves all seats because a history key fixes whose turn it is). ## 6. Other runs * A second full run of the tests (machine at load average ~100 from other jobs) reproduced the picture: ABR same 11942 / 3600 / 2925, ABR fine 14375 / 10960 / 12325, push/fold -9.8 ± 1.7 vs equilibrium and +221.9 ± 2.8 vs the perturbed copy (exact 226.0). Uncontended wall time: curve test ~50 s, push/fold test ~25 s. * CLI smoke on a 6-player toy blueprint (`train_blueprint(6, 200000)`, `--iters 200000`, `--mem-gb 2`, all seats, 4000 AIVAT deals): average +1636 ± 353 mbb/game; by seat (SB..BTN) -47, -1806, +3864, +4165, +1974, +1664 (each ± ~1000); learner 980k infosets, 4.4M slots, miss rate 2.4% (under-trained; raise `--iters`), 32 s training.