tisonkun opened a new pull request, #173: URL: https://github.com/apache/datasketches-rust/pull/173
## Summary - normalize interpolation weights before multiplication so finite extreme inputs produce finite quantiles - reject non-finite extrema and invalid reference-format centroid weights during deserialization - detect native and reference-format total-weight overflow, including buffered values, and return `InvalidData` instead of panicking ## Motivation A cross-implementation test audit against DataSketches Java and C++ exposed two P0 correctness gaps in the Rust TDigest implementation. The first is the Rust manifestation of apache/datasketches-java#702: quantile interpolation multiplied each value by its raw weight before normalization, so alternating `-f64::MAX` and `f64::MAX` inputs produced non-finite quartiles even though every input and stored centroid mean was finite. The second affects malformed serialized input. Native data could retain infinite extrema, while reference-format floating-point weights were converted to `u64` before validation. Cumulative centroid or buffered weight overflow then either panicked in debug builds or could wrap in release builds. The changes preserve the existing serialization formats and valid Java, C++, and reference snapshots. Tests cover public TDigest behavior and malformed-input regressions only; no language-specific implementation tests were copied. ## Commits 1. `fix(tdigest): keep extreme finite quantiles finite` 2. `fix(tdigest): reject invalid serialized state` ## Validation - `cargo x check` - `cargo x test` (480 tests) - `cargo x lint` - targeted TDigest behavior and serialization tests -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
