oneshotlm
Compare all models on this prompt →

Reaction-diffusion · kimi-k2.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 · 4 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
The user wants a Gray-Scott reaction-diffusion simulation. This is a classic pattern formation system described by two coupled PDEs:

∂u/∂t = D_u ∇²u - uv² + F(1-u)
∂v/∂t = D_v ∇²v + uv² - (F+k)v

Where:
- u and v are chemical concentrations
- D_u and D_v are diffusion rates
- F is the feed rate
- k is the kill rate

I need to:
1. Create a canvas-based simulation
2. Implement the Gray-Scott equations using a numerical method (likely Euler with finite differences for the Laplacian)
3. Allow mouse interaction to seed new patterns
4. Make it visually appealing with good colors
5. Keep everything in a single HTML file

Key implementation details:
- Use two buffers/grid arrays for u and v (current and next states)
- Laplacian calculation using 3x3 stencil with weights (typically center -1, neighbors 0.2, diagonals 0.05, or similar)
- Parameters F and k can be adjusted to get different patterns (coral, spots, stripes, etc.)
- Render using putImageData or direct pixel manipulation
- Mouse click/drag adds v chemical to seed growth

Let me build this step by step.

I'll create a Gray-Scott reaction-diffusion simulation with mouse interaction for seeding patterns. This will be a self-contained single HTML file.

write index.html (15907 bytes)
toolResult

Successfully wrote 15907 bytes to index.html

assistant
thinking
I've created the Gray-Scott reaction-diffusion simulation. Let me verify the file was created properly and describe what it does.

I've created a Gray-Scott reaction-diffusion simulation in `index.html`. ## Features **Simulation** - Real-time PDE solving using Euler integration with 3x3 Laplacian stencil - Dual-buffer grid system for A (activator) and B (inhibitor) chemicals - Spatial downsampling (2x) for performance while maintaining visual quality **Interaction** - **Click/drag** anywhere to seed new growth patterns - Preset buttons for classic Gray-Scott patterns: Coral, Fingerprint, Spots, Worms - Adjustable parameters: Feed rate (F), Kill rate (k), diffusion rates, timestep **Visuals** - Organic cyan/teal coloring against dark background - Turing patterns emerge naturally from the reaction-diffusion dynamics **Controls** | Parameter | Default | Effect | |-----------|---------|--------| | Feed (F) | 0.0545 | Rate of A replenishment | | Kill (k) | 0.062 | Rate of B removal | | Diffusion A | 1.0 | Activator spread | | Diffusion B | 0.5 | Inhibitor spread | Open `index.html` in a browser to see the patterns grow. Click and drag to create new seeds—the patterns will self-organize into coral-like structures, spots, or mazes depending on the F/k parameter values.

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

modelkimi-k2.5
vendorMoonshot · Kimi
harnesspi-agent
generated2026-07-22

EVALUATION

3/5 working

Gray-Scott simulation with UI controls; click/drag seed growth into worm-like patterns but no idle animation.

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 motion0.0%
on click0.6%
on drag1.3%
on wheel0.8%
on enter + space0.8%
on arrow keys2.3%
on w/a/s/d2.1%
frame spread15.1 / 255
console errors0
js errors none

METRICS

runtime110.2s
tokens in5.2k
tokens out5.1k
cached2.0k
cost / run$0.0128