\

Solving poker in custom WebGPU kernels

23 points - today at 3:38 PM

Source
  • mncalc7

    today at 9:01 PM

    You should check out https://jax-js.com/. It has parity with quite a large surface area of Jax, and compiles natively in the browser to wasm and webGPU, entirely written in JS.

    • patrickhulin

      today at 3:38 PM

      I wanted to build a poker solver that I could host for ~free. This meant running client-side, where the best browser technology is WebGPU. The tensor library I wanted did not exist, but in the LLM era we sometimes don't need libraries at all. I had Codex turn my thousands of lines of PyTorch code into custom WebGPU kernels with parity tests. Codex then spent days optimizing those kernels.

      You can use the solver at https://holdem.computer, and the source is at https://github.com/phulin/poker2.

      • beepbooptheory

        today at 8:57 PM

        Man was really excited for some poker-themed computer science blogging like back in the day but really I guess shoulda known huh :/.

        • bluecalm

          today at 8:29 PM

          >>A more modern approach instead β€œre-solves” each spot to a limited search depth and uses a neural network as an approximation function at the depth cutoff. Both tabular (e.g. Piosolver) and neural (e.g. GTOWizard) commercial solvers are available.

          PioSOLVER doesn't use any abstractions or cutoff functions. It just solves the whole game without any simplifications other than allowed bet sizes. The cost is rather large RAM requirements. The advantages is that it's very precise and produces exact results for every hand (it doesn't bundle them).