ariesdevil commented on code in PR #210:
URL: https://github.com/apache/datasketches-rust/pull/210#discussion_r3843648909


##########
datasketches/src/tdigest/sketch.rs:
##########
@@ -44,57 +44,76 @@ const INITIAL_UNMERGED_CAPACITY: usize = 8;
 /// Default weight for single values.
 const DEFAULT_WEIGHT: NonZeroU64 = NonZeroU64::new(1).unwrap();
 
+// The update buffer has two physical representations:
+//
+// * `Staging` stores raw `f64` values compactly before the first compression.
+// * `Centroids` stores `[compressed prefix | unmerged unit-weight tail]` in 
one allocation. The
+//   tail length identifies the boundary between the two regions.
+//
+// Compression permanently transitions a non-empty buffer from `Staging` to 
`Centroids`.
 #[derive(Debug, Clone)]
-enum MutableStorage {
-    /// Compact staging storage used before the first compression.
-    Initial(Vec<f64>),
-    /// Compressed centroids followed by `num_unmerged` unit-weight values.
-    Active {
+enum TDigestBuffer {
+    Staging(Vec<f64>),
+    Centroids {

Review Comment:
   Good names



-- 
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]

Reply via email to