Solving Pasur Using GPU-Accelerated Counterfactual Regret Minimization

Sina Baghal · 2025

Read Solving Pasur Using GPU-Accelerated Counterfactual Regret Minimization by Sina Baghal (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-06559.txt.

Introduction

Sina Baghal solves a fishing card game with fast chips in a 2025 paper, as a solo author. The game, Pasur, runs six rounds and kin to Cassino and Scopa. Its rules are tangled and its tree of plays is vast, which makes a full solve a stiff test.

His frame runs the game on graphics chips with tight care for memory. A famed regret-shrinking loop then finds near-best play that no side can gain by straying. The tree is split into true states and scores kept from past rounds to fit the chips. Game solvers gain a worked case of chip speed bent to a folk game.

Catalog record

CREATORSina Baghal
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE213 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2508-06559

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Solving Pasur Using GPU-Accelerated Counterfactual Regret Minimization Sina Baghal Abstract Pasur is a fishing card game played over six rounds and is played similarly to games such as Cassino and Scopa, and Bastra 1 1 1 Wikipedia: Pasur (card game) . This paper introduces a CUDA-accelerated computational framework for simulating Pasur, emphasizing efficient memory management. We use our framework to compute near-Nash equilibria via Counterfactual Regret Minimization (CFR), a well-known algorithm for solving large imperfect-information games. Solving Pasur presents unique challenges due to its intricate rules and the large size of its game tree. We handle rule complexity using PyTorch CUDA tensors and to address the memory-intensive nature of the game, we decompose the game tree into two key components: (1) actual game states, and (2) inherited scores from previous rounds. We construct the Full Game Tree by pairing card states with accumulated scores in the Unfolding Process . This design reduces memory overhead by storing only essential strategy values and node connections. To further manage computational complexity, we apply a round-by-round backward training strategy, starting from the final round and recursively propagating average utilities to earlier stages. Our approach constructs the complete game tree, which on average consists of over 10 9 10^{9} nodes. We provide detailed implementation snippets to illustrate the structure and training logic of our framework and the CFR algorithm. After computing a near-Nash equilibrium strategy, we train a tree-based model to predict these strategies for use during gameplay. We then estimate the fair value of each deck through large-scale self-play between equilibrium strategies by simulating, for instance, 10,000 games per matchup, executed in parallel using GPU acceleration. Our analysis reveals that the distribution of high-value cards heavily influences match outcomes, accounting for much of the variation in deck fairness. Finally, each trained model is lightweight, making it feasible to be used as a real-time AI agent for Pasur. Similar frameworks can be extended to other reinforcement learning algorithms in settings where the action tree naturally decomposes into multiple rounds such as turn-based strategy games or sequential trading decisions in financial markets. 1 Introduction and Background Imperfect-information games pose significant challenges due to hidden information and strategic uncertainty. Counterfactual Regret Minimization (CFR) has emerged as a powerful algorithmic framework for approximating Nash equilibria in such settings, notably achieving success in poker variants and other complex card games [ 7 , 3 , 1 , 2 , 6 ] . By iteratively minimizing regret over possible strategies, CFR converges towards equilibrium policies without exhaustive search, making it an attractive method for large-scale sequential games. In this work, we focus on Pasur , a traditional fishing card game popular in Middle Eastern cultures, with a six-round structure and unique scoring rules. Each round, players receive new cards while aiming to capture valuable cards from the table through matching and summation mechanics. Unlike many extensively studied games, Pasur has not been rigorously solved, in part due to its combinatorial complexity and memory-intensive game tree. In this paper, we present a CUDA-accelerated implementation of CFR in PyTorch tailored to Pasur, addressing its computational challenges by decomposing the game tree into game states and accumulated scores. Our approach computes the complete game tree, enabling near-Nash equilibrium calculations rather than relying on sampling methods. To further optimize GPU memory usage, we train the CFR models round-by-round in reverse order, propagating average utilities to ensure tractability. At any given time, only the tensors for the current round are kept on the GPU; all others are stored in CPU memory. Our carefully designed data structures made it possible to train and develop the entire CFR algorithm on a game tree with an average size of 10^{9} , all within the constraints of a system with 32 GB of RAM and 10 GB of VRAM. After computing a near-Nash equilibrium strategy, we train a tree-based model to calculate the strategies for use during gameplay. These tree-model also facilites the estimation of deck fair values through self-play. This framework not only advances the strategic understanding of Pasur and fishing card games more broadly, but also enables the development of practical AI agents capable of playing at near-optimal levels. Moreover, this document details the construction and update procedures of every step in the framework through CodeSnippets, including the implementation of the CFR algorithm. Several clarifications about the CodeSnippets are in order. The CodeSnippets aim to convey as much detail as possible; however, certain operations are omitted for clarity. These include routine tasks such as data type conversions and the use of .clone() to avoid in-place modifications, if necessary. Additionally, we omit the torch. prefix in all code expressions. For example, torch.any(t_act[:,1,:], dim=1) is written as any(t_act[:,1,:], dim=1) . It is also worth noting that not all lines of code are shown in the CodeSnippets. For complete implementations, we refer the reader to the GitHub repository 2 2 2 Paper Homepage . Finally, we use symbolic notation to simplify certain expressions. For instance, instead of t_1.repeat_interleave(t_2) , we write t_1 \otimes t_2 . Similarly, t_1 \otimes_{1} t_2 denotes the dimension-specific form \texttt{t\_1.repeat\_interleave(t\_2, dim=1)}. 1.1 Extensive Games and CFR In Imperfect-Information Extensive-Form Games there is a finite set of players ( \mathcal{P} ). A node h at time T is defined by all the information revealed at a , particularly the actions taken by players \mathcal{P} . Terminal nodes , denoted by \mathcal{Z} , are defined as those nodes where no further action is available. For each player p\in\mathcal{P} , there is a payoff function u_{p}:\mathcal{Z}\to\mathbb{R} . In this paper, we focus on the zero-sum two-player setting i.e., \mathcal{P}=\{0,1\} and u_{0}=-u_{1} . Imperfect information is represented by information sets (infosets) for each player p\in\mathcal{P} . It is emphasized that at player p ’s turn at infoset I , all nodes h,h^{\prime}\in I are identical from p ’s perspective. In this situation, we say infoset I belongs to p and we denote the set of all such infosets by \mathcal{I}_{p} . Actions available at infoset I are also denoted by A(I) . A strategy \sigma_{p}(I):A(I)\to\mathbb{R}^{\geq 0} is a distribution over actions in A(I) . The strategy of other players is denoted by \sigma_{-p} . We denote by u_{p}(\sigma_{p},\sigma_{-p}) the expected payoff for p if players’ actions are governed by strategy profile \sigma:=\{\sigma_{p}\}_{p\in\mathcal{P}} . Reach probability \pi^{\sigma}(h) is defined as the probability of arriving at node h , if all players play according to \sigma . For I\in\mathcal{I}_{p} and h\in A(I) , we denote by \pi^{\sigma}_{-p}(h) the probability of arriving at h in the event where p chooses to reach h and other players follow \sigma . Define \pi^{\sigma}_{p}(I):=\sum_{h\in I}\pi^{\sigma}_{p}(h) and \pi^{\sigma}_{-p}(I):=\sum_{h\in I}\pi^{\sigma}_{-p}(h) . Counterfactual utility at infoset I\in\mathcal{I}_{p} is defined as u^{\sigma}(I):=\sum_{h\in I,h^{\prime}\in\mathcal{Z}}\pi^{\sigma}_{-p}(h)\pi^{\sigma}(h,h^{\prime})u_{p}(h^{\prime}) (1) Similarly, counterfactual utility for a\in A(I) , u^{\sigma}(I,a) is defined as in ( 1 ), except that p chooses a with probability 1 once it reaches I . Formally, if h.a denotes the node wherein action a is chosen at node h , then u^{\sigma}_{p}(I,a):=\sum_{h\in I,h^{\prime}\in\mathcal{Z}}\pi^{\sigma}_{-p}(h)\pi^{\sigma}(h.a,h^{\prime})u_{p}(h^{\prime}) (2) Finally, in a two-player extensive game a Nash equilibrium [ 4 ] is a strategy profile \bm{\sigma}^{*} for which the following holds u_{p}(\sigma^{*}_{p},\sigma^{*}_{-p})=\max_{\sigma^{\prime}_{p}}u_{p}(\sigma^{\prime}_{p},\sigma^{*}_{-p}). In other words, \sigma_{p} is the best response to \sigma_{-p} for each p\in\mathcal{P} . An \epsilon

Read the complete text