pub struct MMLPathValidator {
pub compression_level: u32,
}Expand description
Validates a tensor transformation using Minimum Message Length (Kolmogorov) principles.
The MML score measures how well the output compresses relative to the input.
A lower score means the transformation found a more optimal encoding path.
The proof is valid only if mml_score <= mml_threshold.
Fields§
§compression_level: u32Implementations§
Source§impl MMLPathValidator
impl MMLPathValidator
Sourcepub fn compute_mml_score(
&self,
input: &Tensor,
output: &Tensor,
) -> TribeResult<f64>
pub fn compute_mml_score( &self, input: &Tensor, output: &Tensor, ) -> TribeResult<f64>
Compute the MML score: ratio of compressed output length to compressed input length. Score < 1.0 means the transformation produced a more compressible result.
Sourcepub fn compute_entropy_mml_score(&self, input: &Tensor, output: &Tensor) -> f64
pub fn compute_entropy_mml_score(&self, input: &Tensor, output: &Tensor) -> f64
Compute an MML-like score using the same byte-level entropy approximation implemented on ESP firmware. This does NOT use DEFLATE and is intended for calibration and comparison only.
Score is defined as: output_entropy / input_entropy, where entropy is Shannon entropy over the raw little-endian bytes of the tensor data.
Sourcepub fn validate(&self, mml_score: f64, mml_threshold: f64) -> bool
pub fn validate(&self, mml_score: f64, mml_threshold: f64) -> bool
Check whether an MML score passes the threshold for a given difficulty.
Sourcepub fn threshold_for_difficulty(base_threshold: f64, difficulty: u64) -> f64
pub fn threshold_for_difficulty(base_threshold: f64, difficulty: u64) -> f64
Compute the MML threshold for a given difficulty level. Tighter (lower) thresholds at higher difficulties.