pub struct DccService { /* private fields */ }Expand description
The Dynamic Context Core service.
Manages the cold-path analysis loop, GORNA arbitration, and agent coordination.
Implementations§
Source§impl DccService
impl DccService
Sourcepub fn new(config: DccConfig) -> (DccService, Receiver<TelemetryEvent>)
pub fn new(config: DccConfig) -> (DccService, Receiver<TelemetryEvent>)
Creates a new DCC service.
Sourcepub fn set_adaptation_mode(&self, agent_id: AgentId, mode: AdaptationMode)
pub fn set_adaptation_mode(&self, agent_id: AgentId, mode: AdaptationMode)
Sets the [AdaptationMode] for an agent — the developer-control surface
over the adaptive core. Thread-safe; takes effect on the next arbitration
tick. Manual(strategy) pins an agent, Stable blocks opportunistic
upgrades, Bounded clamps the range, Learning (default) negotiates freely.
Sourcepub fn adaptation_mode(&self, agent_id: AgentId) -> AdaptationMode
pub fn adaptation_mode(&self, agent_id: AgentId) -> AdaptationMode
Returns the [AdaptationMode] configured for an agent (default Learning).
Sourcepub fn set_hint(&self, hint: EngineHint)
pub fn set_hint(&self, hint: EngineHint)
Applies a developer EngineHint biasing GORNA arbitration — the same
control axis as set_adaptation_mode.
Cap bounds an agent’s per-frame time budget; Prioritize biases its
negotiation weight. Thread-safe; takes effect on the next arbitration
tick. Hints persist and accumulate per agent (latest value wins per
kind) until cleared with clear_agent_hints.
Advisory only: a Manual pin and the death-spiral safety stop still win.
Sourcepub fn clear_agent_hints(&self, agent_id: AgentId)
pub fn clear_agent_hints(&self, agent_id: AgentId)
Clears all developer hints for an agent, restoring engine defaults. Thread-safe; takes effect on the next arbitration tick.
Sourcepub fn hints(&self) -> HashMap<AgentId, AgentHints>
pub fn hints(&self) -> HashMap<AgentId, AgentHints>
Read-only snapshot of the accumulated per-agent hints (glass-box; safe any time), e.g. for the editor’s Control-Plane panel.
Sourcepub fn layout_recommendations(&self) -> HashMap<String, LayoutRecommendation>
pub fn layout_recommendations(&self) -> HashMap<String, LayoutRecommendation>
Read-only snapshot of the per-component layout recommendations the DCC’s advisor has derived from access telemetry — for the glass-box surface (e.g. the editor’s Control-Plane panel). Advisory only: the DCC observes the Data layer and recommends, it never repacks.
Sourcepub fn start_decision_recording(&self)
pub fn start_decision_recording(&self)
Starts recording GORNA’s per-tick decisions into a fresh trace. The recording can be replayed later for bit-for-bit reproduction (QA, network lockstep, bug repro). Thread-safe; takes effect next tick.
Sourcepub fn stop_decision_recording(&self) -> DecisionTrace
pub fn stop_decision_recording(&self) -> DecisionTrace
Stops recording and returns the captured [DecisionTrace].
Sourcepub fn recorded_decisions(&self) -> DecisionTrace
pub fn recorded_decisions(&self) -> DecisionTrace
A snapshot of the decisions recorded so far (glass-box; safe any time).
Sourcepub fn replay_decisions(&self, trace: DecisionTrace)
pub fn replay_decisions(&self, trace: DecisionTrace)
Begins replaying trace: each subsequent arbitration tick issues the
recorded strategies in order (bypassing live fit + AdaptationMode)
until the trace is exhausted, then normal arbitration resumes.
Sourcepub fn stop_replay(&self)
pub fn stop_replay(&self)
Stops any in-progress replay, returning to live arbitration.
Sourcepub fn is_replaying(&self) -> bool
pub fn is_replaying(&self) -> bool
Whether a replay is currently in progress (trace not yet exhausted).
Sourcepub fn connect_budget_channel(&mut self, channel: BudgetChannel)
pub fn connect_budget_channel(&mut self, channel: BudgetChannel)
Connects the DCC to the Scheduler’s budget channel. After GORNA arbitration, budgets are sent through this channel.
Sourcepub fn register_agent(&self, agent: Arc<Mutex<dyn Agent>>, priority: f32)
pub fn register_agent(&self, agent: Arc<Mutex<dyn Agent>>, priority: f32)
Registers an agent with a priority value.
Higher priority values mean the agent is updated first in each frame. The agent is active in all engine modes.
Sourcepub fn register_agent_for_mode(
&self,
agent: Arc<Mutex<dyn Agent>>,
priority: f32,
modes: Vec<EngineMode>,
)
pub fn register_agent_for_mode( &self, agent: Arc<Mutex<dyn Agent>>, priority: f32, modes: Vec<EngineMode>, )
Registers an agent with a priority value, active only in the specified modes.
Higher priority values mean the agent is updated first in each frame.
If modes is empty, the agent is active in all modes.
Sourcepub fn start(&mut self, event_rx: Receiver<TelemetryEvent>)
pub fn start(&mut self, event_rx: Receiver<TelemetryEvent>)
Starts the DCC background thread.
Sourcepub fn agent_registry(&self) -> &Arc<Mutex<AgentRegistry>> ⓘ
pub fn agent_registry(&self) -> &Arc<Mutex<AgentRegistry>> ⓘ
Returns the agent registry for use by the Scheduler.
Sourcepub fn event_sender(&self) -> Sender<TelemetryEvent>
pub fn event_sender(&self) -> Sender<TelemetryEvent>
Returns a sender handle to submit events to the DCC.
Sourcepub fn get_context(&self) -> Context
pub fn get_context(&self) -> Context
Returns the current context.
Sourcepub fn context_handle(&self) -> Arc<RwLock<Context>> ⓘ
pub fn context_handle(&self) -> Arc<RwLock<Context>> ⓘ
Returns a shared handle to the live context.
Used by observers (e.g. the editor’s Control Plane workspace) that
want to read up-to-date hardware state, mode, and budget multiplier
each frame without going through get_context()’s clone.
Sourcepub fn initialize_agents(&self, context: &mut EngineContext<'_>)
pub fn initialize_agents(&self, context: &mut EngineContext<'_>)
Initializes all registered agents once after registration.
Should be called once after all agents are registered, giving them access to engine services for caching and lane setup.
Sourcepub fn execute_agents(&self, context: &mut EngineContext<'_>)
pub fn execute_agents(&self, context: &mut EngineContext<'_>)
Executes all registered agents in priority order.
Called each frame. Each agent selects the appropriate lanes and dispatches their execution.
Sourcepub fn agent_count(&self) -> usize
pub fn agent_count(&self) -> usize
Returns the number of registered agents.
Trait Implementations§
Source§impl Drop for DccService
impl Drop for DccService
Auto Trait Implementations§
impl Freeze for DccService
impl !RefUnwindSafe for DccService
impl Send for DccService
impl Sync for DccService
impl Unpin for DccService
impl UnsafeUnpin for DccService
impl !UnwindSafe for DccService
Blanket Implementations§
§impl<T> AppLifecycle for Twhere
T: ?Sized,
impl<T> AppLifecycle for Twhere
T: ?Sized,
§fn on_start(&mut self, ctx: &mut dyn AppContext)
fn on_start(&mut self, ctx: &mut dyn AppContext)
update. Apps install their theme / fonts here.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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.