0% found this document useful (0 votes)
105 views

Pokerkit: A Comprehensive Python Library For Fine-Grained Multi-Variant Poker Game Simulations

Uploaded by

zilugsibuch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

Pokerkit: A Comprehensive Python Library For Fine-Grained Multi-Variant Poker Game Simulations

Uploaded by

zilugsibuch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1

PokerKit: A Comprehensive Python Library for


Fine-Grained Multi-Variant Poker Game Simulations
Juho Kim
Faculty of Applied Science and Engineering
University of Toronto, Toronto, Ontario, Canada
[email protected]

Abstract—PokerKit is an open-source Python library designed card stud, razz, and deuce-to-seven triple draw. Moreover,
arXiv:2308.07327v5 [cs.AI] 16 Oct 2023

to overcome the restrictions of existing poker game simulation PokerKit provides a programmatic interface that allows users
and hand evaluation tools, which typically support only a handful to define their own variants and customize game parameters
of poker variants and lack flexibility in game state control. In
contrast, PokerKit significantly expands this scope by supporting such as betting structures, high/low-split options, antes, blinds,
an extensive array of poker variants and it provides a flexible and straddles.
architecture for users to define their custom games. This paper This paper explores the development of PokerKit, delving
details the design and implementation of PokerKit, including its into its features and capabilities, its rigorous testing and
intuitive programmatic API, multi-variant game support, and a validation processes, and its existing and potential applica-
unified hand evaluation suite across different hand types. The
flexibility of PokerKit allows for applications in diverse areas, tions. Through this comprehensive examination, we aim to
such as poker AI development, tool creation, and online poker underscore PokerKit’s unique contribution to the field of
casino implementation. PokerKit’s reliability has been established computational poker.
through static type checking, extensive doctests, and unit tests,
achieving 99% code coverage. The introduction of PokerKit
represents a significant contribution to the field of computer II. R ELATED W ORK
poker, fostering future research and advanced AI development The functionalities of PokerKit primarily fall into two
for a wide variety of poker games. The source code is available categories: game simulations and hand evaluations. Game
at https://github.com/uoftcprg/pokerkit
simulations encompass creating an environment where poker
Index Terms—Board games, Card games, Games of chance, games can be played out programmatically, simulating real-
Game design, Multi-agent systems, Poker, Rule based systems, world scenarios with high fidelity. On the other hand, hand
Scripting, Strategy games
evaluations are concerned with determining the strength of
particular poker hands. In this section, we explore notable
I. I NTRODUCTION
contributions in these areas, discussing their limitations and

P OKER, a game that intertwines strategy and chance,


has emerged as an exciting and challenging domain
for artificial intelligence (AI) research, primarily due to its
illustrating how PokerKit improves upon these existing solu-
tions.
inherent nature of imperfect information. Pioneering AI agents
such as Deepstack and Pluribus have leveraged poker, more A. Game Simulation
specifically Texas hold ’em, as a benchmark for evaluating Poker game logic has been developed for use in numerous
their algorithms [1], [2]. Nonetheless, poker is not a monolithic online gaming platforms such as PokerStars, GGPoker, and
game but a collection of numerous variants, each introducing 888Poker. While these implementations effectively serve their
its unique set of complexities. This vast diversity underscores intended purposes, they are proprietary and usually support
the inherent challenge of developing a comprehensive poker only a select few variants. Among these, PokerStars distin-
game logic system. This is particularly true in the open-source guishes itself by offering a broader range of game options
space, where solutions are often confined to supporting a [7]–[9].
limited set of poker variants [3], [4]. PokerKit, in contrast, supports all major poker variants
In the open-source space, there exist numerous poker li- played on these platforms and much more, at any deck type,
braries. Some specialize in providing a simulated poker en- betting structure, limit, and optional high/low-split. This wide
vironment, but their focus tends to be on heads-up (2-player) selection that surpasses the state-of-the-art online poker plat-
no-limit Texas Hold’em [3], [4]. However, the vast majority of forms further illustrates the comprehensive nature of PokerKit.
these libraries concentrate purely on hand evaluation and lack On the open-source front, libraries such as poker-holdem-
the extensive game logic needed for poker game simulations engine and PyPokerEngine have made strides but have consid-
[5], [6]. erable limitations. They are limited in the number of variants
To address this gap in the open-source space of computer they support and offer less intuitive interfaces. Some rely on
poker, we developed PokerKit, a comprehensive Python li- networking, while others necessitate the usage of callbacks
brary. It accommodates a multitude of poker variants, includ- that return an action based on the game state [3], [4]. This
ing but not limited to Texas hold ’em, Omaha hold ’em, seven methodology makes it impossible to carry out fine-grained
2

TABLE I without compromising the robustness of the implementation,


S UPPORTED GAME VARIANTS AMONG ONLINE POKER CASINOS [7]–[9]. backed by extensive unit tests and doctests to ensure error-
N OTE THAT “HL8” DENOTES “ HIGH / LOW- SPLIT EIGHT OR BETTER ” AND
“HLR” DENOTES “ HIGH / LOW- SPLIT REGULAR ”. T HE LISTING HERE free operations. Naturally, common variants come pre-defined
CONTAINS ALL THE VARIANTS DEFINED IN THE 2023 W ORLD S ERIES OF in the PokerKit package, so, for most use cases, users will not
P OKER T OURNAMENT RULES [10]. have to define their own variants. An example of user-defined
Variants PokerKit PokerStars GGPoker 888Poker variant is shown in Figure 1.
Texas hold ’em yes yes yes yes PokerKit stands out with its ability to cater to an assortment
Short-deck hold ’em yes yes yes no of use cases, offering varying degrees of control over the game
Omaha yes yes yes yes state. For instance, in use cases for poker AI agent develop-
Omaha HL8 yes yes no yes
5-Card Omaha HL8 yes yes no no
ment, where the agents’ focus lies primarily in action selection
7-card stud yes yes no no during betting rounds, minute details such as showdown order,
7-card stud HL8 yes yes no no posting blinds, posting antes, and bet collection may not be
7-card stud HLR yes no no no pertinent. On the other hand, an online poker casino requires
Razz yes yes no no
A-to-5 triple draw yes no no no granular control over each game aspect. These include dealing
2-to-7 triple draw yes yes no no hole cards one by one, burning cards, deciding to muck or
Badugi yes yes no no show during the showdown (even when unnecessary), killing
Badacey yes no no no
hands after the showdown, pushing chips to the winner’s stack,
Badeucey yes no no no
2-to-7 single draw yes yes no no and even the winner collecting the chips into their stack.
5-card draw yes yes no no PokerKit rises to this challenge, providing users with varying
levels of automation tailored to their specific needs.
TABLE II 1) The First Televised Million-dollar All-in Pot: To demon-
S UPPORTED HAND TYPES AMONG OPEN - SOURCE LIBRARIES [5], [6]. strate PokerKit, The first televised million-dollar all-in pot in
Hands PokerKit Deuces Treys
poker history, played between professional poker players Tom
Standard (Texas hold ’em, etc.) yes yes yes Dwan and Phil Ivey, is recreated in Figure 2 [12]. Note that,
Eight-or-better yes no no for the sake of conciseness in the following examples, opera-
Short-deck hold ’em yes no no tions like ante/blind posting, bet collection, showdown, hand
Regular (Razz, etc.) yes no no killing, chip pushing, and chip pulling were configured to be
Badugi yes no no
Kuhn poker yes no no automated. However, users have the option to manually invoke
these operations by disabling the corresponding automation.

control over game states, such as bet collection after each


B. Hand Evaluation
street, mandatory card turn-over to prevent chip dumping dur-
ing all-ins, showdown order, choice of mucking the best hand Beyond its use of providing a simulated poker environment,
(and vice versa), and killing losing hands post-showdown. PokerKit serves as a valuable resource for evaluating poker
Comparatively, the Python chess engine, python-chess, of- hands. The hand evaluation component in PokerKit offers a
fers an exemplary model. It allows users to interact program- high-level Pythonic programmatic interface for hand evalu-
matically with games through function calls [11]. PokerKit ation, as demonstrated in Figure 3. It supports the largest
emulates this style by providing an intuitive programmatic API selection of hand types in any mainstream open-source poker
to verify, query, and apply various operations. library, and can easily be extended to support custom hand
types. This makes it an invaluable tool for users interested in
B. Hand Evaluation studying the statistical properties of poker, regardless of their
interest in game simulations.
While it is not the primary focus of the library, PokerKit
also provides facilities for evaluating poker hands. These tools
support a greater number of hand types than those offered IV. D ESIGN AND I MPLEMENTATION
by alternative open-source libraries such as Deuces and Treys A. Game Simulation
[5], [6], as shown in Table II. Just like variants for game PokerKit’s poker simulations are architected around the
simulation, the end user may extend the existing framework concept of states, encapsulating all the vital information about
to add their own hand type for their custom variants. the current game through its member variables.
- Cards in deck.
III. F EATURES AND C APABILITIES
- Community cards.
A. Game Simulation - Mucked cards.
Each poker variant often introduces unique game rules and - Burned cards.
hand types not seen in other variants [10]. The versatility - Bets
of PokerKit allows for the customization of poker variants, - Stacks
allowing users to define their own unique games, adapt an - Hole cards
existing variant, or implement a variant not currently supported - Pots (main + side)
by PokerKit out of the box. This flexibility is achieved - And more...
3

from pokerkit import (


Automation as A,
from pokerkit import ( NoLimitTexasHoldem,
Automation as A, )
BettingStructure,
Deck, state = NoLimitTexasHoldem.create_state(
KuhnPokerHand, # Automations
Opening, (
State, A.ANTE_POSTING,
Street, A.BET_COLLECTION,
) A.BLIND_OR_STRADDLE_POSTING,
A.CARD_BURNING,
state = State( A.HOLE_CARDS_SHOWING_OR_MUCKING,
# Automations, A.HAND_KILLING,
( A.CHIPS_PUSHING,
A.ANTE_POSTING, A.CHIPS_PULLING,
A.BET_COLLECTION, ),
A.BLIND_OR_STRADDLE_POSTING, True, # Uniform antes?
A.CARD_BURNING, 500, # Antes
A.HOLE_DEALING, (1000, 2000), # Blinds or straddles
A.BOARD_DEALING, 2000, # Min-bet
A.HOLE_CARDS_SHOWING_OR_MUCKING, # Starting stacks
A.HAND_KILLING, (1125600, 2000000, 553500),
A.CHIPS_PUSHING, 3, # Number of players
A.CHIPS_PULLING, )
), # Pre-flop
Deck.KUHN_POKER, # Deck state.deal_hole("Ac2d") # Ivey
(KuhnPokerHand,), # Hand types # Antonius (hole cards unknown)
# Streets state.deal_hole("5h7s")
( state.deal_hole("7h6h") # Dwan
Street( # Dwan
False, # Card burning state.complete_bet_or_raise_to(7000)
(False,), # Hole dealings # Ivey
0, # Board dealings state.complete_bet_or_raise_to(23000)
False, # Draw cards? state.fold() # Antonius
Opening.POSITION, # Opener state.check_or_call() # Dwan
1, # Min bet # Flop
# Max number of completions, state.deal_board("Jc3d5c")
# bets, or raises # Ivey
None, state.complete_bet_or_raise_to(35000)
), state.check_or_call() # Dwan
), # Turn
# Betting structure state.deal_board("4h")
BettingStructure.FIXED_LIMIT, # Ivey
True, # Uniform antes? state.complete_bet_or_raise_to(90000)
(1,) * 2, # Antes # Dwan
(0,) * 2, # Blinds or straddles state.complete_bet_or_raise_to(232600)
0, # Bring-in # Ivey
(2,) * 2, # Starting stacks state.complete_bet_or_raise_to(1067100)
2, # Number of players state.check_or_call() # Dwan
) # River
state.deal_board("Jh")
Fig. 1. An initialization of a Kuhn poker game as a user-defined variant. # Final stacks: 572100, 1997500, 1109500
Note that split-pot games can be created by specifying multiple hand types: print(state.stacks)
one high and one low.

Fig. 2. An example game simulation. Note that the game was created as a
pre-defined variant.
4

from pokerkit import (


Card,
OmahaHoldemHand,
)

h0 = OmahaHoldemHand.from_game(
"6c7c8c9c", # Hole cards
"8s9sTc", # Board cards
)
h1 = OmahaHoldemHand("6c7c8s9sTc")

print(h0 == h1) # True

Fig. 3. An example hand evaluation.

PokerKit structures the game flow into distinct phases,


each supporting a different set of operations. Depending on
the game state, each phase may be skipped. For instance,
if the user has specified no antes, the ante posting phase
will be omitted. Likewise, if no bets were placed during
the betting phase, the bet collection phase will be bypassed.
A phase transition occurs upon the completion of a phase.
This transition is internally managed by the game framework,
facilitating a seamless game flow to the end user.
During each phase of PokerKit’s game simulation, the
user can invoke various methods to execute operations. Each
operation belongs to a specific phase and can only be enacted
when the corresponding phase is active.
1) Ante Posting: During the ante posting phase, each player
has the option to execute an ante-posting operation. The
parameters supplied to the state during its creation may dictate
no antes, uniform antes, or non-uniform antes, such as big
blind antes. If no player is due to post an ante, this phase is
bypassed. Fig. 4. The flowchart of phases in PokerKit.

2) Bet Collection: The collection of bets on the table


occurs after any phase that allows players to bet. If any bet
is present, the bet collection operation must be performed phase is bypassed if all players are all-in or if only one player
before proceeding to the subsequent phase. This phase only remains in the hand.
occurs after ante posting or betting. When no bets are pending 6) Showdown: During the showdown, players reveal or
collection, this phase is skipped. muck their hands in accordance with the showdown order.
3) Blind or Straddle Posting: Forced bets like blinds or The first to show is typically the last aggressor in the final
straddles must be posted before the start of the first street. street. If no one bet, the player who was the first to act in
PokerKit accommodates a variety of blind or straddle config- the final betting round must show first. Players can opt to
urations, ranging from small and big blinds, to button blinds, show a losing hand or muck a winning hand, even though
or even no blind at all. If the state is configured to exclude this is often disadvantageous. When dealing with all-in pots,
any forced bets, this phase is skipped. players are obligated to show their hands in order to prevent
4) Dealing: The dealing phase precedes a betting phase. chip-dumping [10]. If this is the case, or if only one player
During this phase, the user can deal board or hole cards, remains in the pot, the showdown phase is bypassed.
contingent upon the state’s configuration. Options to burn 7) Hand Killing: The dealer is responsible for “killing,” or
a card or discard and draw cards are also available when discarding, hands that cannot win any portion of the pot. If no
applicable. This phase is bypassed if only one player remains hand should be killed, this phase is bypassed.
in the hand. 8) Chips Pushing: The dealer is charged with pushing the
5) Betting: During betting, players can execute actions such chips to the winners. In poker games, the pot size is always
as folding, checking, calling, posting a bring-in, completing, non-zero due to the mandatory presence of antes, forced bets,
betting, or raising. During state creation, the user must specify or bring-ins (as enforced by PokerKit). Thus, this phase is
how to select the first player to act and the betting limits. This always carried out.
5

TABLE III
S TATE PHASES AND THEIR CORRESPONDING OPERATIONS . def verify_operation(self, ...):
...
Phases Operations if is_inoperable:
Ante posting Ante posting raise ValueError("...")
Bet collection Bet collection
Blind or straddle posting Blind or straddle posting ...
Card burning
Hole dealing def can_operate(self, ...):
Dealing
Board Dealing
Standing pat or discarding try:
Folding self.verify_operation(...)
Checking or calling except ValueError:
Betting
Bring-in posting
Completion, betting, or raising to return False
Showdown Hole cards showing or mucking return True
Hand killing Hand killing
Chips pushing Chips pushing
def operate(self, ...):
Chips pulling Chips pulling
self.verify_operation(...)
...
TABLE IV
S TATE OPERATIONS AND THEIR AUTOMATABILITIES .
Fig. 5. The method triplets of an example operation.
Phases Automatable
Ante posting Yes
Bet collection Yes
- Deck: Most variants use a 52-card deck.
Blind or straddle posting Yes
Card burning Yes - Hand types: Most variants have one, but high/low-split
Hole dealing Yes games have two.
Board Dealing Yes - Streets: Each specifies whether to burn a card, deal
Standing pat or discarding No
Folding No
the board, deal the players, draw cards, the opener, the
Checking or calling No minimum bet, and the maximum number of bets or raises.
Bring-in posting No - Betting structure: Betting limits such as no-limit, pot-
Completion, betting, or raising to No limit, or fixed-limit.
Hole cards showing or mucking Yes
Hand killing Yes This flexibility in the definition gives PokerKit the ability
Chips pushing Yes to describe not only every variant specified in the 2023 World
Chips pulling Yes
Series of Poker Tournament Rules [10] but also esoteric
variants, ranging from Greek hold ’em, Kuhn poker, 6-card
9) Chips Pulling: Players may incorporate the chips they’ve Omaha, Rhode Island hold ’em, and countless more.
won back into their stack. In poker, at least one player is In addition to the parameters related to the variants, users
guaranteed to win the pot. Consequently, this phase is never can supply additional values, namely automations, antes (uni-
skipped. form antes or non-uniform antes such as big blind antes),
Each operation is coupled with two associated methods: blinds/straddles, bring-ins, and starting stacks.
a verification method and an action query. The verification
method validates if a move can be executed within the rules,
B. Hand Evaluation
considering the current game state and the variant in play.
It raises an error if any discrepancy is detected. Users can Hand evaluation is another vital aspect of PokerKit. The
directly invoke this or use a corresponding action query library generates a lookup table for each hand type. The hands
method (with optional arguments), which simply checks if the are generated in the order or reverse order of strength and
verification method triggers an error and returns a boolean assigned indices, which are used to compare hands. High-level
value indicating the validity of the action. The method that interfaces allow users to construct hands by passing in the
performs the operation initially runs the verification method, necessary cards and using standard comparison operators to
executing the operation only if no errors are raised. If the compare the hand strengths. It’s worth noting that “strength”
verification fails, the state remains unchanged. in poker hands does not necessarily mean “low” or “high”
PokerKit’s philosophy is that it should focus on maintaining hands [13]. Each hand type in PokerKit handles this distinction
the game state and enforcing rules. Error handling is left to internally, making it transparent to the end user.
the user, who may need to handle errors differently depending In the lookup process, cards are converted into unique
on the application. Assertions are used sparingly throughout integers that represent their ranks. Each rank corresponds to a
the library for sanity checks. On runtime, users may choose unique prime number and the converted integers are multiplied
to disable them for optimization purposes without impacting together. The suitedness of the cards is then checked. Using
the library’s functionalities. the product and the suitedness, the library looks for the
The game variant is defined through several attributes, matching hand entries which are then used to compare hands.
which are as follows: This perfect hashing approach was originally employed in the
6

TABLE V TABLE VII


H AND TYPES AND THEIR LOOKUP TABLES IN P OKER K IT [6]. T HE HAND EVALUATION SPEEDS OF P OKER K IT AND T REYS [6].

Hand types Lookups Table size PokerKit Treys


Standard high Speed (# hands/s) 1016740.7 3230966.4
Standard low
Standard 7462
Greek hold ’em
Omaha hold ’em
Eight-or-better low
A. Static Type Checking
Eight-or-better 112
Omaha eight-or-better low While Python is a dynamically typed language, it also
Short-deck hold ’em Short-deck hold ’em 1404
provides an option to write type annotations in the code
Regular low Regular 7462
Badugi Badugi 1092 [15]. Mypy, a static type checker for Python, is utilized to
Kuhn poker Kuhn poker 3 scrutinize the PokerKit project [16]. All the code in PokerKit
successfully passes the Mypy static type checking with the
TABLE VI “--strict” flag.
T HE GAME SIMULATION SPEED OF P OKER K IT.

PokerKit B. Doctests
Speed (# games/s) 847.31 Docstrings serve a dual purpose of providing not only
documentation and sample usage but also tests [17]. Most
Deuces hand evaluation library and is also used by Treys [5], classes and methods within the library are accompanied by
[6]. example usages in doctests that illustrate their functionality.
Furthermore, these doctests offer insight into potential sce-
V. P ERFORMANCE B ENCHMARKS narios where errors are raised, helping users understand the
The benchmarks in this section were conducted using a library’s expected behavior under various circumstances.
computer equipped with a 12th Gen Intel® Core™ i7-1255U
processor and 16 GB of RAM, utilizing Python version 3.11.5. C. Unit Tests
Note that the specific values reported here reflect the perfor- Unit tests are employed to test broader functionalities that
mance under this particular hardware and software setup and do not fall into normal usage patterns. For example, some
may vary on different systems. of the unit tests evaluate all possible hand for each lookup
and validates the hands by comparing them against the results
A. Game Simulation from other poker hand evaluation libraries. For efficiency, this
The general performance of the game simulation component is achieved by obtaining an MD5 checksum of the large text
of PokerKit has been evaluated by digitalizing all 83 televised string of ordered hands generated by the lookup tables in
hands from the final table of the 2023 World Series of PokerKit and other open-source libraries.
Poker (WSOP) $50,000 Poker Players Championship, shown One of the methods of validating PokerKit has been the
in Table VI. The selection of this particular tournament was recreation of various famous poker hands and games. This
motivated by its varying number of players (as the finalists includes all 83 televised hands from the final table of the
were eliminated), and its rotation through nine different diverse 2023 World Series of Poker (WSOP) $50,000 Poker Players
variants of poker [14]. Championship which features poker games of nine different
variants [14]. The library was tested for consistency, ensuring
B. Hand Evaluation that pot values after each street and resulting stacks after the
The hand evaluation facilities in PokerKit sacrifice slight hand is over accurately match the real outcomes.
speed to provide an intuitive high-level interface. As a result, Additional unit tests were implemented to rigorously scru-
PokerKit’s hand evaluation suite is slower than open-source tinize PokerKit’s behavior under unusual circumstances like
Python hand evaluation libraries such as Treys as shown in scenarios involving extremely low starting stacks that often
Table VII [6]. Note that the Deuces library, another popular fall below the blinds or antes.
alternative, is not benchmarked as it lacks Python 3 support Together, the doctests and unit tests cover 99% of the
and Treys is a fork of Deuces that supports Python 3 [5], [6]. PokerKit codebase, ensuring a comprehensive examination.
For the benchmarking process, we iterated through all In conclusion, through the diligent application of static type
possible Texas hold ’em hands in both PokerKit and Treys. checking, doctests, unit tests, and recreations of real-life hands,
The speeds are reported as the number of hands evaluated per PokerKit has undergone thorough testing and validation. This
second. rigorous approach guarantees that the library can dependably
handle a wide array of poker game scenarios, solidifying
VI. T ESTING AND VALIDATION its position as an invaluable resource for researchers and
Ensuring robustness and error-free operation has been a developers in the field.
top priority throughout PokerKit’s development. To validate
its functionality, a variety of rigorous testing methods were VII. U SE C ASES AND A PPLICATIONS
employed, spanning from extensive doctests to unit tests, and Thanks to its flexible architecture and fine-grained control,
recreating renowned poker hands and games. PokerKit is adaptable to a wide array of tasks. It proves
7

to be an effective tool in various applications, ranging from VIII. C ONCLUSION


AI development and poker tool creation to serving as the This paper presents PokerKit, a versatile and efficient
backbone of online poker platforms. This section explores Python library for poker game simulation and hand evaluation.
key use cases where PokerKit has demonstrated its invaluable By providing support for various major poker variants, Pok-
contributions. erKit ensures a comprehensive and accurate implementation
of poker game logic and hand evaluation mechanisms.
A key strength of PokerKit is its intuitive design, which
A. AI Development allows for both manual and automatic control over game states,
The continuous action space and the imperfect information facilitating its application in diverse contexts. The library’s
nature inherent to poker present a compelling challenge for AI. built-in unit tests and doctests ensure the robustness of its
Most of the breakthroughs in Poker AI agents were limited implementation, while its use in real-world projects provides
to Texas hold ’em variants [1], [2]. PokerKit’s capacity to a testimony of its reliability.
support a comprehensive set of poker variants, coupled with its Despite PokerKit’s extensive functionality, there are still
robust and error-free nature, makes it an ideal framework for exciting prospects for future work in the world of computer
developing, testing, and benchmarking poker AI models that poker. Notably, the absence of a standardized interface for
can generalize beyond Texas hold’em. Its design, which allows Poker AI, similar to the Universal Chess Interface, presents an
for the automation of irrelevant operations, facilitates the opportunity for development. While the PIOSolver team has
simulation of numerous game scenarios needed for effective created a Universal Poker Interface, it does not adequately
AI training and evaluation. Furthermore, its benchmarked represent the broad scope of poker or poker AI due to its
speed is adequate for various AI applications. specialized commands and parameters for its Nash equilibrium
One popular domain of computer poker is the development solving algorithm and its two-player limitation [18]. A stan-
of poker solvers. Generally, solvers like PIOSolver begin with dardized interface catering to a variety of AI methodologies
a game tree construction, which is then followed by the could substantially enhance the efficiency and interoperability
more computationally intensive Nash equilibrium calculation of poker AI development.
[18]. PokerKit can be leveraged during this initial game tree In conclusion, PokerKit presents a valuable contribution
construction while the Nash equilibrium calculation can be to the field of computer poker, offering a comprehensive
carried out in more performant languages such as C or C++. and efficient toolkit for poker game simulation and hand
It’s worth noting that during the game tree construction, the evaluation. Future work, including the creation of a universal
sequence of possible actions is independent of the cards dealt. poker AI interface, holds the promise of further enriching the
This intrinsic characteristic provides ample opportunities for field.
developers to implement optimizations and reduce the runtime
by orders of magnitude. IX. ACKNOWLEDGEMENT
We acknowledge the use of ChatGPT, based on GPT-4, an
AI language model, in order to enhance the readability of the
B. Poker Tool Development paper [19].
PokerKit lays a solid foundation for the development of
various poker tools, including hand equity calculators and R EFERENCES
poker training software. With its extensive support for most [1] M. Moravčı́k, M. Schmid, N. Burch, V. Lisý, D. Morrill, N. Bard,
major poker variants, developers are empowered to create T. Davis, K. Waugh, M. Johanson, and M. Bowling, “Deepstack:
Expert-level artificial intelligence in heads-up no-limit poker,” Science,
tools that cater to a broad spectrum of poker games. Further, vol. 356, no. 6337, pp. 508–513, 2017. [Online]. Available:
PokerKit’s efficient hand evaluation capability and its intuitive https://www.science.org/doi/abs/10.1126/science.aam6960
programmatic API enable the development of user-friendly, [2] N. Brown and T. Sandholm, “Superhuman ai for multiplayer poker,”
Science, vol. 365, no. 6456, pp. 885–890, 2019. [Online]. Available:
performance-optimized tools. https://www.science.org/doi/abs/10.1126/science.aay2400
[3] B. Scopelliti, “brunoscopelliti/poker-holdem-engine: Texas hold’em
poker engine,” 2023, accessed: 2023-08-04. [Online]. Available:
https://github.com/brunoscopelliti/poker-holdem-engine
C. Online Poker Platform Development [4] ishikota, “Ishikota/pypokerengine: Poker engine for poker ai
development in python,” 2023, accessed: 2023-08-04. [Online].
The application of PokerKit extends beyond research and Available: https://github.com/ishikota/PyPokerEngine
tool development; it’s equally effective in creating online poker [5] W. Drevo, “Worldveil/deuces: A pure python poker hand evaluation
library,” 2023, accessed: 2023-08-04. [Online]. Available: https:
platforms. Its capacity to simulate the intricate changes of the //github.com/worldveil/deuces
poker table makes it ideal for the smooth gameplay experience [6] W. Drevo, I. Hendley, and M. Saindon, “Ihendley/treys: A pure python
demanded in online poker rooms. poker hand evaluation library,” 2023, accessed: 2023-08-04. [Online].
Available: https://github.com/ihendley/treys
In summary, whether it’s developing sophisticated AI mod- [7] PokerStars, “Poker games,” 2023, accessed: 2023-08-04. [Online].
els, creating intuitive poker tools, or providing a reliable basis Available: https://www.pokerstars.com/poker/games/
for online poker platforms, PokerKit’s versatile capabilities [8] C. Zetzsche, “Ggpoker in 2022: Where is the new
industry giant heading?” PokerFuse, feb 2022, accessed: 2023-
make it well-suited to a wide array of applications in the poker 08-04. [Online]. Available: https://pokerfuse.com/features/in-depth/
landscape. 217163-ggpoker-2022-predictions-online-poker-giant/
8

[9] 888poker, “Poker games,” 2023, accessed: 2023-08-04. [Online].


Available: https://www.888poker.com/poker-games/
[10] World Series of Poker, “2023 world series of poker®
official tournament rules,” Paris Las Vegas Hotel and
Casino and Horseshoe Las Vegas Hotel and Casino, Las
Vegas, Nevada, 2023, accessed: 2023-08-04. [Online]. Available:
https://www.wsop.com/2022/2023-WSOP-Tournament-Rules.pdf
[11] N. Fiekas, “python-chess: a chess library for python,” 2023, accessed:
2023-08-04. [Online]. Available: https://python-chess.readthedocs.io/en/
stable/
[12] P. Seaton, “Poker moments: Phil ivey, tom dwan and the
million-dollar pot,” PokerNews, nov 2018, accessed: 2023-08-
04. [Online]. Available: https://www.pokernews.com/news/2018/11/
poker-moments-phil-ivey-tom-dwan-million-dollar-pot-32706.htm
[13] World Series of Poker, “2023 world series of poker® official live
action rules,” Paris Las Vegas Hotel, Las Vegas, Nevada, 2023,
accessed: 2023-08-04. [Online]. Available: https://www.wsop.com/
2023/2023-WSOP-Live-Action-Rules.pdf
[14] C. Zetzsche, “Brian rast wins $50,000 poker players championship for
the third time ($1,324,747),” PokerNews, jun 2023, accessed: 2023-
08-04. [Online]. Available: https://www.pokernews.com/news/2023/06/
brian-rast-wins-ppc-for-third-time-43877.htm
[15] G. van Rossum, J. Lehtosalo, and L. Langa, “Pep 484 –
type hints,” sep 2014, accessed: 2023-08-04. [Online]. Available:
https://peps.python.org/pep-0484/
[16] J. Lehtosalo and mypy contributors, “Welcome to mypy
documentation!” 2023, accessed: 2023-08-04. [Online]. Available:
https://mypy.readthedocs.io/en/stable/
[17] Python Software Foundation, “doctest — test interactive python
examples,” 2023, accessed: 2023-08-04. [Online]. Available: https:
//docs.python.org/3/library/doctest.html
[18] PioSolver, “Piosolver 2.0 upi documentation,” 2021, accessed: 2023-08-
04. [Online]. Available: https://piofiles.com/docs/upi documentation/
[19] OpenAI, “Gpt-4 technical report,” 2023.

You might also like