← f_ notebook · ideas/cores_next_steps.md

f_cores: what comes next (five steps, captured 2026-11-29) ​

Status: ⚪ planned, nothing started. Captured by Claude (offline) on 2026-11-29 from a conversation with Matt, right after f_cores was committed (ba67aa4, built 6bcc797). Matt chose to capture all five for the next session; he has not picked an order. Claude's lean: 1, then 2, then 3; hold 4 and 5.

Read first, in a fresh session: CLAUDE.md, HANDOFF.md, .specify/plan.md, .specify/gates.md, then this note. For the module itself: docs/f-reference/f_cores.md; for why it exists: ideas/field_object_bridge.md and ideas/f_defects_spike.md (the spike keeps its historical name). Do not re-derive the evidence below.

Where things stand (do not re-derive) ​

f_cores (a shared reader that marks the swirl centers, called defects in physics, of a signed 2D field) is built, benched on the GPU and looked at live by Matt:

  • Tier 1 mirror 16/16; codebox bench 7/7; module contract bench 2/2, re-run after the rename (tests/logs/20261129-002459-bench.log, 20261129-002505-bench.log).
  • NumPy tier: exact on 8,188 cores across f_cgl and f_nematic; thresholding |A| or |q| is not a substitute in busy fields.
  • Matt, live, 2026-11-28 and 2026-11-29: marks sit on the f_cgl cores and come in pairs; out0 into f_vf_stamp reads as worth keeping; a derived vecfield gave marks he found "interesting" (which one was not recorded); on f_nematic Plus marks travel farther than Minus; the panel and the helpfile look good.
  • Known limits: the input must be at the render size; an exact zero vector has an undefined winding; the spread is capped at 16 texels each side (about 1.5% of the height at 1080p); no count, no tracking, no analytic-source check. Cost: the spread at its cap is about 2.1 ms at 1080p (resolved), everything else is an upper bound at the bench floor.
  • Open decisions that are Matt's: the menu category (G-menu; "Adapters" is provisional), and whether f_cores moves to .specify/stable/.

1. Close out (lean: first; small) ​

What is left after the commit:

  • Update ideas/field_object_bridge.md with what the module established. Open questions 1 (one shared reader: yes), 2 (marks only in v1; a count is item 3), 3 (tracking: not needed so far), 5 (derived vecfields: "interesting", unexamined) have answers or partial answers; section A's "inferred" items on the detector are now observed.
  • Preflight Part 2a: a fresh-context reviewer of the helpfile and docs/f-reference/f_cores.md (module-preflight skill: review-rubric.md and review-procedure.md beside it). Needs a subagent and Matt's go; state the cost first. Part 2b: the console-lines half (the helpfile look is done).
  • tests/run.sh -q tests/build/test_gates.py with Matt's go (CLAUDE.md: before the last commit of a session).
  • Optional: the resolved cost of the count chain is done (0.25 ms per frame at 1080p, 2026-11-29); still optional: the spread rows at size 1% are upper bounds; the Kinem (analytic) source check on f_nematic; a look at what a derived vecfield's marks mean (sources, sinks, saddles) and which field Matt used.
  • Housekeeping: README.md Demos row demo_cgl still says "unbuilt" though package/examples/f_demo_cgl.maxpat was committed (Matt's patch, 2026-11-28, ba67aa4); triage with Matt. f_cgl User Story 6's Texture seed half is open and unbuilt.

Progress 2026-11-29 (Claude, offline): bridge note updated (questions 1, 2, 3, 5; section A item 3 now observed); preflight Part 1 run, 9 ok, 0 RED, 0 exempt (build/py.sh build/preflight.py f_cores); test_gates.py 5/5 (tests/logs/20261129-115532-offline.log). Still owed: Part 2a review (Matt's go, cost stated), Part 2b console lines (Matt), the demo_cgl Demos row (Matt), the optional items.

2. A demo, demo_cores (lean: second) ​

Goal: test whether the loop is performable, not just correct: a field's own cores drive a second field. Chain (from Matt's T031 look, details not recorded): f_cgl or f_nematic → f_cores out 0 → f_vf_stamp (the stamp texture) → f_vf_advect and/or f_vf_fluid → a look. Fills the README demo_cores stub.

  • Read first (CLAUDE.md): .specify/demos/spec.md (concepts and intent), the README Demos table and one or two existing demos in package/examples/ for the file shape (.maxpat plus a .json preset), docs/f-reference/f_vf_stamp.md (it needs a held press, so a continuous demo needs a decision), f_vf_advect.md, f_vf_fluid.md.
  • Questions for Matt: which source (f_cgl or f_nematic; nematic Plus marks are the comets that move); which look; what he used in T031; whether Charge = Plus only; mark size for stamping (wider discs than the default?).
  • Verification: tier 3 only (Matt's look; demos have no bench). Update the Demos row stage (stub, built, looked) and run tests/build/test_launch.py; check whether a demo-coverage test exists before adding the patcher.
  • Risk: the held press; the marks at the render size are small for stamping.

Draft 2026-11-29 (Claude, offline; read: .specify/demos/spec.md, docs/f-reference/f_vf_stamp.md, f_vf_advect.md and f_vf_fluid.md heads, f_demo_cgl and f_demo_fluid box lists; nothing built). Chain: source (f_cgl out 1, or f_nematic out 1) -> f_cores out 0 -> f_vf_stamp inlet 0 (a stamp 1 message held on, since a press is the only trigger and there is no stamp on load) -> stamp out 0 (ink) to f_vf_advect inlet 0, stamp out 1 (impulse) to f_vf_fluid -> fluid out to f_vf_advect inlet 1 -> vs_output; the source also on a second vs_output or a mixer for the A/B. Existing demos are vs_render, vs_presets and pattrstorage plus bpatchers (14 boxes); f_demo_cgl is the closest template. Built 2026-11-29 (Claude, offline, generated by a scratch script, never opened in Max): package/examples/f_demo_cores.maxpat, source f_nematic (Matt's pick); defaults taken without asking: stamp 1 from a loadbang, both charges. Not checked: that it opens, wiring, that the chain looks like anything. README row demo_cores is now untriaged. Looked at (Matt, live, 2026-11-29): "the patch works great" (opens, wiring right; what the look is like was not recorded). Item 2 done; items 1 and 2 closed, item 3 is next, and P-cores-sibling-reader waits on it. Coverage: README row demo_cores already exists as a stub; no coverage test was found by name (not searched further).

an.mean check (2026-11-29, Claude, offline from source, no bench run): jit.fx.an.mean averages texel pairs per stage and is inexact at odd stages (1080 and 1920 both hit one), so a count of marks from it would be off at render sizes (see docs/max-reference/jit_fx_vs_ideas.md). Jitter being always present removes the dependency concern but not this. Lean for item 3 now: our own halving passes that sum (not average) with out-of-range reads as 0, giving an exact integer count in float32 up to 2^24 at any size. A bench run of an.mean itself would only confirm the border behavior (inferred) and is not needed for that choice.

Spec written 2026-11-29, built, then MERGED into f_cores as outlets 2 to 5 (Matt: "merge it"): record in .specify/stable/f_cores/count/ (spec, plan, tasks).

Matt, 2026-11-29 (chat): outlet type = 1x1 float32 texture; events = both triggers and a smoothed rate.

3. A count and event outlet (lean: third; the best next module) ​

Goal: make "fields as sources of events" real: defect density as a control signal, and pair births and deaths as triggers. f_cores spec User Story 5 (P3, not built).

  • Facts from the spike: the count differs by regime: constant zero in phase turbulence, near constant when settled, busy in defect turbulence (changed on about 65% of steps by about 2, consistent with pair events). In dense fields a trigger stream is dense.
  • Design choices for Matt: the outlet type (a 1×1 float32 texture like f_lfo, or a CPU float message); events as triggers or rates; smoothing; what consumes it.
  • Ways to get the count (check, do not assume): (a) jit.fx.an.mean outputs a 1×1 texture (docs/max-reference/jit_fx_vs_ideas.md; a Jitter Tools dependency, so read docs/max-reference/jit_fx.md and packaging.md first); (b) halving passes of our own (about 8 at 256², 11 at 1080p, each cheap; float32 sums of 0/1 stay exact, but averaging on non-power-of-two sizes was not checked); (c) GPU-to-CPU readback (docs/max-reference/jit_gl_asyncread_architecture.md; adds latency and a CPU stage). Births and deaths need the previous frame's count, so the module becomes temporal (docs/max-reference/temporal_synthesis_architecture.md).
  • Read first: the vsynth-bpatcher skill's references/signal-model.md (a control signal is a texture; which modules process a 1×1 control texture; frame-counted time), then f_lfo and f_util_profile as precedents.
  • Verification: NumPy mirror (count = sum of marks; closed forms), bench against it, and the count's exactness on odd sizes.
  • Risk: the reduction is new to this library; render-size input in dense fields over-counts by up to 3% (nematic, scale 192), so the outlet inherits that.

4. A sibling reader for scalar fields (held) ​

Goal: show the reader pattern generalizes beyond topological defects: local maxima or minima of any scalar field as objects (droplets in f_vf_ch, blobs, coherent vortices in f_vf_fluid from vorticity or the Okubo-Weiss field (from memory, not looked up)).

  • First step: a NumPy spike in the shape of ideas/f_defects_spike.md (question, what to find, tiers, stop rules): a 3×3 non-maximum-suppression detector against the objects a blob labelling finds, on f_vf_ch and on a scalar made from f_cgl's amplitude. Cheap, a stencil, no scatter.
  • Name carefully: the lesson of f_cores is that physics words read as jargon in a video menu; pick a plain name with Matt before the build.
  • Parked: P-cores-sibling-reader in .specify/gates.md; reopens when items 2 and 3 are done, or when Matt says so.
  • Spec written 2026-11-29 (Claude, offline; Matt: "Start item 4, write the spec"): ideas/f_peaks_spike.md (question, overlap check, what to find, tiers, stop rules, decisions D1 to D6). Nothing run; gate reopened.

5. Objects back into fields: a particle layer (held) ​

Goal: the first stateful object module: particles pushed by a vecfield, drawn back into a texture. The classic case is Chladni sand: particles slide down f_chladni outlet 2 (the gradient toward the nodal lines) into the figure. Opens the "agents" and "objects with no field" sections of ideas/field_object_bridge.md.

  • Read first: docs/max-reference/temporal_synthesis_architecture.md and intraframe_multipass_architecture.md (ping-pong and multi-pass), docs/f-reference/f_caustic.md (forward scatter into a float32 capture: the only scatter precedent here), f_vf_advect.md, f_chladni.md.
  • Risks: a position-in-texture ping-pong plus scatter is the same shape of risk as ideas/f_rd_stepper_spike.md (stop rule: a cost budget in ms); respawn and boundary rules; a random start makes the bench non-deterministic, so seed it; particle count against cost.
  • Parked: P-cores-particles; reopens when item 3 shows the events idea earns its place, or when Matt says so.
  • Spec written 2026-11-29 (Claude, offline; Matt: "Item 5, write the spec"): ideas/f_particles_spike.md (question, overlap check, what to find, tiers, stop rules, decisions D1 to D7). Nothing run; gate reopened.

Not planned (held in the open) ​

Tracking defect identity across frames (a CPU stage, unmeasured); a raw-tensor input decode; analytic (Kinem) source verification (inside item 1's optional list); the sections of the bridge note on graphs, grammars and integer structure (system class D, no field to read out).

ideas/field_object_bridge.md, ideas/f_defects_spike.md, .specify/stable/f_cores/ (spec, plan, tasks and the Record), docs/f-reference/f_cores.md, .specify/plan.md, HANDOFF.md, .specify/gates.md (G-cores-next, P-cores-sibling-reader, P-cores-particles).