id: 810b0f8cb3964b0a9d59057569f91178
parent_id: 
item_type: 1
item_id: cef67230cdcf407bb27cfb94b32a4483
item_updated_time: 1780223889422
title_diff: "[{\"diffs\":[[1,\"Java Bot Analysis — Supersonic Framework\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":40}]"
body_diff: "[{\"diffs\":[[1,\"> **Temporary analysis document — NOT for version control.**\\\n> This document maps every Java bot generation, utility class, and data file to the current Rust port status.\\\n\\\n---\\\n\\\n## 1. Java Bot Architecture Overview\\\n\\\n### 1.1 Composite Pattern — `ModularStrategy`\\\n\\\nThe Java Supersonic framework uses a **composite strategy pattern** as its core abstraction. Every bot is a tree of `ModularStrategy` nodes, each containing zero or more sub-strategies. The root delegates to children according to a voting mode:\\\n\\\n| Voting Mode | Behaviour |\\\n|-------------|-----------|\\\n| `FirstApplicable` | Returns the first child whose `isApplicable()` is `true` |\\\n| `Democratic` | Majority vote among applicable children (weighted) |\\\n| `Random` | Weighted random selection among applicable children |\\\n\\\n### 1.2 Strategy Composition Hierarchy\\\n\\\n```\\\nCustomModNGV2 (Root ModularStrategy)\\\n├── StealFromInactive\\\n├── FoldMicroStack\\\n├── ModNashICMv7\\\n├── PushOrFoldStrategyV3\\\n├── KEHU20BBNeqV3\\\n├── NGPreFlopStrategyV3\\\n├── NGPostFlopStrategyV3\\\n│   ├── BluffModule\\\n│   ├── LureModule\\\n│   └── EHSDecision\\\n└── EmergencyStrategy\\\n```\\\n\\\nThe root uses `FirstApplicable` voting — strategies are ordered by priority. If a higher-priority strategy applies (e.g., Nash ICM in endgame), it short-circuits and lower strategies are never consulted.\\\n\\\n### 1.3 Rust Equivalent\\\n\\\n| Java | Rust | Status |\\\n|------|------|--------|\\\n| `Strategy` interface | `Strategy` trait | ✅ Ported |\\\n| `ModularStrategy` | `ModularStrategy` struct | ✅ Ported |\\\n| `VotingMode` enum | `VotingMode` enum | ✅ Ported |\\\n| `StrategyBot` adapter | `StrategyBot` struct | ✅ Ported |\\\n| Game state fields | `StrategyContext` struct | ✅ Ported |\\\n\\\n---\\\n\\\n## 2. Generation 1: Static Rules\\\n\\\n### 2.1 BigStackStrategy — Cash NL, stack > 25 BB\\\n- Preflop: Hand grouping system (groups 1–8)\\\n- Postflop: Static hand classification → action mapping\\\n- **Rust status:** ✅ Ported as `BigStackBot`\\\n\\\n### 2.2 ShortStackStrategy — Cash NL, stack ≤ 25 BB\\\n- Preflop: Push/fold based on Sklansky-Chubukov rankings\\\n- Postflop: Commit or fold approach\\\n- **Rust status:** ✅ Ported as `ShortStackBot`\\\n\\\n---\\\n\\\n## 3. Generation 2: Mathematical Rules\\\n\\\n### 3.1 RingNLStrategyV1 — Cash NL EHS-based\\\n- Replaced static hand grouping with **Effective Hand Strength (EHS)**\\\n- `ehs = hs × (1 − npot) + (1 − hs) × ppot`\\\n- Threshold system per street (strong/good/marginal/weak)\\\n- **Rust status:** ⚠️ Partially ported — uses `approximate_win_prob()` instead of EHS from `HandPotential`\\\n\\\n### 3.2 RingFLStrategyV1 — Cash FL\\\n- Fixed-limit specific thresholds, more calling, BB defense\\\n- **Rust status:** ❌ Not ported\\\n\\\n---\\\n\\\n## 4. Generation 3: Nash/ICM\\\n\\\n### 4.1 ModNashICMv7 — SNG endgame\\\n- ICM equity + simplified Nash equilibrium for push/fold\\\n- Iterative best-response computation\\\n- **Rust status:** ❌ Not ported\\\n\\\n### 4.2 KEHU20BBNeqV3 — HU precomputed Nash tables\\\n- 20BB and 15BB depth Nash solutions in CSV\\\n- **Rust status:** ❌ Not ported (tables not converted)\\\n\\\n### 4.3 PushOrFoldStrategyV3 — SNG/MTT endgame\\\n- Chart-based push/fold, position × hand range\\\n- **Rust status:** ❌ Not ported\\\n\\\n---\\\n\\\n## 5. Generation 4: Opponent Modelling\\\n\\\n### 5.1 PlayerModelV3\\\n- DB-backed opponent statistics (VPIP, PFR, AF, etc.)\\\n- **Rust plan:** In-memory `HashMap<PlayerId, OpponentStats>`\\\n- **Rust status:** ❌ Not ported\\\n\\\n### 5.2 RangePredictor\\\n- Predicts opponent hand range from observed actions\\\n- **Rust status:** ❌ Not ported\\\n\\\n### 5.3 CustomModNGV2 — Most advanced Java bot\\\n- 10 sub-strategies in FirstApplicable order\\\n- **Rust status:** ❌ Not ported (the assembly mechanism)\\\n\\\n---\\\n\\\n## 6. Configuration via Preferences\\\n\\\nJava uses `java.util.prefs.Preferences` — hierarchical key-value store.\\\nRust replacement: **TOML configuration files**.\\\n\\\n### Key Thresholds (Java defaults):\\\n\\\n**RingNLStrategyV1:**\\\n| Key | Default |\\\n|-----|---------|\\\n| `flop.strong_threshold` | 0.80 |\\\n| `flop.good_threshold` | 0.60 |\\\n| `flop.marginal_threshold` | 0.40 |\\\n| `turn.strong_threshold` | 0.75 |\\\n| `aggression.ip_bonus` | 0.03 |\\\n| `aggression.cbet_threshold` | 0.35 |\\\n| `aggression.multiway_penalty` | 0.05 |\\\n\\\n**ModNashICMv7:**\\\n| Key | Default |\\\n|-----|---------|\\\n| `maxOpponents` | 8 |\\\n| `icmSteps` | 100 |\\\n| `nashIterations` | 50 |\\\n| `stackThreshold` | 15 |\\\n\\\n---\\\n\\\n## 7. Data Files (Not Converted)\\\n\\\n| Java File | Description | Rust Plan |\\\n|-----------|-------------|-----------|\\\n| `math/hand_equity_169.dat` | 169×169 equity matrix | `include_bytes!()` or generated const |\\\n| `math/huneq/hu_20bb_sb.csv` | HU Nash 20BB SB | Parse with `csv` crate |\\\n| `math/huneq/hu_20bb_bb.csv` | HU Nash 20BB BB | Parse with `csv` crate |\\\n| `math/huneq/hu_15bb_sb.csv` | HU Nash 15BB SB | Parse with `csv` crate |\\\n| `math/huneq/hu_15bb_bb.csv` | HU Nash 15BB BB | Parse with `csv` crate |\\\n| `math/push_fold_charts.dat` | Position push/fold ranges | Compile-time const or TOML |\\\n\\\n---\\\n\\\n## 8. Key Gaps Summary\\\n\\\n1. **HandPotential not wired** — single highest-impact fix (upgrades Gen 1 → Gen 2)\\\n2. **No tournament support** — no SNG, MTT, or ICM strategies\\\n3. **No heads-up support** — no HU strategies or Nash tables\\\n4. **No FL cash support** — no fixed-limit strategies\\\n5. **No opponent modelling** — no PlayerModel, RangePredictor, or HandRange\\\n6. **No configuration-driven assembly** — bots are hardcoded\\\n7. **No bluff/lure modules** — no deceptive play capabilities\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":5303}]"
metadata_diff: {"new":{"id":"cef67230cdcf407bb27cfb94b32a4483","parent_id":"2c8da247905946c3aa19eb4936e16323","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":1780223817211,"user_updated_time":1780223817211,"markup_language":1,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":1780223889422},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-05-31T10:46:29.036Z
created_time: 2026-05-31T10:46:29.036Z
type_: 13