Dylan Matthews

Case study · Research prototype · private repository

EDH Solver

Bounded game-theory models for single decisions in competitive Commander.

Python validates a decision node and NumPy samples a declared opponent field. Precomputed CFR counter-war payoffs feed multiplayer regret matching. Paired action outcomes produce conditional EV gaps with Hoeffding intervals; no multiplayer equilibrium guarantee.
Open the full-size architecture diagram.

The problem

In four-player competitive Commander (cEDH), players face recurring decisions: whether to attempt a win now or wait a turn, and whether to spend a counterspell or trust a later player to answer. These are usually argued from intuition. The solver models a few such decision points explicitly, with every assumption declared. It does not try to solve Magic as a whole, which is impossible in general. It is a research prototype for finding which assumptions change the answer.

Contribution and AI assistance

Dylan's recorded decisions shaped the project. On 2026-09-05 Dylan chose the attempt-or-wait decision as the first one to model, allowed game capture only as a separate future product, and kept a later phase conditional. On 2026-09-06 Dylan made a solver the primary goal and chose to extend the existing package rather than rebuild. Later, Dylan authorized corpus composition, opponent assumptions, sensitivity analysis and a proposal for a simulator interface.

How AI contributed

The plan is written by an assistant reporting to 'the user', and it records that implementation began after Dylan said 'Begin'. The repository also includes a CLAUDE.md guide for coding agents. This suggests coding-agent sessions implemented the stages, but there is no file-level attribution.

  • Python
  • NumPy
  • JSON Schema
  • uv

Two consequential decisions

Decision 1

Three layers, with nothing extrapolated between them

Layer 1 solves a two-player counterspell exchange with counterfactual regret minimization (CFR), where a Nash equilibrium and scalar exploitability are defined. Layer 2 models how several defenders allocate interaction. Layer 3 compares actions at one declared decision point against declared opponents. Each layer consumes explicit parameters from the layer below. The composed four-player result does not claim a unique equilibrium or a global exploitability certificate.

Decision 2

Report where the answer flips, not a single number

Every comparison carries its opponent model's version, hash and expiry date, its interval and its blind spots. Stage 8a adjusts each declared parameter until the recommendation changes. The interval covers sampling error only, not model error. This showed where missing data costs the most: on one modeled table, the assumed amount of opponent interaction was one unit away from flipping the answer.

Verification

  • Stage 0 record: three methods found the same equilibrium for the counterspell exchange: a closed form worked out by hand, support enumeration and CFR. The defender counters 40% of the time, and the game is worth 0.600 to the attacker. One acceptance criterion was corrected after measurement showed it was wrong.
  • The simulator's interface contracts are copied into this repository. Tests serialize real request objects to the exact HTTP bytes, but offline tests say nothing about a deployed service's health.
  • All results come from stage records in the private repository. None has been independently reviewed.

Outcome and progression

3 methods agree

Equilibrium check for the two-player counterspell layer

Stage 0, September 2026. The closed form, support enumeration and CFR (20,000 iterations, seed 0) agree within 0.01 on counter rate and game value. The parameters are declared, not measured from real games.

1 unit

How far the assumed interaction count sat from flipping the attempt-or-wait answer

Stage 8a sensitivity scan, September 6, on a declared field where attempting led by +0.1066. This identifies a valuable parameter to validate. The solver's configured local source lacked tournament views in its September 5 observation; other consumers document those views elsewhere. It is not evidence that the tables are universally undeployed.

Milestones

  1. 2026-09-04Milestone 0: design, internal interfaces and wire contracts.
  2. 2026-09-05Owner product decisions recorded, with the attempt-or-wait decision first.
  3. 2026-09-06Direction changed to a three-layer solver; layers 1 and 2 committed.
  4. 2026-09-17Stages 15 and 16: an observable quantity for the defender and a deck interaction profile.

What I would measure next

Connect the solver's configured data source to the published tournament views, verify consumer access, and fit opponent models from real decklists. Then rerun the 54-cell sensitivity grid and report which comparisons change sign relative to the checked-in assumptions.

Explore the evidence

  1. Read the problem and the two decisions on this page to see where each layer's claims stop.
  2. Under verification, compare the three methods used to find the counterspell equilibrium.
  3. Open the public simulator integration handoff to see the contract the solver consumes.

Evidence and further reading