Gary Miller

LEAD_APPLIED_AI.ENG // FULL_STACK_AI.SYSTEMS // QUANT.DEV

SYS.LOG: Holdem-Trainer (PyHoldem Pro)

>_ MISSION_OBJECTIVE

In competitive Texas Hold'em poker, profitability is dictated by identifying and patching marginal expected value (EV) leaks. Traditional solver-grade software suffers from high barriers to entry, steep learning curves, and critical data privacy concerns—requiring users to upload proprietary hand histories to third-party databases.

PyHoldem Pro addresses this with a local-first gameplay simulator, quantitative engine, and automated coaching workflow. It combines real-time EV-based grading, Bayesian playing-style classification, and spaced-repetition drills while keeping hand histories and training data under the player's control.

>_ ARCHITECTURE & STACK

  • Frontend (React 18 + TypeScript + Vite): Engineered for high-performance rendering of fast-updating table states. TypeScript ensures strict type safety over complex WebSocket payloads.
  • Backend (Python 3.13 + FastAPI + Uvicorn): Python was selected for its robust mathematical libraries and rapid hand evaluation capabilities. FastAPI manages high-concurrency operations and persistent WebSocket connections with low latency.
  • Persistence & Observability: PostgreSQL with SQLAlchemy/Alembic handles relational mapping, while a Docker Compose overlay of Prometheus and Grafana tracks API latencies and game loop health.

>_ CORE ENGINEERING CHALLENGES

1. Scaling CPU-Bound Monte Carlo in an ASGI Event Loop: Calculating multiway range-vs-range equity requires thousands of Monte Carlo card simulations, which normally blocks FastAPI's event loop and drops WebSockets. I optimized this by implementing a highly compressed lookup table and a C-level fast evaluation module. Identical board/hand permutations are cached, and exact enumeration algorithms execute dynamically when cards-to-come are low.

2. Scaling Exact Malmuth-Harville ICM Permutations: Computing tournament Independent Chip Model (ICM) equity across a 9-handed table requires $9! = 362,880$ permutations. I engineered a recursive dynamic programming algorithm that calculates probabilities in $O(2^n \cdot n)$ using memoized sub-state stack weights, driving execution times under 5 milliseconds.

3. Preventing Client-Side Inspection in Drills: To prevent players from bypassing math drills via React state inspection, I implemented a server-owned validation architecture. The frontend only receives a quiz_id, and absolute/relative tolerance evaluations are computed securely server-side before persisting progress to the DB.

>_ FUTURE ROADMAP

Integration of Celery and Redis to handle CPU-intensive Counterfactual Regret Minimization (CFR+) solving outside the web request cycle, alongside an automated study scheduler targeting the user's highest EV-loss nodes.

>_ ENGINEERING SIGNAL

The repository pairs algorithmic depth with full-stack delivery: Monte Carlo and exact-enumeration engines, memoized ICM analysis, server-owned validation, persistent training state, WebSocket workflows, Docker orchestration, Prometheus/Grafana observability, and more than 630 passing tests across core behavior.

ACCESS_SOURCE_CODE()