pub struct AdaptiveExecutionRouter { /* private fields */ }Expand description
Closed-loop online EWMA execution router selecting CpuSerial, CpuParallel, GpuCompute, or MixedCoExec with hysteresis and regression backoff.
Implementations§
Source§impl AdaptiveExecutionRouter
Hysteresis-gated lane evaluation, headroom probing, EWMA updates, and fault failover for AdaptiveExecutionRouter.
impl AdaptiveExecutionRouter
Hysteresis-gated lane evaluation, headroom probing, EWMA updates, and fault failover for AdaptiveExecutionRouter.
Sourcepub fn can_probe(&self, recent_frame_ms: f64, target_interval_ms: f64) -> bool
pub fn can_probe(&self, recent_frame_ms: f64, target_interval_ms: f64) -> bool
Returns true when background lane probing is permitted (> 35% frame headroom OR >= 3 consecutive deadline misses).
§Arguments
f64- Recent active frame duration in milliseconds.f64- Target display frame interval in milliseconds.
§Returns
bool-truewhen probing is allowed without risking stutter.
Sourcepub fn evaluate(
&mut self,
workload: ExecutionWorkloadFeatures,
now_ms: u64,
) -> ExecutionRouterDecision
pub fn evaluate( &mut self, workload: ExecutionWorkloadFeatures, now_ms: u64, ) -> ExecutionRouterDecision
Evaluates workload at monotonic timestamp now_ms, applying 15% gain, 5-streak, 300ms dwell, backoff, and immediate failover.
§Arguments
ExecutionWorkloadFeatures- Current frame scene workload features.u64- Monotonic timestamp in milliseconds.
§Returns
ExecutionRouterDecision- Active execution lane and full cost-model telemetry.
Sourcepub fn observe_frame(
&mut self,
observed_cpu_us: f64,
observed_gpu_compute_ns: u64,
observed_gpu_render_ns: u64,
workload: ExecutionWorkloadFeatures,
missed_deadline: bool,
now_ms: u64,
)
pub fn observe_frame( &mut self, observed_cpu_us: f64, observed_gpu_compute_ns: u64, observed_gpu_render_ns: u64, workload: ExecutionWorkloadFeatures, missed_deadline: bool, now_ms: u64, )
Assimilates real CPU and GPU timing observations (LAST_GPU_COMPUTE_NS/LAST_GPU_RENDER_NS), triggering 1s -> 2s -> 4s backoff on regression.
§Arguments
f64- Observed CPU execution time in microseconds.u64- Observed GPU compute time in nanoseconds.u64- Observed GPU render time in nanoseconds.ExecutionWorkloadFeatures- Workload features from the observed frame.bool- True when the observed frame missed its display deadline.u64- Monotonic timestamp in milliseconds.
Sourcepub fn trigger_gpu_fault_failover(
&mut self,
worker_threads: usize,
now_ms: u64,
) -> ExecutionLane
pub fn trigger_gpu_fault_failover( &mut self, worker_threads: usize, now_ms: u64, ) -> ExecutionLane
Source§impl AdaptiveExecutionRouter
impl AdaptiveExecutionRouter
pub fn get_active_lane(&self) -> ExecutionLane
pub fn get_mut_active_lane(&mut self) -> &mut ExecutionLane
pub fn set_active_lane(&mut self, val: ExecutionLane) -> &mut Self
pub fn get_cost_model(&self) -> ExecutionCostModel
pub fn get_mut_cost_model(&mut self) -> &mut ExecutionCostModel
pub fn set_cost_model(&mut self, val: ExecutionCostModel) -> &mut Self
pub fn get_streak_lane(&self) -> ExecutionLane
pub fn get_mut_streak_lane(&mut self) -> &mut ExecutionLane
pub fn set_streak_lane(&mut self, val: ExecutionLane) -> &mut Self
pub fn get_streak_count(&self) -> u32
pub fn get_mut_streak_count(&mut self) -> &mut u32
pub fn set_streak_count(&mut self, val: u32) -> &mut Self
pub fn get_last_switch_ms(&self) -> u64
pub fn get_mut_last_switch_ms(&mut self) -> &mut u64
pub fn set_last_switch_ms(&mut self, val: u64) -> &mut Self
pub fn get_has_switched(&self) -> bool
pub fn get_mut_has_switched(&mut self) -> &mut bool
pub fn set_has_switched(&mut self, val: bool) -> &mut Self
pub fn get_backoff_until_ms(&self) -> u64
pub fn get_mut_backoff_until_ms(&mut self) -> &mut u64
pub fn set_backoff_until_ms(&mut self, val: u64) -> &mut Self
pub fn get_backoff_level(&self) -> u32
pub fn get_mut_backoff_level(&mut self) -> &mut u32
pub fn set_backoff_level(&mut self, val: u32) -> &mut Self
pub fn get_pre_switch_baseline_us(&self) -> f64
pub fn get_mut_pre_switch_baseline_us(&mut self) -> &mut f64
pub fn set_pre_switch_baseline_us(&mut self, val: f64) -> &mut Self
pub fn get_awaiting_post_switch_check(&self) -> bool
pub fn get_mut_awaiting_post_switch_check(&mut self) -> &mut bool
pub fn set_awaiting_post_switch_check(&mut self, val: bool) -> &mut Self
pub fn get_consecutive_deadline_misses(&self) -> u32
pub fn get_mut_consecutive_deadline_misses(&mut self) -> &mut u32
pub fn set_consecutive_deadline_misses(&mut self, val: u32) -> &mut Self
pub fn get_total_switches(&self) -> u64
pub fn get_mut_total_switches(&mut self) -> &mut u64
pub fn set_total_switches(&mut self, val: u64) -> &mut Self
pub fn get_total_failovers(&self) -> u64
pub fn get_mut_total_failovers(&mut self) -> &mut u64
pub fn set_total_failovers(&mut self, val: u64) -> &mut Self
pub fn get_total_regressions(&self) -> u64
pub fn get_mut_total_regressions(&mut self) -> &mut u64
pub fn set_total_regressions(&mut self, val: u64) -> &mut Self
pub fn get_last_observed_cpu_us(&self) -> f64
pub fn get_mut_last_observed_cpu_us(&mut self) -> &mut f64
pub fn set_last_observed_cpu_us(&mut self, val: f64) -> &mut Self
pub fn get_last_observed_gpu_compute_us(&self) -> f64
pub fn get_mut_last_observed_gpu_compute_us(&mut self) -> &mut f64
pub fn set_last_observed_gpu_compute_us(&mut self, val: f64) -> &mut Self
pub fn get_last_observed_gpu_render_us(&self) -> f64
pub fn get_mut_last_observed_gpu_render_us(&mut self) -> &mut f64
pub fn set_last_observed_gpu_render_us(&mut self, val: f64) -> &mut Self
Trait Implementations§
Source§impl Clone for AdaptiveExecutionRouter
impl Clone for AdaptiveExecutionRouter
impl Copy for AdaptiveExecutionRouter
Source§impl Debug for AdaptiveExecutionRouter
impl Debug for AdaptiveExecutionRouter
Source§impl Default for AdaptiveExecutionRouter
Default AdaptiveExecutionRouter starting conservatively in ExecutionLane::CpuSerial.
impl Default for AdaptiveExecutionRouter
Default AdaptiveExecutionRouter starting conservatively in ExecutionLane::CpuSerial.
Source§impl PartialEq for AdaptiveExecutionRouter
impl PartialEq for AdaptiveExecutionRouter
impl StructuralPartialEq for AdaptiveExecutionRouter
Auto Trait Implementations§
impl Forget for AdaptiveExecutionRouter
impl Freeze for AdaptiveExecutionRouter
impl Move for AdaptiveExecutionRouter
impl RefUnwindSafe for AdaptiveExecutionRouter
impl Send for AdaptiveExecutionRouter
impl Sync for AdaptiveExecutionRouter
impl Unpin for AdaptiveExecutionRouter
impl UnsafeUnpin for AdaptiveExecutionRouter
impl UnwindSafe for AdaptiveExecutionRouter
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
Mutably borrows from an owned value. Read more