oneshotlm
Compare all models on this prompt →

Reaction-diffusion · qwen3.8-2.4t-a95b

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
Write a single-file Gray-Scott simulation. Use canvas, and use typed arrays plus a simple finite difference computation (no WebGL needed. Though WebGL would be faster... For simplicity, a CPU simulation on a low-resolution grid upscaled with ImageData should suffice. Use requestAnimationFrame and run multiple steps per frame). Add mouse-drag seeding, sliders for presets (F, k), and a feed/kill preset selector.

Implementation: grid ~256x256, 20 simulation steps per frame. Laplacian with 9-point stencil. Render V to an offscreen canvas at grid resolution, then drawImage with scaling.

Write the file.
write /tmp/ws/index.html (11184 bytes)
toolResult

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

assistant
thinking
Should I quickly verify the syntax with node? This script is browser-only (canvas, DOM). At the very least I could use node --check to check whether there are any parse errors in the JS. Extract the contents of the script? More simply: just trust it as-is, but doing a quick parse check on the script text with node would be a good sanity check.
bash {"command":"cd /tmp/ws && node -e \"\nconst html = require('fs').readFileSync('index.html','utf8');\nconst m = html.match(/<script>([\\s\\S]
toolResult

JS parses OK, length: 7954 -rw-r--r--. 1 node node 11192 Aug 13 01:32 index.html

assistant
thinking
Wait, new Function only does parsing — but the script is an IIFE, so Function's parsing check is fine. Done.

Done — `/tmp/ws/index.html` is a fully self-contained single-page app (verified the JS parses cleanly). **What's inside:** - **Gray-Scott model** on a 320×240 grid using double-buffered `Float32Array`s, a 9-point Laplacian stencil (diagonals weighted 0.25), and toroidal wrapping. Runs ~12 simulation steps per frame by default (adjustable 1–30). - **Real-time organic growth**: the default preset is "Coral growth", which produces branching, coral-like Turing structures that keep evolving. 8 classic regimes included (mitosis spots, mazes, fingerprints, solitons, worms, chaos, moving spots). - **Mouse seeding**: click and drag anywhere on the canvas to inject chemical V — strokes are interpolated between pointer events so fast drags leave continuous growth trails. - **Rendering**: V concentration mapped through a custom deep-blue → teal → warm-sand color ramp, drawn to an offscreen grid-resolution canvas and upscaled with pixelated rendering. - **Controls**: preset selector, live Feed/Kill sliders (for exploring the parameter space yourself), speed slider, seed-blobs button, clear, pause/resume, and an FPS readout. Zero external resources — just open the file in any browser.

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

modelqwen3.8-2.4t-a95b
vendorQwen
harnesspi-agent
generated2026-08-13

EVALUATION

4/5 working

Gray-Scott reaction-diffusion grows organic coral-like Turing patterns, animates on its own, and mouse click/drag/wheel seed dramatic new growth.

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 motion3.0%
on click14.7%
on drag22.9%
on wheel19.4%
on enter + space23.5%
on arrow keys2.8%
on w/a/s/d1.7%
frame spread65.8 / 255
console errors0
js errors none

METRICS

runtime61.8s
tokens in14k
tokens out4.8k
cached0
cost / run$0.0559