Skip to content

Commit df94ff6

Browse files
committed
Ship PromQL group matching evidence
1 parent b00c93a commit df94ff6

5 files changed

Lines changed: 1491 additions & 2 deletions

File tree

docs/PROMQL_FEATURE_MATRIX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ they do not justify a PromQL-aware extension API.
8686
| `PQL-O04` | set operators `and`, `or`, `unless` ([SQL](QUERY_SQL_EQUIVALENTS.md#sql-prom-012-set-membership)) | shipped | yes | `SQL` | `API` | P0 |
8787
| `PQL-O05` | one-to-one vector matching ([SQL](QUERY_SQL_EQUIVALENTS.md#sql-prom-004-vector-arithmetic-with-label-matching)) | shipped | yes | `SQL` | `API` | P0 |
8888
| `PQL-O06` | `on(...)` and `ignoring(...)` ([SQL](QUERY_SQL_EQUIVALENTS.md#sql-prom-013-on-and-ignoring-label-matching)) | shipped | yes | `SQL` | `API` | P0 |
89-
| `PQL-O07` | `group_left` and `group_right` | in progress | yes | `SQL` | `API` | P0 |
89+
| `PQL-O07` | `group_left` and `group_right` ([SQL](QUERY_SQL_EQUIVALENTS.md#sql-prom-014-group_left-and-group_right)) | shipped | yes | `SQL` | `API` | P0 |
9090
| `PQL-O08` | trigonometric binary `atan2` | missing | no | `SQL` | `API` | P1 |
9191
| `PQL-O09` | `sum` with `by`/`without` ([SQL](QUERY_SQL_EQUIVALENTS.md#sql-prom-003-cross-series-sum-by-label)) | missing | yes | `SQL` | `API` | P0 |
9292
| `PQL-O10` | `avg` with `by`/`without` | missing | yes | `SQL` | `API` | P0 |

docs/QUERY_EVIDENCE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,3 +643,42 @@ adds range behavior, cumulative-work rejection, shutdown, and cold reopen.
643643
Section 33 executes both JSON-label SQL joins through public grids. No
644644
extension opcode, private table, storage format, batching, compression,
645645
rollup, retention, transaction, or migration behavior changed.
646+
647+
## Session 4 `PQL-O07` group-matching result
648+
649+
The checked-in
650+
[`2026-08-04_session4_pql_o07.json`](evidence/2026-08-04_session4_pql_o07.json)
651+
was captured from exact extension and server build
652+
`b00c93aa240f3ec1295d2591cef7b8631514b895`. This fixture adds two
653+
32-point service-factor series—one unique side for each of the `api` and
654+
`worker` groups—to the established 512-series workload. The narrow shape uses
655+
one CPU series against both factors with `group_left(team)`; the wide shape
656+
uses the two factors against all CPU series with `group_right(team)`.
657+
658+
| shape | final points | intermediate points/query | response bytes | p50 ms | p95 ms | p99 ms | decoded points/query |
659+
|---|---:|---:|---:|---:|---:|---:|---:|
660+
| exact host, `+ group_left(team)` | 1 | 3 | 150 | 0.626 | 0.986 | 1.181 | 96 |
661+
| 2 one-side × 512 many-side × four points, `- group_right(team)` | 2,048 | 2,056 | 78,618 | 6.749 | 7.217 | 7.497 | 16,448 |
662+
663+
Each request reads each operand exactly once. The wide shape considers 514
664+
candidate chunks, decodes 512 CPU plus two factor series, and charges 2,048
665+
many-side plus eight one-side child points as intermediate work. It is faster
666+
than a 512-by-512 self-join because the one side is genuinely small; no group
667+
operation triggers per-many-series storage reads. The retained result bytes
668+
include the copied `team` label.
669+
670+
The run durably completed all 118,521 main and boundary-fixture points with
671+
zero failed or queued work. The two added persisted series raised logical
672+
payload bytes to 64,361, while total SQLite/WAL/SHM storage remained 672,688
673+
bytes. Whole-process RSS HWM was 35,500 KiB. Intermediate, result, response,
674+
deadline, and cancellation limits cover both child vectors, per-step matching,
675+
label construction, uniqueness checks, and serialization.
676+
677+
Prometheus 3.13.2 API and promtool fixtures pin both group directions,
678+
operation direction, comparison left-value/right-name behavior, included and
679+
absent labels, unique-side cardinality, and post-copy result uniqueness. The
680+
real-extension regression adds range grids, exact ordering, cumulative-work
681+
rejection, shutdown, and cold reopen. Section 33 executes both joins plus a
682+
one-side uniqueness preflight using public grids. No extension opcode, private
683+
table, storage format, batching, compression, rollup, retention, transaction,
684+
or migration behavior changed.

docs/QUERY_TEST_REFERENCES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ real extension when the behavior reaches storage.
3131
| `PQL-O04` | `servers/crates/timeless-metrics-api/tests/storage_contract.rs` | `session_four_promql_set_operators_are_many_to_many_stepwise_and_reopen` | step-local `and`/`or`/`unless`, contributing value/name policy, many-to-many groups, scalar errors, range sparsity, limits, executable SQL, oracle parity, and reopen |
3232
| `PQL-O05` | `servers/crates/timeless-metrics-api/tests/storage_contract.rs` | `session_four_promql_arithmetic_and_one_to_one_match_oracle_and_reopen` | per-step default all-non-name-label matching, unmatched filtering, duplicate cardinality error, range ordering, limits, SQL, oracle parity, and reopen |
3333
| `PQL-O06` | `servers/crates/timeless-metrics-api/tests/storage_contract.rs` | `session_four_promql_on_ignoring_match_labels_names_limits_and_reopen` | `on`/`ignoring`, empty/missing labels, result-label and metric-name policy, set matching, duplicate groups, range grids, limits, SQL, oracle parity, and reopen |
34+
| `PQL-O07` | `servers/crates/timeless-metrics-api/tests/storage_contract.rs` | `session_four_promql_group_matching_direction_labels_limits_and_reopen` | both group directions, included/missing labels, operation/value/name direction, one-side and result uniqueness, ranges, limits, SQL, oracle parity, and reopen |
3435
| `PQL-R01` | `servers/crates/timeless-metrics-api/tests/storage_contract.rs` | `session_four_pins_promql_selector_window_errors_and_reopen` | real extension window, boundaries, HTTP, reopen |
3536
| `LQL-F01` | `servers/crates/timeless-logs-api/tests/api_e2e.rs` | `http_uses_the_established_8192_entry_buffer_without_request_flushes` | real extension query path and bounded row result |
3637
| `LQL-F06` | `servers/crates/timeless-logs-api/tests/api_e2e.rs` | `http_uses_the_established_8192_entry_buffer_without_request_flushes` | exact severity through real rich blocks |

0 commit comments

Comments
 (0)