← f_ notebook · ideas/f_rd_stepper_spike.md

f_rd_stepper_spike — can a real-space explicit PDE stepper run in a pix chain? ​

Status: 🔵 spike plan, not run. Captured 2026-11-28 (Claude offline, docs only). It gates f_gs, f_excitable, f_turing and (loosely) f_perona. Numbers below are derived from VisualPDE preset constants, not measured. No spike has been run, no Max bench taken.

The question ​

f_ks, f_cgl and f_wave_field are spectral solvers (DFT passes, 256² float32). The reaction-diffusion candidates are naturally real-space explicit: one Laplacian stencil plus a pointwise reaction per substep, in a ping-pong. The library has no module like that. Is it affordable, and at what grid size and substep count does it look alive?

What to find out ​

  1. Stability and resolution: for Gray-Scott at 256², what dt is stable and how many substeps per frame make the pattern visibly evolve at 30 fps. Compare the 256² pattern scale with VisualPDE's 330 to 700 cell grids.
  2. Stiff cases: Brusselator, Gierer-Meinhardt and Schnakenberg sit near the explicit 2D limit (Dv dt / dx^2 = 0.2 for Gierer-Meinhardt and Schnakenberg, from their presets); Gray-Scott does not (0.016 in the Pearson preset). Which of them need a smaller step than a per-frame budget allows.
  3. Float32: do states near zero (u near 0 in Gray-Scott) stay stable.
  4. Edges: periodic wrap versus clamp, and the G-edge-wrap hazard in pix chains.
  5. Cost per substep in a jit.gl.pix ping-pong, and whether several substeps can sit in one chain or need a multi-stage pix chain like the one P-confinement mentions.

Proposed method (per the f_ verification tiers) ​

  • Tier 1, NumPy mirror (offline, no Max, no API calls): a 256² explicit stepper for Gray-Scott with the observed a, b, Du, Dv; sweep dt, substeps and seeds; record stability limits and a look-alive measure (for example, defect or spot count over time, or frame-to-frame change). Repeat for one stiff kinetic (Gierer-Meinhardt) to bound the hard case. This follows the f_cgl_spike.py and f_nematic_spike.py practice; see ideas/f_cgl.md "Spike result".
  • Tier 2, bench (needs Max in the foreground; Matt's go, announce first): a scratch stepper patch and a cost measurement. Do not start before the NumPy numbers say it is worth it.
  • Tier 3, live look: Matt's.

Reuse to check before writing anything ​

docs/max-reference/temporal_synthesis_architecture.md and intraframe_multipass_architecture.md for the ping-pong and multi-pass patterns; the f_vf_lbm and f_vf_fluid stepping (real-space solvers already in the library, now in PDE) as the nearest precedent for explicit steps in a pix chain (their substep counts and cost were not read). Not read for this note: how those two modules iterate.

Stop rule ​

If Gray-Scott at 256² cannot reach a lively pattern in under about 4 ms per frame at a reasonable substep count (the f_ks and f_cgl costs are 2.4 and 3.5 ms), park the real-space family and keep only the spectral candidate (f_swift). Say so in .specify/gates.md.

Gate ​

P-pattern-gen.