Skip to main content

Module compress

Module compress 

Source
Expand description

LZ4 block-stream compressor for browser-deployable dataset artifacts.

Unified v3 .q42 volumes already embed LZ4-compressed SuperBlocks; the compress command copies them unchanged. Legacy v1 raw SuperBlock streams are still converted to the framed transport format for the browser VFS:

Per block:
  [block_id:   u64 LE]
  [comp_len:   u32 LE]
  [uncomp_len: u32 LE]
  [payload:    comp_len bytes]   โ€” lz4_flex::compress_prepend_size output

Structsยง

CompressStats

Constantsยง

CHUNK_SIZE ๐Ÿ”’
Bytes per compressed chunk. 8 192 ร— 48 = 393 216 โ€” the same size used by the import pipeline, so the browser decoder is identical for both sources.
QUINS_PER_BLOCK ๐Ÿ”’
QUIN_DATA_PER_BLOCK ๐Ÿ”’
QUIN_SIZE ๐Ÿ”’
SUPERBLOCK_HEADER ๐Ÿ”’
SUPERBLOCK_SIZE ๐Ÿ”’
SuperBlock layout constants (must match qualia-core-db).

Functionsยง

compress_q42
Compress a .q42 file. Unified v3 volumes are copied as-is; legacy v1 SuperBlock streams are stripped and re-framed for the browser VFS.
compress_raw
Compress any binary file (e.g. legacy .lex sidecar) as raw bytes.
read_exact_or_eof ๐Ÿ”’
write_lz4_block ๐Ÿ”’