Commit Graph
5443 Commits
Author SHA1 Message Date
discord9 f91e85d089 feat(common-meta): add raw-series preflight and execution surface to Datanode trait
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-18 13:07:24 +08:00
discord9 83a0d58980 feat(query): capture native raw-series routes and extend MergeScan for typed frames (#9663)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

**Stacked on #9662** (native config). Also requires **#9655** (frame
ordering metadata).

## What's changed and what's your intention?

Add native raw-series route capture and MergeScan typed-frame support:

- `CaptureNativeRawRoute`: captures region routing during planning when
`experimental_native_promql` is enabled.
- `NativeRawSource`: borrows the captured route for native raw-series
execution.
- Schema identity validation for `greptime.series.` metadata.
- Wires `experimental_native_promql` from `QueryEngineState` →
`DfQueryPlanner` → `DistExtensionPlanner`.

**4 files, +1746/-113 lines.**

Note: diff includes cherry-picked commits from #9655. Once it merges,
the diff will shrink.

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches.
2026-10-18 13:07:02 +08:00
discord9 440ecb909b feat(common-query): add raw series request binding and preflight types (#9657)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

No dependencies on other open PRs.

## What's changed and what's your intention?

Add raw series request types for the named raw-series preflight
contract:

- `RawSeriesRequest` / `RawSeriesTag`: versioned binding for a
single-region raw-series request.
- `PreparedNamedRawSeries` + encode/decode: JSON body for the
`PREPARE_RAW_SERIES_ACTION` Flight action.

Strict serde (`deny_unknown_fields`), version 1 only. Includes wire
compatibility fixtures.

**7 files, +661 production + wire fixtures.**

### Verification

- `cargo check --all-targets` ✅, `cargo nextest run -p common-query` ✅,
`cargo clippy -- -D warnings` ✅

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 13:06:55 +08:00
discord9 e0af59f14c feat(promql): materialize complete raw source labels (#9654)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

**Depends on #9650** (labels decoder). Must merge after (or be rebased
onto) #9650.

## What's changed and what's your intention?

Add `promql::source::materialize_raw_labels`: a stream decorator that
converts raw series chunks with primary-key-encoded labels into chunks
with complete explicit labels.

Uses `PrimaryKeyLabelDecoder` (from #9650) to decode dense/sparse
primary keys against the scan-bound region metadata snapshot. Rejects
schemas with eval grids or empty fields, and requires complete (not
projected) label decoding. Output always advertises
`RawLabelSource::Explicit`.

**5 files, +1216/-0 lines (169 production + 1040 tests + 7 config).**
The merge module is intentionally excluded.

### Verification

- Compiled and tested with #9650 cherry-picked: `cargo check
--all-targets` ✅, `cargo nextest run -p promql` ✅, `cargo clippy -- -D
warnings` ✅
- Cannot compile standalone until #9650 merges.

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 13:06:46 +08:00
Dennis Zhuang bd9f7dc40b docs(promql): say what draining the histograms after an early stop is for
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 12:08:07 +08:00
Dennis Zhuang 328218776d fix(promql): follow up the post-merge review of native histogram operators
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 12:01:31 +08:00
discord9 53ef80a516 feat(query): capture native raw-series routes and extend MergeScan for typed frames
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-18 11:38:02 +08:00
discord9 3ef71b5702 feat(common-query): add raw series request binding and preflight types
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-18 11:33:20 +08:00
discord9 7c6595d9f7 feat(promql): materialize complete raw source labels
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-18 11:33:13 +08:00
discord9 f8054ab297 feat(promql): select instant samples from shared typed fields (#9649)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Builds on the shared series types already present on `narthex` (#9598,
#9599). This PR targets `narthex`, not `main`, and has no dependency on
another open PR.

## What's changed and what's your intention?

Extract instant sample selection into `select_instants`, operating on
the existing `RawTimestamps` and `SeriesFields`. It returns source row
indices and evaluation timestamps without converting the payload into a
new representation.

Use it in the existing `InstantManipulate` path when timestamps are
non-null, strictly increasing milliseconds and the configured fields are
Float64. Other inputs retain the existing path, including duplicate
timestamps and Histogram columns. Selection preserves lookback
boundaries, offsets, stale markers, ordinary NaNs, null samples, and the
existing output-point limit.

This is one extracted slice of previously local work: **5 files, +732/-3
lines, including tests**. It does not add native planning,
scanner/Flight integration, configuration, storage formats, or any new
Histogram type.

### Verification

- Passed: scoped Rust formatting, `hawkeye format`, `hawkeye check`,
`git diff --check`, and normal commit hooks.
- Running on this exact extracted branch; results not yet claimed:
`cargo check --locked -p promql --all-targets` and `cargo nextest run
--locked -p promql --retries 0`.
- Independent source review is in progress. Kept as a draft until
verification and review are complete.
- Full-workspace tests, full-workspace Clippy, and SQLness have not been
run for this extracted branch.

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 09:59:01 +08:00
discord9 88a1e684a0 feat(common-recordbatch): recognize SeriesScanExec in metrics and preserve typed errors (#9656)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Independent PR. No dependencies.

## What's changed and what's your intention?

Recognize `SeriesScanExec` in query metrics and preserve typed errors
through the record batch adapter:

- `PlanMetrics`: recognizes `SeriesScanExec` nodes so region-scoped
stats attribution works.
- `RecordBatchStreamAdapter`: preserves the original typed error via
`BoxedError` instead of wrapping into a generic execution error. This
lets downstream recover the specific status code (e.g.,
`InvalidArguments` instead of `EngineExecuteQuery`).

**2 files, +203/-9 production + 1 sqlness expected result.**

### Error code change

The typed error preservation changes the error code for the
`semantic_graph` upper-bound-only query from `3001(EngineExecuteQuery)`
to `1004(InvalidArguments)`. The error message text is unchanged. The
new code is correct: the original error was an argument validation
error, not a generic execution failure. The sqlness expected result has
been updated.

### Verification

- `cargo check --all-targets` ✅, `cargo nextest run -p
common-recordbatch` → **65/65 passed** ✅
- sqlness expected result updated for the typed error code change

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches.
2026-10-18 09:55:54 +08:00
discord9 5d93b8177c feat(common-query): adapt ordered record batches to raw series (#9652)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

No dependencies on other open PRs. Builds on shared series types from
#9598/#9599.

## What's changed and what's your intention?

Add `record_batches_to_raw_series` in `common-query`: converts an
ordinary DataFusion `RecordBatch` stream into contiguous raw series
chunks.

The adapter validates column types at construction (time must be
Timestamp(Millisecond, None), tags must be string/dictionary, fields
must be Float64 or native histogram), encodes series identity via Arrow
RowConverter, and produces `RawSeriesChunk`s with explicit labels and
contiguous ordering. Float64 fields share source buffers (zero-copy);
histograms reuse the existing `histogram_samples_from_arrow` bridge.

Chunking merges equal-key runs within and across batches; a key change
or end-of-input sets `is_last`. Timestamps must be strictly increasing
within a series. Empty batches are skipped with a bounded poll loop.

**3 files, +1666/-0 lines, including 20 tests.** No production callers
yet — consumed by follow-up scan wiring PRs.

### Verification

- `cargo check --locked -p common-query --all-targets` ✅
- `cargo nextest run --locked -p common-query --retries 0` ✅
- `cargo clippy --locked -p common-query --all-targets -- -D warnings` ✅

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 09:55:47 +08:00
discord9 fb9bda2744 feat(store-api): add raw-series scanner preflight and ordering contract (#9651)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

No dependencies on other open PRs.

## What's changed and what's your intention?

Add two default methods to `RegionScanner` for raw-series scan
preflight:

- `raw_series_schema()` — non-consuming check whether this scanner can
provide raw series for a given label source. Returns `None`
(unsupported) by default; overrides promise `scan_series_partition` can
execute.
- `raw_series_ordering()` — returns the ordering guarantee without
consuming scanner state. Defaults to `Contiguous` (conservative for
legacy sources).

Both are additive-only trait defaults with no behavior change for
existing implementors. **32 insertions, 0 deletions, 1 file.**

### Verification

- `cargo check --locked -p store-api --all-targets` ✅
- `cargo nextest run --locked -p store-api --retries 0` ✅
- `cargo clippy --locked -p store-api --all-targets -- -D warnings` ✅

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 09:55:41 +08:00
discord9 e25fa2bd8d Merge remote-tracking branch 'upstream/narthex' into feat/narthex-instant-eval-pr
# Conflicts:
#	src/promql/src/lib.rs
2026-10-18 09:55:27 +08:00
discord9 869a32fdcb feat(query): add experimental_native_promql config option (#9662)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Independent PR. No dependencies.

## What's changed and what's your intention?

Add the `experimental_native_promql` configuration option (default:
`false`):

- `QueryOptions.experimental_native_promql`: new boolean field, default
`false`.
- Four example TOML configs updated with the commented-out option.
- `config/config.md` regenerated with the new option.

The option is stored in process configuration only. Session-level
override and the actual gate in query planning are in follow-up PRs.

**6 files, +24/-0 lines.**

### Verification

- Compiles standalone: no unused fields or methods.

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [x] This PR requires documentation updates. (config.md regenerated)
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches.
2026-10-18 09:54:51 +08:00
discord9 b27ca7c7bd feat(common-query): declare raw series frame ordering in schema metadata (#9655)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

No dependencies on other open PRs.

## What's changed and what's your intention?

Add ordering metadata to raw series frame schemas:

- `raw_series_frame_schema_with_ordering()`: builds the canonical v1
frame schema and stamps the producer's ordering (`contiguous` or
`read_key_then_time`) into Arrow schema metadata. Rejects `Interleaved`
(no v1 wire representation).
- `raw_series_frame_ordering()`: reads the declaration back, defaulting
absent metadata to `Contiguous` (legacy frames), rejecting unknown
values.
- `pack_raw_series` now declares ordering on every yielded batch via
`RecordBatch::with_schema`.

Includes a wire compatibility fixture
(`tests/compatibility/wire/raw_series_ordering/`) with 4 cases.

**4 files, +277/-7 lines.**

### Verification

- `cargo check --all-targets` ✅, `cargo nextest run -p common-query` ✅,
`cargo clippy -- -D warnings` ✅

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 09:54:12 +08:00
discord9 2d9b2a970f feat(mito-codec): decode scan-bound primary key labels (#9650)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Builds on `narthex` base types (#9598, #9599, #9602, #9603). No
dependency on other open PRs.

## What's changed and what's your intention?

Add `PrimaryKeyLabelDecoder` to `mito-codec`: given a scan-bound
`RegionMetadata` snapshot and a primary key byte sequence, decode the
complete metric name and label set (or a projected subset).

Supports both dense and sparse primary key encodings. Sparse keys get a
new `visit_label_ids` method that validates the full tail (rejecting
duplicates, reserved IDs, and truncated framing) before reading values.
Dense keys check that all fields are present and decode each value with
exact type fidelity.

This is one extracted slice of previously local work: **4 files,
+1046/-13 lines, including tests**. It has no production call site yet —
it will be consumed by the raw series scan wiring in follow-up PRs.

### Verification

- `cargo check --locked -p mito-codec --all-targets` ✅
- `cargo nextest run --locked -p mito-codec --retries 0` → **62/62
passed** ✅
- `cargo clippy --locked -p mito-codec --all-targets -- -D warnings` ✅
- `hawkeye format`, `hawkeye check`, `git diff --check` ✅
- Full-workspace tests and SQLness not run for this extracted branch.

## PR Checklist

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 09:54:01 +08:00
Dennis Zhuang 8b85a3c58f feat(promql): match vectors holding native histograms
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 08:33:18 +08:00
Dennis Zhuang 17f30f594a feat(promql): evaluate range functions over native histogram samples
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 08:19:49 +08:00
Dennis Zhuang 41cfd237f6 test(promql): pin absent_over_time as absent over present_over_time
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 07:56:32 +08:00
Dennis Zhuang 1147fafa5d fix(promql): sort quantile_over_time windows with Go's sort
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 07:53:35 +08:00
Dennis Zhuang 438c44c109 chore: merge fix/narthex-super-imports into chore/narthex-ablation
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 01:40:23 +08:00
Dennis Zhuang 4761d39690 refactor(promql): drop a redundant field reset and a duplicate range window test
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 01:37:40 +08:00
Dennis Zhuang 72b06dc730 fix(promql): drop retained samples when an anchored window is skipped
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 01:24:00 +08:00
Dennis Zhuang 47f89b34b7 chore(promql): import parent items through crate paths
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 01:23:02 +08:00
Dennis Zhuang a19e8cbd46 chore(promql): fix stale docs and drop a dead branch in Narthex operators
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 01:22:59 +08:00
Dennis Zhuang b37f47022b refactor(promql): share metadata labels, error mapping and Kahan increments across Narthex operators
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 01:22:08 +08:00
Dennis Zhuang db0a531d7d chore: merge narthex into feat/narthex-histogram-arith 2026-10-18 01:03:36 +08:00
Dennis Zhuang 041a48d456 chore: merge narthex into feat/narthex-classic-histogram 2026-10-18 01:01:15 +08:00
Dennis Zhuang 6485e9c810 chore: merge narthex into feat/narthex-map-label-time 2026-10-18 00:58:38 +08:00
Dennis Zhuang 6b94b067fd chore: merge narthex into feat/narthex-select
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:57:50 +08:00
dennis zhuang 819c0d0065 feat(promql): match evaluated vectors for binary and set operators (#9679)
I hereby agree to the terms of the [GreptimeDB
CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)

Targets `narthex`. Stacked on #9673 for `GridSeriesBuilder` and the test
reference; review only the two `vector_match` commits.

## What's changed and what's your intention?

### Problem

The native path has no vector–vector operations: arithmetic,
comparisons, `group_left`/`group_right` and `and`/`or`/`unless` between
two sets of evaluated series.

### Change

`vector_match::binary_vectors` and `vector_match::set_vectors` take both
operands as evaluated series on one grid and return trimmed grid series.
Semantics follow Prometheus `VectorBinop`, `resultMetric`,
`signatureFunc`, `VectorAnd`, `VectorOr` and `VectorUnless` at every
grid point:

- Match groups: `on(...)` keeps the listed labels (`__name__` when
listed); `ignoring(...)` and the default keep every other label except
`__name__`. Empty label values count as absent.
- Cardinality is checked per point, never over a series' whole lifetime:
- The "one" side (right, or left with `group_right`) may hold one series
per match group at a point where both operands are non-empty.
- One-to-one matching may match a group once per point, filtered
comparisons included.
  - `group_x` results must have unique label sets per point.
  
Series of one group that are present at disjoint points never conflict.
- Result labels: arithmetic and `bool` comparisons drop `__name__`,
`__type__` and `__unit__`; one-to-one keeps the `on` labels or drops the
`ignoring` ones; `group_x` labels are copied from the "one" side, and
removed when it has no value for them.
- Values: comparisons without `bool` keep the left value where they
hold; `bool` returns 1 or 0. `^` and `atan2` use the standard library.
- Errors: the error of the earliest failing grid point is returned. At
one point a one-side duplicate is reported before a one-to-one or
`group_x` violation, as Prometheus checks the one side before matching.
- Fields are paired by position; the output carries the shorter side's
field count, named after the left side. Each field is matched on its
own, as if the operands held only that field, and the per-field results
are joined by label set. Set operators require equal field counts and
return `NotImplemented` otherwise.
- `or` requires the same field count on both sides and rejects others
with `NotImplemented`. Histogram samples are rejected with
`NotImplemented`.

Series are processed whole over their own grid ranges: the "one" side is
indexed by match group, and per-point checks run only over the points a
series covers.

Review focus:

- `binary_vectors`: the one-side duplicate check is limited to points
where both operands are non-empty, as Prometheus short-circuits empty
steps before checking.
- `binary_vectors`: the one-to-one check counts a match even when the
comparison filters it out.
- `Results::sort_rows`: duplicate rows of one result label set at a
point are the `group_x` uniqueness error; the earliest point across all
label sets is returned.
- `binary_vectors` error selection: earliest point wins; ties go to the
one-side duplicate.
- Results of different match groups that share a label set once
`__type__` is dropped fail as duplicate label sets after the operator,
as Prometheus does; two results within one group fail the `group_x`
uniqueness check.

### Non-goals

- Scalar operands (MAP-ARITH), `fill` modifiers, histogram operands
(MATCH-HIST), planner wiring.

### Constraints

Results agree with Prometheus within promql-compat's relative tolerance
(1e-10), not bit for bit.

The ordinary planner deviates from Prometheus in ways this kernel does
not reproduce:

- An operand whose plan has no tag columns is joined on time only and
broadcast to every series of the other side (`only_join_time_index`).
Prometheus matches it by label signature, so `sum(m) / m` returns
nothing in Prometheus.
- Labels with an empty value and absent labels join as different values
(`NullEquality::NullEqualsNull` over nullable tag columns). Prometheus
treats them as equal.

### Verification

- `cargo nextest run -p promql`: 317 passed.
- `cargo clippy -p promql --all-targets --all-features -- -D warnings`,
`cargo fmt --check`, `hawkeye check`: clean.
- `binary_vectors_match_prometheus_reference`: 3,000 random cases
against a per-point transcription of Prometheus
`VectorBinop`/`resultMetric`/`signatureFunc` that keeps labels in a map
with `__name__` as an ordinary label. The cases cover all 13 operators,
`bool`, random `on`/`ignoring` subsets including `__name__`, all three
cardinalities with random `group_x` labels, 1–2 fields per side, and
series with holes and disjoint lifetimes. Over 1,000 cases succeed and
over 100 hit a cardinality error; results compare label sets, absolute
grid ranges and value bits, and errors compare their class.
- `set_vectors_match_prometheus_reference`: 3,000 random cases for
`and`/`or`/`unless`.
- `vector_operations_match_prometheus`: 180 fixtures (120 binary, 60
set) produced by the Prometheus v3.15.0 engine
(`vector_match/prometheus_cases.txt`); results compare label sets and
grid points exactly and values within the tolerance, errors compare
their class.
- `pow_and_atan2_match_go`: 452 Go `math.Pow`/`math.Atan2` results
(`vector_match/go_math_cases.txt`) agree with the standard library
within the tolerance.
- `reports_the_earliest_failing_point`: a `group_left` violation at the
first point wins over a one-side duplicate at the second.
- Mutation check: dropping `__name__` for comparisons, ignoring the
`ignoring` list, checking one-side duplicates at points where an operand
is empty, removing the one-to-one match check, keeping a `group_x` label
the one side lacks, not filtering comparisons, keeping matched rows in
`or`, swapping `and`/`unless`, keeping all labels under `on`, accepting
duplicate result rows, and taking the wrong "many" side for
`group_right` each fail a test. So do replacing the Go ports with
`powf`/`atan2`, misplacing the fractional-exponent split in `pow`,
returning the first one-side or one-to-one violation found instead of
the earliest, always or never preferring the one-side duplicate on ties,
returning the first duplicate label set instead of the earliest, and
skipping the row sort.
- `colliding_results_fail_by_where_they_collide`: a collision across
match groups reports duplicate label sets, one within a group the
grouping error; the random reference now includes `__type__`.

## PR Checklist
Please convert it to a draft if some of the following conditions are not
met.

- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
- [ ] This PR requires documentation updates.
- [x] API changes are backward compatible.
- [x] Schema or data changes are backward compatible.
- [ ] This PR needs to be backported to release branches, and I have
added the `backport-<target>` labels (e.g. `backport-v1.3` targets
`release/v1.3`).
2026-10-18 00:56:03 +08:00
Dennis Zhuang 2b01ac6aad fix(promql): propagate histogram aggregation errors other than mixed schemas
Also drop the unobservable 0.0 + count arm in iterate.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:45:14 +08:00
Dennis Zhuang ee1ba3923c fix(promql): take native histogram bounds from Go's table
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:43:38 +08:00
Dennis Zhuang 1fb52ec4c2 chore: merge feat/narthex-classic-histogram into feat/narthex-histogram-arith
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:41:30 +08:00
Dennis Zhuang e57cd63014 fix(promql): sort classic buckets per point like Go and parse le like strconv
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:40:17 +08:00
Dennis Zhuang 781ccda356 fix(promql): order instant sorts with Go's sort algorithm
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:38:35 +08:00
Dennis Zhuang d6635400d4 chore: merge feat/narthex-map-label-time into feat/narthex-classic-histogram 2026-10-18 00:37:45 +08:00
Dennis Zhuang 857d8e0b6d docs(promql): list the regex dialect differences of label_replace
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:37:15 +08:00
Dennis Zhuang 1940a42449 chore: merge feat/narthex-window-eval into feat/narthex-map-label-time 2026-10-18 00:36:49 +08:00
Dennis Zhuang 96a7a2108f fix(promql): match each field of a vector on its own
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:36:27 +08:00
Dennis Zhuang 7b47b63e5c chore: merge feat/narthex-window-eval into feat/narthex-vector-match 2026-10-18 00:31:32 +08:00
Dennis Zhuang a4dda7262e chore: merge feat/narthex-window-eval into feat/narthex-select 2026-10-18 00:25:48 +08:00
Dennis Zhuang 581facd631 test(promql): pin name dropping for mad_over_time and ts_of_*
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:25:39 +08:00
Dennis Zhuang 26ee7145a9 chore: merge feat/narthex-window-eval-at into feat/narthex-new-eval 2026-10-18 00:24:52 +08:00
Dennis Zhuang d6f004aebb fix(promql): reject subquery grids longer than u64 and pin anchored predict_linear
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:24:26 +08:00
Dennis Zhuang 42662804eb chore: merge feat/narthex-window-eval-rate into feat/narthex-window-eval-at
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:24:05 +08:00
Dennis Zhuang a98c21e880 fix(promql): check smoothing factors at the first non-empty window
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:20:41 +08:00
Dennis Zhuang b300f02ebf chore: merge feat/narthex-window-eval into feat/narthex-window-eval-rate
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:20:03 +08:00
Dennis Zhuang f0086a354c fix(promql): keep no samples once the last window is evaluated
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2026-10-18 00:18:42 +08:00