From ac4d8d7ddd57487fd434f739a2aceb7f5ec53df3 Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Sun, 4 Oct 2026 03:49:30 +0000 Subject: [PATCH] refactor(planner): rename asap-physical-operators to the Stage 4 asap-executor crate Rename crates/asap-physical-operators to crates/executor (package asap-executor), keeping plan/ and physical_planner/ in it as #572's 2026-10-03 update decides. Imports are rewritten without compatibility re-exports. The three stage manifest guards now reject asap-executor; only integration-tests depends on it (#572, B5). Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 40 +++++------ Cargo.toml | 2 +- .../Cargo.toml | 6 +- .../README.md | 10 +-- .../src/capability.rs | 0 .../src/dag/mod.rs | 0 .../src/error.rs | 0 .../src/evaluation.rs | 0 .../src/expressions/arithmetic.rs | 0 .../src/expressions/binary.rs | 0 .../src/expressions/mod.rs | 0 .../src/expressions/planner.rs | 0 .../src/key_by_label_values.rs | 0 .../src/lib.rs | 0 .../src/measurement.rs | 0 .../src/operators/aggregate/mod.rs | 0 .../src/operators/aggregate/temporal.rs | 0 .../src/operators/aligned_binary.rs | 0 .../src/operators/common.rs | 0 .../src/operators/current_series.rs | 0 .../src/operators/filter.rs | 0 .../src/operators/joins/mod.rs | 0 .../src/operators/limit.rs | 0 .../src/operators/mod.rs | 0 .../src/operators/projection.rs | 0 .../src/operators/scope_timestamp.rs | 0 .../src/operators/series_labels.rs | 0 .../src/operators/series_window.rs | 0 .../src/operators/sort.rs | 0 .../src/operators/source.rs | 0 .../src/operators/summary/mod.rs | 0 .../src/operators/unchecked.rs | 0 .../src/operators/vector_binary.rs | 0 .../src/operators/vector_window.rs | 0 .../src/physical_planner/candidates.rs | 0 .../src/physical_planner/compiled.rs | 0 .../src/physical_planner/logical.rs | 0 .../src/physical_planner/mod.rs | 0 .../src/physical_planner/precompute.rs | 0 .../src/physical_planner/promql_fallback.rs | 0 .../src/physical_planner/promql_rows.rs | 0 .../src/physical_planner/promql_values.rs | 0 .../src/physical_planner/row_values.rs | 0 .../src/plan/mod.rs | 0 .../src/plan/properties.rs | 0 .../src/runtime/batch_execution.rs | 0 .../src/runtime/context.rs | 0 .../src/runtime/cooperative.rs | 0 .../src/runtime/mod.rs | 0 .../src/runtime/tests.rs | 0 .../src/sources/memory.rs | 0 .../src/sources/mod.rs | 0 .../src/statistic.rs | 0 .../src/summary_kernels/count_min_sketch.rs | 0 .../count_min_sketch_with_heap.rs | 0 .../src/summary_kernels/count_sketch.rs | 0 .../summary_kernels/count_sketch_with_heap.rs | 0 .../src/summary_kernels/datasketches_kll.rs | 0 .../src/summary_kernels/dd_sketch.rs | 0 .../src/summary_kernels/exact.rs | 0 .../src/summary_kernels/factory.rs | 0 .../src/summary_kernels/hll_sketch.rs | 0 .../src/summary_kernels/hydra_kll.rs | 0 .../src/summary_kernels/increase.rs | 0 .../src/summary_kernels/mod.rs | 0 .../src/summary_kernels/traits.rs | 0 .../src/summary_kernels/univmon.rs | 0 .../src/summary_kernels/weighted_frequency.rs | 0 .../src/values.rs | 0 .../tests/blocking_resources.rs | 6 +- .../tests/common/mod.rs | 0 .../tests/current_series_heap.rs | 10 +-- .../tests/deployment.rs | 14 ++-- .../tests/deployment_computation.rs | 8 +-- .../tests/physical_dag.rs | 64 +++++++++--------- .../tests/physical_plan_recovery.rs | 4 +- .../tests/physical_semantics.rs | 18 ++--- .../tests/plan_properties.rs | 4 +- .../tests/planspace_series_identity_heap.rs | 6 +- .../tests/precompute_candidates.rs | 58 +++++++--------- .../tests/precompute_population.rs | 14 ++-- .../tests/promql_binary.rs | 18 +++-- .../tests/promql_fallback.rs | 2 +- .../tests/promql_values.rs | 14 ++-- .../tests/raw_scan.rs | 10 +-- .../tests/summary_projection.rs | 2 +- .../tests/weighted_topk_binding.rs | 67 +++++++++---------- crates/integration-tests/Cargo.toml | 2 +- .../tests/kll_pane_execution.rs | 2 +- .../tests/operator_design_examples.rs | 4 +- .../tests/physical_common/mod.rs | 2 +- .../tests/planner_layering_example1.rs | 2 +- .../tests/precompute_raw_samples.rs | 22 +++--- .../tests/sql_to_physical.rs | 6 +- .../tests/stage1_cost_independence.rs | 2 +- .../tests/stage2_dependencies.rs | 6 +- .../tests/stage3_dependencies.rs | 2 +- .../physical-planning-and-deployment.md | 4 +- .../develop_docs/physical-compile-coverage.md | 2 +- 99 files changed, 207 insertions(+), 226 deletions(-) rename crates/{asap-physical-operators => executor}/Cargo.toml (72%) rename crates/{asap-physical-operators => executor}/README.md (96%) rename crates/{asap-physical-operators => executor}/src/capability.rs (100%) rename crates/{asap-physical-operators => executor}/src/dag/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/error.rs (100%) rename crates/{asap-physical-operators => executor}/src/evaluation.rs (100%) rename crates/{asap-physical-operators => executor}/src/expressions/arithmetic.rs (100%) rename crates/{asap-physical-operators => executor}/src/expressions/binary.rs (100%) rename crates/{asap-physical-operators => executor}/src/expressions/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/expressions/planner.rs (100%) rename crates/{asap-physical-operators => executor}/src/key_by_label_values.rs (100%) rename crates/{asap-physical-operators => executor}/src/lib.rs (100%) rename crates/{asap-physical-operators => executor}/src/measurement.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/aggregate/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/aggregate/temporal.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/aligned_binary.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/common.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/current_series.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/filter.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/joins/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/limit.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/projection.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/scope_timestamp.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/series_labels.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/series_window.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/sort.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/source.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/summary/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/unchecked.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/vector_binary.rs (100%) rename crates/{asap-physical-operators => executor}/src/operators/vector_window.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/candidates.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/compiled.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/logical.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/precompute.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/promql_fallback.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/promql_rows.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/promql_values.rs (100%) rename crates/{asap-physical-operators => executor}/src/physical_planner/row_values.rs (100%) rename crates/{asap-physical-operators => executor}/src/plan/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/plan/properties.rs (100%) rename crates/{asap-physical-operators => executor}/src/runtime/batch_execution.rs (100%) rename crates/{asap-physical-operators => executor}/src/runtime/context.rs (100%) rename crates/{asap-physical-operators => executor}/src/runtime/cooperative.rs (100%) rename crates/{asap-physical-operators => executor}/src/runtime/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/runtime/tests.rs (100%) rename crates/{asap-physical-operators => executor}/src/sources/memory.rs (100%) rename crates/{asap-physical-operators => executor}/src/sources/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/statistic.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/count_min_sketch.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/count_min_sketch_with_heap.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/count_sketch.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/count_sketch_with_heap.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/datasketches_kll.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/dd_sketch.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/exact.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/factory.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/hll_sketch.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/hydra_kll.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/increase.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/mod.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/traits.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/univmon.rs (100%) rename crates/{asap-physical-operators => executor}/src/summary_kernels/weighted_frequency.rs (100%) rename crates/{asap-physical-operators => executor}/src/values.rs (100%) rename crates/{asap-physical-operators => executor}/tests/blocking_resources.rs (98%) rename crates/{asap-physical-operators => executor}/tests/common/mod.rs (100%) rename crates/{asap-physical-operators => executor}/tests/current_series_heap.rs (97%) rename crates/{asap-physical-operators => executor}/tests/deployment.rs (86%) rename crates/{asap-physical-operators => executor}/tests/deployment_computation.rs (98%) rename crates/{asap-physical-operators => executor}/tests/physical_dag.rs (96%) rename crates/{asap-physical-operators => executor}/tests/physical_plan_recovery.rs (97%) rename crates/{asap-physical-operators => executor}/tests/physical_semantics.rs (97%) rename crates/{asap-physical-operators => executor}/tests/plan_properties.rs (98%) rename crates/{asap-physical-operators => executor}/tests/planspace_series_identity_heap.rs (99%) rename crates/{asap-physical-operators => executor}/tests/precompute_candidates.rs (95%) rename crates/{asap-physical-operators => executor}/tests/precompute_population.rs (97%) rename crates/{asap-physical-operators => executor}/tests/promql_binary.rs (96%) rename crates/{asap-physical-operators => executor}/tests/promql_fallback.rs (99%) rename crates/{asap-physical-operators => executor}/tests/promql_values.rs (97%) rename crates/{asap-physical-operators => executor}/tests/raw_scan.rs (98%) rename crates/{asap-physical-operators => executor}/tests/summary_projection.rs (99%) rename crates/{asap-physical-operators => executor}/tests/weighted_topk_binding.rs (96%) diff --git a/Cargo.lock b/Cargo.lock index 9cf7c069a..fcdc601d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -328,6 +328,25 @@ dependencies = [ "tokio", ] +[[package]] +name = "asap-executor" +version = "0.1.0" +dependencies = [ + "asap-frontend-promql", + "asap-logical-optimizer", + "asap-plan-selection", + "asap-types", + "asap_sketchlib 0.3.0 (git+https://github.com/ProjectASAP/asap_sketchlib?rev=5f03ccbd798ed5fec62bdd839bcb331123cab369)", + "chrono", + "futures", + "regex", + "rmp-serde", + "serde", + "serde_json", + "thiserror 2.0.18", + "tracing", +] + [[package]] name = "asap-frontend-common" version = "0.1.0" @@ -377,10 +396,10 @@ dependencies = [ name = "asap-integration-tests" version = "0.1.0" dependencies = [ + "asap-executor", "asap-frontend-promql", "asap-frontend-sql", "asap-logical-optimizer", - "asap-physical-operators", "asap-physical-optimizer", "asap-plan-selection", "asap-planner", @@ -402,25 +421,6 @@ dependencies = [ "thiserror 2.0.18", ] -[[package]] -name = "asap-physical-operators" -version = "0.1.0" -dependencies = [ - "asap-frontend-promql", - "asap-logical-optimizer", - "asap-plan-selection", - "asap-types", - "asap_sketchlib 0.3.0 (git+https://github.com/ProjectASAP/asap_sketchlib?rev=5f03ccbd798ed5fec62bdd839bcb331123cab369)", - "chrono", - "futures", - "regex", - "rmp-serde", - "serde", - "serde_json", - "thiserror 2.0.18", - "tracing", -] - [[package]] name = "asap-physical-optimizer" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index b8798fe8f..ad0ed9ce6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "crates/asap-physical-operators", + "crates/executor", "crates/types", "crates/frontend-common", "crates/sql-function-catalog", diff --git a/crates/asap-physical-operators/Cargo.toml b/crates/executor/Cargo.toml similarity index 72% rename from crates/asap-physical-operators/Cargo.toml rename to crates/executor/Cargo.toml index ec420fc98..dc29ebb33 100644 --- a/crates/asap-physical-operators/Cargo.toml +++ b/crates/executor/Cargo.toml @@ -1,8 +1,12 @@ [package] -name = "asap-physical-operators" +name = "asap-executor" version = "0.1.0" edition = "2021" +# #509 Stage 4 reference executor. No stage crate (asap-logical-optimizer, +# asap-physical-optimizer, asap-plan-selection) depends on it; their manifest +# guards reject it. Its tests use the stage crates as dev-dependencies. + [dependencies] chrono = { version = "0.4.39", default-features = false, features = ["std"] } futures = "0.3" diff --git a/crates/asap-physical-operators/README.md b/crates/executor/README.md similarity index 96% rename from crates/asap-physical-operators/README.md rename to crates/executor/README.md index 3cae41aab..3189dfefb 100644 --- a/crates/asap-physical-operators/README.md +++ b/crates/executor/README.md @@ -1,6 +1,6 @@ -# ASAP physical operators +# ASAP executor -An independent Rust physical operator DAG runtime shared by ingestion time and +The #509 Stage 4 reference executor: an independent Rust physical operator DAG runtime shared by ingestion time and query time execution. The library requires neither backend engine, a server, a storage implementation, Arrow nor DataFusion. DataFusion informed the design; it is not the execution framework. @@ -20,14 +20,14 @@ operator is needed. Summary construction updates state batch by batch. End of input means the supplied query range or ingestion window is complete. ```rust -use asap_physical_operators::{ +use asap_executor::{ expressions::Expression, operators::Operator, values::Value, plan::PhysicalDAG, runtime::{Limits, RunContext, Scope}, }; -use asap_physical_operators::planner::ir::schema::DataType; +use asap_executor::planner::ir::schema::DataType; use futures::{executor::block_on, StreamExt}; let source = Operator::scalar(Value::Int64(7), DataType::Int64)?; @@ -44,7 +44,7 @@ let run = RunContext::new( let mut output = plan.execute(&[1], run)?.remove(0); let batch = block_on(output.next()).unwrap()?; assert!(matches!(batch.rows()[0][0], Value::Int64(-7))); -# Ok::<(), asap_physical_operators::dag::Error>(()) +# Ok::<(), asap_executor::dag::Error>(()) ``` `physical_planner::compile` accepts a logical Post-ASAP DAG (`PhysicalASAPDAG`) and typed input contracts. diff --git a/crates/asap-physical-operators/src/capability.rs b/crates/executor/src/capability.rs similarity index 100% rename from crates/asap-physical-operators/src/capability.rs rename to crates/executor/src/capability.rs diff --git a/crates/asap-physical-operators/src/dag/mod.rs b/crates/executor/src/dag/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/dag/mod.rs rename to crates/executor/src/dag/mod.rs diff --git a/crates/asap-physical-operators/src/error.rs b/crates/executor/src/error.rs similarity index 100% rename from crates/asap-physical-operators/src/error.rs rename to crates/executor/src/error.rs diff --git a/crates/asap-physical-operators/src/evaluation.rs b/crates/executor/src/evaluation.rs similarity index 100% rename from crates/asap-physical-operators/src/evaluation.rs rename to crates/executor/src/evaluation.rs diff --git a/crates/asap-physical-operators/src/expressions/arithmetic.rs b/crates/executor/src/expressions/arithmetic.rs similarity index 100% rename from crates/asap-physical-operators/src/expressions/arithmetic.rs rename to crates/executor/src/expressions/arithmetic.rs diff --git a/crates/asap-physical-operators/src/expressions/binary.rs b/crates/executor/src/expressions/binary.rs similarity index 100% rename from crates/asap-physical-operators/src/expressions/binary.rs rename to crates/executor/src/expressions/binary.rs diff --git a/crates/asap-physical-operators/src/expressions/mod.rs b/crates/executor/src/expressions/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/expressions/mod.rs rename to crates/executor/src/expressions/mod.rs diff --git a/crates/asap-physical-operators/src/expressions/planner.rs b/crates/executor/src/expressions/planner.rs similarity index 100% rename from crates/asap-physical-operators/src/expressions/planner.rs rename to crates/executor/src/expressions/planner.rs diff --git a/crates/asap-physical-operators/src/key_by_label_values.rs b/crates/executor/src/key_by_label_values.rs similarity index 100% rename from crates/asap-physical-operators/src/key_by_label_values.rs rename to crates/executor/src/key_by_label_values.rs diff --git a/crates/asap-physical-operators/src/lib.rs b/crates/executor/src/lib.rs similarity index 100% rename from crates/asap-physical-operators/src/lib.rs rename to crates/executor/src/lib.rs diff --git a/crates/asap-physical-operators/src/measurement.rs b/crates/executor/src/measurement.rs similarity index 100% rename from crates/asap-physical-operators/src/measurement.rs rename to crates/executor/src/measurement.rs diff --git a/crates/asap-physical-operators/src/operators/aggregate/mod.rs b/crates/executor/src/operators/aggregate/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/aggregate/mod.rs rename to crates/executor/src/operators/aggregate/mod.rs diff --git a/crates/asap-physical-operators/src/operators/aggregate/temporal.rs b/crates/executor/src/operators/aggregate/temporal.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/aggregate/temporal.rs rename to crates/executor/src/operators/aggregate/temporal.rs diff --git a/crates/asap-physical-operators/src/operators/aligned_binary.rs b/crates/executor/src/operators/aligned_binary.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/aligned_binary.rs rename to crates/executor/src/operators/aligned_binary.rs diff --git a/crates/asap-physical-operators/src/operators/common.rs b/crates/executor/src/operators/common.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/common.rs rename to crates/executor/src/operators/common.rs diff --git a/crates/asap-physical-operators/src/operators/current_series.rs b/crates/executor/src/operators/current_series.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/current_series.rs rename to crates/executor/src/operators/current_series.rs diff --git a/crates/asap-physical-operators/src/operators/filter.rs b/crates/executor/src/operators/filter.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/filter.rs rename to crates/executor/src/operators/filter.rs diff --git a/crates/asap-physical-operators/src/operators/joins/mod.rs b/crates/executor/src/operators/joins/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/joins/mod.rs rename to crates/executor/src/operators/joins/mod.rs diff --git a/crates/asap-physical-operators/src/operators/limit.rs b/crates/executor/src/operators/limit.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/limit.rs rename to crates/executor/src/operators/limit.rs diff --git a/crates/asap-physical-operators/src/operators/mod.rs b/crates/executor/src/operators/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/mod.rs rename to crates/executor/src/operators/mod.rs diff --git a/crates/asap-physical-operators/src/operators/projection.rs b/crates/executor/src/operators/projection.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/projection.rs rename to crates/executor/src/operators/projection.rs diff --git a/crates/asap-physical-operators/src/operators/scope_timestamp.rs b/crates/executor/src/operators/scope_timestamp.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/scope_timestamp.rs rename to crates/executor/src/operators/scope_timestamp.rs diff --git a/crates/asap-physical-operators/src/operators/series_labels.rs b/crates/executor/src/operators/series_labels.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/series_labels.rs rename to crates/executor/src/operators/series_labels.rs diff --git a/crates/asap-physical-operators/src/operators/series_window.rs b/crates/executor/src/operators/series_window.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/series_window.rs rename to crates/executor/src/operators/series_window.rs diff --git a/crates/asap-physical-operators/src/operators/sort.rs b/crates/executor/src/operators/sort.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/sort.rs rename to crates/executor/src/operators/sort.rs diff --git a/crates/asap-physical-operators/src/operators/source.rs b/crates/executor/src/operators/source.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/source.rs rename to crates/executor/src/operators/source.rs diff --git a/crates/asap-physical-operators/src/operators/summary/mod.rs b/crates/executor/src/operators/summary/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/summary/mod.rs rename to crates/executor/src/operators/summary/mod.rs diff --git a/crates/asap-physical-operators/src/operators/unchecked.rs b/crates/executor/src/operators/unchecked.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/unchecked.rs rename to crates/executor/src/operators/unchecked.rs diff --git a/crates/asap-physical-operators/src/operators/vector_binary.rs b/crates/executor/src/operators/vector_binary.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/vector_binary.rs rename to crates/executor/src/operators/vector_binary.rs diff --git a/crates/asap-physical-operators/src/operators/vector_window.rs b/crates/executor/src/operators/vector_window.rs similarity index 100% rename from crates/asap-physical-operators/src/operators/vector_window.rs rename to crates/executor/src/operators/vector_window.rs diff --git a/crates/asap-physical-operators/src/physical_planner/candidates.rs b/crates/executor/src/physical_planner/candidates.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/candidates.rs rename to crates/executor/src/physical_planner/candidates.rs diff --git a/crates/asap-physical-operators/src/physical_planner/compiled.rs b/crates/executor/src/physical_planner/compiled.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/compiled.rs rename to crates/executor/src/physical_planner/compiled.rs diff --git a/crates/asap-physical-operators/src/physical_planner/logical.rs b/crates/executor/src/physical_planner/logical.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/logical.rs rename to crates/executor/src/physical_planner/logical.rs diff --git a/crates/asap-physical-operators/src/physical_planner/mod.rs b/crates/executor/src/physical_planner/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/mod.rs rename to crates/executor/src/physical_planner/mod.rs diff --git a/crates/asap-physical-operators/src/physical_planner/precompute.rs b/crates/executor/src/physical_planner/precompute.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/precompute.rs rename to crates/executor/src/physical_planner/precompute.rs diff --git a/crates/asap-physical-operators/src/physical_planner/promql_fallback.rs b/crates/executor/src/physical_planner/promql_fallback.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/promql_fallback.rs rename to crates/executor/src/physical_planner/promql_fallback.rs diff --git a/crates/asap-physical-operators/src/physical_planner/promql_rows.rs b/crates/executor/src/physical_planner/promql_rows.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/promql_rows.rs rename to crates/executor/src/physical_planner/promql_rows.rs diff --git a/crates/asap-physical-operators/src/physical_planner/promql_values.rs b/crates/executor/src/physical_planner/promql_values.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/promql_values.rs rename to crates/executor/src/physical_planner/promql_values.rs diff --git a/crates/asap-physical-operators/src/physical_planner/row_values.rs b/crates/executor/src/physical_planner/row_values.rs similarity index 100% rename from crates/asap-physical-operators/src/physical_planner/row_values.rs rename to crates/executor/src/physical_planner/row_values.rs diff --git a/crates/asap-physical-operators/src/plan/mod.rs b/crates/executor/src/plan/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/plan/mod.rs rename to crates/executor/src/plan/mod.rs diff --git a/crates/asap-physical-operators/src/plan/properties.rs b/crates/executor/src/plan/properties.rs similarity index 100% rename from crates/asap-physical-operators/src/plan/properties.rs rename to crates/executor/src/plan/properties.rs diff --git a/crates/asap-physical-operators/src/runtime/batch_execution.rs b/crates/executor/src/runtime/batch_execution.rs similarity index 100% rename from crates/asap-physical-operators/src/runtime/batch_execution.rs rename to crates/executor/src/runtime/batch_execution.rs diff --git a/crates/asap-physical-operators/src/runtime/context.rs b/crates/executor/src/runtime/context.rs similarity index 100% rename from crates/asap-physical-operators/src/runtime/context.rs rename to crates/executor/src/runtime/context.rs diff --git a/crates/asap-physical-operators/src/runtime/cooperative.rs b/crates/executor/src/runtime/cooperative.rs similarity index 100% rename from crates/asap-physical-operators/src/runtime/cooperative.rs rename to crates/executor/src/runtime/cooperative.rs diff --git a/crates/asap-physical-operators/src/runtime/mod.rs b/crates/executor/src/runtime/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/runtime/mod.rs rename to crates/executor/src/runtime/mod.rs diff --git a/crates/asap-physical-operators/src/runtime/tests.rs b/crates/executor/src/runtime/tests.rs similarity index 100% rename from crates/asap-physical-operators/src/runtime/tests.rs rename to crates/executor/src/runtime/tests.rs diff --git a/crates/asap-physical-operators/src/sources/memory.rs b/crates/executor/src/sources/memory.rs similarity index 100% rename from crates/asap-physical-operators/src/sources/memory.rs rename to crates/executor/src/sources/memory.rs diff --git a/crates/asap-physical-operators/src/sources/mod.rs b/crates/executor/src/sources/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/sources/mod.rs rename to crates/executor/src/sources/mod.rs diff --git a/crates/asap-physical-operators/src/statistic.rs b/crates/executor/src/statistic.rs similarity index 100% rename from crates/asap-physical-operators/src/statistic.rs rename to crates/executor/src/statistic.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/count_min_sketch.rs b/crates/executor/src/summary_kernels/count_min_sketch.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/count_min_sketch.rs rename to crates/executor/src/summary_kernels/count_min_sketch.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/count_min_sketch_with_heap.rs b/crates/executor/src/summary_kernels/count_min_sketch_with_heap.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/count_min_sketch_with_heap.rs rename to crates/executor/src/summary_kernels/count_min_sketch_with_heap.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/count_sketch.rs b/crates/executor/src/summary_kernels/count_sketch.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/count_sketch.rs rename to crates/executor/src/summary_kernels/count_sketch.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/count_sketch_with_heap.rs b/crates/executor/src/summary_kernels/count_sketch_with_heap.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/count_sketch_with_heap.rs rename to crates/executor/src/summary_kernels/count_sketch_with_heap.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/datasketches_kll.rs b/crates/executor/src/summary_kernels/datasketches_kll.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/datasketches_kll.rs rename to crates/executor/src/summary_kernels/datasketches_kll.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/dd_sketch.rs b/crates/executor/src/summary_kernels/dd_sketch.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/dd_sketch.rs rename to crates/executor/src/summary_kernels/dd_sketch.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/exact.rs b/crates/executor/src/summary_kernels/exact.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/exact.rs rename to crates/executor/src/summary_kernels/exact.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/factory.rs b/crates/executor/src/summary_kernels/factory.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/factory.rs rename to crates/executor/src/summary_kernels/factory.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/hll_sketch.rs b/crates/executor/src/summary_kernels/hll_sketch.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/hll_sketch.rs rename to crates/executor/src/summary_kernels/hll_sketch.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/hydra_kll.rs b/crates/executor/src/summary_kernels/hydra_kll.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/hydra_kll.rs rename to crates/executor/src/summary_kernels/hydra_kll.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/increase.rs b/crates/executor/src/summary_kernels/increase.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/increase.rs rename to crates/executor/src/summary_kernels/increase.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/mod.rs b/crates/executor/src/summary_kernels/mod.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/mod.rs rename to crates/executor/src/summary_kernels/mod.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/traits.rs b/crates/executor/src/summary_kernels/traits.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/traits.rs rename to crates/executor/src/summary_kernels/traits.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/univmon.rs b/crates/executor/src/summary_kernels/univmon.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/univmon.rs rename to crates/executor/src/summary_kernels/univmon.rs diff --git a/crates/asap-physical-operators/src/summary_kernels/weighted_frequency.rs b/crates/executor/src/summary_kernels/weighted_frequency.rs similarity index 100% rename from crates/asap-physical-operators/src/summary_kernels/weighted_frequency.rs rename to crates/executor/src/summary_kernels/weighted_frequency.rs diff --git a/crates/asap-physical-operators/src/values.rs b/crates/executor/src/values.rs similarity index 100% rename from crates/asap-physical-operators/src/values.rs rename to crates/executor/src/values.rs diff --git a/crates/asap-physical-operators/tests/blocking_resources.rs b/crates/executor/tests/blocking_resources.rs similarity index 98% rename from crates/asap-physical-operators/tests/blocking_resources.rs rename to crates/executor/tests/blocking_resources.rs index fd9091a79..a407f7e0c 100644 --- a/crates/asap-physical-operators/tests/blocking_resources.rs +++ b/crates/executor/tests/blocking_resources.rs @@ -1,5 +1,5 @@ //! Blocking operators enforce resources before returning their first batch. -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, plan::{PhysicalDAG, PhysicalOperator}, runtime::{Limits, RunContext, Scope}, @@ -107,7 +107,7 @@ fn join_yields_during_computation_and_observes_cancellation() { // Sorting and grouping yield even for one large batch. #[test] fn blocking_reductions_yield_and_release_memory_on_cancellation() { - use asap_physical_operators::{ + use asap_executor::{ operators::{Reduction, SortKey}, plan::PhysicalOperator, }; @@ -143,7 +143,7 @@ fn blocking_reductions_yield_and_release_memory_on_cancellation() { // Merge-sort rounds preserve input order for tied keys across chunk boundaries. #[test] fn cooperative_sort_preserves_ties_across_chunks() { - use asap_physical_operators::operators::SortKey; + use asap_executor::operators::SortKey; let batch = Batch::try_new( schema(2), (0..1025) diff --git a/crates/asap-physical-operators/tests/common/mod.rs b/crates/executor/tests/common/mod.rs similarity index 100% rename from crates/asap-physical-operators/tests/common/mod.rs rename to crates/executor/tests/common/mod.rs diff --git a/crates/asap-physical-operators/tests/current_series_heap.rs b/crates/executor/tests/current_series_heap.rs similarity index 97% rename from crates/asap-physical-operators/tests/current_series_heap.rs rename to crates/executor/tests/current_series_heap.rs index 37e4dfda2..8dac92c11 100644 --- a/crates/asap-physical-operators/tests/current_series_heap.rs +++ b/crates/executor/tests/current_series_heap.rs @@ -1,6 +1,6 @@ //! Spatial heap weights come from a fresh instant vector, never sample history. mod common; -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, physical_planner::{ promql_rows::{decode_series_identity, series_row, SERIES_IDENTITY_COLUMN}, @@ -234,7 +234,7 @@ fn spatial_heap_ranks_latest_values_in_independent_runs() { // Blocking membership selection shares the run's cancellation and byte budget. #[test] fn current_series_observes_resource_limits() { - use asap_physical_operators::Error; + use asap_executor::Error; let plan = snapshot_plan(); for cancelled in [false, true] { let data = input(&[("one", 50_000, 1.)]); @@ -273,7 +273,7 @@ fn current_series_observes_resource_limits() { #[test] fn identity_encoding_is_lossless_and_rejects_noncanonical_inputs() { - use asap_physical_operators::physical_planner::promql_rows::encode_series_identity; + use asap_executor::physical_planner::promql_rows::encode_series_identity; let labels = BTreeMap::from([ ("a".into(), "quote\"slash\\".into()), ("other".into(), "".into()), @@ -296,7 +296,7 @@ fn identity_encoding_is_lossless_and_rejects_noncanonical_inputs() { // test does not manually assemble the computation or its dependency edges. #[test] fn planner_current_series_candidate_compiles_with_dynamic_identity() { - use asap_physical_operators::physical_planner::{compile, promql_rows::with_series_identity}; + use asap_executor::physical_planner::{compile, promql_rows::with_series_identity}; use planner_types::{types::AccuracyTarget, workload::*}; use std::rc::Rc; let workload = PlanningWorkload { @@ -334,7 +334,7 @@ fn planner_current_series_candidate_compiles_with_dynamic_identity() { .candidate(&open_root) .unwrap(); let snapshot_program = - asap_physical_operators::physical_planner::promql_rows::compile_current_series_evaluation( + asap_executor::physical_planner::promql_rows::compile_current_series_evaluation( &open_selected, ) .unwrap(); diff --git a/crates/asap-physical-operators/tests/deployment.rs b/crates/executor/tests/deployment.rs similarity index 86% rename from crates/asap-physical-operators/tests/deployment.rs rename to crates/executor/tests/deployment.rs index 9b00522cd..270c8d6fe 100644 --- a/crates/asap-physical-operators/tests/deployment.rs +++ b/crates/executor/tests/deployment.rs @@ -1,11 +1,11 @@ //! Exercise the public library without a backend server, store, or scheduler. -use asap_physical_operators::planner::ir::{ +use asap_executor::planner::ir::{ scalar::ColumnRef, schema::{ FieldDataType, GroupingStrategy, SketchAlgorithm, SketchKind, SketchParams, SummaryUpdate, }, }; -use asap_physical_operators::{factory::create_planner_accumulator, AggregateCore}; +use asap_executor::{factory::create_planner_accumulator, AggregateCore}; fn family(k: u32) -> FieldDataType { FieldDataType::Sketch( @@ -28,9 +28,7 @@ fn build(values: &[f64]) -> Box { } fn read(state: &dyn AggregateCore) -> f64 { state - .estimate( - &asap_physical_operators::planner::ir::schema::SketchStatistic::Quantile { q: 0.5 }, - ) + .estimate(&asap_executor::planner::ir::schema::SketchStatistic::Quantile { q: 0.5 }) .unwrap() } @@ -64,8 +62,8 @@ fn invalid_kll_parameters_are_rejected_at_binding() { // a packed-wire column-bit budget must not be imposed on this constructor. #[test] fn native_count_sketch_dimensions_are_not_packed_wire_dimensions() { - use asap_physical_operators::planner::ir::schema::SummaryInputExpr; - use asap_physical_operators::KeyByLabelValues; + use asap_executor::planner::ir::schema::SummaryInputExpr; + use asap_executor::KeyByLabelValues; let family = FieldDataType::Sketch( SketchKind::new( SketchAlgorithm::CountSketchWithHeap, @@ -85,7 +83,7 @@ fn native_count_sketch_dimensions_are_not_packed_wire_dimensions() { let state = operator.into_accumulator(); let state = state .as_any() - .downcast_ref::() + .downcast_ref::() .unwrap(); assert_eq!(state.query_key(&key), 7.0); } diff --git a/crates/asap-physical-operators/tests/deployment_computation.rs b/crates/executor/tests/deployment_computation.rs similarity index 98% rename from crates/asap-physical-operators/tests/deployment_computation.rs rename to crates/executor/tests/deployment_computation.rs index a9ff1f95d..464601272 100644 --- a/crates/asap-physical-operators/tests/deployment_computation.rs +++ b/crates/executor/tests/deployment_computation.rs @@ -1,7 +1,7 @@ //! Planner-selected PromQL computation compiles from the timed DAG alone; //! the deployment supplies only raw rows at the ingestion frontier. mod common; -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, physical_planner::{compile, promql_rows, CompiledPhysicalDAG, InputContract, Source}, runtime::{Limits, RunContext, Scope}, @@ -115,7 +115,7 @@ fn execute( dag: &PhysicalASAPDAG, samples: &[Sample], end: i64, -) -> Result>, String> { +) -> Result>, String> { execute_relabeled(dag, samples, end, &BTreeMap::new()) } @@ -126,7 +126,7 @@ fn execute_relabeled( samples: &[Sample], end: i64, relabel: &BTreeMap<&str, (&str, &str)>, -) -> Result>, String> { +) -> Result>, String> { let inputs = raw_inputs(dag); let program = compile( dag, @@ -624,8 +624,8 @@ fn population_sums_and_averages_are_compensated() { // returns the sketch's total update weight, including colliding items. #[test] fn stored_count_min_bare_count_compiles_to_a_evaluation() { + use asap_executor::summary_kernels::CountMinSketchAccumulator; use asap_logical_optimizer::{Replacement, ReplacementStrategy, TargetSubDAG}; - use asap_physical_operators::summary_kernels::CountMinSketchAccumulator; let root = lower_with("count(up)", AccuracyTarget::Epsilon(0.02)); let dag = asap_logical_optimizer::ASAPStrategies::default() .replacements(&TargetSubDAG::new(&root)) diff --git a/crates/asap-physical-operators/tests/physical_dag.rs b/crates/executor/tests/physical_dag.rs similarity index 96% rename from crates/asap-physical-operators/tests/physical_dag.rs rename to crates/executor/tests/physical_dag.rs index 14a0ebfae..93b19a5fc 100644 --- a/crates/asap-physical-operators/tests/physical_dag.rs +++ b/crates/executor/tests/physical_dag.rs @@ -1,5 +1,5 @@ //! Acceptance tests use the library directly, without either backend engine. -use asap_physical_operators::{ +use asap_executor::{ dag::{ operators::{Expression, Operator, Reduction, SortKey}, values::{Batch, SchemaRef, Value}, @@ -149,8 +149,8 @@ fn summary_construction_merge_and_evaluation_at_both_phases() { Operator::evaluation( state, 0, - asap_physical_operators::operators::SummaryEvaluation::Exact( - asap_physical_operators::summary_kernels::exact::ExactEvaluation { + asap_executor::operators::SummaryEvaluation::Exact( + asap_executor::summary_kernels::exact::ExactEvaluation { statistic: Statistic::Sum, lookback_ms: None, }, @@ -304,7 +304,7 @@ fn binding_rejects_unsupported_operations() { assert!(Operator::evaluation( sum.schema(), 0, - asap_physical_operators::operators::SummaryEvaluation::Sketch( + asap_executor::operators::SummaryEvaluation::Sketch( planner_types::ir::schema::SketchStatistic::Quantile { q: 0.5 } ) ) @@ -406,7 +406,7 @@ fn kll_raw_partial_and_precomputed_are_native_dags() { Operator::evaluation( state.clone(), 0, - asap_physical_operators::operators::SummaryEvaluation::Sketch( + asap_executor::operators::SummaryEvaluation::Sketch( planner_types::ir::schema::SketchStatistic::Quantile { q: 0.5 }, ), ) @@ -426,7 +426,7 @@ fn kll_raw_partial_and_precomputed_are_native_dags() { // Exact state must match its declared family; a mislabeled state is rejected. #[test] fn exact_state_and_family_validation() { - use asap_physical_operators::summary_kernels::exact::ExactAccumulator; + use asap_executor::summary_kernels::exact::ExactAccumulator; let family = FieldDataType::ExactAggregate(ExactKind::Sum, ExactParams::Sum); let mut acc = ExactAccumulator::new(family.clone(), false).unwrap(); acc.update(None, 7., 0); @@ -462,8 +462,8 @@ fn exact_state_and_family_validation() { Operator::evaluation( schema.clone(), 0, - asap_physical_operators::operators::SummaryEvaluation::Exact( - asap_physical_operators::summary_kernels::exact::ExactEvaluation { + asap_executor::operators::SummaryEvaluation::Exact( + asap_executor::summary_kernels::exact::ExactEvaluation { statistic: Statistic::Sum, lookback_ms: None, }, @@ -491,7 +491,7 @@ fn exact_state_and_family_validation() { // Planner binding rejects unknown computation instead of accepting a fallback. #[test] fn bind_post_asap_before_execution() { - use asap_physical_operators::dag::planner::bind; + use asap_executor::dag::planner::bind; use planner_types::ir::properties::ExecutionDataState; use planner_types::ir::scalar::{ArithmeticOpKind, ScalarValue}; use std::collections::BTreeMap; @@ -544,7 +544,7 @@ fn bind_post_asap_before_execution() { }], roots: vec![1], }; - let sources = || -> BTreeMap> { + let sources = || -> BTreeMap> { BTreeMap::from([( 0, Box::new( @@ -553,7 +553,7 @@ fn bind_post_asap_before_execution() { vec![Batch::try_new(schema.clone(), vec![vec![Value::Float64(1.)]]).unwrap()], ) .unwrap(), - ) as asap_physical_operators::dag::planner::Source<'static>, + ) as asap_executor::dag::planner::Source<'static>, )]) }; let native = bind(&dag, sources(), &[1]).unwrap(); @@ -583,8 +583,8 @@ fn empty_exact_count_is_an_integer_state_evaluation() { let read = Operator::evaluation( build.schema(), 0, - asap_physical_operators::operators::SummaryEvaluation::Exact( - asap_physical_operators::summary_kernels::exact::ExactEvaluation { + asap_executor::operators::SummaryEvaluation::Exact( + asap_executor::summary_kernels::exact::ExactEvaluation { statistic: Statistic::Count, lookback_ms: None, }, @@ -602,7 +602,7 @@ fn empty_exact_count_is_an_integer_state_evaluation() { // A deployment source cannot pass a different row shape to bound expressions. #[test] fn source_batches_must_match_the_bound_schema() { - use asap_physical_operators::dag::{self, PhysicalOperator}; + use asap_executor::dag::{self, PhysicalOperator}; use planner_types::ir::properties::ExecutionDataState; use std::{cell::Cell, collections::BTreeMap, rc::Rc}; struct WrongSource { @@ -708,7 +708,7 @@ fn extrema_preserve_numeric_values_in_the_presence_of_nan() { // Planner wire nodes, including grouping and edge roles, are executable at either phase. #[test] fn planner_semijoin_sort_limit_contract_at_both_phases() { - use asap_physical_operators::dag::planner::{bind, Source}; + use asap_executor::dag::planner::{bind, Source}; use planner_types::ir::operator::{GroupKeys, JoinKind}; use planner_types::ir::properties::*; use planner_types::ir::scalar::CompareOpKind; @@ -720,16 +720,15 @@ fn planner_semijoin_sort_limit_contract_at_both_phases() { ("score", DataType::Float64, false), ]); let keys_schema = schema(&[("key", DataType::Utf8, false)]); - let node = - |id, payload, schema: &asap_physical_operators::values::SchemaRef| PhysicalASAPDAGNode { - id, - payload, - output_schema: (**schema).clone(), - output_state: ExecutionDataState::QUERY_ROWS, - guarantee: None, - }; - let edge = |producer, consumer, role, schema: &asap_physical_operators::values::SchemaRef| { - PhysicalASAPDAGEdge { + let node = |id, payload, schema: &asap_executor::values::SchemaRef| PhysicalASAPDAGNode { + id, + payload, + output_schema: (**schema).clone(), + output_state: ExecutionDataState::QUERY_ROWS, + guarantee: None, + }; + let edge = + |producer, consumer, role, schema: &asap_executor::values::SchemaRef| PhysicalASAPDAGEdge { producer, consumer, role, @@ -737,8 +736,7 @@ fn planner_semijoin_sort_limit_contract_at_both_phases() { data_state: ExecutionDataState::QUERY_ROWS, grouping: GroupingEdgeCompatibility::NotApplicable, window: WindowEdgeCompatibility::NotApplicable, - } - }; + }; let groups = GroupKeys::by(vec![0]); let dag = PhysicalASAPDAG { nodes: vec![ @@ -870,7 +868,7 @@ fn planner_semijoin_sort_limit_contract_at_both_phases() { // Planner scalar signatures, collection access and null predicates share native execution. #[test] fn planner_expressions_preserve_collection_and_nullable_types() { - use asap_physical_operators::dag::expressions::CompiledExpression; + use asap_executor::dag::expressions::CompiledExpression; use planner_types::ir::scalar::{CompareOpKind, ScalarValue}; let input_schema = schema(&[( @@ -1152,7 +1150,7 @@ fn assert_weighted_rate_topk(count_sketch: bool) { // The grouped temporal reducer's sample schema must survive physical Sort/Limit binding. #[test] fn grouped_temporal_schema_compiles_and_executes_topk() { - use asap_physical_operators::physical_planner::{ + use asap_executor::physical_planner::{ compile_node, CompiledPhysicalDAG, InputContract, Source, }; use planner_types::ir::physical_export::{PhysicalASAPDAGNode, PhysicalASAPOperatorPayload}; @@ -1262,7 +1260,7 @@ fn grouped_temporal_schema_compiles_and_executes_topk() { // A certified candidate set must have authoritative values for every key, including after recovery. #[test] fn certified_pruning_rejects_missing_authoritative_values_after_recovery() { - use asap_physical_operators::physical_planner::{ + use asap_executor::physical_planner::{ compile_node, CompiledPhysicalDAG, InputContract, Source, }; use planner_types::ir::operator::JoinKind; @@ -1355,7 +1353,7 @@ fn certified_pruning_rejects_missing_authoritative_values_after_recovery() { while let Some(batch) = stream.next().await { rows.extend(batch?.rows().iter().cloned()); } - Ok::<_, asap_physical_operators::Error>(rows) + Ok::<_, asap_executor::Error>(rows) }); if certified && !complete { assert!(result @@ -1374,7 +1372,7 @@ fn certified_pruning_rejects_missing_authoritative_values_after_recovery() { // Precompute arithmetic must match population/window identities, never zip arrival order. #[test] fn compiled_ingestion_binary_preserves_alignment_and_rejects_missing_updates() { - use asap_physical_operators::physical_planner::{ + use asap_executor::physical_planner::{ compile_node, CompiledPhysicalDAG, InputContract, Source, }; use planner_types::ir::operator::BinaryOpKind; @@ -1465,7 +1463,7 @@ fn compiled_ingestion_binary_preserves_alignment_and_rejects_missing_updates() { while let Some(batch) = stream.next().await { rows.extend(batch?.rows().iter().cloned()); } - Ok::<_, asap_physical_operators::Error>(rows) + Ok::<_, asap_executor::Error>(rows) }); match expected { Some(values) => assert_eq!(floats(&result.unwrap(), 2), values), diff --git a/crates/asap-physical-operators/tests/physical_plan_recovery.rs b/crates/executor/tests/physical_plan_recovery.rs similarity index 97% rename from crates/asap-physical-operators/tests/physical_plan_recovery.rs rename to crates/executor/tests/physical_plan_recovery.rs index 9dca664b9..68a6e4672 100644 --- a/crates/asap-physical-operators/tests/physical_plan_recovery.rs +++ b/crates/executor/tests/physical_plan_recovery.rs @@ -1,6 +1,6 @@ //! Deserialized physical plans recover selected operators without logical lowering. //! Deployments choose the encoding; JSON is used here only as a test format. -use asap_physical_operators::{ +use asap_executor::{ operators::{Operator, SortKey}, physical_planner::{CompiledPhysicalDAG, InputContract}, }; @@ -71,7 +71,7 @@ fn recovery_retains_selected_operator_and_rejects_invalid_contracts() { #[test] fn candidate_recovery_preserves_materialization_boundary() { - use asap_physical_operators::physical_planner::CompiledPhysicalPlan; + use asap_executor::physical_planner::CompiledPhysicalPlan; let precompute = sorted(); let output = InputContract::bounded(precompute.output_contract(1).unwrap().schema); let query = CompiledPhysicalDAG::from_operators( diff --git a/crates/asap-physical-operators/tests/physical_semantics.rs b/crates/executor/tests/physical_semantics.rs similarity index 97% rename from crates/asap-physical-operators/tests/physical_semantics.rs rename to crates/executor/tests/physical_semantics.rs index be2017cc1..62e97bd39 100644 --- a/crates/asap-physical-operators/tests/physical_semantics.rs +++ b/crates/executor/tests/physical_semantics.rs @@ -1,7 +1,7 @@ //! Contract tests inspired by DataFusion's limit, sort and join test matrices. //! Expectations follow ASAP's IR (notably row-count and IEEE NaN equality). //! Reference: apache/datafusion e2ca7f3, physical-plan/src/{limit.rs,sorts/sort.rs}. -use asap_physical_operators::{ +use asap_executor::{ expressions::CompiledExpression, operators::{Expression, Operator, Reduction, SortKey}, plan::PhysicalDAG, @@ -347,7 +347,7 @@ fn projection_rejects_expression_bound_to_another_schema() { // A valid Planner MIN/MAX schema must bind even for a non-null input column. #[test] fn global_extrema_bind_with_planner_derived_schema() { - use asap_physical_operators::physical_planner::compile_node; + use asap_executor::physical_planner::compile_node; use planner_types::ir::operator::{AggIntent, GroupKeys, Reduction as PlanReduction}; use planner_types::ir::properties::*; use planner_types::ir::schema::*; @@ -601,7 +601,7 @@ fn kll_partial_merge_and_multiple_evaluations_preserve_population() { Operator::evaluation( state.clone(), 0, - asap_physical_operators::operators::SummaryEvaluation::Sketch( + asap_executor::operators::SummaryEvaluation::Sketch( planner_types::ir::schema::SketchStatistic::Quantile { q }, ), ) @@ -621,8 +621,8 @@ fn kll_partial_merge_and_multiple_evaluations_preserve_population() { )); for (pair, expected) in outputs.chunks(2).zip([0., 64., 127.]) { let value = |batches: &[Result< - asap_physical_operators::runtime::SharedValue, - asap_physical_operators::Error, + asap_executor::runtime::SharedValue, + asap_executor::Error, >]| { assert_eq!(batches.len(), 1); match batches[0].as_ref().unwrap().rows()[0][0] { @@ -641,7 +641,7 @@ fn kll_partial_merge_and_multiple_evaluations_preserve_population() { // Retained zero-column rows still own Vec headers and must consume the output budget. #[test] fn zero_column_output_obeys_memory_limit() { - use asap_physical_operators::Error; + use asap_executor::Error; let input = schema(&[]); let batch = Batch::try_new(input.clone(), vec![vec![]; 200]).unwrap(); let mut dag = PhysicalDAG::default(); @@ -670,7 +670,7 @@ fn zero_column_output_obeys_memory_limit() { // Empty exact-state finalization must preserve ordinary global MIN/MAX null semantics. #[test] fn empty_exact_summary_extrema_agree_with_ordinary_aggregation() { - use asap_physical_operators::Statistic; + use asap_executor::Statistic; use planner_types::ir::schema::{ExactKind, ExactParams}; let input = schema(&[("v", DataType::Float64, false)]); @@ -697,8 +697,8 @@ fn empty_exact_summary_extrema_agree_with_ordinary_aggregation() { Operator::evaluation( state, 0, - asap_physical_operators::operators::SummaryEvaluation::Exact( - asap_physical_operators::summary_kernels::exact::ExactEvaluation { + asap_executor::operators::SummaryEvaluation::Exact( + asap_executor::summary_kernels::exact::ExactEvaluation { statistic, lookback_ms: None, }, diff --git a/crates/asap-physical-operators/tests/plan_properties.rs b/crates/executor/tests/plan_properties.rs similarity index 98% rename from crates/asap-physical-operators/tests/plan_properties.rs rename to crates/executor/tests/plan_properties.rs index fd16f96d1..7a629e1d6 100644 --- a/crates/asap-physical-operators/tests/plan_properties.rs +++ b/crates/executor/tests/plan_properties.rs @@ -1,5 +1,5 @@ //! Finite-input contracts are validated before source execution. -use asap_physical_operators::{ +use asap_executor::{ operators::{Operator, SortKey}, plan::{Boundedness, Emission, PhysicalDAG}, runtime::{Limits, OutputStream, RunContext, Scope}, @@ -122,7 +122,7 @@ fn blocking_inputs_require_an_explicit_finite_source() { // Kernel support must not be mistaken for executable native state/evaluation support. #[test] fn summary_capability_levels_are_distinct() { - use asap_physical_operators::{ + use asap_executor::{ capability::{validate_native_family, validate_sketch_evaluation, validate_summary_kernel}, planner::ir::schema::SketchStatistic, }; diff --git a/crates/asap-physical-operators/tests/planspace_series_identity_heap.rs b/crates/executor/tests/planspace_series_identity_heap.rs similarity index 99% rename from crates/asap-physical-operators/tests/planspace_series_identity_heap.rs rename to crates/executor/tests/planspace_series_identity_heap.rs index 9e843adfa..ce9fee082 100644 --- a/crates/asap-physical-operators/tests/planspace_series_identity_heap.rs +++ b/crates/executor/tests/planspace_series_identity_heap.rs @@ -6,15 +6,15 @@ mod common; use common::compile_physical_asap_dag; use planner_types::ir::OperatorNode; +use asap_executor::physical_planner::promql_rows::{ + compile_current_series_evaluation, SERIES_IDENTITY_COLUMN, +}; use asap_logical_optimizer::{ accuracy::AccuracyEvidenceProvider, accuracy::DefaultAccuracyModel, accuracy::PropagationStats, pass1::replacement::default_strategies_with_evidence, pass1::replacement::ReplacementProvenance, search_workload_with_targets, Proposals, ReplacementStrategy, ReplacementSubDAG, TargetSubDAG, }; -use asap_physical_operators::physical_planner::promql_rows::{ - compile_current_series_evaluation, SERIES_IDENTITY_COLUMN, -}; use asap_plan_selection::candidate_selection::global_selection; use asap_plan_selection::cost::cost_model::DefaultCostModel; use planner_types::{ diff --git a/crates/asap-physical-operators/tests/precompute_candidates.rs b/crates/executor/tests/precompute_candidates.rs similarity index 95% rename from crates/asap-physical-operators/tests/precompute_candidates.rs rename to crates/executor/tests/precompute_candidates.rs index d5aa35e57..09429469f 100644 --- a/crates/asap-physical-operators/tests/precompute_candidates.rs +++ b/crates/executor/tests/precompute_candidates.rs @@ -1,7 +1,6 @@ //! Materialized frontiers are compiled by Planner, never rewritten by deployment. mod common; -use asap_logical_optimizer::search_workload; -use asap_physical_operators::{ +use asap_executor::{ factory::create_planner_accumulator, operators::Operator, physical_planner::{ @@ -12,6 +11,7 @@ use asap_physical_operators::{ runtime::{Limits, RunContext, Scope}, values::{Batch, Value}, }; +use asap_logical_optimizer::search_workload; use asap_plan_selection::candidate_selection::global_selection; use asap_plan_selection::cost::cost_model::DefaultCostModel; use common::compile_physical_asap_dag; @@ -51,8 +51,7 @@ fn grouped_rate_space() -> asap_logical_optimizer::CandidateLogicalASAPDAGs<&'st let root = asap_frontend_promql::lower_promql_workload(&workload, 0) .unwrap() .remove(0); - let root = asap_physical_operators::physical_planner::promql_rows::with_series_identity(&root) - .unwrap(); + let root = asap_executor::physical_planner::promql_rows::with_series_identity(&root).unwrap(); search_workload(vec![("grouped-rate", root)]) } @@ -138,9 +137,9 @@ fn grouped_rate_can_be_materialized_before_or_after_grouped_sum() { let state = accumulator.into_accumulator(); expected_rate_sum += state .as_any() - .downcast_ref::() + .downcast_ref::() .unwrap() - .evaluation(asap_physical_operators::Statistic::Rate, range_ms, None) + .evaluation(asap_executor::Statistic::Rate, range_ms, None) .unwrap() .unwrap(); let summary = Value::Summary { @@ -173,7 +172,7 @@ fn grouped_rate_can_be_materialized_before_or_after_grouped_sum() { let root = dag.roots[0] as u64; let state_id = state.id as u64; let rate_id = evaluation.id as u64; - let frontiers = asap_physical_operators::physical_planner::enumerate_frontiers( + let frontiers = asap_executor::physical_planner::enumerate_frontiers( &dag, &BTreeMap::from([(state_id, InputContract::bounded(input_schema.clone()))]), &[root], @@ -184,15 +183,13 @@ fn grouped_rate_can_be_materialized_before_or_after_grouped_sum() { assert!(frontiers.contains(&vec![rate_id])); assert!(frontiers.contains(&vec![root])); assert!(!frontiers.contains(&vec![root, rate_id])); - assert!( - asap_physical_operators::physical_planner::enumerate_frontiers( - &dag, - &BTreeMap::from([(state_id, InputContract::bounded(input_schema.clone()))]), - &[root], - 1, - ) - .is_err() - ); + assert!(asap_executor::physical_planner::enumerate_frontiers( + &dag, + &BTreeMap::from([(state_id, InputContract::bounded(input_schema.clone()))]), + &[root], + 1, + ) + .is_err()); let candidates = compile_candidates( &dag, BTreeMap::from([(state_id, InputContract::bounded(input_schema))]), @@ -257,15 +254,13 @@ fn grouped_rate_can_be_materialized_before_or_after_grouped_sum() { InputContract::bounded(Arc::new(state.output_schema.clone())), )]); for frontier in [vec![rate_id, rate_id], vec![root, rate_id], vec![999]] { - assert!( - asap_physical_operators::physical_planner::compile_candidate( - &dag, - contracts.clone(), - &[root], - &frontier - ) - .is_err() - ); + assert!(asap_executor::physical_planner::compile_candidate( + &dag, + contracts.clone(), + &[root], + &frontier + ) + .is_err()); } let inventory = compile_candidates( &dag, @@ -366,9 +361,9 @@ fn grouped_rate_can_be_materialized_before_or_after_grouped_sum() { let rate_of_sum = wrong_order .into_accumulator() .as_any() - .downcast_ref::() + .downcast_ref::() .unwrap() - .evaluation(asap_physical_operators::Statistic::Rate, range_ms, None) + .evaluation(asap_executor::Statistic::Rate, range_ms, None) .unwrap() .unwrap(); assert_ne!( @@ -381,7 +376,7 @@ fn grouped_rate_can_be_materialized_before_or_after_grouped_sum() { /// persistence; an explicit Rate-state input retains its original semantics. #[test] fn bounded_inventory_exposes_grouped_rate_physical_frontiers() { - use asap_physical_operators::physical_planner::enumerate_frontiers; + use asap_executor::physical_planner::enumerate_frontiers; let dag = grouped_rate(); let state = dag .nodes @@ -563,8 +558,8 @@ fn recompiled_candidate( inputs: &BTreeMap, roots: &[u64], frontier: &[u64], -) -> Result { - use asap_physical_operators::plan::Emission; +) -> Result { + use asap_executor::plan::Emission; if frontier.is_empty() { return Ok(CompiledPhysicalPlan { precompute: None, @@ -662,8 +657,7 @@ fn population_topk_cuts_equal_per_frontier_compilation() { .unwrap() .remove(0); let root = - asap_physical_operators::physical_planner::promql_rows::with_series_identity(&original) - .unwrap(); + asap_executor::physical_planner::promql_rows::with_series_identity(&original).unwrap(); let selected = asap_logical_optimizer::pass1::maintained_population::MaintainedPopulationStrategy::new( std::slice::from_ref(&root), diff --git a/crates/asap-physical-operators/tests/precompute_population.rs b/crates/executor/tests/precompute_population.rs similarity index 97% rename from crates/asap-physical-operators/tests/precompute_population.rs rename to crates/executor/tests/precompute_population.rs index 1065d595c..b0b78c041 100644 --- a/crates/asap-physical-operators/tests/precompute_population.rs +++ b/crates/executor/tests/precompute_population.rs @@ -1,5 +1,5 @@ //! Persisted precompute DAGs preserve group/window identity and execute state-to-state computation. -use asap_physical_operators::{ +use asap_executor::{ factory::create_planner_accumulator, operators::Operator, physical_planner::{precompute, CompiledPhysicalDAG, Source}, @@ -223,7 +223,7 @@ fn finalized_shared_panes_rebuild_one_global_summary_after_recovery() { assert_eq!( state .as_any() - .downcast_ref::() + .downcast_ref::() .unwrap() .evaluation(Statistic::Sum, None, None) .unwrap() @@ -318,9 +318,9 @@ fn state_dag( fn native_run( program: &CompiledPhysicalDAG, family: FieldDataType, - states: Vec>, + states: Vec>, context: RunContext, -) -> Result>, asap_physical_operators::Error> { +) -> Result>, asap_executor::Error> { let program = serde_json::from_slice::(&serde_json::to_vec(&program).unwrap()) .unwrap(); @@ -363,8 +363,8 @@ fn ingestion_context(limits: Limits) -> RunContext { ) .unwrap() } -fn sum_state(value: f64) -> Arc { - let mut state = asap_physical_operators::summary_kernels::exact::ExactAccumulator::new( +fn sum_state(value: f64) -> Arc { + let mut state = asap_executor::summary_kernels::exact::ExactAccumulator::new( planner_types::ir::schema::FieldDataType::ExactAggregate( planner_types::ir::schema::ExactKind::Sum, planner_types::ir::schema::ExactParams::Sum, @@ -434,7 +434,7 @@ fn precompute_rejects_nonfinite_and_nonpositive_dds_updates() { // An exact count must not silently lose units when exposed through Float64 rows. #[test] fn precompute_count_conversion_checks_precision() { - use asap_physical_operators::summary_kernels::exact::ExactAccumulator; + use asap_executor::summary_kernels::exact::ExactAccumulator; let family = FieldDataType::ExactAggregate(ExactKind::Count, ExactParams::Count); let program = state_dag(family.clone(), None, false); for (count, valid) in [(3u64, true), ((1u64 << 53) + 1, false)] { diff --git a/crates/asap-physical-operators/tests/promql_binary.rs b/crates/executor/tests/promql_binary.rs similarity index 96% rename from crates/asap-physical-operators/tests/promql_binary.rs rename to crates/executor/tests/promql_binary.rs index 92cc58540..88e8e322f 100644 --- a/crates/asap-physical-operators/tests/promql_binary.rs +++ b/crates/executor/tests/promql_binary.rs @@ -1,5 +1,5 @@ //! Binary computation must be fully compiled before deployment binds values. -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, physical_planner::{compile_node, CompiledPhysicalDAG, InputContract, Source}, runtime::{Limits, RunContext, Scope}, @@ -97,14 +97,14 @@ fn program_for_bool(operator: BinaryOperator, return_bool: bool) -> CompiledPhys fn evaluate( left: Vec>, right: Vec>, -) -> Result>, asap_physical_operators::Error> { +) -> Result>, asap_executor::Error> { evaluate_with(program(), left, right) } fn evaluate_with( physical_dag: CompiledPhysicalDAG, left: Vec>, right: Vec>, -) -> Result>, asap_physical_operators::Error> { +) -> Result>, asap_executor::Error> { let sources = [left, right] .into_iter() .enumerate() @@ -164,11 +164,11 @@ fn duplicate_matching_identity_is_rejected() { // Scalar broadcasting and comparison filtering keep the vector operand's value. #[test] fn scalar_broadcast_and_bool_comparison_are_distinct() { - use asap_physical_operators::physical_planner::promql_values; + use asap_executor::physical_planner::promql_values; use planner_types::ir::scalar::CompareOpKind; for return_bool in [false, true] { let physical_dag = promql_values::compile_binary( - &asap_physical_operators::expressions::binary::BinaryOperator::from_logical( + &asap_executor::expressions::binary::BinaryOperator::from_logical( &BinaryOperator { kind: BinaryOpKind::Compare(CompareOpKind::Lt), vector_match: None, @@ -291,8 +291,8 @@ fn binary_obeys_memory_and_cancellation() { }); assert!(matches!( (cancel, result), - (true, Err(asap_physical_operators::Error::Cancelled)) - | (false, Err(asap_physical_operators::Error::MemoryLimit)) + (true, Err(asap_executor::Error::Cancelled)) + | (false, Err(asap_executor::Error::MemoryLimit)) )); } } @@ -330,9 +330,7 @@ fn label_map_bool_comparison_drops_the_name() { // Stored temporal evaluations drop metric names before filter comparisons and set matching. #[test] fn stored_series_evaluations_support_filters_and_sets() { - use asap_physical_operators::{ - physical_planner::compile, summary_kernels::exact::ExactAccumulator, - }; + use asap_executor::{physical_planner::compile, summary_kernels::exact::ExactAccumulator}; use planner_types::ir::operator::PromQLVectorSetOpKind; use planner_types::ir::properties::*; use planner_types::ir::scalar::CompareOpKind; diff --git a/crates/asap-physical-operators/tests/promql_fallback.rs b/crates/executor/tests/promql_fallback.rs similarity index 99% rename from crates/asap-physical-operators/tests/promql_fallback.rs rename to crates/executor/tests/promql_fallback.rs index c7dab96a5..5075ede35 100644 --- a/crates/asap-physical-operators/tests/promql_fallback.rs +++ b/crates/executor/tests/promql_fallback.rs @@ -2,7 +2,7 @@ //! The deployment supplies only its selector's raw series; expected values are //! hand-computed with Prometheus semantics. mod common; -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, physical_planner::{compile, promql_fallback, promql_rows, CompiledPhysicalDAG, InputContract}, runtime::{Limits, RunContext, Scope}, diff --git a/crates/asap-physical-operators/tests/promql_values.rs b/crates/executor/tests/promql_values.rs similarity index 97% rename from crates/asap-physical-operators/tests/promql_values.rs rename to crates/executor/tests/promql_values.rs index 1174ab5e1..4644d8052 100644 --- a/crates/asap-physical-operators/tests/promql_values.rs +++ b/crates/executor/tests/promql_values.rs @@ -1,7 +1,7 @@ //! Compile, persist and rebind dynamic-label computation without deployment lowering. -use asap_physical_operators::expressions::binary::{BinaryOpKind, BinaryOperator}; +use asap_executor::expressions::binary::{BinaryOpKind, BinaryOperator}; -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, physical_planner::{promql_values::*, CompiledPhysicalDAG, Source}, runtime::{Limits, RunContext, Scope}, @@ -31,7 +31,7 @@ fn run(dag: CompiledPhysicalDAG, rows: Vec>) -> Vec> { fn run_inputs( dag: CompiledPhysicalDAG, batches: Vec, -) -> Result>, asap_physical_operators::Error> { +) -> Result>, asap_executor::Error> { let dag = serde_json::from_slice::(&serde_json::to_vec(&dag).unwrap()).unwrap(); let sources = batches @@ -211,7 +211,7 @@ fn histogram_quantile_keeps_each_label_group() { // Linking an ensemble preserves its shared producer and every selected operator. #[test] fn composed_ensemble_shares_a_producer_across_roots() { - use asap_physical_operators::{ + use asap_executor::{ physical_planner::InputContract, plan::{PhysicalOperator, PlanProperties}, runtime::{Input, OutputStream}, @@ -242,7 +242,7 @@ fn composed_ensemble_shares_a_producer_across_roots() { &'a self, inputs: Vec>, context: RunContext, - ) -> Result, asap_physical_operators::Error> { + ) -> Result, asap_executor::Error> { self.starts.set(self.starts.get() + 1); self.source.start(inputs, context) } @@ -400,7 +400,7 @@ fn scalar_broadcast_rejects_colliding_result_labels_after_recovery() { // finalize each population, and preserve the requested metric-name semantics. #[test] fn exact_state_evaluations_recover_and_finalize_panes() { - use asap_physical_operators::factory::create_planner_accumulator; + use asap_executor::factory::create_planner_accumulator; use planner_types::ir::schema::*; use std::sync::Arc; for (kind, params, expected) in [ @@ -450,7 +450,7 @@ fn exact_state_evaluations_recover_and_finalize_panes() { #[test] fn recovered_exact_counter_uses_window_and_omits_insufficient_samples() { - use asap_physical_operators::factory::create_planner_accumulator; + use asap_executor::factory::create_planner_accumulator; use planner_types::ir::schema::*; use std::sync::Arc; for (kind, params, expected) in [ diff --git a/crates/asap-physical-operators/tests/raw_scan.rs b/crates/executor/tests/raw_scan.rs similarity index 98% rename from crates/asap-physical-operators/tests/raw_scan.rs rename to crates/executor/tests/raw_scan.rs index 3878f908c..136d56513 100644 --- a/crates/asap-physical-operators/tests/raw_scan.rs +++ b/crates/executor/tests/raw_scan.rs @@ -1,5 +1,5 @@ //! Scan acceptance uses the public connector contract and Planner physical DAGs. -use asap_physical_operators::dag::{ +use asap_executor::dag::{ planner::bind_with_data_sources, scan::{DataSources, MemorySource, RawSource}, values::{Batch, SchemaRef, Value}, @@ -188,8 +188,8 @@ struct CountingSource { fail: bool, } impl RawSource for CountingSource { - fn boundedness(&self) -> asap_physical_operators::plan::Boundedness { - asap_physical_operators::plan::Boundedness::Bounded + fn boundedness(&self) -> asap_executor::plan::Boundedness { + asap_executor::plan::Boundedness::Bounded } fn schema(&self) -> SchemaRef { self.schema.clone() @@ -366,7 +366,7 @@ fn empty_sources_and_three_valued_predicates() { // A physical candidate can be compiled once without readers and rebound per run. #[test] fn compile_without_readers_and_rebind_inputs() { - use asap_physical_operators::{ + use asap_executor::{ operators::Operator, physical_planner::{compile, InputContract, Source}, }; @@ -402,7 +402,7 @@ fn compile_without_readers_and_rebind_inputs() { // Input boundedness must be proved during compilation, before readers exist. #[test] fn compilation_rejects_unknown_boundedness_for_sort() { - use asap_physical_operators::{ + use asap_executor::{ physical_planner::{compile, InputContract}, plan::{Boundedness, Emission, PlanProperties}, }; diff --git a/crates/asap-physical-operators/tests/summary_projection.rs b/crates/executor/tests/summary_projection.rs similarity index 99% rename from crates/asap-physical-operators/tests/summary_projection.rs rename to crates/executor/tests/summary_projection.rs index 0362d9542..be59b1cfd 100644 --- a/crates/asap-physical-operators/tests/summary_projection.rs +++ b/crates/executor/tests/summary_projection.rs @@ -1,5 +1,5 @@ //! Opaque state travels through a retained physical projection without scalar decoding. -use asap_physical_operators::{ +use asap_executor::{ expressions::Expression, factory::create_planner_accumulator, operators::Operator, diff --git a/crates/asap-physical-operators/tests/weighted_topk_binding.rs b/crates/executor/tests/weighted_topk_binding.rs similarity index 96% rename from crates/asap-physical-operators/tests/weighted_topk_binding.rs rename to crates/executor/tests/weighted_topk_binding.rs index 7d438a5b6..756f66359 100644 --- a/crates/asap-physical-operators/tests/weighted_topk_binding.rs +++ b/crates/executor/tests/weighted_topk_binding.rs @@ -1,16 +1,16 @@ //! Planner output binds directly to the shared runtime at a declared rate-value frontier. mod common; -use asap_logical_optimizer::{ - accuracy::AccuracyEvidenceProvider, accuracy::DefaultAccuracyModel, - accuracy::EqualSplitAllocator, accuracy::PropagationStats, ASAPStrategies, Replacement, - ReplacementStrategy, TargetSubDAG, -}; -use asap_physical_operators::dag::{ +use asap_executor::dag::{ operators::Operator, planner::{compile, InputContract, Source}, values::{Batch, Value}, Limits, RunContext, Scope, }; +use asap_logical_optimizer::{ + accuracy::AccuracyEvidenceProvider, accuracy::DefaultAccuracyModel, + accuracy::EqualSplitAllocator, accuracy::PropagationStats, ASAPStrategies, Replacement, + ReplacementStrategy, TargetSubDAG, +}; use common::compile_physical_asap_dag; use futures::{executor::block_on, StreamExt}; use planner_types::ir::physical_export::{PhysicalASAPDAG, PhysicalASAPOperatorPayload}; @@ -253,14 +253,12 @@ fn rate_updates_cannot_enter_integer_heap_factory() { proof: NonNegativeWeightProof::ResetAwareCounterDerivative, }, }; - assert!( - asap_physical_operators::factory::create_planner_accumulator( - &family, - &input, - &Default::default() - ) - .is_err() - ); + assert!(asap_executor::factory::create_planner_accumulator( + &family, + &input, + &Default::default() + ) + .is_err()); } /// A catalog-resolved per-series rate can feed a heap sketch directly, without @@ -277,7 +275,7 @@ fn direct_rate_topk_preserves_dynamic_unreferenced_labels() { } fn check_direct_rate_topk(dynamic: bool) { - use asap_physical_operators::physical_planner::promql_rows::{ + use asap_executor::physical_planner::promql_rows::{ decode_series_identity, series_row, with_series_identity, SERIES_IDENTITY_COLUMN, }; let mut logical = @@ -332,10 +330,8 @@ fn check_direct_rate_topk(dynamic: bool) { .unwrap_or_else(|| panic!("missing {algorithm:?} over direct Rate")); if dynamic { let (source, ranked) = - asap_physical_operators::physical_planner::promql_rows::compile_rate_ranking( - candidate, - ) - .unwrap(); + asap_executor::physical_planner::promql_rows::compile_rate_ranking(candidate) + .unwrap(); assert!(matches!( source.operator, planner_types::ir::Operator::ASAP( @@ -390,10 +386,9 @@ fn check_direct_rate_topk(dynamic: bool) { ) .unwrap(); let bytes = serde_json::to_vec(&raw_compiled).unwrap(); - let raw_compiled = serde_json::from_slice::< - asap_physical_operators::physical_planner::CompiledPhysicalDAG, - >(&bytes) - .unwrap(); + let raw_compiled = + serde_json::from_slice::(&bytes) + .unwrap(); // Each evaluation receives a complete raw window. A reset, a stopped // series and an expired leader must not retain last run's heap weights. for (end, series, expected) in [ @@ -622,7 +617,7 @@ fn check_direct_rate_topk(dynamic: bool) { // CountSketch; a raw metric does not establish the non-negative CMS contract. #[test] fn spatial_topk_exposes_signed_heap_candidate_over_complete_snapshot() { - use asap_physical_operators::physical_planner::promql_rows::{ + use asap_executor::physical_planner::promql_rows::{ decode_series_identity, series_row, with_series_identity, SERIES_IDENTITY_COLUMN, }; let logical = lower_promql("topk by(job)(1, m)", AccuracyTarget::Epsilon(0.1)).unwrap(); @@ -668,10 +663,8 @@ fn spatial_topk_exposes_signed_heap_candidate_over_complete_snapshot() { ) .unwrap(); let snapshot_program = - asap_physical_operators::physical_planner::promql_rows::compile_current_series_evaluation( - selected, - ) - .unwrap(); + asap_executor::physical_planner::promql_rows::compile_current_series_evaluation(selected) + .unwrap(); let encoded: serde_json::Value = serde_json::from_slice(&serde_json::to_vec(&snapshot_program).unwrap()).unwrap(); assert!(!encoded.to_string().contains("CurrentSeries")); @@ -806,9 +799,7 @@ fn continuously_maintained_dag(candidate: &Rc) // placement: materialization timing, not a separate candidate, puts it in precompute. #[test] fn maintained_rate_heap_compiles_fixed_window_precompute() { - use asap_physical_operators::physical_planner::{ - compile_candidate, promql_rows::with_series_identity, - }; + use asap_executor::physical_planner::{compile_candidate, promql_rows::with_series_identity}; let root = Rc::new( with_series_identity( &lower_promql("topk by(job)(2, rate(m[1m]))", AccuracyTarget::Epsilon(0.1)).unwrap(), @@ -868,14 +859,18 @@ fn maintained_rate_heap_compiles_fixed_window_precompute() { &[heap.id as u64], ) .unwrap(); - let exported = asap_physical_operators::physical_planner::promql_rows::compile_fixed_window_rate_aggregation(&dag).unwrap(); + let exported = + asap_executor::physical_planner::promql_rows::compile_fixed_window_rate_aggregation( + &dag, + ) + .unwrap(); assert_eq!( serde_json::to_vec(&exported).unwrap(), serde_json::to_vec(&physical).unwrap() ); // Execute the selected split across a state serialization boundary. // Each run builds fresh weights from that window's counters. - let execute = |plan: &asap_physical_operators::physical_planner::CompiledPhysicalDAG, + let execute = |plan: &asap_executor::physical_planner::CompiledPhysicalDAG, input: Batch, scope: Scope| { let id = plan.input_contracts().next().unwrap().0; @@ -925,10 +920,8 @@ fn maintained_rate_heap_compiles_fixed_window_precompute() { .zip(["a", "b", "c"]) .map(|(samples, label)| { let mut accumulator = - asap_physical_operators::factory::create_planner_accumulator( - family, input, grouping, - ) - .unwrap(); + asap_executor::factory::create_planner_accumulator(family, input, grouping) + .unwrap(); for (offset, value) in [10_000, 30_000, 50_000].into_iter().zip(samples) { accumulator.update_single(value, end - 60_000 + offset); } diff --git a/crates/integration-tests/Cargo.toml b/crates/integration-tests/Cargo.toml index 0d8c79229..0d2f938bf 100644 --- a/crates/integration-tests/Cargo.toml +++ b/crates/integration-tests/Cargo.toml @@ -17,5 +17,5 @@ asap_sketchlib = { workspace = true } serde_json = "1" tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread"] } -asap-physical-operators = { path = "../asap-physical-operators" } +asap-executor = { path = "../executor" } futures = "0.3" diff --git a/crates/integration-tests/tests/kll_pane_execution.rs b/crates/integration-tests/tests/kll_pane_execution.rs index 99d589010..cf9a495c4 100644 --- a/crates/integration-tests/tests/kll_pane_execution.rs +++ b/crates/integration-tests/tests/kll_pane_execution.rs @@ -1,6 +1,6 @@ //! Maintenance -> stored pane state -> independently bound query execution. mod physical_common; -use asap_physical_operators::{ +use asap_executor::{ operators::{Operator, SummaryEvaluation}, physical_planner::{CompiledPhysicalDAG, InputContract, Source}, plan::{PhysicalDAG, PhysicalOperator, PlanProperties}, diff --git a/crates/integration-tests/tests/operator_design_examples.rs b/crates/integration-tests/tests/operator_design_examples.rs index 18e02d81b..bc22f2c2e 100644 --- a/crates/integration-tests/tests/operator_design_examples.rs +++ b/crates/integration-tests/tests/operator_design_examples.rs @@ -141,7 +141,7 @@ async fn sql_scalar_subquery_retains_its_cardinality_contract() { /// Execute the SQL SUM example for nonempty, empty and all-NULL populations. #[tokio::test] async fn sql_sum_example_executes_with_sql_null_semantics() { - use asap_physical_operators::{ + use asap_executor::{ physical_planner::{compile, InputContract, Source}, runtime::{Limits, RunContext, Scope}, sources::{DataSources, MemorySource}, @@ -262,7 +262,7 @@ async fn sql_window_and_filtered_aggregate_types() { /// constructed by the test. #[tokio::test] async fn batch_planning_selects_and_executes_each_plan() { - use asap_physical_operators::{ + use asap_executor::{ physical_planner::{compile, InputContract}, runtime::Scope, values::{Batch, Value}, diff --git a/crates/integration-tests/tests/physical_common/mod.rs b/crates/integration-tests/tests/physical_common/mod.rs index 11216b3e8..03daaa01a 100644 --- a/crates/integration-tests/tests/physical_common/mod.rs +++ b/crates/integration-tests/tests/physical_common/mod.rs @@ -1,4 +1,4 @@ -use asap_physical_operators::{ +use asap_executor::{ operators::Operator, physical_planner::{CompiledPhysicalDAG, Source}, runtime::{Limits, RunContext, Scope}, diff --git a/crates/integration-tests/tests/planner_layering_example1.rs b/crates/integration-tests/tests/planner_layering_example1.rs index bbce6336b..13903f878 100644 --- a/crates/integration-tests/tests/planner_layering_example1.rs +++ b/crates/integration-tests/tests/planner_layering_example1.rs @@ -824,7 +824,7 @@ fn stage2_everything_runs_at_query_time() { /// runs as a retained PromQL expression, and the samples of each time range a /// native operator reads. fn compile_in_runtime(p: &PhysicalCandidate) -> Result<(), String> { - use asap_physical_operators::physical_planner::{compile, promql_fallback, InputContract}; + use asap_executor::physical_planner::{compile, promql_fallback, InputContract}; use asap_types::ir::physical_export::compile_physical_asap_workload_with_node_ids; use std::sync::Arc; let ids = compile_physical_asap_workload_with_node_ids(&p.stage2.roots) diff --git a/crates/integration-tests/tests/precompute_raw_samples.rs b/crates/integration-tests/tests/precompute_raw_samples.rs index 2cc311bfe..4cabb156d 100644 --- a/crates/integration-tests/tests/precompute_raw_samples.rs +++ b/crates/integration-tests/tests/precompute_raw_samples.rs @@ -7,12 +7,7 @@ use asap_types::ir::OperatorNode; use physical_common::compile_maintained_physical_asap_dag; use std::{collections::BTreeMap, collections::BTreeSet, rc::Rc, sync::Arc}; -use asap_integration_tests::fixtures::lower_promql; -use asap_logical_optimizer::{ - search_workload, ASAPStrategies, Replacement, ReplacementStrategy, ReplacementSubDAG, - TargetSubDAG, -}; -use asap_physical_operators::{ +use asap_executor::{ factory::create_planner_accumulator, operators::Operator, physical_planner::{precompute, Source}, @@ -21,6 +16,11 @@ use asap_physical_operators::{ values::{Batch, Value}, AggregateCore, KeyByLabelValues, Statistic, }; +use asap_integration_tests::fixtures::lower_promql; +use asap_logical_optimizer::{ + search_workload, ASAPStrategies, Replacement, ReplacementStrategy, ReplacementSubDAG, + TargetSubDAG, +}; use asap_plan_selection::candidate_selection::global_selection; use asap_plan_selection::cost::cost_model::DefaultCostModel; use asap_types::ir::operator::Reduction; @@ -141,9 +141,9 @@ fn execute( .map(|n| (&n.output_schema, &n.payload)) ); }); - let program = serde_json::from_slice::< - asap_physical_operators::physical_planner::CompiledPhysicalDAG, - >(&serde_json::to_vec(&program).unwrap()) + let program = serde_json::from_slice::( + &serde_json::to_vec(&program).unwrap(), + ) .unwrap(); let schema = precompute::raw_sample_schema(); let batch = Batch::try_new( @@ -317,7 +317,7 @@ fn check( }; let stored_only = matches!(family, FieldDataType::Sketch(kind, _) if kind.algorithm() == &asap_types::ir::schema::SketchAlgorithm::Cms); - if stored_only || asap_physical_operators::capability::validate_native_family(family).is_err() { + if stored_only || asap_executor::capability::validate_native_family(family).is_err() { // Families without a native state (e.g. UnivMon), or with native // stored state only (plain CMS), are outside precompute execution; // their compile must fail. @@ -363,7 +363,7 @@ fn check( } } let mut expected = - BTreeMap::>::new(); + BTreeMap::>::new(); for (labels, time, value) in rows { let updater = expected .entry(population(reduction, &keys, labels)) diff --git a/crates/integration-tests/tests/sql_to_physical.rs b/crates/integration-tests/tests/sql_to_physical.rs index bfac9650f..ed03b1372 100644 --- a/crates/integration-tests/tests/sql_to_physical.rs +++ b/crates/integration-tests/tests/sql_to_physical.rs @@ -1,13 +1,13 @@ //! SQL frontend, candidate selection, physical compilation and fresh-run execution. mod physical_common; -use asap_frontend_sql::{lower_sql, SqlCatalog}; -use asap_logical_optimizer::search_workload; -use asap_physical_operators::{ +use asap_executor::{ physical_planner::{compile, InputContract, Source}, runtime::{Limits, RunContext, Scope}, sources::{DataSources, MemorySource}, values::{Batch, Value}, }; +use asap_frontend_sql::{lower_sql, SqlCatalog}; +use asap_logical_optimizer::search_workload; use asap_plan_selection::candidate_selection::global_selection; use asap_plan_selection::DefaultCostModel; use asap_types::ir::physical_export::PhysicalASAPOperatorPayload; diff --git a/crates/logical-optimizer/tests/stage1_cost_independence.rs b/crates/logical-optimizer/tests/stage1_cost_independence.rs index 2c1203a74..24669ed95 100644 --- a/crates/logical-optimizer/tests/stage1_cost_independence.rs +++ b/crates/logical-optimizer/tests/stage1_cost_independence.rs @@ -11,7 +11,7 @@ const FORBIDDEN_CRATES: &[&str] = &[ "asap-physical-optimizer", "asap-plan-selection", "asap-planner", - "asap-physical-operators", + "asap-executor", ]; /// Every `.rs` file under `dir`. diff --git a/crates/physical-optimizer/tests/stage2_dependencies.rs b/crates/physical-optimizer/tests/stage2_dependencies.rs index e6a1c7b14..70e991d2d 100644 --- a/crates/physical-optimizer/tests/stage2_dependencies.rs +++ b/crates/physical-optimizer/tests/stage2_dependencies.rs @@ -4,11 +4,7 @@ use std::path::Path; /// Crates Stage 2 must not depend on: Stage 3, the facade and the executor. -const FORBIDDEN_CRATES: &[&str] = &[ - "asap-plan-selection", - "asap-planner", - "asap-physical-operators", -]; +const FORBIDDEN_CRATES: &[&str] = &["asap-plan-selection", "asap-planner", "asap-executor"]; /// The manifest names no later stage, facade or executor crate, so Cargo /// rejects any import of them. diff --git a/crates/plan-selection/tests/stage3_dependencies.rs b/crates/plan-selection/tests/stage3_dependencies.rs index 967bdbe33..0c40fd9f9 100644 --- a/crates/plan-selection/tests/stage3_dependencies.rs +++ b/crates/plan-selection/tests/stage3_dependencies.rs @@ -4,7 +4,7 @@ use std::path::Path; /// Crates Stage 3 must not depend on: the facade and the executor. -const FORBIDDEN_CRATES: &[&str] = &["asap-planner", "asap-physical-operators"]; +const FORBIDDEN_CRATES: &[&str] = &["asap-planner", "asap-executor"]; /// The manifest names neither the facade nor the executor crate, so Cargo /// rejects any import of them. diff --git a/docs/design_docs/physical-planning-and-deployment.md b/docs/design_docs/physical-planning-and-deployment.md index 6f6d7f207..3f448f80c 100644 --- a/docs/design_docs/physical-planning-and-deployment.md +++ b/docs/design_docs/physical-planning-and-deployment.md @@ -312,7 +312,7 @@ and `query`. *Maintenance* stays materialization's word (section 2): it covers how state is built, retained, reused and scheduled. A precompute DAG is the physical object that maintenance compiles to, so reusing *maintenance* for it collapses two layers: Stage 2 materialization (#509) owns maintenance, and -`asap-physical-operators::physical_planner` owns the DAGs. +`asap-executor::physical_planner` owns the DAGs. ### Precompute Physical DAG @@ -523,7 +523,7 @@ Deployment: ``` The deployment engine executes the bound Physical DAGs through ASAPPlanner's -shared physical operator implementation library, `asap-physical-operators`, and +shared physical operator implementation library, `asap-executor`, and its DAG runtime. The merge executes once per run for both consumers. Execution does not introduce additional planning decisions. diff --git a/docs/develop_docs/physical-compile-coverage.md b/docs/develop_docs/physical-compile-coverage.md index 720767696..56ebf0e42 100644 --- a/docs/develop_docs/physical-compile-coverage.md +++ b/docs/develop_docs/physical-compile-coverage.md @@ -1,7 +1,7 @@ # Physical compile coverage for deployment computation Audience: developers moving computation from ASAPQuery-backend into -`asap_physical_operators::physical_planner`. +`asap_executor::physical_planner`. ## Contract