euv-core 0.48.3

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
/// Default fixed capacity for the non-blocking drop-oldest telemetry ring queue.
pub const DEFAULT_TELEMETRY_QUEUE_CAPACITY: usize = 256;
/// Default maximum cached verified startup winners stored in `WinnerCache`.
pub const DEFAULT_WINNER_CACHE_CAPACITY: usize = 64;
/// Default consecutive missed-deadline frames required before considering a candidate probe.
pub const DEFAULT_SUSTAINED_MISS_THRESHOLD: u32 = 6;
/// Default input-to-present latency multiplier over target frame interval triggering a probe.
pub const DEFAULT_INPUT_LATENCY_DEGRADE_RATIO: f64 = 1.5;
/// Default consecutive candidate wins required before recommending or triggering a switch.
pub const DEFAULT_CONSECUTIVE_WINS_REQUIRED: u32 = 3;
/// Default minimum net latency improvement in milliseconds required to overcome switch cost.
pub const DEFAULT_SWITCH_COST_MS: f64 = 0.75;
/// Default minimum dwell time in milliseconds between performance-driven switches.
pub const DEFAULT_MIN_DWELL_MS: u64 = 5_000;
/// Default post-switch cooldown period in milliseconds suppressing probing and re-switching.
pub const DEFAULT_COOLDOWN_MS: u64 = 3_000;
/// Default minimum explicit frame headroom ratio (`25%` of target interval) required to run a probe when not idle.
pub const DEFAULT_PROBE_MIN_HEADROOM_RATIO: f64 = 0.25;
/// Default number of budget-sliced warmup steps required before a handoff candidate is boundary-ready.
pub const DEFAULT_HANDOFF_WARMUP_STEPS: u32 = 3;
/// Default per-frame UI/render-thread warmup budget slice in milliseconds.
pub const DEFAULT_HANDOFF_PER_FRAME_BUDGET_MS: f64 = 1.5;
/// Default maximum warmup timeout in milliseconds before aborting a handoff.
pub const DEFAULT_HANDOFF_TIMEOUT_MS: u64 = 500;
/// Default number of confirmed post-handoff fence frames before releasing old backend resources.
pub const DEFAULT_POST_COMMIT_FENCE_FRAMES: u32 = 2;

pub(crate) const REASON_SINGLE_CHANNEL_LOCKED: &str =
    "host supports a single render channel; probing disabled";
pub(crate) const REASON_CACHE_HIT_VERIFIED: &str =
    "reused verified startup winner from device/driver/display/build cache";
pub(crate) const REASON_STARTUP_GPU_DIRECT: &str =
    "selected visually equivalent GpuDirect as startup first candidate";
pub(crate) const REASON_STARTUP_FALLBACK_READY: &str =
    "selected highest-priority visually equivalent available candidate";
pub(crate) const REASON_STARTUP_FAILOVER: &str =
    "startup candidate failed; switched immediately to known-working path";
pub(crate) const REASON_PROBE_COOLDOWN: &str = "probe skipped during post-switch cooldown window";
pub(crate) const REASON_PROBE_HANDOFF_ACTIVE: &str =
    "probe skipped while frame-boundary handoff is in flight";
pub(crate) const REASON_PROBE_NO_TRIGGER: &str =
    "probe skipped because frame deadlines and input latency are healthy";
pub(crate) const REASON_PROBE_NO_HEADROOM: &str =
    "probe skipped because system is neither idle nor within explicit frame headroom";
pub(crate) const REASON_PROBE_STARTED: &str =
    "short candidate probe permitted during idle or explicit frame headroom";
pub(crate) const REASON_VISUAL_GATE_FAILED: &str =
    "candidate disqualified by visual-equivalence or capability gate";
pub(crate) const REASON_CONTEXT_MISMATCH: &str =
    "candidates must be compared under identical scene_profile and display_mode_hz";
pub(crate) const REASON_HYBRID_NO_NET_GAIN: &str =
    "Hybrid disqualified because sparse CPU effects plus GPU composite lack net positive gain";
pub(crate) const REASON_TIE_PREFER_GPU_DIRECT: &str =
    "retained or preferred GpuDirect on tie without hardcoded lock-in";
pub(crate) const REASON_BELOW_SWITCH_COST: &str =
    "candidate advantage did not exceed switch cost threshold";
pub(crate) const REASON_DWELL_OR_COOLDOWN_ACTIVE: &str =
    "switch deferred until minimum dwell time and cooldown elapse";
pub(crate) const REASON_AWAITING_CONSECUTIVE_WINS: &str =
    "candidate won sample but has not yet met consecutive win threshold";
pub(crate) const REASON_RECOMMEND_ONLY_SHADOW: &str =
    "shadow mode recorded verified switch recommendation without live takeover";
pub(crate) const REASON_AUTO_SWITCH_HANDOFF: &str =
    "candidate cleared all gates and consecutive wins; starting frame-boundary handoff";
pub(crate) const REASON_HANDOFF_COMMITTED: &str = "candidate first frame matched dimensions, scale, scene version, and deadline at frame boundary";
pub(crate) const REASON_HANDOFF_ABORTED: &str =
    "handoff aborted cleanly; old backend continues presenting uninterrupted";
pub(crate) const REASON_FAULT_DEVICE_LOST: &str =
    "immediate failover on DeviceLost skipping perf comparison and retaining last valid frame";
pub(crate) const REASON_FAULT_SURFACE_DESTROYED: &str =
    "tagged SurfaceDestroyed fault excluded from seamless-handoff success counts";
pub(crate) const REASON_FAULT_DRIVER_SUSPENDED: &str =
    "tagged DriverSuspended fault excluded from seamless-handoff success counts";
pub(crate) const REASON_FAULT_THERMAL_THROTTLED: &str =
    "tagged ThermalThrottled fault excluded from seamless-handoff success counts";
pub(crate) const REASON_KEEP_CURRENT: &str = "current active backend remains optimal";
pub(crate) const DEFAULT_DEVICE_ID: &str = "unknown-device";
pub(crate) const DEFAULT_DRIVER_VERSION: &str = "unknown-driver";
pub(crate) const DEFAULT_BUILD_ID: &str = env!("CARGO_PKG_VERSION");
pub(crate) const CANDIDATE_LABEL_GPU_DIRECT: &str = "gpu_direct";
pub(crate) const CANDIDATE_LABEL_GPU_UPLOAD: &str = "gpu_upload";
pub(crate) const CANDIDATE_LABEL_HYBRID: &str = "hybrid";
pub(crate) const CANDIDATE_LABEL_SOFTWARE: &str = "software";
pub(crate) const CANDIDATE_LABEL_TERMINAL: &str = "terminal";
pub(crate) const SWITCH_MODE_RECOMMEND_ONLY: &str = "recommend_only";
pub(crate) const SWITCH_MODE_AUTO_SWITCH: &str = "auto_switch";
pub(crate) const FAULT_LABEL_DEVICE_LOST: &str = "device_lost";
pub(crate) const FAULT_LABEL_SURFACE_DESTROYED: &str = "surface_destroyed";
pub(crate) const FAULT_LABEL_DRIVER_SUSPENDED: &str = "driver_suspended";
pub(crate) const FAULT_LABEL_THERMAL_THROTTLED: &str = "thermal_throttled";
pub(crate) const HZ_MILLIHZ_SCALE: f64 = 1_000.0;
pub(crate) const SCORE_TIE_EPSILON_MS: f64 = 0.05;
pub(crate) const SCORE_MISSED_WEIGHT_MS: f64 = 25.0;
pub(crate) const SCORE_P95_WEIGHT: f64 = 0.35;
pub(crate) const SCORE_P99_WEIGHT: f64 = 0.40;
pub(crate) const SCORE_INPUT_WEIGHT: f64 = 0.25;