Skip to content

PromQL parser-fork gaps (umbrella) — 72% of corpus rejections, all in promql-parser #108

Open

Description

@zzylol

Umbrella — PromQL parser-fork gaps (tracking)

233 of the ~322 PromQL corpus rejections (72%) are L1 parse failures in the private promql-parser fork (ProjectASAP/promql-parser, branch asap), before the lowerer ever runs. This repo consumes the parser via a git pin; the fixes land in the fork, and the only change here is bumping that pin once each lands.

Correction (2026-07-10): none of these are "mirror upstream"

An earlier read of this issue assumed some gaps (smoothed/anchored/start/end) were just a rebase onto GreptimeTeam upstream away. That was checked against the actual grammar and it does not hold — GreptimeTeam upstream lags Prometheus (Go) on every one of these:

  • smoothed / anchored are stub tokens even upstream — src/parser/promql.y:124 marks them %expect-unused (declared, no production consumes them) on both the fork and GreptimeTeam main.
  • trim operators, duration expressions, and callable start()/end() have no token / AST anywhere upstream.

The fork's asap commit (c51beaf) added the experimental functions (info, histogram_quantiles, min_of/max_of/step/range, the *_over_time reducers) but explicitly deferred the grammar/lexer features. So all five gaps are net-new parser work on the asap branch; there is nothing to mirror.

Split (all in ProjectASAP/promql-parser)

gap corpus kind issue
smoothed / anchored 61 grammar production for existing stub tokens (lexer done) ProjectASAP/promql-parser#1
trim </ >/ 110 from-scratch operator port (lexer + grammar + AST) ProjectASAP/promql-parser#2
duration-arithmetic exprs 51 DurationExpr AST + lexer + grammar ProjectASAP/promql-parser#3
start() / end() callable 6 reserved-keyword lexer/grammar work ProjectASAP/promql-parser#4
info() 2nd-arg matcher 5 validation bug fix ProjectASAP/promql-parser#5

Ordered easiest-first: #5 (bug fix) → #1 (token exists) → #4 → #3 → #2 (biggest).

The remaining ~89 non-parser rejections are lowering gaps (tracked elsewhere) and deliberate rejections (out-of-range φ, __name__ regex per #67).

Activity

  1. added
    enhancementNew feature or request
    promqlPromQL front-end lowering (L1→L2)
    on Jul 9, 2026
  2. changed the title [-]PromQL: five parser-fork gaps account for 60% of corpus rejections (trim ops, smoothed/anchored, duration exprs, start()/end(), info() matcher)[/-] [+]PromQL parser-fork gaps (umbrella) — 72% of corpus rejections, all in promql-parser[/+] on Jul 10, 2026
  3. added
    parserExternal or internal query parser behavior
    testingCorpus, regression, differential, or benchmark tests
    on Aug 26, 2026
  4. zzylol commented on Aug 26, 2026

    @zzylol
    ContributorAuthor

    Related open work

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

    enhancementNew feature or requestparserExternal or internal query parser behaviorpromqlPromQL front-end lowering (L1→L2)testingCorpus, regression, differential, or benchmark tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions