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: u64T — the measurement window, in milliseconds.
warmup_requests_per_worker: u32Warmup 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: u64Quiesce between warmup completion and the first sampled request.
cooldown_ms: u64§5.1 — cooldown between the two lanes of an interleaved replicate.
n_predict: u32Generated tokens per request (max_tokens on the wire).
replicates: u32Replicates per cell. The matrix declares the FLOOR (replicates_min);
a receipt records the number actually run and is NONCONFORMANT-VALID
below it.
interleaved: boolWhether the replicates alternated A,B,A,B,….
sampler: SamplerThe pinned sampler (PP-28).
Implementations§
Source§impl ProtocolParams
impl ProtocolParams
Sourcepub const fn spec_fallback() -> Self
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.
Sourcepub fn from_matrix() -> Result<Self, String>
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.
Sourcepub fn from_matrix_source(source: &str) -> Result<Self, String>
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
Sourcepub fn effective_with_source() -> (Self, ProtocolSource)
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().
Sourcepub fn effective() -> Self
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).
Trait Implementations§
Source§impl Clone for ProtocolParams
impl Clone for ProtocolParams
impl Copy for ProtocolParams
Source§impl Debug for ProtocolParams
impl Debug for ProtocolParams
Source§impl<'de> Deserialize<'de> for ProtocolParams
impl<'de> Deserialize<'de> for ProtocolParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ProtocolParams
impl PartialEq for ProtocolParams
Source§impl Serialize for ProtocolParams
impl Serialize for ProtocolParams
impl StructuralPartialEq for ProtocolParams
Auto Trait Implementations§
impl Freeze for ProtocolParams
impl RefUnwindSafe for ProtocolParams
impl Send for ProtocolParams
impl Sync for ProtocolParams
impl Unpin for ProtocolParams
impl UnsafeUnpin for ProtocolParams
impl UnwindSafe for ProtocolParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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