Flow coordinates and the reference regression

Flow uses array-axis order throughout the native integrator. For mass shaped [batch, sx, sy, channel], flow component 0 advances sx and component 1 advances sy. A positive linear ramp has a positive Sobel derivative (8 for unit spacing). Flow ascends growth potential and descends mass density, with the configured density gate determining the mixture.

The earlier implementation reversed both Sobel signs and built its transport position grid in the opposite axis order. The author uses default NumPy/JAX meshgrid (xy) and then stacks [Y, X]; the native helper already uses ij indexing and must stack [X, Y]. Metal reproduced the same cross-axis transport. This creates diagonal anisotropy even after a single step. A transpose test alone misses it: the crossed-axis operator commutes with transposition.

The correction changes trajectories. Earlier seeds, search scores and capacity results describe the earlier dynamics and must retain their executable/source provenance. Replay them before interpreting them under the corrected engine. Positive obstacle height now produces negative growth potential; signed user-supplied growth-potential fields retain their literal sign. The additive QD24 update does not use this transport operator and is unchanged.

Checks

FlowLeniaSpatialConventionTests checks signed ramps and transport of a unit impulse on both axes, with rectangular grids and wall/torus boundaries. FlowLeniaInteractiveMetalTests checks quarter-turn and reflection symmetry for MLX/Metal, fixed/embedded parameters, and independent author trajectories. The pre-correction engine fails the ramp, transport and symmetry checks.

The fixture Tests/LeniaCoreTests/Fixtures/flowlenia-author.json was generated by the author’s code at commit dce428c, using JAX 0.6.2 and Equinox 0.12.2 on CPU. It contains an asymmetric two-channel input and the full fields after one and eight steps, plus all parameters. Native comparison uses the matching Colab kernel profile, per-channel alpha, zero-padded gradient, wall boundary, and unclipped pre-integration flow. This checks a matched configuration; it does not equate every named native profile with the author’s current defaults.

Regenerate from a clean checkout of that reference commit:

uv run --with jax==0.6.2 --with equinox==0.12.2 python analysis/generate_flow_reference_fixture.py \
  --reference-checkout /path/to/FlowLenia \
  --output Tests/LeniaCoreTests/Fixtures/flowlenia-author.json
swift test -c release --filter 'FlowLeniaSpatialConventionTests|FlowLeniaInteractiveMetalTests'

The full validation also found and aligned three backend details: Flow channel sums use explicit Float32 reduction instead of potentially reduced-precision matmul; MLX excludes the same external food/chemotaxis channels from density as Metal; and the embedded-parameter weighted average uses the same added epsilon in both backends, including nearly empty cells. Positive circular obstacle heights lower the growth potential. These are covered by the reference, repulsion, search-food and search-mutation tests.

The selected validation run passed 76 tests. Both MLX execution paths and Metal matched the author fixture with maximum absolute field error below 3.85e-6 at one and eight steps. These are short-horizon numerical checks, not a promise of identical long trajectories on every platform.