Skip to main content

DccService

Struct DccService 

Source
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

Source

pub fn new(config: DccConfig) -> (DccService, Receiver<TelemetryEvent>)

Creates a new DCC service.

Source

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.

Source

pub fn adaptation_mode(&self, agent_id: AgentId) -> AdaptationMode

Returns the [AdaptationMode] configured for an agent (default Learning).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn stop_decision_recording(&self) -> DecisionTrace

Stops recording and returns the captured [DecisionTrace].

Source

pub fn recorded_decisions(&self) -> DecisionTrace

A snapshot of the decisions recorded so far (glass-box; safe any time).

Source

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.

Source

pub fn stop_replay(&self)

Stops any in-progress replay, returning to live arbitration.

Source

pub fn is_replaying(&self) -> bool

Whether a replay is currently in progress (trace not yet exhausted).

Source

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.

Source

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.

Source

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.

Source

pub fn start(&mut self, event_rx: Receiver<TelemetryEvent>)

Starts the DCC background thread.

Source

pub fn stop(&mut self)

Stops the DCC background thread.

Source

pub fn agent_registry(&self) -> &Arc<Mutex<AgentRegistry>>

Returns the agent registry for use by the Scheduler.

Source

pub fn event_sender(&self) -> Sender<TelemetryEvent>

Returns a sender handle to submit events to the DCC.

Source

pub fn get_context(&self) -> Context

Returns the current context.

Source

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.

Source

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.

Source

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.

Source

pub fn agent_count(&self) -> usize

Returns the number of registered agents.

Source

pub fn get_agent(&self, id: AgentId) -> Option<Arc<Mutex<dyn Agent>>>

Returns a reference to the agent with the given ID, if registered.

Trait Implementations§

Source§

impl Drop for DccService

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AppLifecycle for T
where T: ?Sized,

§

fn on_start(&mut self, ctx: &mut dyn AppContext)

Called once after the backend is up but before the first update. Apps install their theme / fonts here.
§

fn on_exit(&mut self)

Called once when the window is closing. Persist state here.
§

impl<T> AsAny for T
where T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

Returns a reference to the inner value as &dyn Any.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(value: T, _simd: S) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,