Personal project

AlphaBridge

A bridge AI that taught itself to bid.

No neural net priors, no human conventions baked in — a genetic evolution loop discovers a tournament-legal bidding system from pure noise, then explains every call it makes.

Python stdlib only Genetic evolution Duplicate bridge Self-explaining ACBL-legal
AlphaBridge playing all four seats — recorded from the real UI, auction through card play.
Champion matchpoint % 0.1 vs. 2/1, Precision & GIB anchors
Genome size 2184 integers encode the whole policy
Evolved rules 10 of 40 slots, every one disclosed
Dependencies 0 pure Python standard library
EngineHidden infoWatch mode

A real bridge table, honest by construction.

A full duplicate bridge engine runs in the browser: dealing, auction legality, trick resolution, duplicate and cross-IMP scoring. Hidden information is enforced at the architecture level — each seat sees only what the laws of bridge allow, and the dummy stays face-down until the opening lead.

Flip on bot thoughts and the AI narrates each decision as it makes it; Watch AI vs AI lets a whole board play itself.

The AlphaBridge play table mid-deal: a green card table with a live trick, seat panels, bot commentary, and an auction history

The discovery

It invented its own bidding system.

Evolution starts from random noise. Generation after generation, candidate genomes play duplicate-field tournaments against 2/1, Precision, and GIB-style anchors — human systems are opponents, never teachers. What survives is a bidding language no person designed, exported with full ACBL disclosure metadata: every call announced, every alert marked.

The agreement browser showing AlphaBridge Native, the self-discovered system, with ACBL metadata and decoded bidding rules
DisclosureCall meaningsAssistant

Every call explains itself.

A feature that can’t be explained to the player isn’t done. Tap any call to read its decoded meaning; seat panels show exactly what each player is allowed to know; the real-hand assistant recommends a call for your own 13 cards and tells you why.

The agreement browser is the single source of truth for what every strategy bids — the evolved AI included.

A fresh board during the auction: seat knowledge panels, legal call buttons, and the bidding grid
DeterministicBenchmarkedLocal-first

A lab, not a black box.

Determinism is a first-class invariant: the same seed reproduces the same deal, auction, play, and evolution result, byte for byte. Training runs are budget-guarded, benchmarks gate every optimization, and the dashboard puts smoke runs, engine throughput, and evolution leaderboards one click away.

Everything runs locally on a laptop — no services, no GPUs, no installs.

The AlphaBridge main menu and dashboard hub

Under the hood

Pure standard libraryEngine, GA, web server, and UI with zero dependencies — http.server is the whole backend.
Deterministic by seedSame seed → same deal, auction, play, and leaderboard. Every speedup must keep results byte-identical.
Genetic evolutionElitism, crossover, per-gene mutation, and random immigrants over a duplicate-field tournament fitness.
Information-state boundariesStrategies receive only a seat’s legal view; the engine, not the bot, enforces legality.
Tournament-legalEvolved agreements carry ACBL Open Chart compliance: alerts, pre-alerts, and written-defense metadata.
Benchmark-gated speedThroughput bounds training scale, so hot paths are profiled and regressions are visible immediately.

Try it yourself.

The read-only lab is hosted right here — browse the discovered bidding system and the dashboard rebuilt from the latest artifacts on every deploy.

Playing a board needs the local engine. One clone, no installs:

$ git clone https://github.com/shengchao-lin/AlphaBridge.git
$ cd AlphaBridge
$ python3 main.py play-ui