You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ AI-generated issue — requires human investigation before acting on it.
Summary
HashCounter in src/collector.rs uses std::collections::hash_map::DefaultHasher for mapping stack traces to buckets. The Rust standard library explicitly documents that the hashing algorithm of DefaultHasher is not guaranteed to be stable across Rust versions or even across program runs (it may use randomisation).
Location
src/collector.rs, lines 124–128:
fnhash(key:&T) -> u64{letmut s = DefaultHasher::new();
key.hash(&mut s);
s.finish()}
Impact
A Rust version upgrade could change the hash function, altering bucket distribution and eviction behaviour without notice.
Hash randomisation (if ever enabled for DefaultHasher) would randomise which stack traces are evicted under pressure, making profiling results non-reproducible across runs.
Poor hash distribution for the specific structure of UnresolvedFrames keys (sequences of instruction pointers) could cause excessive collisions and evictions, silently degrading data accuracy.
Expected behaviour
Use a stable, well-distributed hasher appropriate for profiler workloads, such as fnv, ahash, or rustc-hash. The choice should be documented alongside the eviction policy.
Summary
HashCounterinsrc/collector.rsusesstd::collections::hash_map::DefaultHasherfor mapping stack traces to buckets. The Rust standard library explicitly documents that the hashing algorithm ofDefaultHasheris not guaranteed to be stable across Rust versions or even across program runs (it may use randomisation).Location
src/collector.rs, lines 124–128:Impact
DefaultHasher) would randomise which stack traces are evicted under pressure, making profiling results non-reproducible across runs.UnresolvedFrameskeys (sequences of instruction pointers) could cause excessive collisions and evictions, silently degrading data accuracy.Expected behaviour
Use a stable, well-distributed hasher appropriate for profiler workloads, such as
fnv,ahash, orrustc-hash. The choice should be documented alongside the eviction policy.