Building / 02

Mechanics of the Rock

Mechanics of the Rock is a guide to competitive pool for league players moving up to tournament play. I started it in September as researched chapters on the break, aiming, banks and the rest, where every claim carries an evidence tag and a numbered source. Then the claims needed testing, so it grew a physics engine, a shot planner that plays the table for you, and an iPhone app that watches the table while you practice.

Role
Solo build
When
Sep 2026 to now
Team
Solo
Status
●live

Fig. 01

I wrote my own physics engine in Rust, so one core runs on the web, the phone and the server.

I started from the physics in pooltool, an open-source pool simulator, and Dr. Dave Alciatore's technical proofs. Like pooltool, it jumps from collision to collision instead of stepping time: between them every ball follows a closed-form path through sliding, rolling and spinning, so a 9-ball break on a 9-foot table comes out as 94 events in about 5 ms.

Field notes

It compiles to WebAssembly for the site, through UniFFI for iOS, and to a native batch runner for the server, and CI checks that a break hashes the same bit for bit on macOS, Linux, WebAssembly and the phone. In parallel it runs 1,567 breaks a second, which is what the simulator's Monte Carlo batches use. pooltool is still the reference: its fixtures run in my tests, event for event.

01 / The build9 figures

The Mechanics of the Rock home page: the title in a heavy serif, a nine-ball spread drawn in ink, and the chapter list in a side rail.

Fig. 02

I wrote nine chapters, and every claim on the site carries an evidence tag and a numbered source.

Tags run from [rule] and [measured] down to [anecdotal] and [unverified]. Where sources disagree, the chapter prints the disagreement instead of averaging it.

Field notes

It's a Next.js 16 app on Vercel, with Supabase for sign-in and the game journal and Stripe for the paid tools. The look is grey-green paper, green-black ink and one chalk blue, with red kept for unverified claims and nothing else. Every PR runs types, the build, a headless Chrome visual battery, the Rust tests and a WASM determinism check.

The Drill Library page: 91 drills, 39 sources, 23 systems, above a setup table.

Fig. 03

The drill library is one sourced JSON file that the site and the iPhone app both read.

91 drills with difficulty bands and evidence tiers, faceted search, and a session builder for tonight's practice.

A lab report diagram of Ko Ping Chung's break: the cue ball's line into the rack and the 1 ball's path, a straight line fitted through its tracked frames, into the side pocket.

Fig. 04

Lab reports measure real breaks off broadcast video.

I tracked seven of Ko Ping Chung's 2023 US Open breaks frame by frame from the overhead camera, with the rail diamonds as the ruler. The 1 went in the side all seven times. Then I ran the same break through the model.

Fig. 05

The 3D view has a second look that draws the break as light instead of objects.

Points on near-black, no color. Each ball is a shell of points that turns with the engine's spin, a moving ball sheds a trail as long as its speed, and every contact throws a small burst.

Field notes

It's the same playback as the realistic view. Trails and bursts live in one ring buffer of 14,000 particles timed on the simulation's clock, so slow motion slows them and a paused break freezes them. On the simulator, switch to 3D and pick Particles. This clip is the public site at half speed.

Ghost ball, then play itAim · play

Fig. 06

The shot solver starts where a player does, from the ghost ball.

It aims at the ghost-ball contact first, then searches direct shots, banks, kicks and combos, scores every candidate with the full engine, and keeps the closest aim at the softest speed. (This sketch runs on The Lab's own small pool model, not MotR's engine.)

Fig. 07

Table Lab plans a whole runout and prices every shot for the player you pick.

It measures each pocket's window, works out the make chance in closed form, then plays the cue ball across a grid of speeds and tip positions and looks two shots ahead. One decision used to take 119 seconds. Now it takes about 0.2.

Left: a broadcast frame from the 2026 UK Open with six pockets marked and all ten balls circled and numbered, one ringed in yellow as unsure. Right: the same layout read into Table Lab's line-drawn table.

Fig. 08

Table Lab reads a layout off a photo, even a frame from a match on TV.

Tap the pockets you can see and it works out which is which, finds the balls as discs in the photo, and guesses their numbers from color. On this frame from the 2026 UK Open it finds all 10 balls. It marks the 2, tucked behind the 9, as unsure. It still swaps the red 3 and the pink 4, which is why you check its read before you use it.

Field notes

It runs in the browser, and the photo never leaves the device. A broadcast camera sits low over the cloth, so flattening the picture top-down would stretch every ball into a streak. Instead it finds the balls in the photo itself, then steps each one back toward the camera to where it sits on the cloth. The frame is from a YouTube broadcast of Joshua Filler and Darren Appleton at the 2026 UK Open Pool Championship.

Fig. 09

The iPhone app runs the same Rust engine natively, planner included.

Deal a layout, ask for the runout, and it plays each shot with the odds for a league player. I started the app on November 15, and the engine and the planner were running on the phone by the next day.

02 / On the bench