Skip to content

Commit 18a93e2

Browse files
zzylolzz_yclaude
authored
refactor: rename sketchlib-rust to asap_sketchlib (#266)
* refactor: rename sketchlib-rust to asap_sketchlib across the repo The sketchlib-rust repository (ProjectASAP/sketchlib-rust) has been renamed to asap_sketchlib (ProjectASAP/asap_sketchlib) and its Cargo package name changed from "sketchlib-rust" to "asap_sketchlib". Update all references across the codebase: - Cargo.toml dependency declarations (asap-query-engine, sketch-core) - Rust source imports (use sketchlib_rust:: → use asap_sketchlib::) - UDF Jinja templates (5 files in asap-summary-ingest) - Doc comments, Dockerfile comments, deployment docs, benchmark report - Regenerate Cargo.lock Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: fix import ordering in otel.rs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: zz_y <zz_y@node0.zz-y-298424.softmeasure-pg0.wisc.cloudlab.us> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a3894c1 commit 18a93e2

22 files changed

Lines changed: 195 additions & 188 deletions

‎Cargo.lock‎

Lines changed: 138 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎asap-common/sketch-core/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ serde.workspace = true
99
rmp-serde = "1.1"
1010
xxhash-rust = { version = "0.8", features = ["xxh32"] }
1111
dsrs = { git = "https://github.com/ProjectASAP/datasketches-rs", rev = "d748ec75c80fff21f7b24897244dd1c895df2e9a" }
12-
sketchlib-rust = { git = "https://github.com/ProjectASAP/sketchlib-rust", rev = "440427438fdaf3ac2298b53ee148f9e12a64ffcc" }
12+
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib" }
1313
clap = { version = "4.0", features = ["derive"] }
1414

1515
[dev-dependencies]

‎asap-common/sketch-core/report.md‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Report
22

3-
Compares the **legacy** sketch implementations in `sketch-core` vs the **sketchlib-rust** backends (Count-Min Sketch, Count-Min-With-Heap, KLL, HydraKLL).
3+
Compares the **legacy** sketch implementations in `sketch-core` vs the **asap_sketchlib** backends (Count-Min Sketch, Count-Min-With-Heap, KLL, HydraKLL).
44

55
## Fidelity harness
66

@@ -32,23 +32,23 @@ cargo test -p sketch-core
3232
| width | n | domain | Mode | Pearson corr | MAPE (%) | RMSE (%) |
3333
|-------|--------|--------|----------------|----------------|----------|----------|
3434
| 1024 | 100000 | 1000 | Legacy | 0.9998451189 | 24.48 | 52.76 |
35-
| 1024 | 100000 | 1000 | sketchlib-rust | 0.9998387103 | 24.36 | 54.11 |
35+
| 1024 | 100000 | 1000 | asap_sketchlib | 0.9998387103 | 24.36 | 54.11 |
3636

3737
#### depth=5
3838

3939
| width | n | domain | Mode | Pearson corr | MAPE (%) | RMSE (%) |
4040
|-------|--------|--------|----------------|----------------|----------|----------|
4141
| 2048 | 200000 | 2000 | Legacy | 0.9999733814 | 8.75 | 29.94 |
42-
| 2048 | 200000 | 2000 | sketchlib-rust | 0.9999744627 | 8.37 | 28.84 |
42+
| 2048 | 200000 | 2000 | asap_sketchlib | 0.9999744627 | 8.37 | 28.84 |
4343
| 2048 | 50000 | 500 | Legacy | 1.0000000000 | 0.00 | 0.00 |
44-
| 2048 | 50000 | 500 | sketchlib-rust | 1.0000000000 | 0.00 | 0.00 |
44+
| 2048 | 50000 | 500 | asap_sketchlib | 1.0000000000 | 0.00 | 0.00 |
4545

4646
#### depth=7
4747

4848
| width | n | domain | Mode | Pearson corr | MAPE (%) | RMSE (%) |
4949
|-------|--------|--------|----------------|----------------|----------|----------|
5050
| 4096 | 200000 | 2000 | Legacy | 0.9999993694 | 0.20 | 3.69 |
51-
| 4096 | 200000 | 2000 | sketchlib-rust | 0.9999993499 | 0.21 | 4.27 |
51+
| 4096 | 200000 | 2000 | asap_sketchlib | 0.9999993499 | 0.21 | 4.27 |
5252

5353
---
5454

@@ -61,16 +61,16 @@ The heap is maintained by local updates; recall is measured against the **true**
6161
| width | n | domain | heap_size | Mode | Top-k recall | Pearson (top-k) | MAPE (%) | RMSE (%) |
6262
|-------|--------|--------|-----------|----------------|--------------|-----------------|----------|----------|
6363
| 1024 | 100000 | 1000 | 10 | Legacy | 0.40 | 0.9571 | 0.174 | 0.319 |
64-
| 1024 | 100000 | 1000 | 10 | sketchlib-rust | 0.80 | 1.0000 | 0.000 | 0.000 |
64+
| 1024 | 100000 | 1000 | 10 | asap_sketchlib | 0.80 | 1.0000 | 0.000 | 0.000 |
6565

6666
#### depth=5
6767

6868
| width | n | domain | heap_size | Mode | Top-k recall | Pearson (top-k) | MAPE (%) | RMSE (%) |
6969
|-------|--------|--------|-----------|----------------|--------------|-----------------|----------|----------|
7070
| 2048 | 200000 | 2000 | 20 | Legacy | 0.60 | 0.9964 | 0.045 | 0.101 |
71-
| 2048 | 200000 | 2000 | 20 | sketchlib-rust | 1.00 | 0.9982 | 0.021 | 0.067 |
71+
| 2048 | 200000 | 2000 | 20 | asap_sketchlib | 1.00 | 0.9982 | 0.021 | 0.067 |
7272
| 2048 | 200000 | 2000 | 50 | Legacy | 0.40 | 0.9999983 | 5.60 | 16.49 |
73-
| 2048 | 200000 | 2000 | 50 | sketchlib-rust | 0.48 | 0.9999990 | 3.90 | 12.95 |
73+
| 2048 | 200000 | 2000 | 50 | asap_sketchlib | 0.48 | 0.9999990 | 3.90 | 12.95 |
7474

7575
---
7676

@@ -84,23 +84,23 @@ For each quantile \(q\), we compute the sketch estimate `est_value`, then:
8484
| n_updates | Mode | q=0.5 | q=0.9 | q=0.99 |
8585
|-----------|----------------|---------|---------|---------|
8686
| 200000 | Legacy | 0.0104 | 0.0145 | 0.0028 |
87-
| 200000 | sketchlib-rust | 0.0275 | 0.0470 | 0.0061 |
87+
| 200000 | asap_sketchlib | 0.0275 | 0.0470 | 0.0061 |
8888
| 50000 | Legacy | 0.0131 | 0.0091 | 0.0054 |
89-
| 50000 | sketchlib-rust | 0.0110 | 0.0116 | 0.0031 |
89+
| 50000 | asap_sketchlib | 0.0110 | 0.0116 | 0.0031 |
9090

9191
#### k=50
9292

9393
| n_updates | Mode | q=0.5 | q=0.9 | q=0.99 |
9494
|-----------|----------------|---------|---------|---------|
9595
| 200000 | Legacy | 0.0013 | 0.0021 | 0.0012 |
96-
| 200000 | sketchlib-rust | 0.0101 | 0.0044 | 0.0074 |
96+
| 200000 | asap_sketchlib | 0.0101 | 0.0044 | 0.0074 |
9797

9898
#### k=200
9999

100100
| n_updates | Mode | q=0.5 | q=0.9 | q=0.99 |
101101
|-----------|----------------|---------|---------|---------|
102102
| 200000 | Legacy | 0.0021 | 0.0036 | 0.0000 |
103-
| 200000 | sketchlib-rust | 0.0015 | 0.0001 | 0.0002 |
103+
| 200000 | asap_sketchlib | 0.0015 | 0.0001 | 0.0002 |
104104

105105
---
106106

@@ -111,15 +111,15 @@ For each quantile \(q\), we compute the sketch estimate `est_value`, then:
111111
| k | n | domain | Mode | q=0.5 (mean / max) | q=0.9 (mean / max) |
112112
|-----|--------|--------|----------------|--------------------|--------------------|
113113
| 20 | 200000 | 200 | Legacy | 0.0170 / 0.0546 | 0.0165 / 0.0452 |
114-
| 20 | 200000 | 200 | sketchlib-rust | 0.0254 / 0.0629 | 0.0546 / 0.0942 |
114+
| 20 | 200000 | 200 | asap_sketchlib | 0.0254 / 0.0629 | 0.0546 / 0.0942 |
115115

116116
#### rows=3, cols=128
117117

118118
| k | n | domain | Mode | q=0.5 (mean / max) | q=0.9 (mean / max) |
119119
|-----|--------|--------|----------------|--------------------|--------------------|
120120
| 20 | 200000 | 200 | Legacy | 0.0166 / 0.0591 | 0.0114 / 0.0304 |
121-
| 20 | 200000 | 200 | sketchlib-rust | 0.0216 / 0.0534 | 0.0238 / 0.1087 |
121+
| 20 | 200000 | 200 | asap_sketchlib | 0.0216 / 0.0534 | 0.0238 / 0.1087 |
122122
| 50 | 200000 | 200 | Legacy | 0.0099 / 0.0352 | 0.0087 / 0.0330 |
123-
| 50 | 200000 | 200 | sketchlib-rust | 0.0119 / 0.0458 | 0.0119 / 0.0296 |
123+
| 50 | 200000 | 200 | asap_sketchlib | 0.0119 / 0.0458 | 0.0119 / 0.0296 |
124124
| 20 | 100000 | 100 | Legacy | 0.0141 / 0.0574 | 0.0149 / 0.0471 |
125-
| 20 | 100000 | 100 | sketchlib-rust | 0.0202 / 0.0621 | 0.0287 / 0.0779 |
125+
| 20 | 100000 | 100 | asap_sketchlib | 0.0202 / 0.0621 | 0.0287 / 0.0779 |

‎asap-common/sketch-core/src/bin/sketchlib_fidelity.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,17 @@ fn main() {
337337
let cms_mode = if matches!(args.cms_impl, ImplMode::Legacy) {
338338
"Legacy"
339339
} else {
340-
"sketchlib-rust"
340+
"asap_sketchlib"
341341
};
342342
let cmwh_mode = if matches!(args.cmwh_impl, ImplMode::Legacy) {
343343
"Legacy"
344344
} else {
345-
"sketchlib-rust"
345+
"asap_sketchlib"
346346
};
347347
let kll_mode = if matches!(args.kll_impl, ImplMode::Legacy) {
348348
"Legacy"
349349
} else {
350-
"sketchlib-rust"
350+
"asap_sketchlib"
351351
};
352352

353353
// CountMinSketch: multiple (depth, width, n, domain)

‎asap-common/sketch-core/src/config.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::sync::OnceLock;
55
pub enum ImplMode {
66
/// Use the original hand-written implementations.
77
Legacy,
8-
/// Use sketchlib-rust backed implementations.
8+
/// Use asap_sketchlib backed implementations.
99
Sketchlib,
1010
}
1111

@@ -19,21 +19,21 @@ pub const DEFAULT_CMWH_IMPL: ImplMode = ImplMode::Sketchlib;
1919

2020
static COUNTMIN_MODE: OnceLock<ImplMode> = OnceLock::new();
2121

22-
/// Returns true if Count-Min operations should use sketchlib-rust internally.
22+
/// Returns true if Count-Min operations should use asap_sketchlib internally.
2323
pub fn use_sketchlib_for_count_min() -> bool {
2424
*COUNTMIN_MODE.get_or_init(|| DEFAULT_CMS_IMPL) == ImplMode::Sketchlib
2525
}
2626

2727
static KLL_MODE: OnceLock<ImplMode> = OnceLock::new();
2828

29-
/// Returns true if KLL operations should use sketchlib-rust internally.
29+
/// Returns true if KLL operations should use asap_sketchlib internally.
3030
pub fn use_sketchlib_for_kll() -> bool {
3131
*KLL_MODE.get_or_init(|| DEFAULT_KLL_IMPL) == ImplMode::Sketchlib
3232
}
3333

3434
static COUNTMIN_WITH_HEAP_MODE: OnceLock<ImplMode> = OnceLock::new();
3535

36-
/// Returns true if Count-Min-With-Heap operations should use sketchlib-rust internally for the
36+
/// Returns true if Count-Min-With-Heap operations should use asap_sketchlib internally for the
3737
/// Count-Min portion.
3838
pub fn use_sketchlib_for_count_min_with_heap() -> bool {
3939
*COUNTMIN_WITH_HEAP_MODE.get_or_init(|| DEFAULT_CMWH_IMPL) == ImplMode::Sketchlib

‎asap-common/sketch-core/src/count_min.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct WireFormat {
3232
pub enum CountMinBackend {
3333
/// Original hand-written matrix implementation.
3434
Legacy(Vec<Vec<f64>>),
35-
/// sketchlib-rust backed implementation.
35+
/// asap_sketchlib backed implementation.
3636
Sketchlib(SketchlibCms),
3737
}
3838

‎asap-common/sketch-core/src/count_min_sketchlib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use sketchlib_rust::{CountMin, RegularPath, SketchInput, Vector2D};
1+
use asap_sketchlib::{CountMin, RegularPath, SketchInput, Vector2D};
22

3-
/// Concrete Count-Min type from sketchlib-rust when sketchlib backend is enabled.
3+
/// Concrete Count-Min type from asap_sketchlib when sketchlib backend is enabled.
44
/// Uses f64 counters (Vector2D<f64>) for weighted updates without integer rounding.
55
pub type SketchlibCms = CountMin<Vector2D<f64>, RegularPath>;
66

‎asap-common/sketch-core/src/count_min_with_heap.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub enum CountMinWithHeapBackend {
5858
sketch: Vec<Vec<f64>>,
5959
heap: Vec<HeapItem>,
6060
},
61-
/// sketchlib-rust CMSHeap implementation.
61+
/// asap_sketchlib CMSHeap implementation.
6262
Sketchlib(SketchlibCMSHeap),
6363
}
6464

‎asap-common/sketch-core/src/count_min_with_heap_sketchlib.rs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
//! Sketchlib-rust CMSHeap integration for CountMinSketchWithHeap.
1+
//! asap_sketchlib CMSHeap integration for CountMinSketchWithHeap.
22
//!
3-
//! Uses CMSHeap (CountMin + HHHeap) from sketchlib-rust instead of CountMin + local heap,
3+
//! Uses CMSHeap (CountMin + HHHeap) from asap_sketchlib instead of CountMin + local heap,
44
//! providing automatic top-k tracking during insert and merge.
55
6-
use sketchlib_rust::RegularPath;
7-
use sketchlib_rust::{CMSHeap, SketchInput, Vector2D};
6+
use asap_sketchlib::RegularPath;
7+
use asap_sketchlib::{CMSHeap, SketchInput, Vector2D};
88

99
/// Wire-format heap item (key, value) to avoid circular dependency with count_min_with_heap.
1010
pub struct WireHeapItem {
1111
pub key: String,
1212
pub value: f64,
1313
}
1414

15-
/// Concrete Count-Min-with-Heap type from sketchlib-rust (CMS + HHHeap).
15+
/// Concrete Count-Min-with-Heap type from asap_sketchlib (CMS + HHHeap).
1616
pub type SketchlibCMSHeap = CMSHeap<Vector2D<i64>, RegularPath>;
1717

1818
/// Creates a fresh CMSHeap with the given dimensions and heap capacity.
@@ -81,7 +81,7 @@ pub fn heap_to_wire(cms_heap: &SketchlibCMSHeap) -> Vec<WireHeapItem> {
8181
.iter()
8282
.map(|hh_item| {
8383
let key = match &hh_item.key {
84-
sketchlib_rust::HeapItem::String(s) => s.clone(),
84+
asap_sketchlib::HeapItem::String(s) => s.clone(),
8585
other => format!("{:?}", other),
8686
};
8787
WireHeapItem {

‎asap-common/sketch-core/src/kll.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct KllSketchData {
3333
pub enum KllBackend {
3434
/// dsrs (DataSketches) implementation.
3535
Legacy(KllDoubleSketch),
36-
/// sketchlib-rust backed implementation.
36+
/// asap_sketchlib backed implementation.
3737
Sketchlib(SketchlibKll),
3838
}
3939

0 commit comments

Comments
 (0)