ptwm_core::entropy::context_mixing::coder
ptwm_core::entropy::context_mixing::coder
Bit-level encode/decode driver. Ties the context models + gated mixer to the shared range coder, coding each byte MSB-first. The payload is self-delimiting: a u32 LE length prefix precedes the coded bits, so decode never depends on the container's decoded_len.
ptwm_core::entropy::context_mixing::coder
crates/ptwm-core/src/entropy/context_mixing/coder.rs:1mod coderBit-level encode/decode driver. Ties the context models + gated mixer to the shared range coder, coding each byte MSB-first. The payload is self-delimiting: a u32 LE length prefix precedes the coded bits, so decode never depends on the container's `decoded_len`.
ptwm_core::entropy::context_mixing::coder::decode_plane
crates/ptwm-core/src/entropy/context_mixing/coder.rs:60pub fn decode_plane(payload: &[u8]) -> Result<Vec<u8>, PtwmCoreError>Decode a plane produced by [`encode_plane`].
ptwm_core::entropy::context_mixing::coder::encode_plane
crates/ptwm-core/src/entropy/context_mixing/coder.rs:26pub fn encode_plane(data: &[u8]) -> Vec<u8>Encode a plane. Output = `[len: u32 LE][range-coded bits]`.
ptwm_core::entropy::context_mixing::coder::MAX_LEN
crates/ptwm-core/src/entropy/context_mixing/coder.rs:16pub const MAX_LENAbsolute cap on the framed length (mirrors rans.rs) — guards a hostile prefix from driving a multi-GiB decode, and bounds the encoder's usize→u32 length cast.
context_mixing
Opt-in context-mixing plane codec (cmix/lpaq lineage). Bit-level prediction from byte-history models, context-gated logistic mixing, binary range coding. Fully integer/deterministic; stateless on the wire.
mixer
Context-gated logistic mixer. One weight vector per gating context (the partial-byte register c0, bounded to 256). Mixes the models' stretched logits, squashes to a probability, and learns the weights online by logistic gradient. Integer/deterministic.