Skip to content

feat(planner): model assignments as SLA-aware items - #776

Merged
milindsrivastava1997 merged 1 commit into
mainfrom
755-optimizer-assignment-unit-=-aqe-repeat-interval-accuracy_sla-latency_sla
Oct 4, 2026
Merged

milindsrivastava1997 merged 1 commit into
mainfrom
755-optimizer-assignment-unit-=-aqe-repeat-interval-accuracy_sla-latency_sla

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Summary

  • Model optimizer demand as items keyed by query requirements, repeat interval, accuracy SLA, and latency SLA.
  • Generate candidates with per-item window compatibility: lookback modulo window, repeat interval modulo slide, and window modulo slide must all be zero.
  • Reject invalid or unsupported optimizer inputs and aggregate unservable-item errors.
  • Remove generated EXACT fallback behavior from the greedy optimizer path.

Closes #755
Closes #758

Follow-up

This includes #759 runtime behavior, but does not close #759 yet: CandidateConfig still has an optional representation and dead EXACT-only branches need cleanup.

Verification

  • cargo test -p asap_planner

@milindsrivastava1997

Copy link
Copy Markdown
Contributor Author

One query string can now be served by two sketches

OptimizerItemKey (aqe_extractor.rs) now includes t_repeat_ms, accuracy_sla_bits and latency_sla_bits. If the same leaf query shows up in two query groups that differ in cadence or SLA, it now becomes two optimizer items, and both carry the same string in query_strings.

build_inference_config (translator.rs) writes one QueryConfig for every query string of every assignment. That gives two QueryConfig entries with the same query string. When the items get different deployed configs, which greedy always does, the two entries point at different aggregation_ids.

The query engine looks up configs by query string and takes the first match (simple_engine/mod.rs:576, promql.rs:238). So:

  • Only one of the sketches is ever queried. The other is still ingested and stored.
  • An occurrence with a strict SLA may be answered by the sketch sized for the relaxed one, or one with a different cadence.
  • Which one wins follows the order of solution.assignments, which isn't stable from run to run.

The test different_slas_become_distinct_items builds exactly this case.

The broader engine-side problem is tracked in #778.

@milindsrivastava1997
milindsrivastava1997 merged commit 0e42b15 into main Oct 4, 2026
8 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the 755-optimizer-assignment-unit-=-aqe-repeat-interval-accuracy_sla-latency_sla branch October 4, 2026 21:33
milindsrivastava1997 added a commit that referenced this pull request Oct 4, 2026
Resolutions:
- Optimizer items (#776) replace AQEs throughout; label-set facts,
  group counts, and the paired key aggregation carry over onto items.
- EXACT is removed: greedy reports unservable items and the facts
  pipeline returns OptimizerPipelineError (LabelSetFacts | Optimizer).
- dataset.rs stays deleted (replaced by label_set_facts.rs).
- Example workload drops its top-k query, which is unservable without
  atomic costs now that EXACT is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant