Skip to main content

WcetFunction

Enum WcetFunction 

Source
pub enum WcetFunction {
    Bounded {
        name: String,
        cycles: u64,
        instr_count: usize,
        loops: Vec<WcetLoopBound>,
        recursion: Option<WcetRecursionBound>,
        hint_rejections: Vec<WcetHintRejection>,
        hint_key: Option<WcetHintKey>,
    },
    Declined {
        name: String,
        reason: WcetDecline,
        note: String,
        op: Option<String>,
        offset: Option<u64>,
        hint_rejections: Vec<WcetHintRejection>,
        hint_key: Option<WcetHintKey>,
    },
}
Expand description

The per-function result: either a sound cycle bound or a loud decline.

Variants§

§

Bounded

A sound upper bound on this function’s execution in cycles.

Fields

§name: String

Function name (WASM export or generated).

§cycles: u64

The sound worst-case cycle bound. For a loop-free function this is the SUM of each instruction’s documented worst-case cycles (each executes at most once). For a function whose loops ALL have proven trip counts (#778 phase 2) each instruction’s cost is multiplied by its proven worst-case execution count. Always ≥ any real execution under the stated precondition.

§instr_count: usize

Number of ARM instructions summed (diagnostic).

§loops: Vec<WcetLoopBound>

Proven loops (empty for a loop-free function), ascending head offset.

§recursion: Option<WcetRecursionBound>

(#778 phase 4 / #49) Present iff this bound was composed via a verified self-recursion certificate; states the derived depth + frame count.

§hint_rejections: Vec<WcetHintRejection>

Hints that were rejected (the static proof stands independently).

§hint_key: Option<WcetHintKey>

(#1063) The key --wcet-hints matches this function on, plus its build-locality — filled by the module driver, absent on sidecars predating the field (additive).

§

Declined

No bound emitted — a loud decline with a machine-readable reason. A decline is emitted (rather than the function omitted) so the map is COMPLETE: a consumer sees every function is either bounded or explicitly unbounded, never silently missing.

Fields

§name: String

Function name.

§reason: WcetDecline

Machine-readable reason.

§note: String

Human-readable note (reason.note()).

§op: Option<String>

(#921) The op that caused the decline, as its ArmOp variant name (I64Add, MveDivF32, …). Emitted for unmodeled-op, where the reason alone left a consumer nothing to act on but a hand-bisect.

ADDITIVE and optional: absent for every other reason, and absent when it cannot be determined, so existing consumers are unaffected.

§offset: Option<u64>

(#921) Byte offset of that op within the function, from the REAL encoder — the same source of truth WcetLoopBound::head_offset uses, so the two are cross-referenceable in one disassembly.

None when any preceding op is one the encoder refuses: an offset that cannot be computed is OMITTED, never approximated, because a wrong offset sends a consumer to the wrong instruction.

§hint_rejections: Vec<WcetHintRejection>

Hints that were offered for this function and rejected.

§hint_key: Option<WcetHintKey>

(#1063) The key --wcet-hints matches this function on, plus its build-locality — filled by the module driver, absent on sidecars predating the field (additive).

Implementations§

Source§

impl WcetFunction

Source

pub fn declined(name: impl Into<String>, reason: WcetDecline) -> Self

Construct a decline, filling in the note from the reason.

Source

pub fn declined_at( name: impl Into<String>, reason: WcetDecline, op: impl Into<String>, offset: Option<u64>, ) -> Self

(#921) Construct a decline that NAMES the offending op and its byte offset. Used for unmodeled-op, whose reason string alone left a consumer with nothing to act on but a hand-bisect of the whole object.

offset is None when the byte position could not be computed from the real encoder; the op name is still emitted, because “which instruction” is the actionable half even without “where”.

Source

pub fn declined_with_rejections( name: impl Into<String>, reason: WcetDecline, hint_rejections: Vec<WcetHintRejection>, ) -> Self

Construct a decline carrying rejected-hint records.

Source

pub fn name(&self) -> &str

The function name this entry is keyed by in the sidecar.

Source

pub fn set_identity(&mut self, display_name: &str, key: &WcetHintKey)

(#1063) Rewrite this entry to its durable identity: the display name plus the hint-key contract the driver assigned. Called by the module driver after composition (composition works in compile names, func_<idx> for internal functions).

Trait Implementations§

Source§

impl Clone for WcetFunction

Source§

fn clone(&self) -> WcetFunction

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 Debug for WcetFunction

Source§

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

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

impl<'de> Deserialize<'de> for WcetFunction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for WcetFunction

Source§

impl PartialEq for WcetFunction

Source§

fn eq(&self, other: &WcetFunction) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for WcetFunction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WcetFunction

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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