codecs
ptwm_core::codecs::zstd_dict
Zstd plane codec with dictionary support.
ptwm_core::codecs::zstd_dict
Zstd plane codec with dictionary support.
ptwm_core::codecs::zstd_dict
crates/ptwm-core/src/codecs/zstd_dict.rs:1mod zstd_dictZstd plane codec **with dictionary support**.
Functionally equivalent to [`crate::codecs::zstd::Zstd`] when the
plane's state bytes are empty: the encoder emits a plain Zstd frame
and the decoder accepts it.
When `state_bytes` is non-empty, the codec treats it as a
pre-trained Zstd dictionary. Encoding seeds the compressor's LZ
window with the dictionary content so repeated structural patterns
(e.g. attention block headers, embedding row layouts) compress to
shorter back-references. Decoding must use the *same* dictionary
bytes, which is why they ride along in the plane record's state
slot.
Dictionary training is out of scope for this module. See
`zstd --train` or the `ptwm chains train-dict` future CLI surface.
The codec is generic over whatever bytes the caller
decides to ship as the dictionary.
ptwm_core::codecs::zstd_dict::ZstdDict
crates/ptwm-core/src/codecs/zstd_dict.rs:31pub struct ZstdDict;