Expand description
Poker solver toolkit for game-theoretically optimal strategies.
This facade crate re-exports all public rbp crates for convenient access.
§Crate Organization
§Core Types
core— Type aliases, constants, DTOs, and shared traitstransport— Optimal transport (Sinkhorn, EMD)cards— Card primitives and hand evaluationmccfr— Game-agnostic CFR framework
§Domain Logic
gameplay— Poker game engineclustering— K-means abstractionnlhe— No-Limit Hold’em solver
§Infrastructure
§Application
Re-exports§
pub use rbp_core as core;pub use rbp_transport as transport;pub use rbp_cards as cards;pub use rbp_mccfr as mccfr;pub use rbp_gameplay as gameplay;pub use rbp_clustering as clustering;pub use rbp_nlhe as nlhe;pub use rbp_database as database;pub use rbp_auth as auth;pub use rbp_gameroom as gameroom;pub use rbp_server as server;pub use rbp_autotrain as autotrain;
Modules§
- dto
- Data transfer objects for API communication.
Structs§
- AbsHist
- ApiDecision
- ApiSample
- ApiStrategy
- GetPolicy
- ID
- Generic ID wrapper providing compile-time type safety over uuid::Uuid.
- ObsHist
- Replace
Abs - Replace
All - Replace
Obs - Replace
One - Replace
Row - RowWrt
Obs - SetStreets
Constants§
- ASYMMETRIC_
UTILITY - Asymmetric payoff for RPS test game (rock beats scissors by 2x).
- BIAS_
FOLDS - Initial regret weight for fold actions (high = fold more often early).
- BIAS_
OTHER - Initial regret weight for call/check actions (baseline).
- BIAS_
RAISE - Initial regret weight for raise actions (low = raise less often early).
- B_BLIND
- Big blind amount.
- CFR_
BATCH_ SIZE_ NLHE - Trees sampled per NLHE iteration (parallelized across threads).
- CFR_
BATCH_ SIZE_ RIVER - Trees sampled per river-only iteration (testing/debugging).
- CFR_
BATCH_ SIZE_ RPS - Trees sampled per RPS iteration.
- CFR_
TREE_ COUNT_ NLHE - Total NLHE training budget (~268M trees for production).
- CFR_
TREE_ COUNT_ RIVER - River-only training budget (~65K trees).
- CFR_
TREE_ COUNT_ RPS - Total RPS training budget (small game converges fast).
- KMEANS_
EQTY_ CLUSTER_ COUNT - Equity histogram resolution (0%, 1%, …, 100%).
- KMEANS_
FLOP_ CLUSTER_ COUNT - Number of flop buckets (distributions over turn clusters).
- KMEANS_
FLOP_ TRAINING_ ITERATIONS - Lloyd’s algorithm iterations for flop clustering.
- KMEANS_
TURN_ CLUSTER_ COUNT - Number of turn buckets (distributions over river equity).
- KMEANS_
TURN_ TRAINING_ ITERATIONS - Lloyd’s algorithm iterations for turn clustering.
- MAX_
DEPTH_ ALLGAME - Maximum tree depth for full game abstraction.
- MAX_
DEPTH_ SUBGAME - Maximum tree depth for real-time subgame solving.
- MAX_
RAISE_ REPEATS - Maximum re-raises per betting round (limits tree width).
- N
- Number of players at the table.
- POLICY_
MIN - Minimum policy weight to prevent division by zero in normalization.
- PRUNING_
EXPLORE - Probability of sampling pruned actions anyway (prevents permanent lock-out).
- PRUNING_
THRESHOLD - Actions with regret below this are candidates for pruning (-300k ≈ 3× max pot).
- PRUNING_
WARMUP - Warm-up epochs before pruning activates (let regrets stabilize first).
- REGRET_
MIN - Floor for cumulative regret storage (prevents unbounded negative growth).
- SAMPLING_
CURIOSITY - Epsilon (ε) - minimum sampling probability floor. Ensures every action retains at least ε probability for exploration.
- SAMPLING_
SMOOTHING - Smoothing (β) - pseudocount added to numerator and denominator. Higher values pull sampling toward uniform (maximum entropy prior).
- SAMPLING_
TEMPERATURE - Temperature (T) - controls sampling entropy via policy scaling. Higher T → more uniform (exploratory); lower T → more peaked (greedy). Formula: σ’(a) = max(ε, (σ(a)/T + β) / (Σσ + β)).
- SHOWDOWN_
TIMEOUT - Timeout for voluntary card reveal at showdown (seconds).
- SINKHORN_
ITERATIONS - Maximum Sinkhorn-Knopp iterations before stopping.
- SINKHORN_
TEMPERATURE - Entropy regularization strength. Lower = closer to true EMD, higher = faster convergence.
- SINKHORN_
TOLERANCE - Early stopping threshold on marginal constraint violation.
- STACK
- Starting stack size in big blinds.
- SUBGAME_
ALTS - Alternative hands in the gadget game (Pluribus uses 4).
- SUBGAME_
ITERATIONS - CFR iterations for real-time subgame refinement.
- S_BLIND
- Small blind amount.
- TRAINING_
LOG_ INTERVAL - Interval between progress log messages during training.
Traits§
- Arbitrary
- Random instance generation for testing and Monte Carlo sampling.
- Unique
- Unique identifier trait for domain entities.
Functions§
- brb
- Register graceful interrupt handler. Type “Q” + Enter to stop after current batch. Optionally set TRAIN_DURATION env var (e.g., “2h”, “30m”) for timed runs.
- interrupted
- Check if graceful shutdown was requested (via stdin “Q”) or deadline reached.
- kys
- Register Ctrl+C handler for immediate (non-graceful) termination. Use when you need hard shutdown without waiting for current batch.
- log
- Initialize dual logging (terminal + file) with timestamped log files.
Creates
logs/directory and writes DEBUG level to file, INFO to terminal.
Type Aliases§
- Chips
- Stack sizes and bet amounts in big blinds.
- Energy
- Distance metrics, convergence thresholds, and smoothing terms.
- Entropy
- Temperature parameters and information-theoretic measures.
- Epoch
- Training iteration counter for CFR epochs.
- Position
- Seat index around the table (0 = button in heads-up).
- Probability
- Strategy weights, sampling distributions, and reach probabilities.
- Utility
- Expected values, regrets, and payoffs.