id: 248a9a0fd858462e9769bbc5a8e968d7
parent_id: 
item_type: 1
item_id: fa49458a016f4368ad4231e0f6dad416
item_updated_time: 1781270105046
title_diff: "[{\"diffs\":[[1,\"Gen 3 Baseline — Implementation Complete\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":40}]"
body_diff: "[{\"diffs\":[[1,\"# Gen 3 Baseline Implementation — Complete\\\n\\\n## Date: 2026-06-12\\\n\\\n## Summary\\\n\\\nAll 6 phases of the Gen 3 porting plan are complete. The `g3_postflop_rollout` strategy is registered, building, and playing profitably in simulations.\\\n\\\n## Files Created/Modified\\\n\\\n### New Files\\\n- `holdem_bots/src/common/hand_range.rs` — Weighted 52×52 hand range matrix with `init_strong_hands`, `init_strong_draws`, `unset_low_ranking`\\\n- `holdem_bots/src/common/player_model.rs` — Default reference player model (Early/Short/HU stages) with fold/bet probability methods\\\n- `holdem_bots/src/cash/rollout_postflop_gen3.rs` — Gen 3 postflop strategy (~750 lines)\\\n- `configs/bots/cash_gen3.toml` — Bot config using Gen 3 postflop\\\n- `configs/sim_gen3_verify.toml` — 6-max simulation config\\\n\\\n### Modified Files\\\n- `holdem_bots/src/common/mod.rs` — Added `hand_range` and `player_model` modules\\\n- `holdem_bots/src/common/hand_potential.rs` — Added `compute_vs_range`, `compute_hs_weighted`, `compute_hs_for_cards`, weighted accumulators\\\n- `holdem_bots/src/cash/mod.rs` — Added `rollout_postflop_gen3` module\\\n- `holdem_bots/src/assembly/registrations.rs` — Registered `g3_postflop_rollout` (now 15 strategies)\\\n\\\n## Architecture\\\n\\\n### Range-Weighted Equity (Gen 3 Core Innovation)\\\n1. Build `strong_hands` range (top 20% by hs on board)\\\n2. Build `strong_draws` range (flush draws + OESDs + overcards)\\\n3. `ppot_vs_ranges` = ppot vs strong_hands\\\n4. `npot_vs_ranges` = npot vs strong_draws\\\n5. `hs` = uniform hand strength\\\n6. `win_prob_vs_ranges = hs * (1 - npot_vs_ranges) + (1 - hs) * ppot_vs_ranges`\\\n\\\n### Rust Nut-Aware Enhancements\\\n- `nutpot_vs_ranges`, `rpot_vs_ranges` from `compute_vs_range`\\\n- `draw_quality = nutpot / (nutpot + rpot + eps)`\\\n- `adjusted_ppot = ppot * (0.7 + 0.3 * draw_quality)`\\\n- Nut-aware win_prob: base EHS + nutpot bonus - rpot discount\\\n- Raise safety gate: non-nut draws blocked when npot > 0.25\\\n\\\n### Dynamic Thresholds (from Java)\\\n- All thresholds use effective_m scaling\\\n- Player model fold/bet probabilities for conti-bet and bluff decisions\\\n- Check-raise trapping, rope-a-dope, semi-bluff logic ported\\\n\\\n## Simulation Results (500 hands, 6-max, seed 123)\\\n\\\n| Player | Hands | Won | Profit | BB/Hand |\\\n|--------|-------|-----|--------|---------|\\\n| FlockBot-1 | 500 | 35 | +20250 | +40.50 |\\\n| Gen2V3-1 | 500 | 69 | +18395 | +36.79 |\\\n| Gen2V3-2 | 500 | 55 | +12690 | +25.38 |\\\n| Gen3-1 | 500 | 63 | +8895 | +17.79 |\\\n| Gen3-2 | 500 | 56 | +3575 | +7.15 |\\\n| ChumpBot-1 | 500 | 213 | -63805 | -127.61 |\\\n\\\n## Key Finding\\\n\\\nGen 3 baseline is profitable (+7 to +18 BB/hand) but behind tuned V3 (+25 to +37 BB/hand). The gap is expected — V3 has been extensively parameter-swept, while Gen 3 uses raw Java thresholds.\\\n\\\n## Bugs Fixed During Implementation\\\n\\\n1. **`consider_fold_as_not_applicable = true` bug**: Initially set to true, causing modular strategy to skip Gen 3 when it wanted to fold. Fixed to false (default). This was the most impactful fix — went from -30 BB/hand to -0.75 BB/hand.\\\n\\\n## Test Results\\\n- All 308 existing tests pass\\\n- 12 new hand_range tests\\\n- 4 new hand_potential range tests\\\n- 6 new player_model tests\\\n- 2 registration tests updated (15 strategies)\\\n\\\n## Next Steps\\\n1. **Parameter sweep** Gen 3 config fields against V3 baseline\\\n2. **Port missing tactics**: backAlleyMug, luringBet, fakeSemiBluff, scareCardHit\\\n3. **Apply structural improvements** identified in prior analysis\\\n4. **Add ICM support** for SNG compatibility\\\n5. **Per-opponent tracking** (Gen 4 direction)\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":3472}]"
metadata_diff: {"new":{"id":"fa49458a016f4368ad4231e0f6dad416","parent_id":"abc167de888d41bf9391c373e90dec8d","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":1781270075790,"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-12T13:16:37.220Z
created_time: 2026-06-12T13:16:37.220Z
type_: 13