id: 2b5dc1d5768041c3af4d6dae7dba18ac
parent_id: 
item_type: 1
item_id: 8f9a294ec08d4a65ba90f901c64b1f81
item_updated_time: 1782797600776
title_diff: "[{\"diffs\":[[1,\"Gen 2 — Rollout-Based EHS (State of the Art)\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":44}]"
body_diff: "[{\"diffs\":[[1,\"# Gen 2 — Rollout-Based EHS\\\n\\\n> **Current state, 2026-06-30.** Monte Carlo equity computation. The foundation for all modern postflop play.\\\n\\\n## Role in the Framework\\\n\\\nGen 2 is the first generation to compute **actual hand equity** via Monte Carlo simulation. Instead of static rules, it evaluates `hs` (hand strength), `ppot` (positive potential), and `npot` (negative potential) to make decisions.\\\n\\\nGen 2 strategies are used:\\\n- As **postflop baselines** (V4 was the previous production postflop)\\\n- As **KEHU Nash HU equilibrium** (preflop only, 15-25BB)\\\n- As the **foundation** that Gen 3 and Gen 4 build upon (shared `rollout_postflop_base.rs`)\\\n\\\n## Preflop Maneuver\\\n\\\n| Priority | Strategy | When |\\\n|---|---|---|\\\n| 1 | `g2_ke_hu_nash` | HU, 15-25 BB → Nash equilibrium push/fold/call |\\\n| 2 | `g1_short_stack_preflop` | ≤25 BB → push/fold chart |\\\n| 3 | `ng_preflop` | >25 BB → 169-hand ranking tables |\\\n\\\n### NG Preflop (`ng_preflop`)\\\nPorted from Java `PreFlopStrategyV1`. Uses three 169-hand ranking tables:\\\n- **General table**: blended by active player count\\\n- **HU table**: heads-up specific rankings\\\n- **Profitability table**: expected BB/100 for each hand\\\n\\\n### KEHU Nash HU (`g2_ke_hu_nash`)\\\nPorted from Java `KEHU20BBNeqV3`. 19 embedded Nash equilibrium tables for HU play at 15BB and 20BB stack depths. Tournament-verified: **+2.97 to +4.46 BB/hand** in HU matchups.\\\n\\\n## Postflop Maneuver\\\n\\\n### Shared Base: `rollout_postflop_base.rs`\\\nAll Gen 2-4 postflop strategies inherit from this base (27 methods). Provides:\\\n- Equity computation via Monte Carlo (`compute_equity`)\\\n- Threshold-based decision logic (`should_call`, `should_raise`, `should_bet`)\\\n- Bet sizing fractions (flop/turn/river, value/protection/bluff)\\\n- Draw evaluation (flush draws, straight draws, nut draws)\\\n\\\n### Gen 2 Postflop: `g2_postflop_rollout`\\\nComputes equity vs **random opponent hands**. No range modeling.\\\n\\\n- **Calls**: use `win_prob` (EHS — accounts for future cards)\\\n- **Bets/Raises**: use `hs` (asserts current strength)\\\n- Thresholds from `PostflopThresholds` (80+ configurable parameters)\\\n\\\n### Gen 2 V4: `g2_postflop_rollout_v4`\\\nPrevious production (preserved). Adds **nut awareness**:\\\n- `nutpot`: probability of improving to the nuts\\\n- `EHS_nut_aware`: equity weighted by nut potential\\\n- Better multi-way handling\\\n\\\n## Key Equity Metrics (from `PotentialResult`)\\\n\\\n| Metric | Meaning | Used For |\\\n|---|---|---|\\\n| `hs` | Hand strength (P(we have best hand now)) | Bets, raises |\\\n| `win_prob` | EHS (hs adjusted for future cards) | Calls |\\\n| `ppot` | Positive potential (P(improve to best)) | Draw calling |\\\n| `npot` | Negative potential (P(lose current best)) | Conservative adjustments |\\\n| `nutpot` | Probability of improving to nuts | Nut-aware equity (V4) |\\\n| `rpot` | Robustness (equity stability across runouts) | Multiway adjustments |\\\n\\\n## Monte Carlo Engine\\\n\\\n- **Algorithm**: random opponent hand assignment + board completion + hand evaluation\\\n- **Sample counts**: configurable (default 10,000; live config uses 50,000)\\\n- **Parallelism**: Rayon-based, uses all available threads\\\n- **Hand evaluation**: 2+2 lookup table (fastest known method)\\\n\\\n## Configs\\\n\\\n| Config | Chain |\\\n|---|---|\\\n| `cash_nl_gen2.toml` | ke_hu_nash → short_stack → ng_preflop → g2_postflop_rollout |\\\n| `cash_nl_gen2_loose.toml` | same, value_bet_floor=0.55, wider calls |\\\n| `cash_nl_gen2_tight.toml` | same, value_bet_floor=0.70, tighter calls, more bluffs |\\\n\\\n## Key Files\\\n\\\n| File | Content |\\\n|---|---|\\\n| `holdem_bots/src/cash/rollout_postflop_base.rs` | Shared base (27 methods) |\\\n| `holdem_bots/src/cash/rollout_postflop_v2.rs` | Gen 2 original postflop |\\\n| `holdem_bots/src/cash/rollout_postflop_v3.rs` | Gen 2 V4 nut-aware postflop |\\\n| `holdem_bots/src/cash/ng_preflop.rs` | NG preflop (169-hand tables) |\\\n| `holdem_bots/src/common/hand_rankings.rs` | 169-hand ranking tables |\\\n| `holdem_bots/src/common/hand_potential.rs` | PotentialResult + MC engine |\\\n| `holdem_bots/src/sng/ke_hu_nash.rs` | KEHU Nash HU strategy |\\\n| `holdem_bots/src/sng/ke_hu_tables.rs` | 19 embedded Nash tables (3,272 lines) |\\\n\\\n## Open Issues\\\n\\\n- **Random opponent assumption**: Gen 2 computes equity vs random hands, ignoring that opponents who bet/call have stronger ranges. **Addressed by Gen 3** (range-aware equity).\\\n- **No opponent adaptation**: Same thresholds regardless of opponent type. **Addressed by Gen 4** (adaptive observer).\\\n\\\n## Where This Goes Next\\\n\\\nGen 2 is stable. It serves as the foundation and baseline for Gen 3-5. No active development beyond maintenance.\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":4515}]"
metadata_diff: {"new":{"id":"8f9a294ec08d4a65ba90f901c64b1f81","parent_id":"1246bbc3bb4948fc8329079b84b4ae3d","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1782623752185,"markup_language":1,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-06-30T05:37:45.281Z
created_time: 2026-06-30T05:37:45.281Z
type_: 13