open-pql
⚠️ Work in Progress: This project is currently under active development and is not yet ready for production use.
The core library for Open PQL (Poker Query Language) - a high-performance Rust implementation for poker analysis and calculations.
Overview
This crate provides the fundamental building blocks for poker analysis, including:
- Card and Hand Representation: Efficient data structures for poker cards, hands, and boards
- Hand Evaluation: Fast algorithms for determining hand strength and rankings
- Range Analysis: Tools for working with poker hand ranges and filtering
- Equity Calculations: Precise equity computations for various poker scenarios
- PQL Parser: SQL-like query language parser for poker analysis
- Game Support: Texas Hold'em, Omaha, and other poker variants
Features
benchmark- Enables benchmarking functionalityx86- Optimizations for x86 architecture
Quick Start
use *;
// Parse and evaluate poker hands
let hero_hand = parse_hand?;
let villain_range = parse_range?;
let board = parse_board?;
// Calculate equity
let equity = calculate_equity_vs_range?;
println!;
// Use PQL queries
let query = "select avg(boardsuitcount(river)) from hero='As9s', villain='*', board='2s3sJh', game='holdem'";
let result = execute_pql_query?;
Architecture
The library is organized into several key modules:
base: Core poker primitives (cards, ranks, suits, hands)functions: PQL function implementations for analysispql_parser: Parser for PQL query languagepql_type: Type system for PQL valuesrange_parser: Parser for poker hand rangesvm: Virtual machine for executing PQL queriesrunner: Query execution engine
Performance
Open PQL is designed for high performance:
- Optimized data structures using bit manipulation
- SIMD instructions for hand evaluation (with
x86feature) - Efficient memory layouts for cache performance
- Compile-time optimizations using procedural macros
Development
Building
# Standard build
# With all features
# Release build with optimizations
Testing
# Run all tests
# Run with property-based testing
Benchmarking
# Run benchmarks (requires benchmark feature)
License
Licensed under the MIT License. See LICENSE for details.