Source map
For the directory tree and the relationship between these files, start with the codebase overview. This page is a lookup table. The project is a Rust binary crate: Cargo.toml names the executable package and src/main.rs declares its modules. Each codec module owns its model, coder, archive writing, decoding, and nearby tests. There is no separate library API to learn before reading a codec.
| File | Start here for |
|---|---|
src/main.rs | Command execution, file I/O, stats, and profile. |
src/cli.rs | CLI syntax and argument parsing. |
src/codec.rs | Codec names, aliases, compression dispatch, archive magic dispatch. |
src/block_huffman.rs | Default block Huffman and bit packing. |
src/adaptive_huffman.rs | Previous-byte Huffman contexts and lazy tree rebuilding. |
src/lz77.rs | Literal and back-reference tokens. |
src/byte_ppm.rs | Byte PPM orders 1–6 and byte order mixing. |
src/ppm.rs | Bit PPM orders 8–64 and bit order mixing. |
src/ppmd.rs | PPMD-style byte exclusion. |
src/ppmd_bit.rs | PPMD byte distribution converted to next-bit probabilities. |
src/ppmd_mix.rs | PPMD byte predictions mixed with bit contexts. |
src/hybrid_ppm.rs | ppm-mix: byte and bit predictors combined. |
src/ppm_match_mix.rs | Hashed match prediction, match, ppm-match-mix, and profiling configurations. |
src/wikimix.rs | Five-model wiki experiment. |
src/io_utils.rs, src/progress.rs | File and progress helpers. |
Where tests and data live
Most modules end with a #[cfg(test)] section containing local round-trip and edge-case tests. cargo test runs them together. Makefile provides build, roundtrip, bench, and optional corpus-download targets. data/sample.txt is tracked and small. The large data/enwik8 and data/enwik9 files are optional and ignored by Git.
docs/wikimix5.md is a design note, not the current behavior contract. For exact codec behavior, read the Rust source and tests.
A reading strategy
Open one codec’s compress, then its decompress. Read the two loops side by side before looking at optimized helpers. The LZ77 walkthrough starts with literal and match tokens. The block Huffman walkthrough adds trees and bit packing. The byte PPM walkthrough adds a model that predicts and updates after each byte.
Next: The wire format and contributor onboarding.