Home

HomeChapter 02 / 8Execution model

Implemented

248 words · 1 min read · Arsh Shah

Software

One frame, seventeen stages

Only the main thread may change simulation state. Metal draw calls are built on that thread; the GPU runs them afterward, in parallel. The design is strict about ownership, because real-time fluid feedback breaks when two writers fight over the same buffers.

A fixed order each frame

Only the main thread may change simulation state. Metal draw calls are recorded there; the GPU runs them afterward, in parallel.[004] Every frame walks the same graph. Dashed nodes — bloom, particles — exist only on Apple Silicon. The order is the point: a real-time fluid coupling breaks the moment two writers fight over the same buffers.

MoveDisturbSolveDraw01Obstacle02Advect u03Advect ρ04Forces05Ripples06Vorticity07Divergence08Pressure09Project10Bloom11Particles12Compose

One frame

What runs, in order, every frame.

Play through the pipeline. Solid nodes run on every machine; dashed nodes (Bloom, Particles) run only on Apple Silicon.

01 · ObstacleMoveBake the boat hull, cutout, and painted solids into one obstacle map.

Fig. 02.1

Condensed per-frame order. Dashed nodes (Bloom, Particles) run only on Apple Silicon.

What the graph is for

The stage graph is an ownership diagram before it is a performance diagram. Wessel and Wright’s intimate control of computers asked for a loop tight enough that a gesture and its consequence occupy the same moment.[131] The pipeline is how RowSim keeps that loop from being rewritten by a second thread, a late sensor, or an architecture-specific fallback. Stam’s stable-fluids order is what the graph is protecting.[113][Th.]

MoveDisturbSolveDraw01Advect02Inject03Ripples04Curl05Divergence06Pressure07Project08ComposeDashed rings = usually the slowest stretch

Where time goes

The stages that usually dominate the frame.

Dashed rings mark the heavy pair: Pressure then Project. Bloom (not shown) adds more cost on Apple Silicon; the fallback stops after Project.

01 · AdvectMoveMove velocity and density with the current flow.

Fig. 02.2

Simplified spine of one frame. Rings mark Pressure → Project, the usual bottleneck. Bloom and particles omitted.

What the logs measured, and what they did not

Sensor-to-host ingest was timed. The median is 1.13 ms; the 99th percentile is 3.64 ms, under a quarter of the 16.7 ms available at 60 Hz. That comparison is honest only if it stays scoped: GPU frame time was not logged, and state-to-photons cannot be recovered from software timestamps. The claim covers ingest, not the photons.

Latency

Ingest fits in a quarter frame. The rest was not logged.

Fig. 3.14 as one slot: what the logs can say, and what they cannot.

01 · IngestSensor-to-host ingest arrives first: median 1.13 ms, 99th percentile 3.64 ms. The packet is already on the host before a sixtieth of a second has passed.

Fig. 02.3

Ingest percentiles against the 16.7 ms 60 Hz slot. GPU frame time was not logged; state-to-photons is unmeasured.

Works cited

Superscripts use the thesis bibliography number. Click a number to return to the first mention.

  1. [004]

    Apple Inc. (2024).

    Metal: Documentation and programming guide.

    Apple Developer Documentation.

    Link

  2. [113]

    Jos Stam (1999).

    Stable fluids.

    Proceedings of SIGGRAPH ’99, pp. 121–128. ACM.

    doi:10.1145/311535.311548

  3. [131]

    David Wessel and Matthew Wright (2002).

    Problems and prospects for intimate musical control of computers.

    Computer Music Journal, 26(3), 11–22.

    doi:10.1162/014892602320582945

  4. [Th.]

    Arsh Shah (2026).

    RowSim: Designing and Evaluating Ambient Interaction in Mixed-Reality Rowing.

    Master’s thesis, Dalhousie University, Halifax, NS.

    ch. 3hdl.handle.net/10222/86331PDF