Skip to content
ZLIB × LEAN / ALGORITHM DETAIL & VERIFICATION

Windows and matching

Where match lengths and distances come from, and why recent history is enough.

THE JOB OF THIS COMPONENT

A repeated passage can be described by a backward distance and a copy length. The compressor keeps recent history to find reusable content. A sliding window limits the retained history; hash chains reduce the candidates that need byte comparisons.

Locate this topic on the global map ↗

The first 2 chapters explain algorithms, data layouts, and optimizations. The final chapter connects the proof argument. Read in order or enter from a familiar stage.

  1. 01
    IMPLEMENTATION DETAIL

    Sliding windows and hash chains

    Understand which earlier bytes to keep and how bounded memory supports continuing match search.

    ↗
  2. 02
    IMPLEMENTATION DETAIL

    Match search and lazy decisions

    Find reusable passages among processed bytes and balance comparison work against match length.

    ↗
  3. 03
    PROOF ARGUMENT

    The matching proof argument

    Explain why references still recover the input after positions move or search stops early.

    ↗
ZLIB × LEAN

Global contents

READING NOWWindows and matching