ptwm_core::codecs::order1_scale_ac
ptwm_core::codecs::order1_scale_ac
Order1ScaleAC: per-row lag-1 conditional arithmetic coder over the SCALE plane of MXFP4 / NVFP4 tensors.
ptwm_core::codecs::order1_scale_ac
crates/ptwm-core/src/codecs/order1_scale_ac.rs:1mod order1_scale_acOrder1ScaleAC: per-row lag-1 conditional arithmetic coder over the SCALE plane of MXFP4 / NVFP4 tensors.
ptwm_core::codecs::order1_scale_ac::ALPHABET
crates/ptwm-core/src/codecs/order1_scale_ac.rs:4pub const ALPHABETptwm_core::codecs::order1_scale_ac::deserialize_state
crates/ptwm-core/src/codecs/order1_scale_ac.rs:159pub fn deserialize_state(bytes: &[u8]) -> Result<StateV0, PtwmCoreError>Returns `Err` on any structural violation; never panics on arbitrary input.
ptwm_core::codecs::order1_scale_ac::Order1ScaleAC
crates/ptwm-core/src/codecs/order1_scale_ac.rs:72pub struct Order1ScaleAC;ptwm_core::codecs::order1_scale_ac::serialize_state
crates/ptwm-core/src/codecs/order1_scale_ac.rs:143pub fn serialize_state(state: &StateV0) -> Vec<u8>Serialize a [`StateV0`] to its wire byte layout.
ptwm_core::codecs::order1_scale_ac::STATE_FORMAT_VERSION
crates/ptwm-core/src/codecs/order1_scale_ac.rs:5pub const STATE_FORMAT_VERSIONptwm_core::codecs::order1_scale_ac::StateV0
crates/ptwm-core/src/codecs/order1_scale_ac.rs:15pub struct StateV0In-memory state. Wire layout: `[bitmap: 32 B][marginal: 512 B][rows: 512 B × popcount]`. Fields stay crate-private; external callers must go through [`from_parts`] or [`deserialize_state`], both of which validate invariants and call `materialize_cumsums` so `cond_cumsum_for` can index without checks.
order1_arithmetic
Order1Arithmetic: static order-1 (lag-1) arithmetic coder over the exponent byte plane — a learned dynamic-length float coder. Fits a conditional table once, serializes it into codec state (the static table is what makes a future GPU decode kernel feasible), and range-codes against the frozen model. Self-delimiting: it frames the true plane length and ignores the container's source-derived decoded_len.
per_group_codebook
PerGroupCodebook codec.