← f_ notebook · ideas/f_solver_outlets.md

One solver, several outlets: a design note for demo-source generators ​

Status: 🔵 design sketch, not a spec. Captured 2026-11-27 (Claude offline, docs only), at Matt's request, after he asked what a new module near f_ks could look like if its job is to be good demo input. Nothing built or tried in Max. Facts about f_chladni, f_quasi and f_wave_field come from docs/f-reference/module-inventory.md and the first 30 lines of docs/f-reference/f_quasi.md; everything about what a new module would emit is inferred. Not a rule for any module.

The idea ​

A solver holds one state. It could hand downstream modules several faces of that state at once, each shaped for a different kind of consumer, so a demoer plugs one generator into many modules. The library already does this for some generators:

  • f_chladni: luma (nodal lines), vecfield (gradient), scalar (magnitude).
  • f_quasi: banded look, exact analytic vecfield, potential as a scalar; the doc says the three come "from one pass".
  • f_wave_field: luma and a vecfield. f_vf_lbm outputs a vecfield.

f_ks has one outlet (luma replicated to RGB, A = 1).

When does an extra outlet earn its place? (a heuristic, not a rule) ​

Other modules can already derive some faces from a luma: f_vf_fieldmap makes a vecfield from any scalar, f_tf_tensormap makes a tensor. So an outlet is worth adding when the solver can give something the derivation loses, distorts or pays for:

FaceDerivable from a luma?What the solver adds
Vecfield (gradient)Yes, via f_vf_fieldmapExactness (no central-difference noise), one pass instead of two; f_quasi ships an exact gradient
TensorYes, via f_tf_tensormap (box-smoothed, so it blurs)The true tensor from the state, which a smoothed image estimate cannot recover (f_nematic.md)
Hue / phaseNo: a complex or multi-component state loses it in lumaThe only way to get color that carries structure (f_cgl.md)
Amplitude or magnitudePartlyA clean scalar separate from phase
Binary maskTrivially (a threshold)Probably little; an outlet may not be worth it, a mode might
Motion (drift)NoA solver that advects its pattern could report its own velocity as a vecfield

A sketch for each candidate ​

Interpretive; every row is untried.

CandidateOutlets that earn a placeNotes
f_ks-like (existing)luma; maybe an exact gradient vecfieldThe state is one real scalar: little beyond luma and gradient
Complex Ginzburg–Landaulook (hue from phase, luma from amplitude); amplitude scalar; phase-gradient vecfieldPhase gradient is singular at a core and wraps: decide whether to emit it (f_cgl.md, open questions 1 and 2). A consumer wanting phase needs cos and sin, not raw
Nematic generatorraw tensor; packed tensor; schlieren look; S scalarNo vecfield outlet: forbidden by the tensor-type rule (f_nematic.md)
Excitable media / Gray–Scottlook; two-species scalar; threshold maskA mask may be a mode

Practical constraints to check [inferred; unchecked] ​

  • Cost. f_quasi makes three outlets in one pass. Whether a solver with a 256² state gets extra outlets nearly free (computed from the same read) or each needs a codebox stage was not examined. f_ks and f_wave_field run at 256² and are shown at the render size, so each outlet is a resample; f_ks's inventory entry says nothing on outlets.
  • Type contracts. A vecfield outlet must follow f_vecfield_type.md (float32, RG = XY, 0.5 = zero); a tensor outlet f_tensor_type.md. Anything else is a plain texture.
  • Bypass. The inventory's convention is that a generator's bypass outputs are neutral per outlet (neutral vecfield, black look). Each new outlet needs a stated bypass value.
  • Panel. More outlets are free on the panel, but each new mode or dial adds to a dense panel (G-ui-density in .specify/gates.md: only the title was read).
  • jit.fx precedent (checked 2026-11-27, offline docs). ge.pattern has a mode that packs cell ID, distance and cell-center UVs into one texture's channels, and the v8 wrappers declare a single outlet, so jit.fx hands over several faces by channel packing. Separate typed outlets are the f_ convention (f_quasi); they keep the vecfield and tensor contracts intact, which packing would not.
  • Unconnected consumers. Several consumers treat an unconnected input as black, which decodes badly for tensors (f_tensor_type.md, consumer rule 5). A generator that always feeds them avoids the trap.

Dials that set properties modules care about ​

The same demo-source thinking applies to dials: f_ks already has scale. Properties that consumers react to include orientation coherence, spectral slope (how many scales at once), drift speed and color richness. A dial that maps to such a property, instead of to a solver coefficient, makes the module faster to demo with. This is a design principle for new modules, not something to retrofit.

Open questions ​

  1. Does the outlet set belong to the module (fixed) or to a mode menu (the same outlets change meaning)? The library's convention is fixed outlets with neutral bypass values.
  2. Is an exact gradient from the solver worth an outlet on f_ks, or is f_vf_fieldmap fine for that case? Compare on a live look before deciding.
  3. Which of these faces would Matt actually patch in a demo? That is the real test, and it is not one I can answer.

f_cgl.md, f_nematic.md, axes_of_investigation.md, f_quasi.md (note the f_quasi doc is docs/f-reference/f_quasi.md), docs/f-reference/f_vecfield_type.md, docs/f-reference/f_tensor_type.md.