Skip to main content

FallbackPolicyEngine

Struct FallbackPolicyEngine 

Source
pub struct FallbackPolicyEngine { /* private fields */ }
Expand description

Non-degrading runtime fallback controller governing cache trimming, hysteresis cadence stepping, and CPU reference fallback.

Implementations§

Source§

impl FallbackPolicyEngine

Non-degrading fallback evaluation, hysteresis cadence control, and CPU reference escalation for FallbackPolicyEngine.

Source

pub fn with_display_hz( display_refresh_hz: f32, semantics: RenderSemanticsContract, ) -> Self

Creates a fallback policy engine targeting display_refresh_hz and locked to semantics.

§Arguments
  • f32 - Active display refresh rate in Hertz.
  • RenderSemanticsContract - Immutable visual fidelity baseline.
§Returns
  • Self - Initialized fallback policy engine.
Source

pub fn update_display_refresh_hz(&mut self, display_refresh_hz: f32)

Updates the native display refresh rate and clamps the active cadence to the new display maximum.

§Arguments
  • &Self - Mutable fallback engine.
  • f32 - New display refresh rate in Hertz.
Source

pub fn record_frame_duration_ms( &mut self, frame_ms: f32, now_ms: u64, ) -> FallbackAction

Evaluates one completed frame’s work duration against the active cadence budget with hysteresis and minimum dwell protection.

§Arguments
  • &Self - Mutable fallback engine.
  • f32 - Completed frame CPU+GPU duration in milliseconds.
  • u64 - Monotonic clock timestamp in milliseconds.
§Returns
  • FallbackAction - Strictly non-degrading action (None, TrimPrefetchAndColdCache, or AdjustPresentCadence).
Source

pub fn evaluate_trigger( &mut self, trigger: FallbackTrigger, now_ms: u64, ) -> FallbackAction

Evaluates an explicit runtime fault or pressure trigger and produces a strictly non-degrading fallback action.

§Arguments
  • &Self - Mutable fallback engine.
  • FallbackTrigger - Detected runtime fault, missing effect path, or memory pressure event.
  • u64 - Monotonic clock timestamp in milliseconds.
§Returns
  • FallbackAction - Required mitigation that preserves full visual quality.
Source

pub fn verify_no_visual_degradation( &self, candidate: &RenderSemanticsContract, ) -> bool

Verifies that candidate preserves full visual fidelity relative to semantics_baseline.

§Arguments
  • &Self - Fallback engine reference.
  • &RenderSemanticsContract - Active post-fallback visual semantics.
§Returns
  • bool - true when zero visual degradation occurred.
Source§

impl FallbackPolicyEngine

Source

pub fn get_config(&self) -> FallbackPolicyConfig

Source

pub fn get_mut_config(&mut self) -> &mut FallbackPolicyConfig

Source

pub fn set_config(&mut self, val: FallbackPolicyConfig) -> &mut Self

Source

pub fn get_display_refresh_hz(&self) -> f32

Source

pub fn get_mut_display_refresh_hz(&mut self) -> &mut f32

Source

pub fn set_display_refresh_hz(&mut self, val: f32) -> &mut Self

Source

pub fn get_active_cadence_hz(&self) -> f32

Source

pub fn get_mut_active_cadence_hz(&mut self) -> &mut f32

Source

pub fn set_active_cadence_hz(&mut self, val: f32) -> &mut Self

Source

pub fn get_last_cadence_change_ms(&self) -> u64

Source

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

Source

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

Source

pub fn get_has_cadence_changed(&self) -> bool

Source

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

Source

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

Source

pub fn get_overrun_streak(&self) -> u32

Source

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

Source

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

Source

pub fn get_under_budget_streak(&self) -> u32

Source

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

Source

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

Source

pub fn get_prefetch_enabled(&self) -> bool

Source

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

Source

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

Source

pub fn get_cache_retain_ratio(&self) -> f32

Source

pub fn get_mut_cache_retain_ratio(&mut self) -> &mut f32

Source

pub fn set_cache_retain_ratio(&mut self, val: f32) -> &mut Self

Source

pub fn get_gpu_recovery_attempts(&self) -> u32

Source

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

Source

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

Source

pub fn get_cpu_reference_forced(&self) -> bool

Source

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

Source

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

Source

pub fn get_last_action(&self) -> FallbackAction

Source

pub fn get_mut_last_action(&mut self) -> &mut FallbackAction

Source

pub fn set_last_action(&mut self, val: FallbackAction) -> &mut Self

Source

pub fn get_total_cadence_steps(&self) -> u64

Source

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

Source

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

Source

pub fn get_total_cache_trims(&self) -> u64

Source

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

Source

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

Source

pub fn get_total_cpu_fallbacks(&self) -> u64

Source

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

Source

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

Source

pub fn get_semantics_baseline(&self) -> RenderSemanticsContract

Source

pub fn get_mut_semantics_baseline(&mut self) -> &mut RenderSemanticsContract

Source

pub fn set_semantics_baseline( &mut self, val: RenderSemanticsContract, ) -> &mut Self

Trait Implementations§

Source§

impl Clone for FallbackPolicyEngine

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 FallbackPolicyEngine

Source§

impl Debug for FallbackPolicyEngine

Source§

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

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

impl Default for FallbackPolicyEngine

Default fallback policy engine bound to a 60 Hz display baseline.

Source§

fn default() -> Self

Creates a fallback policy engine initialized for 60 Hz with full cache retention.

§Returns
  • Self - Initialized fallback policy engine.
Source§

impl PartialEq for FallbackPolicyEngine

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 FallbackPolicyEngine

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.