LifNetwork::step_frame runs a game frame's ticks in one call and ORs every
tick's spikes into the transition's bitset. On the CPU it is exactly the
one-tick loop the session ran; on the GPU it is one batch, with membrane
and refractory left on the device (device-owned state): per frame only the
noise draws, visual drive and plastic gains go up and the spike lists come
down, instead of 1.4 MB per tick (about 24 MB per frame) with the old
step(1) loop and per-batch host sync.
- LifBackend (cpu / cuda:<ordinal>) from FLY_LIF_CUDA / FLY_LIF_CUDA_DEVICE,
set_backend, configure_sweep (set_sweep_plan without the test hook),
sync_host, host_state_current, try_step, take_backend_fault.
- export_state downloads the device arrays itself while the host copy is
stale, so no capture can read old values; the session syncs before
State.Capture.
- A CUDA failure detaches the backend: if the host state was current the
frame continues bit-exactly on the CPU, otherwise the agent fails and a
restore in that worker runs on the CPU. Warm-up no longer panics.
- The legacy agent worker picks its backend explicitly and refuses a GPU it
cannot have (no feature, no device) at Agent.Initialize instead of
running the CPU under a GPU label. The FLY_LIF_CUDA hook in
set_sweep_plan stays for the golden suite and the legacy loop.
- cuda passthrough features on fly-session and fly-legacy-session, so
FLY_CARGO_FEATURES=cuda reaches flysim-session, fly-shadow, fly-session.
- Tests: step_frame vs the one-tick loop (state and bitset, 1 and 3
threads), the backend switch; cuda_exact frame mode; a cuda-feature
session test (FAFB, rollback, restore, checkpoints) against the CPU
reference.