This is an automated email from the ASF dual-hosted git repository.

placave pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new f37288f  chore: fixup new typos glossary and linters (#18)
f37288f is described below

commit f37288fab5d3d243d0c4f71c06f55853e6b452d5
Author: tison <[email protected]>
AuthorDate: Mon Dec 15 20:20:54 2025 +0800

    chore: fixup new typos glossary and linters (#18)
    
    Signed-off-by: tison <[email protected]>
---
 Cargo.toml                     |  9 +++++++++
 src/hll/aux_map.rs             |  4 ++--
 src/hll/cubic_interpolation.rs | 29 ++++++++++++++---------------
 src/hll/mod.rs                 |  4 ++--
 src/hll/sketch.rs              |  6 +++---
 typos.toml                     |  3 ++-
 6 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index f2c7829..ad4eeb6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,3 +36,12 @@ rustdoc-args = ["--cfg", "docsrs"]
 
 [dependencies]
 mur3 = { version = "0.1.0" }
+
+[lints.rust]
+unknown_lints = "deny"
+unsafe_code = "deny"
+unused_must_use = "deny"
+
+[lints.clippy]
+dbg_macro = "deny"
+too_many_arguments = "allow"
diff --git a/src/hll/aux_map.rs b/src/hll/aux_map.rs
index 33e2fdb..8eb1ef8 100644
--- a/src/hll/aux_map.rs
+++ b/src/hll/aux_map.rs
@@ -20,7 +20,7 @@
 //! Stores slot-value pairs for values that don't fit in the 4-bit main array.
 //! Uses open addressing with stride-based probing for collision resolution.
 
-use crate::hll::{RESIZE_DENOM, RESIZE_NUMER, get_slot, get_value, pack_coupon};
+use crate::hll::{RESIZE_DENOMINATOR, RESIZE_NUMERATOR, get_slot, get_value, 
pack_coupon};
 
 const ENTRY_EMPTY: u32 = 0;
 
@@ -175,7 +175,7 @@ impl AuxMap {
     /// Check if we need to grow the hash table (75% load factor)
     fn check_grow(&mut self) {
         let size = 1 << self.lg_size;
-        if (RESIZE_DENOM * self.count) > (RESIZE_NUMER * size) {
+        if (RESIZE_DENOMINATOR * self.count) > (RESIZE_NUMERATOR * size) {
             self.grow();
         }
     }
diff --git a/src/hll/cubic_interpolation.rs b/src/hll/cubic_interpolation.rs
index fa6f211..e192318 100644
--- a/src/hll/cubic_interpolation.rs
+++ b/src/hll/cubic_interpolation.rs
@@ -110,7 +110,6 @@ fn interpolate_using_x_arr_and_y_stride(
 }
 
 /// Cubic interpolation using the Lagrange interpolation formula.
-#[allow(clippy::too_many_arguments)]
 fn cubic_interpolate(
     x0: f64,
     y0: f64,
@@ -122,20 +121,20 @@ fn cubic_interpolate(
     y3: f64,
     x: f64,
 ) -> f64 {
-    let l0_numer = (x - x1) * (x - x2) * (x - x3);
-    let l1_numer = (x - x0) * (x - x2) * (x - x3);
-    let l2_numer = (x - x0) * (x - x1) * (x - x3);
-    let l3_numer = (x - x0) * (x - x1) * (x - x2);
-
-    let l0_denom = (x0 - x1) * (x0 - x2) * (x0 - x3);
-    let l1_denom = (x1 - x0) * (x1 - x2) * (x1 - x3);
-    let l2_denom = (x2 - x0) * (x2 - x1) * (x2 - x3);
-    let l3_denom = (x3 - x0) * (x3 - x1) * (x3 - x2);
-
-    let term0 = y0 * l0_numer / l0_denom;
-    let term1 = y1 * l1_numer / l1_denom;
-    let term2 = y2 * l2_numer / l2_denom;
-    let term3 = y3 * l3_numer / l3_denom;
+    let l0_numerator = (x - x1) * (x - x2) * (x - x3);
+    let l1_numerator = (x - x0) * (x - x2) * (x - x3);
+    let l2_numerator = (x - x0) * (x - x1) * (x - x3);
+    let l3_numerator = (x - x0) * (x - x1) * (x - x2);
+
+    let l0_denominator = (x0 - x1) * (x0 - x2) * (x0 - x3);
+    let l1_denominator = (x1 - x0) * (x1 - x2) * (x1 - x3);
+    let l2_denominator = (x2 - x0) * (x2 - x1) * (x2 - x3);
+    let l3_denominator = (x3 - x0) * (x3 - x1) * (x3 - x2);
+
+    let term0 = y0 * l0_numerator / l0_denominator;
+    let term1 = y1 * l1_numerator / l1_denominator;
+    let term2 = y2 * l2_numerator / l2_denominator;
+    let term3 = y3 * l3_numerator / l3_denominator;
 
     term0 + term1 + term2 + term3
 }
diff --git a/src/hll/mod.rs b/src/hll/mod.rs
index 28f56cd..ebb0c26 100644
--- a/src/hll/mod.rs
+++ b/src/hll/mod.rs
@@ -99,8 +99,8 @@ const KEY_MASK_26: u32 = (1 << KEY_BITS_26) - 1;
 const COUPON_RSE_FACTOR: f64 = 0.409; // At transition point not the asymptote
 const COUPON_RSE: f64 = COUPON_RSE_FACTOR / (1 << 13) as f64;
 
-const RESIZE_NUMER: u32 = 3; // Resize at 3/4 = 75% load factor
-const RESIZE_DENOM: u32 = 4;
+const RESIZE_NUMERATOR: u32 = 3; // Resize at 3/4 = 75% load factor
+const RESIZE_DENOMINATOR: u32 = 4;
 
 /// Extract slot number (low 26 bits) from coupon
 #[inline]
diff --git a/src/hll/sketch.rs b/src/hll/sketch.rs
index f22679b..b33cfb0 100644
--- a/src/hll/sketch.rs
+++ b/src/hll/sketch.rs
@@ -30,7 +30,7 @@ use crate::hll::container::Container;
 use crate::hll::hash_set::HashSet;
 use crate::hll::list::List;
 use crate::hll::serialization::*;
-use crate::hll::{HllType, NumStdDev, RESIZE_DENOM, RESIZE_NUMER, coupon};
+use crate::hll::{HllType, NumStdDev, RESIZE_DENOMINATOR, RESIZE_NUMERATOR, 
coupon};
 
 /// Current sketch mode
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -119,8 +119,8 @@ impl HllSketch {
             }
             Mode::Set { set, hll_type } => {
                 set.update(coupon);
-                let should_promote = RESIZE_DENOM as usize * 
set.container().len()
-                    > RESIZE_NUMER as usize * set.container().capacity();
+                let should_promote = RESIZE_DENOMINATOR as usize * 
set.container().len()
+                    > RESIZE_NUMERATOR as usize * set.container().capacity();
                 if should_promote {
                     self.mode = if set.container().lg_size() == 
self.lg_config_k as usize - 3 {
                         promote_container_to_array(set.container(), *hll_type, 
self.lg_config_k)
diff --git a/typos.toml b/typos.toml
index c27efec..c9b22da 100644
--- a/typos.toml
+++ b/typos.toml
@@ -16,7 +16,8 @@
 # under the License.
 
 [default.extend-words]
-"NUMER" = "NUMER"
+# False-Positive Abbreviations
+"PREINTS" = "PREINTS"
 
 [files]
 extend-exclude = []


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to