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