← f_ notebook · ideas/f_gs.md

f_gs — Gray-Scott generator (working name) ​

Status: ⚪ concept only. Captured 2026-11-28 (Claude offline, docs only) from ideas/visualpde_survey.md. Equations and parameters are observed in VisualPDE's sim/scripts/RD/presets.js (local clone /Users/matt/Github/visual-pde). Everything about how it would run in Max is inferred: nothing tried, no NumPy spike, nothing benched. Priority 1 in the survey, behind the stepper spike (ideas/f_rd_stepper_spike.md).

Why this one ​

Reaction-diffusion is the biggest missing family in f_ (docs/f-reference/pattern_formation_orientation.md: "Not yet in f_"). Gray-Scott is its most recognizable member: spots that divide, worms, mazes, gliders and pulsating solitons from two species and two parameters. It self-sustains once seeded, like f_ks.

The equations (VisualPDE GrayScott, observed) ​

du/dt = Du lap(u) + u^2 v - (a + b) u        (Du = 1)
dv/dt = Dv lap(v) - u^2 v + a (1 - v)        (Dv = 2)

Species names are swapped against the usual Gray-Scott text: here u is the activator (usual V) and a is the feed rate, b the kill rate beyond it. Default a = 0.037, b = 0.06, spatial step 3, domain 1000, initial u = 0, v = 1 plus a seeded bump.

Regimes VisualPDE already carries (observed) ​

PresetWhat it showsParameters
GrayScottdefault, slider for a in [0, 0.1] and b in [0.04, 0.1]a = 0.037, b = 0.06
GrayScottGlidersself-propelled glidersa = 0.014, b = 0.054
GrayScottPearsonClassificationthe whole feed/kill plane painted across one domain: k = 0.07 y / L_y on one axis, 0.02 + 0.048 x / L_x on the otherdt 0.2, spatial step 5, domain 3500, Neumann
subcriticalGSthe subcritical (hysteretic) regiona = 0.037, b = 0.06 form with v drawn
GrayScottWebcam, GrayScottPorousMedia, GrayScottBanner, GrayScottGlidersAdvecting, StochasticGrayScottan image or flow or noise modulating the systemnot read

The webcam, banner and porous-medium presets are the interesting ones for f_: a texture modulating the parameters, not a fixed dial. The preset bodies for those were not opened (only their names).

What f_ would offer ​

  • Regime menu (Spots, Worms, Mazes, Solitons, Gliders, Mitosis, ...): each a fixed feed/kill pair, in place of two touchy dials. The pairs would be taken from the Pearson classification map and credited.
  • Parameter-map inlet: a texture sets feed and kill per pixel (R and G, say). This gives the Pearson map for free from a gradient, and lets an image steer where spots, worms and mazes grow. The nearest precedent is f_wc's pulse inlet.
  • Seed: an optional texture seeds u; default a few blobs or noise. A reset as in f_ks.
  • Outlets (see ideas/f_solver_outlets.md): a look (u, with a palette or the plain luma), v as a second scalar, and a gradient vecfield of u from the state (the exact derivative, not a re-derived one). A mask (threshold) is probably a mode, not an outlet.
  • rate: solver substeps per frame, the "slow motion" dial that f_wc and f_ks already have.

Overlap ​

f_ks, f_cgl, f_wc: none are reaction-diffusion. Gray-Scott's looks (isolated dividing spots, worm mazes) differ from the continuous stripes and spirals of those. No Vsynth or jit.fx equivalent was looked for in this note; pattern_formation_orientation.md records "Vsynth and jit.fx overlap checked (none)" for the pattern-generator family (per the docs, not re-verified).

Solver and cost [inferred, unchecked] ​

  • Explicit, real-space, two float32 textures' worth of state (u and v fit in one RGBA texture). A ping-pong with several substeps per frame inside one jit.gl.pix chain, so cost scales with substeps.
  • Stability margin from the presets (derived, not run): the Pearson preset has Dv dt / dx^2 = 2 * 0.2 / 25 = 0.016, far under the usual explicit limit of about 0.25 in 2D, so the stepper has headroom and VisualPDE's dt is chosen for accuracy, not stability. The default preset's dt was not read.
  • Grid size: VisualPDE runs about 330 to 700 cells across. Whether 256² is enough resolution for the spot and worm scale is the first thing the stepper spike has to answer.
  • Float32 stability near the dead states (u near 0) is unchecked.

Open questions ​

  1. Grid size and substeps per frame at 256² for a visibly lively pattern (stepper spike).
  2. Edge behavior: periodic wrap by default, or clamped (Neumann); G-edge-wrap is the known hazard.
  3. A feed/kill map by texture: how are the two channels scaled to the parameter ranges?
  4. Does a regime menu belong on f_gs or a shared "kinetics" menu with f_turing (ideas/f_turing.md)? The stepper would be shared either way.
  5. Name: f_gs is a placeholder.

Gate ​

P-pattern-gen (in .specify/gates.md). Menu home: PDE (G-menu).