Double Dummy Bridge Solver
Building an intelligent bridge player in Bend

When I was in college, I got really into Bridge. I would go a couple times a week to a local club, and even traveled around to tournaments. I've long since forgotten how many ACBL Master Points I earned. Of course the intersection of being a computer nerd and a bridge nerd means trying to write a computer program to play bridge. It turns out this is incredibly difficult. One particular aspect of computer bridge is called the Double Dummy Problem:
Assuming you can see all four hands, what is the best contract (highest score) that can be achieved by either team?
It turns out to be a really fascinating problem because of the enormity of the search space. There are 635,013,559,600 possible ways to deal four hands, and because there are five possible trump suits (4 suits + no trump), and depending on how the bidding goes, either of the 4 players could lead the first card, so the double dummy search space is roughly 53,644,737,765,488,792,839,237,440,000 nodes of a tree. That's 5.36 × 10²⁸. Ergo, as the programmer, one must get clever about pruning the search tree with various tactics.
Throughout my life and career, I have used this problem as a test problem to learn programming languages. It requires just the right amount of data structure and flow control knowledge. I've made attempts in C++, D, LISP, Clojure, Erlang, Rust, Java, JavaScript, and TypeScript. I don't recall the exact numbers, but my sense is that the best I ever could minmax through a single contract on a single hand in multiple hours...like leaving it cooking overnight.
This problem has more or less been solved in C++ for a while, so it's more of an intellectual exercise for me at this point.
Provability
However, we now find ourselves in the fall of 2026 when AI is taking the mathematics world by storm. I only learned about Lean earlier this year, but now it's all anyone can talk about. But a month ago, from some random tweet, I learned about Bend:
Bend is a functional programming language with dependent types and parallel execution on CPUs and GPUs. Programs state properties as laws and prove them in the same language; the compiler checks every proof before execution.
My curiosity was piqued!
So I grabbed an AI agent and pointed them at the academic literature about the double dummy problem and told it to go to town in Bend making a provably accurate double dummy solver. It came back to me a few hours later with some disturbing results.
It was solving entire hands, that's 20 results (4 players times 5 contracts) in one second. Mind. Blown.
As a web developer, I immediately wanted to make a website that could do this. So my AI agent compiled the Bend code into WASM and built a page to run up to 5 WASM solvers in parallel via web workers. The WASM solver download is 111 KB compressed, and another 19 KB of JavaScript to wire it up. It does slurp up 530 MB of RAM per solver, so it might not work on ancient computers, but it still works!
How Provable?
That's what I'm still working on. So far it's at about 68% proven, but that's a ruff estimate. In theory, it could get to 100%, but I'm not convinced I'll get there. No, I have not read a single line of the code.
For now, behold an online double dummy bridge solver!