Skip to main content

ProtocolParams

Struct ProtocolParams 

Source
pub struct ProtocolParams {
    pub window_ms: u64,
    pub warmup_requests_per_worker: u32,
    pub quiesce_ms: u64,
    pub cooldown_ms: u64,
    pub n_predict: u32,
    pub replicates: u32,
    pub interleaved: bool,
    pub sampler: Sampler,
}
Expand description

§5.1 — the protocol block, read from perf-matrix.yaml and emitted verbatim at the receipt’s top level as protocol.

A reader that cannot see the window, the warmup, the cooldown, the sampler and the replicate count cannot tell a 60 s conformant band from a 5 s one, and two receipts written under different protocols are not comparable — which is why the whole block is also in the PP-22 join key.

Fields§

§window_ms: u64

T — the measurement window, in milliseconds.

§warmup_requests_per_worker: u32

Warmup requests per worker, discarded (§4.4.2’s 2 × c as a per-worker count, so the band-level figure is warmup_requests_per_worker × c).

§quiesce_ms: u64

Quiesce between warmup completion and the first sampled request.

§cooldown_ms: u64

§5.1 — cooldown between the two lanes of an interleaved replicate.

§n_predict: u32

Generated tokens per request (max_tokens on the wire).

§replicates: u32

Replicates per cell. The matrix declares the FLOOR (replicates_min); a receipt records the number actually run and is NONCONFORMANT-VALID below it.

§interleaved: bool

Whether the replicates alternated A,B,A,B,….

§sampler: Sampler

The pinned sampler (PP-28).

Implementations§

Source§

impl ProtocolParams

Source

pub const fn spec_fallback() -> Self

The spec literals, as a documented fallback for tests and for callers that must render a receipt before the matrix carries a protocol: block.

Never reached silently by Self::from_matrix, which returns Err.

Source

pub fn from_matrix() -> Result<Self, String>

Read the protocol: block out of the compiled-in perf-matrix.yaml.

§Errors

When the file does not parse as YAML, or when it carries no protocol: block, or when the block is missing a key. The error NAMES the missing thing: a protocol silently defaulted to the Rust consts is exactly the drift PP-33 exists to prevent.

Source

pub fn from_matrix_source(source: &str) -> Result<Self, String>

Self::from_matrix against an explicit document, so a test can feed a matrix that differs from the shipped one.

§Errors

As Self::from_matrix.

Source

pub fn effective_with_source() -> (Self, ProtocolSource)

The parameters a receipt written on this checkout must use, with the provenance of where they came from.

Self::from_matrix is the honest reader and returns Err; this is the one place the fallback is taken, and the returned ProtocolSource is what the producer prints once and — on the fallback — names in unproduced_fields.

The silent version of this (Self::effective, which discarded the error) put the Rust consts on the wire under a protocol: block the receipt then claimed came from the matrix. PP-33’s whole point is that every gated number lives in perf-matrix.yaml; a receipt that quietly substituted a compiled-in copy is the drift it exists to prevent, and it was invisible because nothing ever called source().

Source

pub fn effective() -> Self

Self::effective_with_source without the provenance, for callers that record it separately (the CLI producer) or do not write a receipt at all (tests, BandConfig).

Source

pub fn source() -> Result<&'static str, String>

"perf-matrix.yaml" when the matrix declares a protocol: block, and the reason the fallback was taken otherwise.

§Errors

When the matrix has no protocol: block; the error is the provenance note a caller puts in unproduced_fields.

Trait Implementations§

Source§

impl Clone for ProtocolParams

Source§

fn clone(&self) -> Self

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 ProtocolParams

Source§

impl Debug for ProtocolParams

Source§

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

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

impl<'de> Deserialize<'de> for ProtocolParams

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 PartialEq for ProtocolParams

Source§

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

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 ProtocolParams

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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, !>

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.