Skip to content

Commit b6f394a

Browse files
zzylolzz_yclaude
authored
refactor(sketch): split asap-sketch out of core (#57, phase 2) (#59)
Phase 2 of the crate reorg (#57): the L4 sketch algebra moves into its own crate. `core/sketch_algebra/` (expr/schema/sketch) becomes `asap-sketch`, depending only on the IR crate (the sketch->intent_algebra dep was already one-directional). Imports rebased onto `asap_control_core::…`; the `sketch_algebra` module is dropped from `core`. No external consumers today, so no downstream import churn. No behavior change; full workspace suite green; clippy --all-targets clean. Co-authored-by: zz_y <zz_y@node0.zz-y-308294.softmeasure-pg0.clemson.cloudlab.us> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d584b5a commit b6f394a

9 files changed

Lines changed: 36 additions & 11 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[workspace]
22
members = [
33
"crates/core",
4+
"crates/sketch",
45
"crates/plan",
56
"crates/lower",
67
"crates/e2e",

crates/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
pub mod intent_algebra;
2-
pub mod sketch_algebra;
32
pub mod types;
43
pub mod workload;

crates/core/src/sketch_algebra/mod.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

crates/sketch/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "asap-sketch"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# The L4 sketch algebra (sketch-bound IR) over the L3 intent algebra.
7+
# Depends only on the IR crate.
8+
[dependencies]
9+
asap-control-core = { path = "../core" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::rc::Rc;
22

33
use super::schema::L4Schema;
44
use super::sketch::{SketchQuery, SummaryKind, SummaryParams};
5-
use crate::intent_algebra::{ColumnId, ColumnRef, QueryExpr};
5+
use asap_control_core::intent_algebra::{ColumnId, ColumnRef, QueryExpr};
66

77
// ── L4 DAG node ───────────────────────────────────────────────────────────────
88

crates/sketch/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//! `asap-sketch` — the L4 **sketch algebra** (sketch-bound IR) over the L3
2+
//! intent algebra.
3+
//!
4+
//! Where L3 ([`asap_control_core::intent_algebra`]) carries *intent* only
5+
//! ("compute a quantile to ε accuracy"), this layer is the sketch-bound IR:
6+
//! the sketch kind + parameters are committed ([`SummaryKind`] /
7+
//! [`SummaryParams`]), and [`L4Node`] / [`SummaryExpr`] describe the summary
8+
//! computation. It depends only on the IR crate.
9+
10+
pub mod expr;
11+
pub mod schema;
12+
pub mod sketch;
13+
14+
pub use expr::{L4Node, SummaryExpr};
15+
pub use schema::{L4DataType, L4Field, L4Schema};
16+
pub use sketch::{SketchQuery, SummaryKind, SummaryParams};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::sketch::{SummaryKind, SummaryParams};
2-
use crate::intent_algebra::DataType;
2+
use asap_control_core::intent_algebra::DataType;
33

44
// ── L4 data types ─────────────────────────────────────────────────────────────
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::intent_algebra::ColumnRef;
1+
use asap_control_core::intent_algebra::ColumnRef;
22

33
// ── Summary kind identifiers ───────────────────────────────────────────────────
44

0 commit comments

Comments
 (0)