pub struct StageCandidate {
pub name: String,
pub overhead_tokens: u32,
pub savings_tokens: u32,
pub applicable: bool,
}Expand description
Minimum Description Length (MDL) stage selection.
MDL principle (Rissanen 1978): the best compression is the one that minimizes description_length(model) + description_length(data|model).
Instead of running all 16 stages on every input, MDL selects the optimal subset of stages for each content type. Stages that add overhead (headers, legends) without sufficient compression are skipped. A stage candidate with its estimated cost and benefit.
Fields§
§name: StringStage name.
overhead_tokens: u32Estimated overhead in tokens (headers, legends, markers).
savings_tokens: u32Estimated savings in tokens.
applicable: boolWhether this stage is applicable to the content type.
Implementations§
Source§impl StageCandidate
impl StageCandidate
Sourcepub fn net_benefit(&self) -> i32
pub fn net_benefit(&self) -> i32
Net benefit: savings minus overhead. Negative means the stage hurts.
Trait Implementations§
Source§impl Clone for StageCandidate
impl Clone for StageCandidate
Source§fn clone(&self) -> StageCandidate
fn clone(&self) -> StageCandidate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StageCandidate
impl RefUnwindSafe for StageCandidate
impl Send for StageCandidate
impl Sync for StageCandidate
impl Unpin for StageCandidate
impl UnsafeUnpin for StageCandidate
impl UnwindSafe for StageCandidate
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
Mutably borrows from an owned value. Read more