Skip to content

fix(promql): preserve special quantile parameters for exact execution - #413

Merged
zzylol merged 1 commit into
mainfrom
fix/promql-exact-binding-semantics
Sep 14, 2026
Merged

zzylol merged 1 commit into
mainfrom
fix/promql-exact-binding-semantics

Conversation

@zzylol

@zzylol zzylol commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Why

Valid PromQL quantile parameters must reach execution so the engine can return the Prometheus-defined special values.

What

Accept out-of-range, NaN, and infinite phi in standard quantile functions. Keep the bounded parameter contract of the nonstandard histogram_quantiles extension.

How

Preserve phi during lowering instead of rejecting it; retain a separate bounded validator for the extension.

Before this PR

quantile_over_time(1.1, m[5m]) failed during lowering, preventing an exact backend plan.

After this PR

The canonical tree retains phi=1.1 so an executor can return +Inf. Regression coverage also pins the already-supported distinction between rate/irate and series-count semantics.

Evidence

The new parameter regression accepts -0.1, 1.1, NaN, +Inf, and -Inf across quantile, quantile_over_time, and histogram_quantile. Backend execution coverage: ProjectASAP/ASAPQuery-backend#728. Screenshots and performance measurements: not applicable.

Verification

cargo +1.98.0 test -p asap-frontend-promql --test promql_binding_regressions --test promql_lowering --test promql_conformance --test promql_equivalence passed on this branch.

The parameter regression checks valid queries survive lowering; the other regressions prevent rate/irate or row/distinct-count intent collapse.

Architectural decisions

No new execution interface. Validation distinguishes standard PromQL from the existing extension contract.

Limitations and follow-up

This PR preserves parameters; executors remain responsible for special-value results. The backend companion adds float-sample exact execution and differential smoke coverage. It pins f27b16a747e5d7fcd70a5510075c0cd062f0dcea, the same fix applied on its existing 029ff2f dependency so its current interfaces remain available.

Human review — do not complete with an agent

  • The MVP boundary is correct.
  • New conceptual layers or public interfaces are necessary.
  • The before/after description matches the intended product behavior.
  • Human reviewer:
  • Decision and rationale:

@zzylol
zzylol merged commit b621631 into main Sep 14, 2026
4 checks passed
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