Skip to main content

Module api

Module api 

Source
Expand description

Public spec-first API reexports. Public, spec-first infotheory API surface.

Re-exports§

pub use crate::prediction::OnlineBytePredictor;
pub use crate::spec::AssetRef;
pub use crate::spec::CanonicalBytes;
pub use crate::spec::CanonicalJson;
pub use crate::spec::CompiledCompressionBackend;
pub use crate::spec::CompiledRateBackend;
pub use crate::spec::CompressionBackendCapabilities;
pub use crate::spec::MethodBackendFamily;
pub use crate::spec::RateBackendCapabilities;
pub use crate::spec::RateBackendTraceStrategy;
pub use crate::spec::SpecEnvironment;
pub use crate::spec::ValidatedCompressionBackend;
pub use crate::spec::ValidatedRateBackend;

Structs§

BinaryPrediction
Probability pair for the next binary symbol.
BytePrefixMass
Live byte-prefix state used to query a 256-way byte PDF as conditional bits.
CalibratedSpec
Configuration for an SSE-calibrated wrapper rate backend.
CompressionPathBatchOptions
Options for backend-first path compression-size operations.
GenerationConfig
Generation options shared by the library API and CLI.
InfotheoryCtx
Reusable execution context holding default rate and compression backends.
MixtureExpertSpec
Expert specification for mixture backends.
MixtureSpec
Mixture specification for rate-backend mixtures.
NcdComputeOptions
NCD compute options (operation-level parallelism only).
ParticleSpec
Configuration for a particle-latent filter ensemble rate backend.
RateBackendBitSession
Stateful bit-level session over a rate backend.
RateBackendBitSessionCheckpoint
Opaque checkpoint for restoring a RateBackendBitSession.
RateBackendSession
Stateful rate-backend session for fitting, conditioning, and continuation.

Enums§

BitOrder
Bit ordering used when factorizing byte symbols.
BitStreamSemantics
Semantic interpretation of a bit stream.
CalibrationContextKind
Fixed context families for calibrated PDF wrappers.
CompressionBackend
Compression backend used by NCD/compression-size operations.
GenerationStrategy
How to pick the next byte from the model distribution.
GenerationUpdateMode
How generated symbols should update the model state.
MixtureKind
Mixture policy kind for rate-backend mixtures.
MixtureScheduleMode
Adaptive schedule family for switching and convex mixtures.
NcdVariant
Normalized compression-distance formula variant.
OperationParallelism
Per-call control over operation-level parallelism.
RateBackend
Core predictive model class used by the library.
ZpaqMethodSpec
Typed ZPAQ method specification.

Constants§

MAX_MIXTURE_NESTING
Shared maximum nesting depth for recursive mixture specifications.

Traits§

OnlineBitPredictor
Minimal bit predictor interface for true binary consumers.

Functions§

d_kl_bytes
KL divergence D_KL(P || Q) between the byte histograms of x and y (bits).
empirical_cross_entropy_bytes
Empirical (zero-order, IID) cross-entropy H₀_q(p) = -Σ p(x) log₂ q(x) between the byte histograms of test_data (treated as p) and train_data (treated as q).
empirical_entropy_bytes
Empirical (zero-order, IID) Shannon entropy H₀(X) in bits/symbol.
empirical_joint_entropy_bytes
Empirical (zero-order, IID) joint Shannon entropy H₀(X,Y) over aligned prefixes.
empirical_mutual_information_bytes
Empirical (zero-order, IID) mutual information I₀(X;Y) from byte histograms.
empirical_ned_bytes
Empirical (zero-order, IID) normalized entropy distance: (H₀(X,Y) - min(H₀(X), H₀(Y))) / max(H₀(X), H₀(Y)).
empirical_ned_cons_bytes
Empirical (zero-order, IID) constructive normalized entropy distance: (H₀(X,Y) - min(H₀(X), H₀(Y))) / H₀(X,Y).
empirical_nte_bytes
Empirical (zero-order, IID) NTE estimate using variation of information normalized by max(H₀(X), H₀(Y)).
empirical_resistance_to_transformation_bytes
Empirical (zero-order, IID) resistance-to-transformation estimate: I₀(X; T(X)) / H₀(X) for tx = T(x).
get_default_ctx
Returns the current default information theory context for this thread.
js_div_bytes
Jensen-Shannon divergence between the byte histograms of x and y (bits).
nhd_bytes
Normalized Hellinger distance between the byte distributions of x and y.
parse_mixture_kind_name
Parse a mixture kind name with the shared alias table used across CLI, Python, and WASM.
parse_mixture_schedule_name
Parse a mixture schedule mode with the shared alias table used across CLI, Python, and WASM.
set_default_ctx
Sets the current default information theory context for this thread.
try_biased_entropy_rate_backend
Fallible biased/plugin entropy rate of data using the explicit rate backend.
try_biased_entropy_rate_bytes
Fallible biased/plugin entropy-rate estimate using the default context backend.
try_compress_bytes_backend
Compress data with backend and return encoded bytes.
try_compress_size_backend
Compute compressed size (bytes) for data using backend.
try_compress_size_chain_backend
Compute compressed size (bytes) for a logical concatenation of parts using backend.
try_conditional_entropy_bytes
Fallible conditional entropy estimate using the default context rate backend.
try_conditional_entropy_paths
Compute conditional entropy estimate H(X|Y) for two files using the default rate backend.
try_conditional_entropy_rate_bytes
Fallible conditional entropy-rate estimate H(X|Y) with the default context backend.
try_cross_entropy_bytes
Fallible cross-entropy estimate H_train(test) using the default context rate backend.
try_cross_entropy_paths
Compute cross-entropy estimate H_train(test) for two files using the default rate backend.
try_cross_entropy_rate_backend
Fallible cross-entropy H_{train}(test) — score test_data under a model trained on train_data.
try_cross_entropy_rate_bytes
Fallible cross-entropy rate estimate with the default context backend.
try_decompress_bytes_backend
Decompress input with backend and return decoded bytes.
try_entropy_rate_backend
Fallible entropy-rate estimate of data using the explicit rate backend.
try_entropy_rate_bytes
Fallible entropy-rate estimate Ĥ(X) (bits per symbol) using the default context backend.
try_generate_bytes
Generate a continuation from prompt using the current default context and GenerationConfig::default().
try_generate_bytes_conditional_chain
Generate a continuation after conditioning on an explicit chain of prefix parts using the current default context and GenerationConfig::default().
try_generate_bytes_conditional_chain_with_config
Generate a continuation after conditioning on an explicit chain of prefix parts using the current default context.
try_generate_bytes_with_config
Generate a continuation from prompt using the current default context.
try_get_bytes_from_paths
Read all files in paths in parallel and return their contents.
try_get_compressed_size_path_backend
Read path and return its compressed size (bytes) using backend.
try_get_compressed_sizes_from_paths_backend
Compute compressed sizes for paths using backend.
try_get_compressed_sizes_from_paths_backend_with_options
Compute compressed sizes for paths using backend with explicit operation-level parallelism controls.
try_intrinsic_dependence_bytes
Fallible intrinsic dependence estimate: (H₀(X) - Ĥ(X)) / H₀(X), where H₀ is the order-0 / empirical entropy and Ĥ is the entropy rate produced by the default context’s rate backend.
try_joint_entropy_rate_backend
Fallible joint entropy rate H(X,Y) using an explicit backend.
try_joint_entropy_rate_bytes
Fallible joint entropy-rate estimate H(X,Y) with the default context backend.
try_js_divergence_paths
Compute Jensen-Shannon divergence between the byte histograms of two files.
try_kl_divergence_paths
Compute KL divergence between the byte histograms of two files.
try_mutual_information_bytes
Fallible mutual-information estimate I(X;Y) using the default context rate backend.
try_mutual_information_paths
Compute mutual information estimate for two files using the default rate backend.
try_mutual_information_rate_backend
Mutual information rate estimate under an explicit backend.
try_mutual_information_rate_bytes
Fallible mutual-information rate estimate with the default context backend.
try_ncd_bytes_backend
Compute NCD for byte slices with an explicit compression backend.
try_ncd_bytes_backend_with_options
Compute NCD for byte slices with an explicit compression backend and explicit operation-level parallelism controls.
try_ncd_bytes_default
Compute NCD for byte slices using the thread-local default context.
try_ncd_matrix_bytes_backend
Compute an n x n pairwise NCD matrix (row-major) with an explicit compression backend.
try_ncd_matrix_bytes_backend_with_options
Compute an n x n pairwise NCD matrix with explicit operation-level parallelism controls.
try_ncd_matrix_bytes_default
Compute an n x n pairwise NCD matrix (row-major) using the thread-local default context.
try_ncd_matrix_paths_backend
Compute an n x n pairwise NCD matrix (row-major) for file paths with an explicit compiled compression backend.
try_ncd_matrix_paths_backend_with_options
Compute an n x n pairwise NCD matrix (row-major) for file paths with an explicit compiled compression backend and operation-level parallelism controls.
try_ncd_paths_backend
Compute NCD for two files with an explicit compression backend.
try_ncd_paths_compiled_backend
Compute NCD for two files with an explicit compiled compression backend.
try_ncd_paths_compiled_backend_with_options
Compute NCD for two files with an explicit compiled compression backend and explicit operation-level parallelism controls.
try_ned_bytes
Fallible normalized entropy distance (NED) estimate with the default context backend.
try_ned_cons_bytes
Fallible constructive NED estimate with the default context backend.
try_ned_cons_rate_bytes
Fallible entropy-rate constructive NED estimate with the default context backend.
try_ned_paths
Compute normalized entropy distance (NED) for two files using the default rate backend.
try_ned_rate_backend
Normalized entropy distance under an explicit backend.
try_ned_rate_bytes
Fallible entropy-rate NED estimate with the default context backend.
try_nhd_paths
Compute normalized Hellinger distance (NHD) between the byte distributions of two files.
try_nte_bytes
Fallible normalized transform-effort (NTE/VI-based) estimate with the default context backend.
try_nte_paths
Compute normalized transform effort (NTE) for two files using the default rate backend.
try_nte_rate_backend
Normalized transform effort (variation-of-information form) under an explicit backend.
try_nte_rate_bytes
Fallible entropy-rate NTE estimate with the default context backend.
try_resistance_to_transformation_bytes
Fallible resistance-to-transformation estimate: I(X; T(X)) / H(X) for tx = T(x), using the default context rate backend.
try_tvd_paths
Compute total variation distance (TVD) between the byte distributions of two files.
tvd_bytes
Total variation distance between the byte distributions of x and y.
validate_compression_backend
Validate a compression backend, including nested rate-backed compressors.
validate_rate_backend
Validate a rate backend, including nested mixture/calibrated subgraphs.