PTWM
codecs

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

Order1ScaleAC: per-row lag-1 conditional arithmetic coder over the SCALE plane of MXFP4 / NVFP4 tensors.

rsmod

ptwm_core::codecs::order1_scale_ac

crates/ptwm-core/src/codecs/order1_scale_ac.rs:1
mod order1_scale_ac

Order1ScaleAC: per-row lag-1 conditional arithmetic coder over the SCALE plane of MXFP4 / NVFP4 tensors.

rsconst

ptwm_core::codecs::order1_scale_ac::ALPHABET

crates/ptwm-core/src/codecs/order1_scale_ac.rs:4
pub const ALPHABET
rsfn

ptwm_core::codecs::order1_scale_ac::deserialize_state

crates/ptwm-core/src/codecs/order1_scale_ac.rs:159
pub fn deserialize_state(bytes: &[u8]) -> Result<StateV0, PtwmCoreError>

Returns `Err` on any structural violation; never panics on arbitrary input.

rstype

ptwm_core::codecs::order1_scale_ac::Order1ScaleAC

crates/ptwm-core/src/codecs/order1_scale_ac.rs:72
pub struct Order1ScaleAC;
rsfn

ptwm_core::codecs::order1_scale_ac::serialize_state

crates/ptwm-core/src/codecs/order1_scale_ac.rs:143
pub fn serialize_state(state: &StateV0) -> Vec<u8>

Serialize a [`StateV0`] to its wire byte layout.

rsconst

ptwm_core::codecs::order1_scale_ac::STATE_FORMAT_VERSION

crates/ptwm-core/src/codecs/order1_scale_ac.rs:5
pub const STATE_FORMAT_VERSION
rstype

ptwm_core::codecs::order1_scale_ac::StateV0

crates/ptwm-core/src/codecs/order1_scale_ac.rs:15
pub struct StateV0

In-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.

[`from_parts`]: StateV0::from_parts