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.
58 lines
2.3 KiB
TOML
58 lines
2.3 KiB
TOML
[package]
|
|
name = "fly-legacy-session"
|
|
version.workspace = true
|
|
edition = "2024"
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
publish = false
|
|
description = "The live fly's composition on the session framework: the pokered-macros-v1 task and executor, the FLYSIM01 import, the parity harness against the legacy loop's FLY_TRACE, and the flysim-session service."
|
|
|
|
[lib]
|
|
name = "fly_legacy_session"
|
|
path = "src/lib.rs"
|
|
|
|
# SERVE-01: the session runtime as the live service, a drop-in for `flysim`.
|
|
[[bin]]
|
|
name = "flysim-session"
|
|
path = "src/bin/flysim-session.rs"
|
|
|
|
# SHADOW-01: the session runtime run beside the live fly (`infra/units/flyshadow.service`).
|
|
[[bin]]
|
|
name = "fly-shadow"
|
|
path = "src/bin/fly-shadow.rs"
|
|
|
|
[features]
|
|
# The LIF tick on the GPU (GPU-02), for `flysim-session` and `fly-shadow`: the same switch as
|
|
# flysim's, so `FLY_CARGO_FEATURES=cuda infra/build/build-flysim.sh` builds every binary with it.
|
|
cuda = ["fly-session/cuda", "flysim/cuda"]
|
|
|
|
[dependencies]
|
|
# The session framework and its legacy workers (AGENT-01, ENV-01).
|
|
fly-session = { path = "../fly-session" }
|
|
flybus = { path = "../flybus" }
|
|
# The unchanged legacy engine the task and executor run: flysim's macro layer, flybrain-gb's
|
|
# palette, macro executor, PokeState, reward adapter and ratchet, read through MEM-01's image.
|
|
# flysim is a library dependency only; nothing here changes the service it builds. SERVE-01's
|
|
# `flysim-session` runs the session behind flysim's own listeners (`flysim::serve`).
|
|
flysim = { path = "../flysim" }
|
|
flybrain-gb = { path = "../flybrain-gb" }
|
|
flybrain-core = { path = "../flybrain-core" }
|
|
serde_json = { workspace = true }
|
|
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync", "time", "macros", "signal"] }
|
|
# The service entry point (SERVE-01), with flysim's own versions of each.
|
|
anyhow = "1.0"
|
|
clap = { version = "4.5", features = ["derive"] }
|
|
toml = "0.9"
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
[dev-dependencies]
|
|
# CTRL-01: the service contracts with the control API on the bus (`tests/service_parity.rs`).
|
|
fly-control-edge = { path = "../fly-control-edge" }
|
|
tempfile = "3"
|
|
axum = "0.8"
|
|
futures-util = "0.3"
|
|
tokio-tungstenite = "0.29"
|
|
tower = { version = "0.5", features = ["util"] }
|
|
# EDGE-02: the session runtime serves the feed over the bus (tests/feed_bus.rs).
|
|
fly-edge = { path = "../fly-edge" }
|