pub struct SimulationService {Show 38 fields
pub scene: GameObjectScene,
pub kernel: Option<CausalComputeKernel>,
pub encoder: Option<CausalEngineEncoder>,
pub bridge: Option<QuantumBridge>,
pub last_bridge_packet: Option<BridgePacket>,
pub decoherence: Option<Decoherence>,
pub oracle: Option<Oracle>,
pub decoherence_fields: Vec<DecoherenceField>,
pub last_result: Option<KernelResult>,
pub last_descriptor: Option<SuperBodyFrameDescriptor>,
pub player_object_id: u64,
pub particle_offsets: Vec<[f32; 3]>,
pub observer: SuperpositionObserver,
pub journal: Vec<SimulationJournalEntry>,
pub console: Vec<String>,
pub mode: SimulationMode,
pub readiness: RuntimeReadiness,
pub frame: u64,
pub tick: u64,
pub quantum_cull_radius: f32,
pub elapsed_time: f32,
pub gate: Option<DreamGate>,
pub limiter: Option<LoomLimiter>,
pub budgeter: Option<LoomBudgeter>,
pub ledger_rx: Option<LedgerLaneReceiver>,
pub causal_observer_rx: Option<CausalObserverLaneReceiver>,
pub causal_observer_tx: Option<CausalObserverLaneSender>,
pub active_zone_index: usize,
pub metaphor_profile: MetaphorProfile,
pub active_particle_count: f32,
pub coherence_target: f32,
pub coherence_current: f32,
pub gather_active: bool,
pub emit_strength: f32,
pub universe_snapshot_rx: Option<Receiver<FieldSnapshot>>,
pub universe_update_tx: Option<Sender<ClientUpdate>>,
pub universe_client_id: u64,
pub universe_connected: bool,
}Expand description
SimulationService — the DreamRealityContainer.
Fields§
§scene: GameObjectSceneActive scene objects.
kernel: Option<CausalComputeKernel>CausalComputeKernel — synced from encoder for collision/POI checks.
encoder: Option<CausalEngineEncoder>CausalEngineEncoder — authoritative encode boundary (wraps SuperBodyController → Kernel).
bridge: Option<QuantumBridge>QuantumBridge — formal CPU→GPU transfer with DreamMemory + SacredSeal.
last_bridge_packet: Option<BridgePacket>Last bridge packet for decoder path (app.rs consumes this).
decoherence: Option<Decoherence>SDK Decoherence facade (input → Weave → Oracle).
oracle: Option<Oracle>Oracle — SacredPath validation + BLAKE3 attestation router.
decoherence_fields: Vec<DecoherenceField>Spatial decoherence zones from scene tags.
last_result: Option<KernelResult>Last kernel tick result for rendering.
last_descriptor: Option<SuperBodyFrameDescriptor>Last SuperBody frame descriptor for GPU upload (backward compat).
player_object_id: u64Player entity ID (CanonicalObserverObject).
particle_offsets: Vec<[f32; 3]>Pre-computed sphere offsets for particle particles.
observer: SuperpositionObserverObserver context for quantum culling.
journal: Vec<SimulationJournalEntry>Session journal.
console: Vec<String>Console messages (for UI display).
mode: SimulationModeSimulation mode.
readiness: RuntimeReadinessReadiness signal — input is gated on this.
frame: u64Current frame index.
tick: u64Total ticks processed.
quantum_cull_radius: f32Quantum cull radius in meters.
elapsed_time: f32Accumulated elapsed time in seconds.
gate: Option<DreamGate>DreamGate — high-throughput Weave validation and dispatch.
limiter: Option<LoomLimiter>LoomLimiter — per-frame mutation rate limiting.
budgeter: Option<LoomBudgeter>LoomBudgeter — hardware-derived resource budgets.
ledger_rx: Option<LedgerLaneReceiver>LedgerLane receiver for cold-path draining.
causal_observer_rx: Option<CausalObserverLaneReceiver>CausalObserverLane receiver for GPU frame cold-path draining.
causal_observer_tx: Option<CausalObserverLaneSender>CausalObserverLane sender (stored here for wiring to renderer).
active_zone_index: usizeActive topology layer index (0-9).
metaphor_profile: MetaphorProfileMetaphor profile for the bridge evaluator.
active_particle_count: f32Active particle count (decremented by POI siphon, regenerated over time).
coherence_target: f32Form coherence target: 1.0=Cohere (fibonacci), 0.0=Wave (sinusoidal). TAB cycles.
coherence_current: f32Current coherence — smooth-lerped toward target (0.5s transition).
gather_active: boolGather mode active (Ctrl held).
emit_strength: f32Primary action emit strength [0,1].
universe_snapshot_rx: Option<Receiver<FieldSnapshot>>Universe connection: snapshot receiver (from QuantumServer).
universe_update_tx: Option<Sender<ClientUpdate>>Universe connection: update sender (to QuantumServer).
universe_client_id: u64Universe client ID.
universe_connected: boolWhether universe is connected.
Implementations§
Source§impl SimulationService
impl SimulationService
Sourcepub const DEFAULT_QUANTUM_CULL_RADIUS: f32 = 9.14
pub const DEFAULT_QUANTUM_CULL_RADIUS: f32 = 9.14
Default quantum cull radius: 9.14m (30ft).
Sourcepub fn new(scene_name: &str, mode: SimulationMode) -> Self
pub fn new(scene_name: &str, mode: SimulationMode) -> Self
Create a new simulation service.
Sourcepub fn input_enabled(&self) -> bool
pub fn input_enabled(&self) -> bool
Whether input is enabled. Requires encoder (authoritative pipeline).
Sourcepub fn connect_universe(&mut self) -> Sender<()>
pub fn connect_universe(&mut self) -> Sender<()>
Connect to a universe server (spawns background kernel thread). Returns the shutdown sender so the caller can stop the universe.
Sourcepub fn set_coherence_target(&mut self, t: f32)
pub fn set_coherence_target(&mut self, t: f32)
Set form coherence target. 1.0=Cohere, 0.0=Wave.
Sourcepub fn set_gather(&mut self, active: bool)
pub fn set_gather(&mut self, active: bool)
Set gather mode.
Sourcepub fn set_emit_strength(&mut self, s: f32)
pub fn set_emit_strength(&mut self, s: f32)
Set primary action emit strength.
Sourcepub fn initialize(
&mut self,
scene: GameObjectScene,
spawn_pos: [f32; 3],
particle_count: u32,
) -> Result<(), String>
pub fn initialize( &mut self, scene: GameObjectScene, spawn_pos: [f32; 3], particle_count: u32, ) -> Result<(), String>
Initialize the simulation from a scene and spawn position. Runs the 7-step initialization sequence with CausalComputeKernel + SDK Decoherence.
Returns Ok(()) if all steps pass, Err with failure description.
Sourcepub fn tick(&mut self, packet: &InputPacket) -> Option<KernelResult>
pub fn tick(&mut self, packet: &InputPacket) -> Option<KernelResult>
Process one simulation tick via single-encoder authority pipeline.
Round trip (THE_BRAIDED_PATH): (1) Build Input Weave → submit to DreamGate (2) Encoder tick (single authority: Encoder → SuperBody → Kernel → AttentionSolver) (3) Build Observation + Locomotion Weaves → submit to DreamGate (4) Gate dispatch: spindle → SacredPath → scene (5) Bridge: encode → GPU-ready BridgePacket (DreamMemory + SacredSeal)
Returns the KernelResult, or None if input is not enabled.
Sourcepub fn check_collisions(&self, threshold: f32) -> Vec<(u64, f32)>
pub fn check_collisions(&self, threshold: f32) -> Vec<(u64, f32)>
Check for collisions with isWall/isCollider objects within threshold.
Sourcepub fn check_poi_proximity(&self, radius: f32) -> Vec<(u64, f32)>
pub fn check_poi_proximity(&self, radius: f32) -> Vec<(u64, f32)>
Check POI proximity. Returns Vec of (object_id, distance).
Sourcepub fn tick_poi_interactions(&mut self)
pub fn tick_poi_interactions(&mut self)
Check POI proximity and dispatch interaction weaves for nearby POIs.
Sourcepub fn tick_collisions(&mut self)
pub fn tick_collisions(&mut self)
Apply collision pushback from wall/collider objects.
Sourcepub fn set_metaphor_profile(&mut self, profile: MetaphorProfile)
pub fn set_metaphor_profile(&mut self, profile: MetaphorProfile)
Set the active metaphor profile and propagate to the bridge evaluator.
Sourcepub fn cycle_metaphor(&mut self) -> &'static str
pub fn cycle_metaphor(&mut self) -> &'static str
Cycle to the next metaphor profile (Wave → Fibonacci → Stream → Wave). Returns the name of the newly active profile.
Sourcepub fn end_session(&mut self)
pub fn end_session(&mut self)
End the simulation session.
Auto Trait Implementations§
impl !Freeze for SimulationService
impl !RefUnwindSafe for SimulationService
impl Send for SimulationService
impl !Sync for SimulationService
impl Unpin for SimulationService
impl UnsafeUnpin for SimulationService
impl !UnwindSafe for SimulationService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more