Expand description
Flow — the typed interface between Data and Lanes.
A Flow is a per-domain, read-only presenter of the World. It runs
every tick during the Substrate Pass (before Lanes execute) in two steps:
select(read-only) — picks the entities relevant for this domain.project(read-only) — builds a typedViewpublished into theLaneBus. Lanes consume the view; they never query the World directly.
A Flow never mutates the World. Representation adaptation (AGDF memory
layout) is the Data layer’s own self-maintenance; semantic / gameplay
mutation is developer-authored (an opt-in DataSystem), never automatic
here. See .agent/rules.md — adapt the HOW, never the WHAT.
Each domain (Render, UI, Physics, Audio, Shadow, …) defines its own
Flow implementation. Adding a new domain costs one registration:
ⓘ
inventory::submit! {
khora_data::flow::FlowRegistration {
name: MyFlow::NAME,
domain: MyFlow::DOMAIN,
run: my_flow_runner_trampoline,
}
}Re-exports§
pub use audio::AudioFlow;pub use audio::AudioPlaybackUpdate;pub use audio::AudioPlaybackWriteback;pub use audio::AudioSourceSnapshot;pub use audio::AudioView;pub use physics::PhysicsFlow;pub use physics::PhysicsStepResult;pub use physics::PhysicsView;pub use render::RenderFlow;pub use shadow::ShadowFlow;pub use shadow::ShadowMatrices;pub use shadow::ShadowView;pub use ui::UiFlow;
Modules§
- audio
AudioFlow— projects the ECS audio domain into a per-tickAudioViewconsumed bySpatialMixingLane.- physics
PhysicsFlow— read-only projection of the physics domain.- render
RenderFlow— projects the ECS World into aRenderWorldfor the render lanes to consume from theLaneBus.- shadow
ShadowFlow— derives, per shadow-casting light, the view-projection matrix the shadow pass will use to render its depth slice.- ui
UiFlow— projects UI ECS data + text layout into a per-frameUiScenepublished into theLaneBus.
Macros§
- register_
flow - Convenience macro for declaring a Flow registration with the standard trampoline (single static instance, no per-frame allocation).
Structs§
- Flow
Registration - Registration entry for a
Flow— submitted by each concrete Flow implementation viainventory::submit!. - Selection
- A snapshot of entities selected by a
Flowfor the current tick.
Traits§
- Flow
- The typed interface between the Data layer and Lanes.
Functions§
- combine_
cache_ key - Folds an ordered sequence of cache-key ingredients (domain epochs,
bit-level hashes of runtime state, the World instance id) into a single
u64via the std hasher. Deterministic within a process, which is all a per-process view cache needs. - run_
flow_ cached - One Substrate-Pass execution of
flow, with view-cache support. This is the body of the [register_flow!] trampoline, extracted so the caching behaviour is a single, directly testable code path.