RS-Poker V5
Show HN: RS-Poker V5 The one with self learning multi-threaded async Agents
Last verified:
What is RS-Poker V5?
RS-Poker V5 is a Rust library that provides comprehensive poker evaluation tools ranging from hand ranking and starting card enumeration to a full self-learning agent arena. The library is designed for developers building poker-related applications, poker AI researchers, and anyone interested in creating automated poker strategies. It supports Texas Holdem poker games with accurate hand evaluation for both five-card and seven-card hands.
Key features include Counterfactual Regret Minimization (CFR) agents for self-learning poker strategies, tokio-based async exploration for multi-threaded performance, rust slab allocation based tree structure for regret minimization, perfect hashing for faster hand ranking, and a terminal user interface (TUI) via ratatui.rs. The library can rank a five-card hand in approximately 20 nanoseconds per hand, enabling 50 million hands per second per CPU core, and seven-card hands in under 25 nanoseconds.
The Arena module allows users to create autonomous agents that compete in simulated Texas Holdem games, making it ideal for determining strategy strength and playing GTO poker at scale. Creating a custom poker bot that competes in an arena requires less than 100 lines of code. The library is open source under the Apache-2.0 license and has 109 stars on GitHub with active community contribution.
RS-Poker V5 pricing
Pricing model: Freemium
Free and open source under Apache-2.0 license. Available on GitHub at https://github.com/elliottneilclark/rs-poker with 109 stars and 37 forks. No paid tiers or commercial licensing required.
RS-Poker V5 pros
- Fast hand ranking at ~20 nanoseconds per five-card hand
- 50 million hands per second ranking per CPU core
- Seven-card hand evaluation under 25 nanoseconds
- Counterfactual Regret Minimization (CFR) agent implementation
- Self-learning multi-threaded async agents
- Tokio-based async exploration for performance
- Rust slab allocation tree structure for regret minimization
- Perfect hashing for faster hand ranking
- Terminal UI via ratatui.rs
- Less than 100 lines of code to create custom poker bot
- Accurate hand evaluation without relying on single kicker
- Breaks ties on closer hands accurately
- Monte Carlo game simulation helpers
- Hand range parsing functionality
- Starting hand enumeration built in
- Well-tested and benchmarked code
- Open source under Apache-2.0 license
- Agent trait for creating custom strategies
- Historians to watch simulations in real-time
- Multi-agent simulations for validation
RS-Poker V5 cons
- CFR agents cannot predict opponents' hands
- Regret minimization uses exact hand or random (not optimal)
- Currently only supports Texas Holdem
- No built-in machine learning components yet
- Needs more data and discussion on opponent hand prediction
- Limited to five-card and seven-card evaluations
- NoLimit Texas Holdem specific features not fully implemented
- Follow-on with ML components ala Pluribus still planned
- Requires Rust programming knowledge
- Community needs to improve algorithms to state of the art
Frequently asked questions about RS-Poker V5
What is RS-Poker V5?
RS-Poker V5 is a Rust library that includes all poker evaluation tools needed from hand ranking and starting card enumeration to a full agent arena for self-learning. It is aimed to be a good starting place for many poker Rust codes with correctness and performance as primary goals.
How fast is the hand ranking performance?
The five-card poker hand evaluation ranks a hand in approximately 20 nanoseconds per hand, enabling 50 million hands per second per CPU core. The seven-card hand evaluation ranks in under 25 nanoseconds.
What poker games does it support?
The library currently supports Texas Holdem poker games. The holdem module contains code specific to holdem including starting hand enumeration, hand range parsing, and Monte Carlo game simulation helpers.
What is the Arena feature?
Arena allows creating agents that play simulated Texas Holdem poker games. These autonomous agent vs agent games determine strategy strength and quickly play lots of GTO poker. It includes Holdem simulation struct, Game state, Agent trait, example Agents, and Historians.
How do I create my own poker agent?
You implement the Agent trait to create your own poker agent. To implement your own strategy, build a new ActionGenerator which generates all possible actions for a game state. The CFRAgent then explores possible results and chooses the action it would most regret not taking.
What is the CFR Agent?
CFRAgent uses Counterfactual Regret Minimization algorithm to choose the best action. It is a good starting point for creating a strong poker agent. The agent explores actions suggested by ActionGenerator and chooses based on regret minimization.
Is RS-Poker V5 open source?
Yes, it is open source under the Apache-2.0 license. The direct GitHub repository is https://github.com/elliottneilclark/rs-poker with 109 stars and active community contribution.
What are the main technical features in V5?
V5 includes tokio-based async exploration, rust slab allocation based tree structure for regret minimization, perfect hashing for faster hand ranking, and a TUI via ratatui.rs. It features self-learning multi-threaded async agents.
How accurate is the hand evaluation?
The hand evaluation is accurate because rs-poker does not rely on just a single kicker. This accuracy allows breaking ties on hands that are closer, ensuring correct rankings.
What are the planned future improvements?
The author plans to release a follow-on with ML components similar to Pluribus. There is also work needed on CFR agents predicting opponents' hands for better regret minimization, which is currently a glaring limitation.