euv-core 0.57.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
/// Little-endian 32-bit Zstandard frame magic number (`0xFD2FB528`).
pub(crate) const ZSTD_FRAME_MAGIC_LE: u32 = 0xFD2F_B528;

/// Inclusive minimum little-endian magic number for RFC 8878 skippable frames (`0x184D2A50`).
pub(crate) const ZSTD_SKIPPABLE_MAGIC_MIN: u32 = 0x184D_2A50;

/// Inclusive maximum little-endian magic number for RFC 8878 skippable frames (`0x184D2A5F`).
pub(crate) const ZSTD_SKIPPABLE_MAGIC_MAX: u32 = 0x184D_2A5F;

/// Maximum uncompressed block payload size permitted by RFC 8878 (`128 KiB`).
pub(crate) const ZSTD_MAX_BLOCK_SIZE: usize = 128 * 1024;

/// Maximum sliding window allocation ceiling (`128 MiB`) guarding against corrupted headers.
pub(crate) const ZSTD_MAX_WINDOW_SIZE: usize = 128 * 1024 * 1024;

/// Maximum total decoded output buffer ceiling (`512 MiB`) guarding against expansion bombs.
pub(crate) const ZSTD_MAX_OUTPUT_SIZE: usize = 512 * 1024 * 1024;

/// Maximum Huffman code bit length allowed by RFC 8878 (`11` bits).
pub(crate) const ZSTD_HUFFMAN_MAX_BITS: u8 = 11;

/// Maximum Huffman symbol table size (`256` literals).
pub(crate) const ZSTD_HUFFMAN_MAX_SYMBOLS: usize = 256;

/// Maximum FSE accuracy log for compressed Huffman weights (`6`).
pub(crate) const ZSTD_FSE_MAX_LOG_HUFFMAN: u8 = 6;

/// Maximum FSE accuracy log for literals length codes (`9`).
pub(crate) const ZSTD_FSE_MAX_LOG_LL: u8 = 9;

/// Maximum FSE accuracy log for match length codes (`9`).
pub(crate) const ZSTD_FSE_MAX_LOG_ML: u8 = 9;

/// Maximum FSE accuracy log for offset codes (`8`).
pub(crate) const ZSTD_FSE_MAX_LOG_OF: u8 = 8;

/// Predefined RFC 8878 FSE accuracy log for literals length codes (`6`).
pub(crate) const ZSTD_PREDEF_LL_LOG: u8 = 6;

/// Predefined RFC 8878 FSE normalized distribution for literals length codes (`36` symbols).
pub(crate) const ZSTD_PREDEF_LL_DIST: [i16; 36] = [
    4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1,
    -1, -1, -1, -1,
];

/// Predefined RFC 8878 FSE accuracy log for match length codes (`6`).
pub(crate) const ZSTD_PREDEF_ML_LOG: u8 = 6;

/// Predefined RFC 8878 FSE normalized distribution for match length codes (`53` symbols).
pub(crate) const ZSTD_PREDEF_ML_DIST: [i16; 53] = [
    1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1,
];

/// Predefined RFC 8878 FSE accuracy log for offset codes (`5`).
pub(crate) const ZSTD_PREDEF_OF_LOG: u8 = 5;

/// Predefined RFC 8878 FSE normalized distribution for offset codes (`29` symbols).
pub(crate) const ZSTD_PREDEF_OF_DIST: [i16; 29] = [
    1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1,
];

/// RFC 8878 literals length code baseline table (`36` entries).
pub(crate) const ZSTD_LL_BASELINES: [u32; 36] = [
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 28, 32, 40, 48, 64,
    128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536,
];

/// RFC 8878 literals length code extra bit counts (`36` entries).
pub(crate) const ZSTD_LL_EXTRA_BITS: [u8; 36] = [
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11,
    12, 13, 14, 15, 16,
];

/// RFC 8878 match length code baseline table (`53` entries).
pub(crate) const ZSTD_ML_BASELINES: [u32; 53] = [
    3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
    28, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41, 43, 47, 51, 59, 67, 83, 99, 131, 259, 515, 1027,
    2051, 4099, 8195, 16387, 32771, 65539,
];

/// RFC 8878 match length code extra bit counts (`53` entries).
pub(crate) const ZSTD_ML_EXTRA_BITS: [u8; 53] = [
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
];

/// Initial RFC 8878 repeat offset triple reset at the start of every Zstd frame.
pub(crate) const ZSTD_INITIAL_REPEAT_OFFSETS: [usize; 3] = [1, 4, 8];

/// Error returned when input bytes do not start with a valid Zstandard frame or skippable frame magic.
pub(crate) const ERR_BLEND_ZSTD_BAD_MAGIC: &str = "blend: invalid zstd frame magic signature";

/// Error returned when a Zstandard stream ends prematurely before completing a frame or block.
pub(crate) const ERR_BLEND_ZSTD_TRUNCATED: &str = "blend: truncated zstd stream";

/// Error returned when a Zstandard frame header sets reserved or unsupported dictionary fields.
pub(crate) const ERR_BLEND_ZSTD_HEADER: &str = "blend: malformed or unsupported zstd frame header";

/// Error returned when a Zstandard block header carries reserved block type `3` or oversized length.
pub(crate) const ERR_BLEND_ZSTD_BLOCK: &str = "blend: invalid zstd block header or size";

/// Error returned when a Zstandard Huffman table or literal stream is malformed.
pub(crate) const ERR_BLEND_ZSTD_HUFFMAN: &str = "blend: malformed zstd huffman literals section";

/// Error returned when a Zstandard FSE table or sequence stream is malformed.
pub(crate) const ERR_BLEND_ZSTD_FSE: &str = "blend: malformed zstd fse table or sequence section";

/// Error returned when a Zstandard sequence references an out-of-range offset or literal count.
pub(crate) const ERR_BLEND_ZSTD_SEQUENCE: &str = "blend: invalid zstd sequence offset or length";

/// Error returned when decompressed Zstandard frame size mismatches `Frame_Content_Size` or exceeds limits.
pub(crate) const ERR_BLEND_ZSTD_SIZE: &str = "blend: zstd output size mismatch or limit exceeded";