Skip to content

test: rank individual and ensemble candidates with synthetic workload costs - #742

Open
milindsrivastava1997 wants to merge 71 commits into
test/promql-exact-function-coveragefrom
732-test-add-prometheus-remote-write-promql-differential-suite
Open

milindsrivastava1997 wants to merge 71 commits into
test/promql-exact-function-coveragefrom
732-test-add-prometheus-remote-write-promql-differential-suite

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Alignment with updated #737

The complete synthetic-ranking test passes. Besides making each admitted candidate win by changing prices, it rejects otherwise matching quotes from another dataset. Costs remain synthetic; this does not establish production-optimal selection.

Verify Backend candidate ranking independently of real cost calibration or execution correctness.

Before this PR: structural tests also selected winners with fixture costs, while #742 mixed in the differential execution harness.

After this PR: Level 2 uses the same ten-query workload and Planner-exposed candidate inventory as #728. Each unique admissible manifest becomes the cheapest candidate in turn. Assertions cover selection reversal, minimum reported cost, exactly one winner, inventory-order stability, and exclusion of missing/infeasible quotes. No Planner logical winner is forced to construct the comparison.

Validation: issue754_level2 passes across all ten queries; strict target Clippy passes. All quotes are explicitly synthetic and establish ranking logic only. The final diff against #728 contains the ranking integration test; the execution harness is preserved in #775.

Current review order: #728 → #742 → #775. Workload + synthetic costs → selected Deployment Plan → data-plane execution is the current milestone. #776/#777/#778/#759 are deferred follow-ups, not prerequisites. Online ERP collection, feedback and runtime replanning are not required.

Query ensemble coverage

The fixtures now include each individual query, the shared-rate ensemble
(temporal-rate, grouped-rate, topk-rate), the shared-quantile ensemble
(temporal-quantile, quantile-ratio), and the full ten-query workload.
Level 2 makes each admitted workload candidate cheapest in turn using complete
synthetic quotes, asserts the exact selected manifest, reverses candidate order,
and rejects missing or infeasible cheapest quotes. The complete ranking test passed
for the ten single-query workloads and all three ensembles.

@milindsrivastava1997 milindsrivastava1997 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated code review: 5 findings, posted inline.

Comment thread promql-compliance/runner/lifecycle.go Outdated
if err := l.runCompose(ctx, environment, "wait", "planner"); err != nil {
return fmt.Errorf("derive workload cost evidence: %w", err)
}
if err := l.runCompose(ctx, environment, "up", "-d", "data-plane"); err != nil {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale backend image (high). prometheus/planner get --build above, but data-plane is brought up without it, so Compose reuses the existing asapquery-backend-promql-compliance-data-plane image. After the first make run-all, subsequent runs on the same machine test the old data_plane binary (e.g. edit data_plane/src/..., rerun, and results still reflect the first build). Suggest adding --build here or building all three services in the first up.

c := caseCard{Dataset: r.Dataset, Suite: r.Suite, Passed: r.Passed, Queries: len(r.Queries)}
for _, q := range r.Queries {
for _, i := range q.Instant {
if i.Responses.Backend.ServedBy != "" {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Prometheus fallback" column is always 0 (medium). query.go sets ServedBy = "prometheus_fallback" when the provenance header is absent, so ServedBy is never empty for backend responses and this check counts fallback answers as ASAPQuery answers. The loop also only looks at q.Instant, skipping range responses. summary.md/summary.json therefore overstate local coverage.

func main() {
dir := flag.String("reports-dir", "/tmp/asapquery-backend-promql-reports", "report directory")
flag.Parse()
files, err := filepath.Glob(filepath.Join(*dir, "*.json"))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picks up stale reports (medium). *.json in REPORT_DIR (a fixed /tmp path by default) also matches the summary.json written by the previous run; it decodes as a runner.Report with empty dataset/suite and the previous overall passed, adding a blank row and possibly pinning the result to false. Likewise, a case that fails before writing its report (build error, health timeout) leaves the previous run's <case>.json counted as current. Suggest excluding summary.json and clearing/scoping REPORT_DIR per run.

Comment thread data_plane/Dockerfile Outdated
# not need credentials for ASAPCollector or Sketchlib while this dependency
# remains private.
RUN mkdir -p ASAPQuery-backend/.cargo && \
printf '%s\n' \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overwrites .cargo/config.toml and patches all builds (medium). (Same block in control_plane/Dockerfile.) > replaces the checked-in config, dropping [net] git-fetch-with-cli = true. And since this applies to every image built from these Dockerfiles, not just the compliance suite, asap-precompute-rs/asap_sketchlib now compile from whatever sibling working trees are passed as build contexts rather than the revisions pinned in Cargo.lock, so production images can pick up uncommitted/unpinned code. Suggest appending (>>) and gating the patch behind a build arg used only by the compliance build.

Comment thread promql-compliance/docker-compose.yml Outdated
asap-precompute-rs: ${ASAP_PRECOMPUTE_RS_CONTEXT}
asap-sketchlib: ${ASAP_SKETCHLIB_CONTEXT}
asap-gorilla-rust: ${ASAP_GORILLA_RUST_CONTEXT}
command: ["--profile", "asapquery", "--planning-snapshot", "/config/planning-snapshot.json", "--prometheus-server", "http://prometheus:9090", "--forward-unsupported-queries", "--http-port", "9091", "--output-dir", "/tmp/asap"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback enabled but always fails the suite (low). --forward-unsupported-queries is on, but report.go:104 fails every response served by Prometheus fallback, so any query routed to the exact/fallback path fails rather than being compared. The design doc also says fallback should be disabled, which would make the validate_profile change in data_plane/src/main.rs pointless as written. Either drop the flag or accept fallback responses for those nodes.

@milindsrivastava1997
milindsrivastava1997 force-pushed the 732-test-add-prometheus-remote-write-promql-differential-suite branch from 1501e44 to 0b40465 Compare September 21, 2026 17:58
@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review September 22, 2026 03:19
@zzylol
zzylol changed the base branch from main to test/promql-exact-function-coverage September 22, 2026 04:30
@zzylol zzylol changed the title test: add runnable PromQL differential compliance suite test: verify issue 754 level-2 data-plane execution Sep 22, 2026
@zzylol
zzylol changed the base branch from test/promql-exact-function-coverage to issue-755 September 22, 2026 20:45
@zzylol
zzylol force-pushed the 732-test-add-prometheus-remote-write-promql-differential-suite branch from 9c84758 to 00195cb Compare September 24, 2026 12:56
@zzylol
zzylol changed the base branch from issue-755 to issue-752 September 24, 2026 12:57
@zzylol zzylol changed the title test: verify issue 754 level-2 data-plane execution test: verify Backend candidate ranking with synthetic workload costs Sep 28, 2026
@zzylol zzylol changed the title test: verify Backend candidate ranking with synthetic workload costs test: rank individual and ensemble candidates with synthetic workload costs Sep 28, 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.

test: add Prometheus Remote Write PromQL differential suite

2 participants