Index chunk evidence is capped by bytes derived from the file size, not by memory
DecisionVerified 2 Oct 2026Holds project: dftracer-utils
Decision. The context, the choice, why, and the options that were turned down.
Context#
The index keeps automatic per-chunk evidence (zonemaps, blooms) for paths. Wide files produced very large indexes, so the evidence needs a budget.
Decision#
The cap is a byte budget, max(8 MiB, stats_share (0.05) x compressed file size). Paths are ranked by non-null count and kept until the cap is spent. path_budget is now an optional count ceiling (0 = none). The result is deterministic: the same file and settings give the same index on any machine.
Why#
A cap from file size depends only on the input and the settings, so the index does not vary by machine. Measured: the wide genesis index shrank 54 percent, and dftracer set queries ran 10-30 percent faster.
Rejected options#
- A cap from the memory budget: the index would depend on the machine.
- A fixed absolute cap: it does not scale with file size.
- Dropping paths early during the build: path frequency is known only at the end of the file.
Also found by searching
- how is per-chunk index evidence chosen under a size budget
- why is the index statistics cap based on compressed file size and not memory
- same file and settings give a different index on another machine
- what does path_budget mean after the byte cap