pub struct MockStreamingDecoder { /* private fields */ }Expand description
Seeded streaming policy model with one cached result per causal solve.
Implementations§
Source§impl MockStreamingDecoder
impl MockStreamingDecoder
Sourcepub fn new(
config: MockDecoderConfig,
seed: u64,
latency_rounds: u32,
) -> Result<Self, DecoderError>
pub fn new( config: MockDecoderConfig, seed: u64, latency_rounds: u32, ) -> Result<Self, DecoderError>
Build a reproducible mock decoder.
§Errors
Returns DecoderError::InvalidProbability or
DecoderError::InvalidGapThreshold for invalid assumptions.
Sourcepub fn request(
&mut self,
key: DecodeKey,
raw: bool,
measurements_ready_at: Option<f64>,
requested_at: f64,
round_duration: f64,
) -> Result<DecoderDecision, DecoderError>
pub fn request( &mut self, key: DecodeKey, raw: bool, measurements_ready_at: Option<f64>, requested_at: f64, round_duration: f64, ) -> Result<DecoderDecision, DecoderError>
Request or reuse one causal solve.
round_duration is the local seam memory-round duration, rather than a
global gate unit. A measurement-backed solve is ready at
measurements_ready_at + latency_rounds * round_duration, or immediately
when a later request arrives after that deadline. A constant solve with
no contributing measurement is ready immediately at requested_at.
§Errors
Returns DecoderError::InvalidTiming if the ready deadline is invalid,
or DecoderError::InconsistentRequest if key is reused for a
different raw parity or deadline.
Sourcepub fn request_at(
&mut self,
key: DecodeKey,
raw: bool,
measurements_ready_at: Option<f64>,
ready_at: f64,
) -> Result<DecoderDecision, DecoderError>
pub fn request_at( &mut self, key: DecodeKey, raw: bool, measurements_ready_at: Option<f64>, ready_at: f64, ) -> Result<DecoderDecision, DecoderError>
Request a solve with an explicit causal deadline.
Factory GAP decisions use this after their required physical QEC rounds;
ordinary readouts should use Self::request to derive the deadline
from the measurement cut.
§Errors
Returns DecoderError::InvalidTiming for a negative or non-finite
timestamp, or a deadline before its measurement cut, or
DecoderError::InconsistentRequest when a cached causal solve is
requested with different inputs.