packages/rust/extensions/native-flow) accelerates the CPU-heavy components below. Under reference-mode the compiled path is the reference implementation and pure-Python is the byte-identical fallback — output is the same either way; native only changes wall-clock.
The gate
One env var,GOLDENFLOW_NATIVE, read in goldenflow/goldenflow/core/_native_loader.py:
GOLDENFLOW_NATIVE=auto(default, or unset) — run native for any component whose kernel symbol is present on the loaded wheel, except the known-divergent components below.GOLDENFLOW_NATIVE=0— force the pure-Python fallback everywhere.GOLDENFLOW_NATIVE=1— require native; raise if the kernel isn’t importable (the CI parity lane).
goldenflow._native (local dev / parity lane), then the distributed goldenflow_native._native wheel (pip install goldenflow[native]). When neither is importable, every path runs pure-Python unchanged.
Components
Each component maps to the native kernel symbol(s) itsauto call site invokes (the floor symbol first — a component is native-capable when any listed symbol is present, so an older wheel stays wheel-skew safe). A ✓ in Parity-signed marks a component that cleared the byte-exact sign-off recorded in _GATED_ON.
Kept pure-Python under
auto (GOLDENFLOW_NATIVE reference-mode): phone_validate. These carry (or could bind) a native symbol that is known to diverge from the pure-Python reference, so they stay on the fallback path until their parity battery is green — reachable only via GOLDENFLOW_NATIVE=1.
How parity stays honest
A component joins the native path only after a parity test proves its kernel is byte-identical (or integer-exact) to the pure-Python reference. CI runs aGOLDENFLOW_NATIVE=1 lane that builds the wheel and asserts native == pure-Python, and scripts/check_native_symbols.py reconciles the host’s kernel references against the crate’s wrap_pyfunction! exports so a referenced-but-unregistered symbol fails loudly. Because output is identical with or without the wheel, toggling the gate never changes a result — only speed.