Chapter 32
runtime/step — step mesh
github.com/openfluke/welvet/runtime/step✅
Why it exists
Spatial feedback (remote links) needs a discrete-time mesh where every cell updates from a double buffer — different from a decoder wavefront. Cross-numeric train also needs the same mesh with weight DType ⊥ activation Tensor[T].
What it is
State[T], StepForward/StepBackward/StepApplyTween / StepMesh across the grid for all wired Ops × dtype × quant × CPU/SIMD. W2A Cross-Numeric Train: polyops.AllKinds() × weight dtype × act host (smoke ~21×7×5 ≈ 735; full ~21×34×15 ≈ 10.7k) — asserts no retained f32 master after StepMesh. Stack Step* is a different clock: IsLineStep / TrainLine (1D pipe) — see §67.
Two clocks named Step
This package is the volumetric mesh: every grid cell hops from a double buffer. MeshBP / MeshTween / MeshTweenChain call it.
Stack Step* (IsLineStep) is a 1D systolic pipe on a Sandwich — not this mesh.
One sample enters child 0 per TrainStackMSE tick; every in-flight sample advances one layer; the output/train event is the sample that entered depth ticks ago. Fill ticks do not update. Serve stays a full ForwardStack. Mesh* still needs a Grid. Named updates: §67.
Go example
cd welvet/examples/32-step && source ../env.sh && go run .package main
import (
"fmt"
"github.com/openfluke/welvet/architecture"
"github.com/openfluke/welvet/core"
"github.com/openfluke/welvet/layers/dense"
"github.com/openfluke/welvet/runtime/step"
)
func main() {
g := architecture.NewGrid(1, 1, 1, 1)
l, _ := dense.New(4, 4, core.ActivationLinear, core.DTypeFloat32)
_ = dense.Place(g, 0, 0, 0, 0, l)
st := step.New[float32](g)
_, err := step.StepForward(g, st, false)
fmt.Println(err)
}
Output
<nil>