fix(promql): preserve special quantile parameters for exact execution - #413
Merged
Merged
Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_quantilesextension.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_equivalencepassed 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 existing029ff2fdependency so its current interfaces remain available.Human review — do not complete with an agent