Skip to content
ENGINEERING CASE STUDY

Building Matchroom

How Matchroom keeps the board responsive, a match recoverable and the opponent ladder grounded in measured play.

How I worked with Codex

I set the product direction, picked the design, and tested on my iPhone. Codex implemented the game and website, ran checks, and revised the build from my feedback. Superpowers helped structure that work from brainstorming through code review.

Web
Next.js, React, Tailwind CSS, IndexedDB and Service Workers
iPhone
React Native, Objective-C++ and SQLite
Shared game and AI
TypeScript rules, Open Sage, WebAssembly and Arkadium match data from Hugging Face
Testing
Jest, Playwright and axe-core
Prompts and replies
72
Recorded Codex turn time
6h 57m
How I counted

From the first brief on November 25 through the opponent directory fix on November 30, 2026. The prompt count includes my messages, approvals, and attachment or voice feedback. The clock covers 66 recorded turns in the main project chat. It excludes gaps between turns, including quota-reset waits that happened in those gaps. The log can’t separate waits within a turn or time I spent testing on my own.

What worked

I got the clearest results when I paired a request with evidence. On-device feedback identified the board shift during AI moves. Screenshots made styling problems concrete, and the offline and no-scroll requirements gave Codex behavior it could verify. I kept early design decisions for review and later delegated implementation and testing once the direction was clear.

What I’d improve

My broad finish-the-app requests gave Codex room to work, but left release readiness open to interpretation. Next time I’d define separate checks for the browser build and physical-device release. I’d also give subjective requests a reference and a testable outcome earlier, such as showing both dice and each checker move without shifting the board.

ARCHITECTURE

One game engine, two platforms

Rules and match state sit below the UI. Animation helps the player follow a decision without changing its outcome.

  1. Board input

    React Native or React submits a typed game action.

  2. Legal outcomes

    The shared reducer applies dice and cube rules and validates the turn.

  3. Evaluation

    Open Sage scores positions in a native queue or a Web Worker. The shared policy selects the opponent’s checker move.

  4. Local commit

    The validated move updates the board, save slot and journal in SQLite or IndexedDB.

Deterministic rules

The game validates complete checker sequences before they can be committed. Bar reentry, dice usage, scoring and Crawford all belong to the same match state machine.

Offline match history

On iPhone, a versioned SQLite journal keeps separate Career and Practice saves. The transaction that records a result also protects against duplicate rating changes after a restart. The browser uses the same validated snapshot format with an IndexedDB transaction.

Native work off the UI queue

Open Sage loads bundled weights and scores moves on a native serial queue. The React Native view can animate the selected sequence one checker at a time. The browser compiles the same evaluator to WebAssembly and isolates it in a dedicated worker.

Matchroom on an iPhone 18 Pro Max simulator showing the light Ivory board and complete turn controls
Native view · iPhone 18 Pro Max simulator
DESKTOP CALIBRATION

How the opponents were ranked

We ran 3,000 seeded five-point matches. The roster calibration used a fixed reference panel and replayed each seed with the seats swapped.

Roster tier win rates

Against the desktop reference panel. The interval is a paired 95% bootstrap range.

Beginner1105 in-app rating
36.4%32.9–40.2%
Intermediate1215 in-app rating
52.3%48.6–55.8%
Expert1300 in-app rating
64.0%59.1–69.3%

The 1,800 roster matches support relative tiers within Matchroom. The other 1,200 matches checked the adjustable practice setting. The highest tier is Expert.

When estimates overlap

Adjacent presets with overlapping intervals are pooled. The tier ratings communicate an in-app difficulty range without implying a precise order for every fictional opponent.

How well do the profiles predict human moves?

Checker-choice log loss on 3,022 decisions from matches held out during fitting. Lower is better.

  • Open Sage equity alone1.503
  • Equity plus fitted styles1.362
VALIDATION

Performance and testing

Keep engine timings, simulator workflow tests and device release verification separate.

82 ms

First engine response

Physical iPhone 15 Pro in airplane mode. Eight synthetic cases ran; the visible p95 timings ranged from 0.02 to 0.56 ms. These figures exclude full-match interaction and are separate from browser performance.

3

Native XCTest journeys

iPhone 18 Pro Max simulator on iOS 27.2. Career restore, a genuine Training recommendation and a rated result with review all passed in the recorded run.

34,748 KiB

ARM64 Release artifact

Unsigned iPhoneOS build on disk. It verifies device-SDK compilation and linking. Signed installation and device profiling are separate checks.

Browser evaluation

In desktop Chrome 158 on Apple Silicon, the production Web Worker initialized in 169.5 ms over loopback. Eight repeated 2-ply opening evaluations ran at a median of 0.90 ms and a sample p95 of 62.70 ms. Cached repeats are faster than the first search.

Cold downloads

The homepage transferred about 145 kB of JavaScript in the recorded run, with no engine requests. The 13.44 MB engine package is requested on first evaluation or when players prepare offline play.

Explore the engine and training data
PLAY MATCHROOM

Start a match

Play backgammon