flybrain/services/flysim/crates/flysim/Cargo.toml
acamilo d3fa7908ec flysim: FLY_FEED_VIA=bus publishes every snapshot on an embedded flybus router
feed.via (FLY_FEED_VIA, default direct) and feed.bus_dir (FLY_BUS_DIR,
default /run/fly/bus). In bus mode flysim does not bind the feed port: it
starts a router on its own two-thread runtime with a closed policy (flysim
may publish fly.feed.snapshots, fly-edge may only subscribe to it), listens
for the edge on <bus_dir>/edge.sock, and a publisher task copies each snapshot
out of the watch slot onto the latest-retained topic: frame, audio and spikes
as sealed artifacts, the header as the envelope payload, or as a header
artifact past 48 KiB. The sim thread still only writes its watch slot, so a
slow bus costs snapshots on the bus and never a frame of the loop.

feedbus holds both halves of the encoding, publish and receive, and the
limits sized for the real 122,367-byte snapshot. Two counters are new:
fly_bus_published_total and fly_bus_publish_failures_total.
2026-09-23 11:41:28 +00:00

63 lines
2.1 KiB
TOML

[package]
name = "flysim"
version.workspace = true
edition = "2024"
rust-version.workspace = true
license.workspace = true
publish = false
description = "The fly brain and its Game Boy, as a service: snapshot feed, control API, checkpoints."
[lib]
name = "flysim"
path = "src/lib.rs"
[[bin]]
name = "flysim"
path = "src/main.rs"
[features]
# The LIF tick on the GPU: a passthrough to `flybrain-core/cuda`, so a release build can carry
# the backend without naming the inner crate on the command line
# (`FLY_CARGO_FEATURES=cuda infra/build/build-flysim.sh`). Off by default.
#
# Compiling it in does not turn it on. The backend attaches only when `FLY_LIF_CUDA=1` is in
# the process environment, and `cudarc` is built with `dynamic-loading`, so a CPU-only run of a
# CUDA-capable binary never opens `libcuda` — `ldd` on it lists no CUDA library at all. The
# compatibility string is unaffected, because the GPU tick is bit-exact with the CPU one
# (`infra/docs/lif-cuda-spike.md`, `infra/docs/cuda-on-dev.md`).
cuda = ["flybrain-core/cuda"]
[dependencies]
flybrain-core = { path = "../flybrain-core" }
flybrain-gb = { path = "../flybrain-gb" }
flybus = { path = "../flybus" }
anyhow = "1.0"
axum = { version = "0.8", features = ["ws"] }
clap = { version = "4.5", features = ["derive"] }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { version = "1", features = [
"rt-multi-thread",
"net",
"sync",
"time",
"signal",
"macros",
] }
toml = "0.9"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
unicode-normalization = "0.1"
[dev-dependencies]
# The legacy profile's pinned identities (`tests/legacy_profile_identity.rs`): test-only, so the
# service itself does not link the session types.
fly-session-types = { path = "../fly-session-types" }
futures-util = "0.3"
# `default-features = false` drops the remote-reference resolver (and with it reqwest and a
# TLS stack): `packages/feed/src/schema.json` is self-contained, so nothing has to be fetched.
jsonschema = { version = "0.36", default-features = false }
tempfile = "3"
tokio-tungstenite = "0.29"
tower = { version = "0.5", features = ["util"] }