Skip to content

fix(cost): bound PromQL absence cardinality - #329

Closed
zzylol wants to merge 1 commit into
feat/cost-promql-stack-linearfrom
fix/cost-estimator-invariants
Closed

zzylol wants to merge 1 commit into
feat/cost-promql-stack-linearfrom
fix/cost-estimator-invariants

Conversation

@zzylol

@zzylol zzylol commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Why

A PromQL presence/absence operator can emit at most one result per evaluation step. Accepting larger output evidence would under-specify the physical semantics and could distort parent costs.

What

  • Rejects PromqlPresence evidence whose output rows exceed the number of evaluation steps.
  • Adds a focused regression test for this bound.

How

The physical DAG validator compares output cardinality with the already validated recurrence count before estimation.

Before

Contradictory absence/presence output cardinality could pass validation.

After

Such a candidate is unavailable with a semantic-invariant error.

Validation

  • cargo test -p asap-aware-mapping
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

Depends on #328. #330 adds complete-plan comparison and ranking.

@zzylol
zzylol force-pushed the feat/cost-promql-stack-linear branch from c7d79aa to c402f0b Compare September 2, 2026 19:28
@zzylol
zzylol force-pushed the fix/cost-estimator-invariants branch from 44d8dab to e32d209 Compare September 2, 2026 19:28
@zzylol
zzylol force-pushed the feat/cost-promql-stack-linear branch from c402f0b to f6a62ad Compare September 3, 2026 02:54
@zzylol
zzylol force-pushed the fix/cost-estimator-invariants branch from e32d209 to 9d35b6d Compare September 3, 2026 02:54
@zzylol
zzylol marked this pull request as ready for review September 3, 2026 03:17
@zzylol
zzylol force-pushed the feat/cost-promql-stack-linear branch from f6a62ad to 9f48885 Compare September 3, 2026 16:11
@zzylol
zzylol force-pushed the fix/cost-estimator-invariants branch from 9d35b6d to 9d7dfc2 Compare September 3, 2026 16:13
@zzylol
zzylol force-pushed the feat/cost-promql-stack-linear branch from 9f48885 to 72bb94d Compare September 3, 2026 16:29
@zzylol
zzylol force-pushed the fix/cost-estimator-invariants branch from 9d7dfc2 to 3fc1aff Compare September 3, 2026 16:29
@zzylol zzylol changed the title fix(cost): enforce physical DAG invariants in estimator fix(cost): bound PromQL absence cardinality Sep 3, 2026
@zzylol zzylol closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant