🚀 A open sourced, extremely efficient Texas Hold'em and short deck solver

Overview

CPP Texas Solver

release license Open In Colab Gitter chat

README English | 中文

Introduction

A open sourced, extremely efficient Texas Hold'em and short deck solver. See this Introduction video for more. Supports Windows,MacOs and Linux.

Features:

  • In a tree with 1~2bets + allin, it's speed exceeds piosolver on flop
  • Support Mac, Linux and Windows
  • Support texas holdem and shortdeck
  • Support cross language calls
  • Result aliged with piosolver
  • Support dump strategy to json file
  • It's the c++ version of TexasHoldemSolverJava with a ton of optimization, it's 5x faster than the java version and takes less than 1/3 memory.

Feel free to mess with a toy solver in google colab

Install

Download package according to your OS in release package, unzip it, and install is done. It's that simple.

GUI version Usage

After install the solver, double click the application binary (TexasSolverGui.exe in windows or TexasSolverGui.app in MacOS) to run TexasSolver.

Console version Usage

Please check console version document for more.

Speed benchmark with piosolver

Piosolver and my TexasSolver(console version) run use the same settings (spr=10,flop game) and their result are aligned.

Input config log thread number memory usage accuracy converge time
piosolver 1.0 config_piosolver log_piosolver 6 492Mb 0.29% 242s
TexasSolver 0.1.0 (Our solver) config_texassolver log_texassolver 6 1600Mb 0.275% 172s

The compare image of their results is here. As you can see their result are very close.

License

GNU AGPL v3

Email

[email protected]

Q & As

  1. Q: Is the solver really free?

    • A: Yes, for personal users, the solver is completely opensourced and free.
  2. Q: Can I upload it to other websites or forums? Can I share it with my friend?

    • A: No, you can only put the link of this project to other website, not the binary, this project is under AGPL-V3 license, and these kind of action violates this license.
  3. Q: Can I intergate it to my software?

    • A: If you intergate the release package(binary) into your software, Yes, you can do that. If you want to intergate the code of the solver into your software or provide service through internet, then you need to contact me for a commercial license, which is also the main profit-making method of this project.
  4. Q: What framework do you use to write the ui?

    • A: I use QT 5.1.0 (opensourced edition) to build the GUI version. For the console version, I use Mingw + CMake.
Comments
  • 关于console_solver的使用问题:运行速度以及输出格式

    关于console_solver的使用问题:运行速度以及输出格式

    您好,我近期才看到您的软件,它真的非常棒,我正在试用中,目前使用一切正常,但我在使用console_solver的过程中发现以下问题: 一、console_solver的启动速度可以优化吗? 我原本以为console_solver的运行速度会更快,但使用中发现软件在提示[##################################################] 100%这个信息的过程每次都需要花费大约8秒的时间,我不知道是不是软件的启动时间,但在GUI中,只要打开软件后,每次我计算转牌或河牌只需要1-2秒的时间,如果我用console_solver计算转牌或河牌,加上前面的启动时间,每次就会需要10秒左右,这个不知道是不是软件启动时间,可以优化一下吗? 二、关于系统输出结果的格式 在目前输出的结果中,有很多的重复信息,打开后会显得零乱。我仍然在有点困难的阅读、理解和熟悉的过程中。这个软件输出结果作为软件最重要最核心的功能,其格式能否在下个版本中有优化。不过,我个人非常不建议您在其他帖子的答复的,您要开发自己独创的格式,这会产生兼容的问题,我自己在使用中也是通过console_solver中设置其输出为txt格式文本并使用的,虽然我同时也在用firefox读取结果,txt格式会最大化的解决您的软件与其他软件使用中的兼容问题。这个仅供参考。 最后,瑕不掩玉,正是因为您的软件非常好,所以提以上这些问题,希望它更好,更完善。非常希望在您方便的时候得到您的回复,期待它的下一个版本,谢谢!加油!!

    opened by jason768719 20
  • Strategy with range indication

    Strategy with range indication

    Hi, first, thanks for providing the code base! Very much appreciated!

    This is to improve the visualization of the results, by scaling the "Strategy" and "Strategy + EV" views with the actual range data of the current node. The range is also considered proportionally when aggregating the summary in the left table. So unlike before, actions (like fold) for hands that have been 100% folded before, do not show up any more. And finally, this introduces an color coding of the EV in the "Strategy + EV" views for Check/Call and Bet/Raises actions: The more negative the EV is, the more blue is added, thus indicating if something is a call is for value of for defending, or if a Bet/Raise is for Value, or a (Semi)-Bluff.

    image

    image

    Same as "strategy" view:

    image

    For cosmetics, I changed the color coding in the "EV" (only) view to transition of grey, instead of over brown. I also increased the window size of the StrategyExplorer slightly, so that on Windows the left table view is seen in total.

    image

    opened by maosatgithub 13
  • Half float option

    Half float option

    I started a new clean branch for easier review. The original DiscountedCfrTrainable class now remains completely untouched.

    I introduced a ComboBox to choose between the level of half float usage in the GUI. The command line version has no interface yet, it's hardcoded disabled (so normal float version is used).

    Not clear if even Turn+River option makes sense, it barely saves anything compared to River alone. So it could be simplified to a checkbox, which might cause less confusion to users.

    The option does not gets saved yet with the saving of parameters.

    I had a tough time getting the mainwindow.ui changed, the first few attempts caused crashes in the autogenerated ui_mainwindow.h. I finally got it running, but the layout is slightly changed.

    I reverted the comment on #include "unistd.h", but I guess that should be solved generically. I use MSVC2015, and this does complain about not finding it. I didn't have the problem with your master tree, it got introduced in gui lately.

    opened by maosatgithub 11
  • Half precision floats for DiscountedCFRTrainable

    Half precision floats for DiscountedCFRTrainable

    Work in Progress

    This is the attempt to use half precision floats for storage of trainable data. So far the results are promising:

    Cuts memory usage almost in half, e.g. in my benchmark from 8 GB to 4.3 GB according to Task-Manager. Execution time increases moderately by about 25% per iteration.

    Results seem useable, but I have so far made no systematic comparison if and to what extend they differ from using normal floats.

    Note: disabling of #include "unistd.h" is unrelated, but was necessary on my machine to compile the base code. There are likely more generic ways to handle that.

    opened by maosatgithub 9
  • compress table file

    compress table file

    The strength of 5 cards is determined by suit distribution and rank distribution. For the offsuit combination, we only need rank distribution. So we need two hash tables. One for suited combination, use cards mask as key. One for offsuit combination, use rank distribution mask as key. In this way, number of records reduced from 2598960 to 5148+6175=11323, from 376992 to 504+1278=1782, respectively.

    opened by yffbit 9
  • segfault in --mode shortdeck

    segfault in --mode shortdeck

    Try to run solver with --mode shortdeck, but it fails. Can you please help?

    [email protected]:~/TexasSolver-Linux# ./console_solver -i resources/text/commandline_sample_input.txt --mode shortdeck EXEC FROM FILE [##################################################] 100% <<<START SOLVING>>> Using 8 threads Iter: 0 Segmentation fault (core dumped) This is commandline file that I use:

    opened by noname72 9
  • Are there any plans to implement a gui for Linux?

    Are there any plans to implement a gui for Linux?

    I'm sure it's been asked before, just didn't see it. Obviously no rush, I understand you're doing this on your free time, just figured I'd ask if it's in the distant future or if no plans in general.

    opened by nat-72o 8
  • minimum allowed raise size is 60% of pot size raise

    minimum allowed raise size is 60% of pot size raise

    img As you can see in the screenshot, i have defined pot size = 5, bet size is 3. Raise sizes i defined 50, 75, 100, 150. When i click show results, i marked this part with red, you can see that raise sizes that it uses are 9, 11, 14, 20. Considering that pot size raise in this example is 3 * bet size + pot size = 14. So raise sizes 11, 14, and 20 are correct for 75, 100 and 150. But for 50% pot size raise it should be 50% of 14 = 7 and you have it 9. Why is this the case? to me it seems that it doesn't allow raise less than 60% pot size raise.

    opened by nbiresev 6
  • About 'set_thread_num'

    About 'set_thread_num'

    how many thread num to set?just only 8?I try 1,2,6,10 in resources/text/commandline_sample_input.txt.None work. Error : terminate called after throwing an instance of 'std::runtime_error' what(): command not valid: set_thread_num

    opened by MoonBunnyZZZ 6
  • Missing CMakeLists.txt on building console version

    Missing CMakeLists.txt on building console version

    I am trying to build using the instructions in https://github.com/bupticybee/TexasSolver/tree/console#compile-from-source but am getting the error;

    CMake Error: The source directory "C:/TexasSolver/Project" does not appear to contain CMakeLists.txt.

    This is with the supplied batch commands and with the CMake GUI - I'm new to all this so have been reading up and from what I can tell, CMakeLists.txt describes what files need building etc. and isn't something I can necessarily create / should get automatically created by CMake etc.

    There's no CMakeLists.txt file anywhere in the structure, so I don't think I'm starting from the wrong directory or something like that.

    Is the file missing, or can you please suggest what I might be doing wrong ? - the batch file I am using is below, essentially as per instructions with some pauses added. I am running VS2022 so altered the path to the batch file (and that part runs fine);

    I also added a 'call' to the batch file execution of vcvars64.bat but as I say, that bit works OK, it's the call the cmake directly after that that fails.

    Thanks in advance for any assistance :)

    ` c:

    cd /TexasSolver/Project

    mkdir vsbuild

    cd vsbuild

    SET PATH=%PATH%;C:\Program Files\CMake\bin

    pause

    call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"

    cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release

    pause

    nmake install

    pause

    cd ../install

    ./console_solver.exe -i resources/text/commandline_sample_input.txt

    pause ` Screenshot of the batch fail below; image

    opened by silentdiverchris 5
  • Understanding the card5_dic_sorted.txt file

    Understanding the card5_dic_sorted.txt file

    A query rather than an issue really, but I'm trying to get my head around what the 2.6 million lines in this file are. At first I assumed it was all possible 5 card boards but 52x51x50x49x48 is 311 million, not 2.6 million so surely it can't be all possible boards, so what is that set / the inclusion criteria for it ?

    Deep poker strategy isn't exactly my field so please excuse my ignorance, but if somebody could tell me what those 2.6 million lines represent, where my maths is wrong or whatever else it is I'm not understanding; I'd appreciate it, thanks.

    opened by silentdiverchris 5
  • Ranges Not Displayed Correctly on

    Ranges Not Displayed Correctly on "Show Result"

    When stepping through the action tree on "Show Result" on Mac OS X the hand grid is not displaying ranges ideally. Each "cell" uses full width to display the strategy and so it is impossible to see what the range of each player is. Instead each cell should use the fraction of the width of the cell proportionate to how much of the range that hand takes up. Hands no longer in range should not display the strategy in the grid and instead you should click on the cell to see the strategy in the side panel on the right.

    opened by maxflores 1
  • Miscellaneous Crashes

    Miscellaneous Crashes

    Frequently when i click "Start solving" the Mac OS X app just crashes. This is not a function of the parameters or of forgetting the build the tree since the same steps when reproduced sometimes do not crash.

    opened by maxflores 11
  • icc profile error message

    icc profile error message

    I got continuously the following error message on my old macbook pro (Mid 2012, macOS 10.15.7).

    fromIccProfile: failed minimal tag size sanity macOS generated a color-profile Qt couldn't parse. This shouldn't happen.

    On my iMac (Retina 5K, 27-inch, 2017, macOS 12.6.1) I don't have this error message.

    opened by LitoFrame 1
  • Why is

    Why is "bet 25%" option not displayed in the decision tree?

    image Under such configuration, the decision tree in River does not include bet 25% but only check and all in. Are there anything that I missed? I think there is some option about OOP bet 315. image

    opened by gosoy 10
  • Use on Linux

    Use on Linux

    Is there any tutorial for using it on Linux? I am new to Linux and installing programs on it seems confusing.

    While compiling it using the terminal, it returns "lack of cmakelists.txt" for "cmake ..". And while I am trying to compile from the scratch, "bash: cd: cmake-3.15.3/: No such file or directory" shows up when I am at "./bootstrap" step.

    opened by sean7084 1
Releases(v0.2.0)
Pseudofermion functional renormalization group solver for (frustrated) quantum magnets in two and three spatial dimensions.

SpinParser SpinParser ("Spin Pseudofermion Algorithms for Research on Spin Ensembles via Renormalization") is a software platform to perform pseudofer

Finn Lasse Buessen 19 Sep 5, 2022
C implementation of a sudoku solver with backtracking algorithm

SUDOKU SOLVER Sudoku solver using backtracking algorithm Sudoku game To solve a sudoku, you need a sudoku. So i made a basic implmentation of one with

Jonas STIRNEMANN 2 Mar 23, 2022
Quick sort is a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays.

Quick sort is a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays. A large array is partitioned into two arrays one of which holds values smaller than the specified value, say pivot, based on which the partition is made and another array holds values greater than the pivot value.

Lakshan Sandanayaka 4 Jan 2, 2023
A Robust and Efficient Trajectory Planner for Quadrotors

Fast-Planner is developed aiming to enable quadrotor fast flight in complex unknown environments. It contains a rich set of carefully designed planning algorithms.

HKUST Aerial Robotics Group 1.5k Jan 5, 2023
Official ACM CSS PEC repository for resources and all things Open source

Contributing Guidelines Ahoy there! Welcome to the PEC-ACM Open Source Repository. We request you to read the whole guidelines before making any pull

PEC CSS 78 Dec 25, 2022
A open source repository of different kinds of algorithms in c. Newbies are encouraged to contribute!

algorithms A open source repository of different kinds of algorithms in c. Newbies are encouraged to contribute! This is my first open source project,

null 28 Dec 5, 2022
C++ fundamentals and questions for beginners and intermediates. Welcoming developers, content writers, and programming enthusiasts.

Rules To Contribute To This Repo You can write solutions only in C++ for Data Structure and Algorithms (if you dont know C++ you can submit only algor

Sushree Satarupa 210 Dec 11, 2022
Collection of algorithms and data structures in C++ and Java

Collection of algorithms and data structures in C++ and Java

Andrei Navumenka 1.7k Jan 2, 2023
WasmEdge Runtime is a high-performance, extensible, and hardware optimized WebAssembly Virtual Machine for automotive, cloud, AI, and blockchain applications.

WasmEdge Runtime is a high-performance, extensible, and hardware optimized WebAssembly Virtual Machine for automotive, cloud, AI, and blockchain applications.

null 5.1k Jan 5, 2023
Emusicchain is a blockchain built using Cosmos SDK and Tendermint and created with Starport.

emusicchain emusicchain is a blockchain built using Cosmos SDK and Tendermint and created with Starport. Get started starport chain serve serve comma

null 2 May 13, 2022
A library of common data structures and algorithms written in C.

C Algorithms The C programming language includes a very limited standard library in comparison to other modern programming languages. This is a coll

Simon Howard 2.9k Jan 9, 2023
Several algorithms and data structures implemented in C++ by me (credited to others where necessary).

Algorithms This repository contains my implementations of several algorithms and data structures in C++ (credited to others where necessary). It has i

Petar Veličković 589 Dec 19, 2022
C++ implementations of well-known (and some rare) algorithms, while following good software development practices

ProAlgos: C++ This project is focused on implementing algorithms and data structures in C++, while following good software engineering practices, such

ProAlgos 485 Dec 7, 2022
Xournal++ is a handwriting notetaking software with PDF annotation support. Written in C++ with GTK3, supporting Linux (e.g. Ubuntu, Debian, Arch, SUSE), macOS and Windows 10. Supports pen input from devices such as Wacom Tablets.

Xournal++ is a hand note taking software written in C++ with the target of flexibility, functionality and speed. Stroke recognizer and other parts are based on Xournal Code

Xournalpp 7.9k Jan 7, 2023
Rufus is a utility that helps format and create bootable USB flash drives.

Rufus is a utility that helps format and create bootable USB flash drives.

Pete Batard 21.3k Jan 9, 2023
Provide building blocks (software, hardware and algorithms) for implementing SLAM using small sensors

RemoteSLAM The purpose of this repo is to provide the building blocks (software drivers, hardware and algorithms) for implementing SLAM systems using

Autonomous Drones Lab, Tel Aviv University 38 Jan 20, 2022
Fundamentals of Data structures and algorithms in c++

Data Structures & Algorithms About the repository: Contains theories and programming questions related to fundamentals of data structures and algorith

fifu 46 Dec 1, 2022
CXXGraph is a Header-Only C++ Library for Graph Representation and Algorithms

CXXGraph is a small library, header only, that manages the Graph and it's algorithms in C++. In other words a "Comprehensive C++ Graph Library".

ZigRazor 186 Dec 29, 2022
Header-only C++ library for robotics, control, and path planning algorithms.

Header-only C++ library for robotics, control, and path planning algorithms.

null 360 Dec 13, 2022