Prospero Challenge

The Prospero Challenge is a small but surprisingly rich rendering benchmark from Matt Keeter. The input is a plain-text program containing thousands of mathematical expressions. Evaluate it over the square [-1, 1] x [-1, 1], color each pixel by the sign of the result, and it produces an image of text from The Tempest.

The challenge is to render that image as quickly as possible. A direct NumPy implementation is short and readable, but it spends a lot of time and memory on intermediate arrays. That makes Prospero a nice playground for compiler ideas, interval arithmetic, expression simplification, parallel evaluation, SIMD, GPU execution, and the tradeoff between startup cost and steady-state frame time.

Runs the 1024x1024 Prospero renderer in WebAssembly.

This post will collect my notes on the challenge and the implementation details I found most interesting.