feat: refactor AlgorithmicEvaluator to stateless, add game engine module and holdem_sim CLI

- Refactor AlgorithmicEvaluator from stateful Arc<Evaluator> wrapper to
  pure stateless evaluator with zero-allocation construction
- Extract shared evaluation logic into pub(crate) methods, eliminating
  ~220 lines of duplicated code from Evaluator
- Add game module: table, hand runner, tournament, bots, config, stats
- Add holdem_sim CLI binary crate for running simulations
- Convert MathEvaluator to thread-safe singleton with Arc<Inner> pattern
- Replace heap-allocated combination generation with const-generics
  stack-based approach in AlgorithmicEvaluator::evaluate_n_card_hand
- Add thiserror 2 dependency for GameError derive
- Update docs: README, ACHIEVEMENTS, ROADMAP
This commit is contained in:
Jan-Peter von Hunnius 2026-05-18 15:12:34 +02:00
parent dd605e8a66
commit 17d0440c86
43 changed files with 12329 additions and 494 deletions

View file

@ -8,6 +8,32 @@
- Card/Hand/Board representations ✅
- Fast LUT hand evaluator (5, 6, and 7 cards) ✅
### Phase 2: Simulation Testbed ✅
**Bot framework**
- Meerkat-API-compatible `HoldemPlayer` trait ✅
- Built-in bots: CallBot, FoldBot, RaiseBot, RandomBot ✅
- Bot factory for config-driven bot instantiation ✅
**Game engine**
- Full hand execution engine (HandRunner state machine) ✅
- Table management with seating, button rotation, blind posting ✅
- Tournament support (SNG, MTT) with blind schedules and prize structures ✅
- Pot management with side pot algorithm ✅
- NL/PL/FL betting structures ✅
- Seed control for reproducible simulations ✅
**Simulation infrastructure**
- TOML-based configuration system ✅
- Cash game simulation loop ✅
- Performance statistics accumulator ✅
- CLI simulation runner (`holdem_sim`) ✅
- Example configs for Cash, SNG, and MTT ✅
**Testing**
- 369+ unit tests passing ✅
- Integration and property tests ✅
## Success Metrics
- **Bot Performance:** Profitability across different game types

View file

@ -16,25 +16,30 @@
- Game type configurations (Cash/SNG/MTT, buyins, blinds, hands per level, etc.)
- Simulation parameters (hands/tournaments count, buyin thresholds for bots, etc.)
### Phase 2: Simulation Testbed
### Phase 2: Simulation Testbed ✅
**Goal:** Mass simulation capability
**Testbed core**
- Tournament/cash game runners
- Parallel simulation engine
- Result collection and analysis
- Bot interface with early folding capability
- Bot performance metrics & visualization
- Simulation and game factories
- Configuration-driven experiment runner
**Testbed core** ✅
- Tournament/cash game runners ✅
- Result collection and analysis ✅
- Bot interface with early folding capability ✅
- Bot performance metrics & summary ✅
- Simulation and game factories ✅
- Configuration-driven experiment runner ✅
- Seed control for reproducibility ✅
**Remaining for mass simulation**
- Parallel simulation engine (multi-threading)
- Result visualization (charts/graphs)
- Rebuy/addon support for tournaments
---
### Phase 3: Bot Framework
**Goal:** All bot types with playability enhancement
**Bot core implementations**
- Generic helper functions for strategies
**Bot core implementations** (partially complete — basic bots exist)
- ~~Generic helper functions for strategies~~ (basic bots done: CallBot, FoldBot, RaiseBot, RandomBot)
- Modular Strategy per stage and game situation
- Rule-based bot with configurable thresholds – port from Java
- Nash equilibrium calculator for SNG endgame – port from Java