Repository navigation
rqe-optimizer: split SumOrCount and TopK; deny unknown AtomicCostEntry fields - #163
Merged
milindsrivastava1997 merged 3 commits intoOct 7, 2026
Conversation
…icCostEntry fields Sum and count shared one capability, so the MILP could serve both items of ASAPQuery's avg rewrite from one exact-sum accumulator, undercounting ingest and memory ~2x. They are now separate capabilities on the same family. AtomicCostEntry and MeasuredAt now reject unknown fields, so a misspelled or newer field fails to load instead of dropping its data. Closes #161 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Value-weighted and count-weighted top-k queries at the same cadence became identical Raqes, so the MILP could serve both from one CMS-heap that ASAPQuery deploys as two (different count_events). Separate capabilities on the same families keep them apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The distribution parameter structs nested in MeasuredAt now deny unknown fields too, so a typo like `skewnes` fails instead of being dropped. All checked-in distribution blocks still parse; the schema snapshot is regenerated. The sharing test now solves the MILP from a cost row: two identical queries must share one deployment (sharing halves ingest), and paired capabilities must not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milindsrivastava1997
deleted the
161-rqe-optimizer-split-sumorcount-into-sum-and-count-deny-unknown-atomiccostentry-fields
branch
October 7, 2026 02:36
This was referenced Oct 7, 2026
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.
Closes #161 (§1–§3).
Changes
rqe-optimizer:Capability::SumOrCount→SumandCount, both with familyexact-sum. Since aDeploymentis keyed by capability, a sum and a count query (ASAPQuery'savgrewrite) can no longer share one accumulator.rqe-optimizer:Capability::TopK→TopKByValue(topk(k, sum_over_time(...))) andTopKByCount(topk(k, count_over_time(...))), both with the same three top-k families. ASAPQuery deploys them with differentcount_events, so they must not share a deployment.aqpbm-core:#[serde(deny_unknown_fields)]onAtomicCostEntryandMeasuredAt.aqpbm-datagen: the same onZipfParameter,UniformParameter,NormalParameter,ParetoParameter(nested inMeasuredAtviaDataDistribution).merged_record.schema.jsonregenerated (additionalProperties: falseon each).Tests
plan_never_serves_paired_capabilities_from_one_deployment: builds candidates from one cost row and solves the MILP. Control: two identical queries share one deployment (sharing halves ingest, so the MILP shares whenever it may). Then (Sum,Count) and (TopKByValue,TopKByCount) must each use two. Verified it fails when the capability check inis_eligibleis removed.a_row_with_an_unknown_field_is_rejected(merge_acuracy),measured_at_with_an_unknown_field_is_rejected(value_rnage),a_distribution_with_an_unknown_field_is_rejected(skewnes).Design decisions (please approve)
SumandCountboth keepexact-sumas their only family; they just never share a deployment.RateOrIncreasestays merged: rate is increase / window, so oneexact-increaseaccumulator serves both correctly, and splitting would double cost when both are queried.Capability::SumOrCount(registry row,sum-or-countcomparator, export script) is unchanged: it labels a measurement, not deployment sharing, and oneexact-summeasurement prices both.deny_unknown_fieldsalso goes on the nestedMeasuredAt, since serde's attribute doesn't propagate and a misspelledvalue_rangewould otherwise load asNone.deny_unknown_fields, closing the last nested gap. They are datagen config types too, so datagen YAML gets stricter; all 33 checked-in distribution blocks still parse. (Internally tagged: serde stripskindbefore the inner struct sees it.)count_eventsfield onRaqe: eligibility and pruning already compare capability, whereas a field would also have to go onDeploymentand into every comparison.TopKByValue/TopKByCount(the issue's suggestion); both keep the current top-k families and the same output-size estimate.is_eligible's capability comparison.🤖 Generated with Claude Code