Expand description
CPU zstd backend — GPU 非搭載環境向け究極の fallback、および test bed。
zstdcrate (zstd-safe+zstd-sys、Apache-2.0 OR MIT) を使った直球実装- 圧縮処理は CPU 重量級なので
tokio::task::spawn_blockingで別スレッドへ逃がす - production では nvCOMP より遅いが、機能 / wire 互換 test の常設レーンとして必須
Structs§
- CpuZstd
- CPU zstd codec。
levelは 1..=22 (zstd-22 は最大圧縮率、時間は長い)。
Functions§
- compress_
blocking - Sync compress sibling of
decompress_blocking. Provided for symmetry — the browser side rarely compresses (it’s read-only), but having both halves keeps the API explainable and useful for offline tooling. - decompress_
blocking - Sync, runtime-free decompress used by
s4-codec-wasm(browser / WASM has no tokio runtime and nospawn_blocking). Same checks as the trait implementation: codec/size match, decompression-bomb cap atmanifest.original_size + 1024, crc32c verify after.