oneshotlm
Compare all models on this prompt →

Reaction-diffusion · claude-opus-5

Run a Gray-Scott reaction-diffusion simulation on a canvas that grows organic Turing patterns in real time, with the mouse seeding new growth.

⛨ sandboxed Open in new tab ↗
transcript · 6 messages
user

Run a Gray-Scott reaction-diffusion simulation on a canvas that grows organic Turing patterns in real time, with the mouse seeding new growth.

assistant
thinking
I'm deciding between WebGL and CPU-based approaches for the Gray-Scott simulation, weighing performance against complexity. A CPU simulation at 200x200 resolution with multiple iterations per frame rendered via ImageData seems like a good balance—fast enough without the overhead of WebGL setup.

Actually, WebGL2 with a minimal CPU fallback makes more sense for a smoother, more impressive result. I'll use ping-pong textures with float formats (RGBA32F or RG16F) for the simulation state, write a shader that computes the 9-point Laplacian for the reaction-diffusion equations, and map the B channel to a color palette for display. Mouse interaction will seed the simulation by passing brush position and radius to the shader. I'll add preset controls for feed/kill rates, reset, palette selection, and speed adjustment, keeping the UI minimal.

Writing the simulation shader... Writing the full implementation... Writing shader code...
bash {"command":"ls -la /tmp/ws 2>/dev/null; node -v 2>/dev/null"}
toolResult

total 0 drwxr-sr-x. 2 node node 6 Aug 3 00:23 . drwxrwsrwx. 3 root node 16 Aug 3 00:23 .. v24.18.1

assistant
thinking
I'm planning to build a Gray-Scott reaction-diffusion simulation using WebGL2 with float textures for performance, implementing a ping-pong buffer approach for the computation. I'll add a UI with preset controls for the f and k parameters, brush size adjustment, reset functionality, and a color palette selector. Writing careful GLSL shaders for the simulation, and I'll include a fallback message if WebGL isn't available.

For the shaders, I'm implementing an update pass that reads the current u and v concentrations, computes a 5 or 9-point Laplacian, applies the reaction-diffusion equations with the feed and kill rates, and handles mouse input for seeding the v concentration. The display shader will map the v values to colors. I'll use RGBA16F or RGBA32F textures and run multiple simulation steps per frame for stability. I'm also considering interactive presets for different pattern types like spots and worms, with an optional gradient mode to vary the parameters spatially for more organic results.
write /tmp/ws/index.html (18692 bytes)
toolResult

Successfully wrote 18692 bytes to /tmp/ws/index.html

assistant

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelclaude-opus-5
vendorAnthropic · Claude
harnesspi-agent
generated2026-08-03

EVALUATION

4/5 working

Reaction-diffusion simulator with live pattern growth, responsive to click/drag/wheel/pause via spacebar; arrows/WASD have no effect (expected).

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion6.3%
on click12.1%
on drag18.8%
on wheel13.6%
on enter + space0.2%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread41.3 / 255
console errors0
js errors none

METRICS

runtime131.3s
tokens in4.8k
tokens out12k
cached4.5k
cost / run$0.3069