Skip to main content

AdaptiveExecutionRouter

Struct AdaptiveExecutionRouter 

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

Source

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 - true when probing is allowed without risking stutter.
Source

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

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

pub fn trigger_gpu_fault_failover( &mut self, worker_threads: usize, now_ms: u64, ) -> ExecutionLane

Triggers an immediate non-hysteresis failover off GPU lanes upon hardware DeviceLost or thermal fault.

§Arguments
  • usize - Available CPU worker threads (>= 1).
  • u64 - Monotonic timestamp in milliseconds.
§Returns
  • ExecutionLane - Newly active safe CPU execution lane.
Source§

impl AdaptiveExecutionRouter

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_active_lane(&self) -> ExecutionLane

Source

pub fn get_mut_active_lane(&mut self) -> &mut ExecutionLane

Source

pub fn set_active_lane(&mut self, val: ExecutionLane) -> &mut Self

Source

pub fn get_cost_model(&self) -> ExecutionCostModel

Source

pub fn get_mut_cost_model(&mut self) -> &mut ExecutionCostModel

Source

pub fn set_cost_model(&mut self, val: ExecutionCostModel) -> &mut Self

Source

pub fn get_streak_lane(&self) -> ExecutionLane

Source

pub fn get_mut_streak_lane(&mut self) -> &mut ExecutionLane

Source

pub fn set_streak_lane(&mut self, val: ExecutionLane) -> &mut Self

Source

pub fn get_streak_count(&self) -> u32

Source

pub fn get_mut_streak_count(&mut self) -> &mut u32

Source

pub fn set_streak_count(&mut self, val: u32) -> &mut Self

Source

pub fn get_last_switch_ms(&self) -> u64

Source

pub fn get_mut_last_switch_ms(&mut self) -> &mut u64

Source

pub fn set_last_switch_ms(&mut self, val: u64) -> &mut Self

Source

pub fn get_has_switched(&self) -> bool

Source

pub fn get_mut_has_switched(&mut self) -> &mut bool

Source

pub fn set_has_switched(&mut self, val: bool) -> &mut Self

Source

pub fn get_backoff_until_ms(&self) -> u64

Source

pub fn get_mut_backoff_until_ms(&mut self) -> &mut u64

Source

pub fn set_backoff_until_ms(&mut self, val: u64) -> &mut Self

Source

pub fn get_backoff_level(&self) -> u32

Source

pub fn get_mut_backoff_level(&mut self) -> &mut u32

Source

pub fn set_backoff_level(&mut self, val: u32) -> &mut Self

Source

pub fn get_pre_switch_baseline_us(&self) -> f64

Source

pub fn get_mut_pre_switch_baseline_us(&mut self) -> &mut f64

Source

pub fn set_pre_switch_baseline_us(&mut self, val: f64) -> &mut Self

Source

pub fn get_awaiting_post_switch_check(&self) -> bool

Source

pub fn get_mut_awaiting_post_switch_check(&mut self) -> &mut bool

Source

pub fn set_awaiting_post_switch_check(&mut self, val: bool) -> &mut Self

Source

pub fn get_consecutive_deadline_misses(&self) -> u32

Source

pub fn get_mut_consecutive_deadline_misses(&mut self) -> &mut u32

Source

pub fn set_consecutive_deadline_misses(&mut self, val: u32) -> &mut Self

Source

pub fn get_total_switches(&self) -> u64

Source

pub fn get_mut_total_switches(&mut self) -> &mut u64

Source

pub fn set_total_switches(&mut self, val: u64) -> &mut Self

Source

pub fn get_total_failovers(&self) -> u64

Source

pub fn get_mut_total_failovers(&mut self) -> &mut u64

Source

pub fn set_total_failovers(&mut self, val: u64) -> &mut Self

Source

pub fn get_total_regressions(&self) -> u64

Source

pub fn get_mut_total_regressions(&mut self) -> &mut u64

Source

pub fn set_total_regressions(&mut self, val: u64) -> &mut Self

Source

pub fn get_last_observed_cpu_us(&self) -> f64

Source

pub fn get_mut_last_observed_cpu_us(&mut self) -> &mut f64

Source

pub fn set_last_observed_cpu_us(&mut self, val: f64) -> &mut Self

Source

pub fn get_last_observed_gpu_compute_us(&self) -> f64

Source

pub fn get_mut_last_observed_gpu_compute_us(&mut self) -> &mut f64

Source

pub fn set_last_observed_gpu_compute_us(&mut self, val: f64) -> &mut Self

Source

pub fn get_last_observed_gpu_render_us(&self) -> f64

Source

pub fn get_mut_last_observed_gpu_render_us(&mut self) -> &mut f64

Source

pub fn set_last_observed_gpu_render_us(&mut self, val: f64) -> &mut Self

Trait Implementations§

Source§

impl Clone for AdaptiveExecutionRouter

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AdaptiveExecutionRouter

Source§

impl Debug for AdaptiveExecutionRouter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AdaptiveExecutionRouter

Default AdaptiveExecutionRouter starting conservatively in ExecutionLane::CpuSerial.

Source§

fn default() -> Self

Creates an AdaptiveExecutionRouter with calibrated EWMA defaults.

§Returns
  • Self - Default AdaptiveExecutionRouter.
Source§

impl PartialEq for AdaptiveExecutionRouter

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AdaptiveExecutionRouter

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.