Summary
The tumbling-window integration for KLL constructs each pool sketch with the unseeded KLL::init, and KLLConfig carries no seed. So the compaction coin is Coin::new() (wall-clock random), and tumbling_clear() re-randomizes it on every window rotation. Two processes/hosts running the same tumbling pipeline therefore diverge in their exact retained samples from the very first window.
Where
src/sketch_framework/tumbling.rs:141 — impl TumblingWindowSketch for KLL's from_config calls KLL::init(config.k, config.m) (not init_with_seed).
src/sketch_framework/tumbling.rs — KLLConfig has k, m only; no seed field.
src/sketches/kll.rs — KLL::init → Coin::new(); clear() re-seeds from Coin::new() when seed == None.
Impact
- Determinism / parity, not correctness. Each process's estimates stay within KLL's error bound and merge fine; but exact cross-process agreement (needed for byte-level reproducibility, dedup, or verification) is not achievable, and re-randomizes each window via
tumbling_clear().
- Only
KLL is affected among tumbling sketches; KLLDynamic is not wired into tumbling at all (and has no seeded constructor either).
Independence from the ASAPv1 wire format
This is unrelated to sketch serialization: the tumbling pool builds sketches locally via from_config and clears them in place — it never (de)serializes its pool sketches. Serializing seed (see the KLL ASAPv1 payload work) does not touch this path.
Suggested fix
Add an optional seed to KLLConfig and use KLL::init_with_seed(k, m, seed) in from_config, so a configured seed makes tumbling KLL reproducible across processes (and survives tumbling_clear(), which already re-seeds from the stored seed when present).
Summary
The tumbling-window integration for
KLLconstructs each pool sketch with the unseededKLL::init, andKLLConfigcarries no seed. So the compaction coin isCoin::new()(wall-clock random), andtumbling_clear()re-randomizes it on every window rotation. Two processes/hosts running the same tumbling pipeline therefore diverge in their exact retained samples from the very first window.Where
src/sketch_framework/tumbling.rs:141—impl TumblingWindowSketch for KLL'sfrom_configcallsKLL::init(config.k, config.m)(notinit_with_seed).src/sketch_framework/tumbling.rs—KLLConfighask,monly; noseedfield.src/sketches/kll.rs—KLL::init→Coin::new();clear()re-seeds fromCoin::new()whenseed == None.Impact
tumbling_clear().KLLis affected among tumbling sketches;KLLDynamicis not wired into tumbling at all (and has no seeded constructor either).Independence from the ASAPv1 wire format
This is unrelated to sketch serialization: the tumbling pool builds sketches locally via
from_configand clears them in place — it never (de)serializes its pool sketches. Serializingseed(see the KLL ASAPv1 payload work) does not touch this path.Suggested fix
Add an optional
seedtoKLLConfigand useKLL::init_with_seed(k, m, seed)infrom_config, so a configured seed makes tumbling KLL reproducible across processes (and survivestumbling_clear(), which already re-seeds from the stored seed when present).