pub struct ChunkPolicy {
pub target: Duration,
pub min_samples: u32,
pub max_samples: u32,
pub calibration_samples: u32,
}Expand description
How chunks are sized for a crate::LanePool run.
Fields§
§target: DurationTarget wall-clock duration of one chunk. Long enough that per-request overhead (handshake, upload, the final transfer) is negligible against it; short enough that a slow lane never holds the tail of the image hostage while every other lane idles.
min_samples: u32Floor for a rate-sized chunk: a zero, tiny or non-finite rate must not collapse the chunk to something overhead dominates.
max_samples: u32Ceiling for any chunk (DEFAULT_MAX_CHUNK_SAMPLES for remote workers).
calibration_samples: u32Size of an uncalibrated lane’s first chunk (see the module doc).
Implementations§
Source§impl ChunkPolicy
impl ChunkPolicy
Sourcepub const EXPORT: Self
pub const EXPORT: Self
The still export and tilt video: about 22 s per chunk, a 32-sample floor (below that a remote round trip costs more than it saves), an 8-sample calibration probe – the desktop export’s existing numbers.
Sourcepub const INTERACTIVE: Self
pub const INTERACTIVE: Self
Interactive (live-view) requests: about 1.5 s per chunk so progress arrives often, single-sample floor and calibration.
Sourcepub const fn fixed(samples: u32) -> Self
pub const fn fixed(samples: u32) -> Self
Every chunk (calibration included) is exactly samples long, whatever the rate.
The chunk partition of a run is then independent of timing (see
crate::Merger’s determinism notes). 0 is treated as 1.
Sourcepub fn samples_for_rate(&self, rate: f64) -> u32
pub fn samples_for_rate(&self, rate: f64) -> u32
The chunk size for a lane measured at rate samples per second: rate * target, rounded, clamped to [min_samples, max_samples]; min_samples for a
non-finite or non-positive rate. Never 0.
Sourcepub fn first_chunk_samples(&self) -> u32
pub fn first_chunk_samples(&self) -> u32
The first chunk of an uncalibrated lane, clamped to [1, max_samples].