Skip to content

Offer maintained-population top-k candidates in Pass 1 #681

Open

Description

@zzylol

Pass 1 does not offer the maintained-population (current-series) top-k candidate (MaintainPopulation / EvaluatePopulation, #573). Only the legacy search proposed it, through MaintainedPopulationStrategy. It is not reachable on main today.

To do: generate it as a per-computation candidate for current-series top-k (and the other population intents), and implement it in physical ASAP-aware optimization. Materialization comes from #604 (G8).

Found in the #676 capability audit.

Activity

  1. zzylol commented on Oct 27, 2026

    @zzylol
    ContributorAuthor

    #961 deletes the unwired MaintainedPopulationStrategy rule and its rule tests. The cases they covered are acceptance tests for reimplementing the rule as a Pass 1 candidate here. The deleted files at ebfad9cd:

    Cases to cover again:

    1. Sharing across readouts. quantile by(job)(0.5,a), quantile by(job)(0.99,a), topk by(job)(1,a) and topk by(job)(5,a) share one population producer, with max_k = 5 and quantiles = true. sum, count and avg, with and without by(job), are current-series candidates that compile.
    2. SQL table rows. Quantiles and scalar readouts over one table share rows without a PromQL lookback. max_k is shared. Populations separate by grouping and filters, projections are preserved, and an invalid value column is rejected.
    3. Recognition limits. These are not instant populations: quantile_over_time(0.5,a[1m]), quantile(0.5,sum by(job)(a)), topk(5,a offset 1m), topk(5,a @ 100), bottomk(5,a). Different sources, groupings or matchers separate populations: topk(5,a) vs topk(10,b), and quantile(0.9,a{job="api"}). without(instance) with a regex matcher keeps without, the grouping and the regex.
    4. Limit/Sort partition check. A global Limit over a per-job Sort, or a per-job Limit over a global Sort, is not the population's top-k.
    5. Selector horizon. The population of sum(a) over a 1-second selector has lookback_ms = 1000 and matches its source; with 300000 it does not.

    #961 keeps the IR coverage (invalid value column, lookback agreement, timing follows materialization, malformed DAGs fail closed) as hand-built tests in crates/types/tests/schema_rebuilding.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions