Course sequence
The course starts with what a file contains and what lossless compression must preserve. It then builds from two simple ideas—shorter codes for common values and references to repeated data—to prediction, context models, and the codecs in this repository. The codebase material is a separate part; no Rust knowledge is needed for the compression chapters.
No compression or information-theory background is assumed. A byte and a bit are defined in the first part. Fractions and probabilities are introduced before they are used for coding. Rust notation is explained before the source walkthroughs.
| Part | Read in this order | What becomes clear |
|---|---|---|
| 1. Files and the lossless contract | What compression does → Bytes and bits → First round trip | What the input and output are; what “exactly restored” means; why an archive has overhead. |
| 2. Frequency codes | Probability and surprise → Prefix codes → Huffman | How counts can lead to shorter codes, and how a decoder identifies each byte. |
| 3. Repeated sequences | LZ77 | How a decoder reconstructs bytes from earlier output rather than from a code tree. |
| 4. Probabilistic coding | Arithmetic coding → Byte PPM | How changing predictions become bits and why both sides must update in the same order. |
| 5. More context models | Bit PPM → PPMD and exclusion | What changes when the predicted unit is a bit, and what an escape rules out. |
| 6. Combining predictors | Mixing → Match prediction → WikiMix-5 → How the methods fit together | How several imperfect models contribute to one decodable prediction, and how all codec families compare. |
| 7. The implementation | Codebase overview → Rust notation → File flow → LZ77 source → Huffman source → Byte PPM source → Integer arithmetic coder → Other model families | Where data moves, where each algorithm lives, and how encoder and decoder mirror each other. |
| 8. Working on the project | Archive formats → Developer onboarding → Experiments and measurement | How formats are identified, what to change, and how to check correctness and size. |
Each concept chapter uses a small example before describing the repository's implementation. The examples are models for understanding, not claims that the Rust codec writes those exact bytes. The interactive examples are optional visualizations of three ideas; the linked source walkthroughs describe the actual implementation.
For a specific CLI name or unfamiliar term, use the codec reference or glossary. For a particular file, use the source map.