Skip to main content

RuntimePolicy

Trait RuntimePolicy 

Source
pub trait RuntimePolicy:
    Clone
    + Send
    + Sync
    + Serialize
    + DeserializeOwned
    + Debug
    + 'static {
    // Required methods
    fn version(&self) -> ContractVersion;
    fn memory_capacity_bytes(&self) -> u64;
    fn memory_reserve_bytes(&self) -> u64;
    fn maximum_active_sequences(&self) -> u32;
    fn maximum_scheduled_tokens(&self) -> u64;
    fn attention_execution_policy(&self) -> AttentionExecutionPolicy;
    fn execution_determinism_requirement(
        &self,
    ) -> ExecutionDeterminismRequirement;
    fn dynamic_storage_profile_order(&self) -> &[DynamicStorageProfile];
    fn reusable_execution_policy(&self) -> Option<&ReusableExecutionPolicy>;
    fn validate(&self) -> Result<(), VNextError>;
}
Expand description

Typed policy selected before planning. Memory capacity is part of the public policy contract so a plan cannot depend on an undocumented env var.

Required Methods§

Source

fn version(&self) -> ContractVersion

Source

fn memory_capacity_bytes(&self) -> u64

Policy memory ceiling before the explicit reserve is subtracted. It may be lower than, but never exceed, the raw device capacity.

Source

fn memory_reserve_bytes(&self) -> u64

Source

fn maximum_active_sequences(&self) -> u32

A non-zero protocol ceiling only. Planning must not reserve, claim, iterate, or materialize resources up to this value.

Source

fn maximum_scheduled_tokens(&self) -> u64

A non-zero ceiling for tokens selected into one scheduler step. This is not installed capacity: admission still evaluates the exact step shape against then-live backing before any provider work is encoded.

Source

fn attention_execution_policy(&self) -> AttentionExecutionPolicy

Provider-family policy sealed into the plan fingerprint. Physical kernel variants remain an invocation-time provider decision.

Source

fn execution_determinism_requirement(&self) -> ExecutionDeterminismRequirement

Minimum repeatability and reusable-execution equivalence that every selected operation provider must prove.

Source

fn dynamic_storage_profile_order(&self) -> &[DynamicStorageProfile]

Ordered, non-empty allowlist used by planning after intersecting every selected provider requirement with the concrete runtime offers.

Source

fn reusable_execution_policy(&self) -> Option<&ReusableExecutionPolicy>

Optional reusable-execution capacity policy selected before planning. Core treats class identities as opaque and owns their memory derivation.

Source

fn validate(&self) -> Result<(), VNextError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§