Skip to main content

RuntimeConfig

Struct RuntimeConfig 

Source
pub struct RuntimeConfig {
    pub thread_count: Option<usize>,
    pub jit_threshold: Option<u32>,
    pub signal_delivery: SignalDeliveryConfig,
    pub completion_retry: CompletionRetryConfig,
    pub outbox_enabled: bool,
}
Expand description

Configuration used when constructing the embedded BEAM runtime.

Fields§

§thread_count: Option<usize>

Optional scheduler thread count supplied by the engine builder.

None is passed through to beamr so the embedded runtime applies its own runtime-aware default.

§jit_threshold: Option<u32>

Optional JIT compilation threshold supplied by the engine builder.

None is passed through to beamr so the embedded runtime applies its own default (beamr::jit::profiler::DEFAULT_JIT_THRESHOLD, 1000 recorded calls per (module, function, arity) at the version this builds against). Nothing here invents a value.

§Why this is reachable at all

beamr counts calls per MFA and compiles once the count reaches the threshold. Until this field existed the engine held the scheduler and never named the threshold, so the compile point was unreachable from aion — there was no way to move the moment of compilation, and therefore no way to test whether a fault tracks it.

That is what this is for: a proportionality instrument. Halving the threshold should halve the call count at which a compile-correlated fault appears, which predicts a number rather than explaining one. A fault that moves with the threshold is caused by compilation; a fault that does not is not, however well the arithmetic happened to fit.

§🔴 What a large value does, and what it does NOT do

This is not a JIT off-switch, and must not be documented as one. beamr::jit::profiler::JitProfiler::record_call increments with saturating_add(1) and then compiles unless new_count < threshold (jit/profiler.rs:253-262). At u32::MAX the counter saturates at u32::MAX and the comparison stops being true, so the MFA compiles — after 4,294,967,295 recorded calls to that one MFA.

Both halves of that sentence are load-bearing. It is a real horizon, not a semantic quibble: at the ~5 calls per durable wait measured on this engine that is ~859 million waits, so a large value genuinely defers compilation past any workload this engine will run. And it is genuinely not “off”: the compile still happens on the other side of that horizon, so anything relying on it never happening is relying on the workload, not on the configuration. beamr’s own scheduler-level disable is the answer to “off”, and it is a separate beamr release; this field cannot stand in for it.

The threshold is stored in an AtomicU32 read by current_threshold (jit/profiler.rs:109, :189-191). beamr can retune it at runtime via tune_threshold, but only when an embedder drives that call, and aion never does — so a value set here is the value that governs.

§signal_delivery: SignalDeliveryConfig

Bounded readiness and retry policy for live signal mailbox delivery.

§completion_retry: CompletionRetryConfig

Unbounded backoff ladder for durable completion retries.

§outbox_enabled: bool

Whether the durable-outbox fan-out dispatch path is enabled.

Implementations§

Source§

impl RuntimeConfig

Source

pub fn new(thread_count: Option<usize>) -> Self

Create runtime configuration from the builder-supplied scheduler count.

Source

pub const fn with_jit_threshold(self, jit_threshold: Option<u32>) -> Self

Override the JIT compilation threshold passed to beamr’s scheduler.

Read Self::jit_threshold before using this. In particular a large value defers compilation past any realistic workload but does not disable the JIT, and must not be described as doing so.

Source

pub const fn with_signal_delivery( self, signal_delivery: SignalDeliveryConfig, ) -> Self

Override the signal delivery retry policy.

Source

pub const fn with_completion_retry( self, completion_retry: CompletionRetryConfig, ) -> Self

Override the durable completion-retry backoff ladder.

Source

pub const fn with_outbox_enabled(self, enabled: bool) -> Self

Override whether the durable-outbox fan-out dispatch path is enabled.

Trait Implementations§

Source§

impl Clone for RuntimeConfig

Source§

fn clone(&self) -> RuntimeConfig

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 RuntimeConfig

Source§

impl Debug for RuntimeConfig

Source§

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

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

impl Default for RuntimeConfig

Source§

fn default() -> RuntimeConfig

Returns the “default value” for a type. Read more
Source§

impl Eq for RuntimeConfig

Source§

impl PartialEq for RuntimeConfig

Source§

fn eq(&self, other: &RuntimeConfig) -> 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 RuntimeConfig

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> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more