From 4a87c769ce0cbb7b47cfe50ecd59da7de16e4fca Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Tue, 17 Nov 2026 13:24:57 +0000 Subject: [PATCH] fix(ci): green main on the current toolchain: std EULER_GAMMA, drop the deleted enumeration viewer test, update the MetricsQL consumer check to lower_metricsql's two-argument signature, scope a test-only import --- .github/workflows/rust.yml | 2 +- crates/cost/src/node/state_bytes/mod.rs | 7 ++----- crates/types/src/plan/physical_asap_dag.rs | 4 ++-- tools/verify_metricsql_external_consumer.sh | 1 - 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4a2d3fd84..9069524e5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -106,7 +106,7 @@ jobs: python3 -m unittest -v test_viewer test_server - name: Run the DAG viewer's Node tests - run: node --test tools/dag-viewer/stages.test.mjs tools/dag-viewer/enumeration.test.mjs tools/dag-viewer/memo.test.mjs + run: node --test tools/dag-viewer/stages.test.mjs tools/dag-viewer/memo.test.mjs - name: Verify MetricsQL frontend as a stable external dependency run: bash tools/verify_metricsql_external_consumer.sh diff --git a/crates/cost/src/node/state_bytes/mod.rs b/crates/cost/src/node/state_bytes/mod.rs index b07215318..120ae8a8a 100644 --- a/crates/cost/src/node/state_bytes/mod.rs +++ b/crates/cost/src/node/state_bytes/mod.rs @@ -352,9 +352,6 @@ const DDSKETCH_ASSUMED_MAGNITUDE_RANGE: ValueMagnitudeRange = ValueMagnitudeRang max_abs: 1e9, }; -/// The Euler–Mascheroni constant γ. -const EULER_GAMMA: f64 = 0.577_215_664_901_532_9; - /// The ratio of the largest to the smallest of `rows` values a DDSketch /// state is assumed to span when the workload declares nothing about its /// values: `rows` samples of an exponential distribution, as latencies @@ -371,8 +368,8 @@ const EULER_GAMMA: f64 = 0.577_215_664_901_532_9; /// exponential (Pareto) are under-charged. fn exponential_values_magnitude_ratio(rows: u64) -> f64 { let n = rows.max(1) as f64; - let harmonic = n.ln() + EULER_GAMMA + 1.0 / (2.0 * n); - n * harmonic * EULER_GAMMA.exp() + let harmonic = n.ln() + std::f64::consts::EULER_GAMMA + 1.0 / (2.0 * n); + n * harmonic * std::f64::consts::EULER_GAMMA.exp() } /// The bytes a DDSketch of relative accuracy `alpha` is expected to hold diff --git a/crates/types/src/plan/physical_asap_dag.rs b/crates/types/src/plan/physical_asap_dag.rs index 9b421daa0..bba81134b 100644 --- a/crates/types/src/plan/physical_asap_dag.rs +++ b/crates/types/src/plan/physical_asap_dag.rs @@ -27,7 +27,7 @@ use crate::ir::properties::execution_data_state::{ExecutionDataState, ExecutionT use crate::ir::properties::selection::SelectionBox; use crate::ir::schema::Schema; use crate::stages::PhysicalCandidateId; -use crate::stages::{Lifetime, PhysicalPropertiesError, StorageMedium}; +use crate::stages::{Lifetime, PhysicalPropertiesError}; use crate::summary_type::SketchParams; /// A node's operator, with each child replaced by its node id. @@ -750,7 +750,7 @@ pub(crate) fn physical_asap_dag_at_query_time_with_node_ids( } for node in &mut dag.nodes { if consumers[node.id] > 1 { - node.lifetime = Lifetime::OneEvaluation(StorageMedium::Memory); + node.lifetime = Lifetime::OneEvaluation(crate::stages::StorageMedium::Memory); } } Ok((dag, nodes_by_id)) diff --git a/tools/verify_metricsql_external_consumer.sh b/tools/verify_metricsql_external_consumer.sh index 0fa137494..fb6cb1b07 100644 --- a/tools/verify_metricsql_external_consumer.sh +++ b/tools/verify_metricsql_external_consumer.sh @@ -21,7 +21,6 @@ cat > "$consumer_dir/src/main.rs" <<'EOF' fn main() { asap_frontend_metricsql::lower_metricsql( "sum(rate(requests_total[5m]))", - asap_types::ir::properties::AccuracyTarget::exact(), std::time::Duration::from_secs(15), ) .expect("a downstream stable crate can parse and lower MetricsQL");