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.
impl FallbackPolicyEngine
Non-degrading fallback evaluation, hysteresis cadence control, and CPU reference escalation for FallbackPolicyEngine.
Sourcepub fn with_display_hz(
display_refresh_hz: f32,
semantics: RenderSemanticsContract,
) -> Self
pub fn with_display_hz( display_refresh_hz: f32, semantics: RenderSemanticsContract, ) -> Self
Sourcepub fn update_display_refresh_hz(&mut self, display_refresh_hz: f32)
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.
Sourcepub const fn cadence_tiers_hz() -> [f32; 9]
pub const fn cadence_tiers_hz() -> [f32; 9]
Returns the ordered 9-tier display-compatible cadence ladder ([480..30] Hz).
§Returns
[f32; 9]- Supported presentation cadence tiers from highest to lowest.
Sourcepub fn record_frame_duration_ms(
&mut self,
frame_ms: f32,
now_ms: u64,
) -> FallbackAction
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, orAdjustPresentCadence).
Sourcepub fn evaluate_trigger(
&mut self,
trigger: FallbackTrigger,
now_ms: u64,
) -> FallbackAction
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.
Sourcepub fn verify_no_visual_degradation(
&self,
candidate: &RenderSemanticsContract,
) -> bool
pub fn verify_no_visual_degradation( &self, candidate: &RenderSemanticsContract, ) -> bool
Source§impl FallbackPolicyEngine
impl FallbackPolicyEngine
pub fn get_config(&self) -> FallbackPolicyConfig
pub fn get_mut_config(&mut self) -> &mut FallbackPolicyConfig
pub fn set_config(&mut self, val: FallbackPolicyConfig) -> &mut Self
pub fn get_display_refresh_hz(&self) -> f32
pub fn get_mut_display_refresh_hz(&mut self) -> &mut f32
pub fn set_display_refresh_hz(&mut self, val: f32) -> &mut Self
pub fn get_active_cadence_hz(&self) -> f32
pub fn get_mut_active_cadence_hz(&mut self) -> &mut f32
pub fn set_active_cadence_hz(&mut self, val: f32) -> &mut Self
pub fn get_last_cadence_change_ms(&self) -> u64
pub fn get_mut_last_cadence_change_ms(&mut self) -> &mut u64
pub fn set_last_cadence_change_ms(&mut self, val: u64) -> &mut Self
pub fn get_has_cadence_changed(&self) -> bool
pub fn get_mut_has_cadence_changed(&mut self) -> &mut bool
pub fn set_has_cadence_changed(&mut self, val: bool) -> &mut Self
pub fn get_overrun_streak(&self) -> u32
pub fn get_mut_overrun_streak(&mut self) -> &mut u32
pub fn set_overrun_streak(&mut self, val: u32) -> &mut Self
pub fn get_under_budget_streak(&self) -> u32
pub fn get_mut_under_budget_streak(&mut self) -> &mut u32
pub fn set_under_budget_streak(&mut self, val: u32) -> &mut Self
pub fn get_prefetch_enabled(&self) -> bool
pub fn get_mut_prefetch_enabled(&mut self) -> &mut bool
pub fn set_prefetch_enabled(&mut self, val: bool) -> &mut Self
pub fn get_cache_retain_ratio(&self) -> f32
pub fn get_mut_cache_retain_ratio(&mut self) -> &mut f32
pub fn set_cache_retain_ratio(&mut self, val: f32) -> &mut Self
pub fn get_gpu_recovery_attempts(&self) -> u32
pub fn get_mut_gpu_recovery_attempts(&mut self) -> &mut u32
pub fn set_gpu_recovery_attempts(&mut self, val: u32) -> &mut Self
pub fn get_cpu_reference_forced(&self) -> bool
pub fn get_mut_cpu_reference_forced(&mut self) -> &mut bool
pub fn set_cpu_reference_forced(&mut self, val: bool) -> &mut Self
pub fn get_last_action(&self) -> FallbackAction
pub fn get_mut_last_action(&mut self) -> &mut FallbackAction
pub fn set_last_action(&mut self, val: FallbackAction) -> &mut Self
pub fn get_active_ladder_step(&self) -> FallbackLadderStep
pub fn get_mut_active_ladder_step(&mut self) -> &mut FallbackLadderStep
pub fn set_active_ladder_step(&mut self, val: FallbackLadderStep) -> &mut Self
pub fn get_total_cadence_steps(&self) -> u64
pub fn get_mut_total_cadence_steps(&mut self) -> &mut u64
pub fn set_total_cadence_steps(&mut self, val: u64) -> &mut Self
pub fn get_total_cache_trims(&self) -> u64
pub fn get_mut_total_cache_trims(&mut self) -> &mut u64
pub fn set_total_cache_trims(&mut self, val: u64) -> &mut Self
pub fn get_total_cpu_fallbacks(&self) -> u64
pub fn get_mut_total_cpu_fallbacks(&mut self) -> &mut u64
pub fn set_total_cpu_fallbacks(&mut self, val: u64) -> &mut Self
pub fn get_semantics_baseline(&self) -> RenderSemanticsContract
pub fn get_mut_semantics_baseline(&mut self) -> &mut RenderSemanticsContract
pub fn set_semantics_baseline( &mut self, val: RenderSemanticsContract, ) -> &mut Self
Trait Implementations§
Source§impl Clone for FallbackPolicyEngine
impl Clone for FallbackPolicyEngine
impl Copy for FallbackPolicyEngine
Source§impl Debug for FallbackPolicyEngine
impl Debug for FallbackPolicyEngine
Source§impl Default for FallbackPolicyEngine
Default fallback policy engine bound to HIGH_REFRESH_DEFAULT_HZ until synchronized with live OS display Hz.
impl Default for FallbackPolicyEngine
Default fallback policy engine bound to HIGH_REFRESH_DEFAULT_HZ until synchronized with live OS display Hz.