Repository navigation
Conversation
…overs) (fails)
Expectations and fixtures for reading the plans ASAPPlanner 3ef265d writes;
the translators still read only wire 15, so these fail until the next
commit.
- Fixtures replanned at 3ef265d by the new scripts/regenerate-plan-fixtures.sh
(asap_planner --plan-file; the named list lives in the script). New:
sum_over_time_1h_cover (a 60 s chain, a 300 s level, a time-range cover),
sum_rate_1h_counter_cover, rate_and_increase_5m_stored (one Counter chain,
two finalizes), and the eight showcase-1h shapes with all four capability
files. Shapes the planner no longer picks are kept with test capability
files (tests/fixtures/capabilities): one engine file plus one exclusion.
- Capability files: {"exact": "Counter"} for the old Rate and Increase
(#1439); both VictoriaMetrics files exclude TimeRangeCover.
- plan_file: wire 16, counter_readout, SummaryMergeWindows, TimeRangeCover.
- ClickHouse: the cover golden and its hand-computed answers, cover answers
equal to reading the narrowest level (Sum, Max, Count, Counter rate),
rate and increase of one chain, readout and cover refusals.
- VictoriaMetrics: readout picks rate or increase; a cover is refused;
snapshot of the public translations updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ClickHouse time-range covers
ASAPPlanner 3ef265d (main fae63521 and later) writes plan wire version 16
and plans with one Counter state for rate and increase (#1439) and with
multi-level window chains read by time-range covers (#1440).
- plan_file reads wire 16 only: FinalizeExactAccumulator.counter_readout,
SummaryMergeWindows {child, width_ms}, TimeRangeCover {levels, range_ms,
offset_ms}.
- Both translators: ExactKind::Counter replaces Rate and Increase; a
finalize's readout picks rate or increase. A counter finalize without a
readout, a readout on another state, and a counter state read without a
finalize are refused.
- ClickHouse: each SummaryMergeWindows level is its own AggregatingMergeTree
table and view over its wider windows, built from the source rows. A
cover reads from each level the windows the planner's cover_windows
takes: (ceil((t - R)/w)*w, floor(t/w)*w] less the wider level's span, as
one UNION ALL; a counter cover joins the levels' rows as time-ordered
segments like one chain. A cover under an offset is refused.
- VictoriaMetrics: a cover's windows depend on the evaluation time, which
one instant MetricsQL expression cannot select, so it is refused (both
capability files exclude it). A plan reading counters still gets the
previous-arm gap (the Counter family).
- Capability README rows follow (Counter, the cover row, sketchlib names).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… variants - --executor-check is gone from asap_planner (it compiles every plan on its executor itself), so the variant table drops its check column. - The two VictoriaMetrics capability variants are planned too, and ONLY_VARIANTS picks a subset. - Each planner log ends with the planner's wall time and peak RSS: planning is a one-time offline cost, reported apart from the data plane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, AQPBM_RUN_DIR) A preflight for a benchmark-external run planned with scripts/plan-suite.sh: the ClickHouse and VictoriaMetrics capability variants translate with their engine's translator and asap.exact with ClickHouse's; equivalent-only plans carry no substitution; no-plan files are listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stitutions_allowed The harness refuses a cell whose engine substituted in a variant that allows none (asap.exact as well as the equivalent-only files), so the preflight reads variant.json instead of the variant name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
unknown variant Rate). It also plans with oneCounterstate for rate and increase (#1439), and reads long ranges with multi-level window chains (#1440). The ClickHouse and VictoriaMetrics translators here read only wire 15, so no plan of the current planner runs on either engine.counter_readout,SummaryMergeWindows,TimeRangeCover). Both translators read a counter's readout. ClickHouse translates a time-range cover: one table and view per chain level, read over the windows the planner'scover_windowspicks. Capability files use{"exact": "Counter"}, and the VictoriaMetrics files exclude covers. Fixtures are replanned at 3ef265d, andplan-suite.shruns on the new planner.max_over_time(latency[1h])every 60 s withclickhouse.equivalent-only: before, the plan file was refused (plan file wire version Some(16); this reader supports 15). After, it runs as 60 s / 300 s / 900 s tables. A cover read at t = 3,660 s takes 3 windows of 900 s, 2 of 300 s and 5 of 60 s (10 rows per series) instead of 60. The answers equal the single-level read, checked at 8 evaluation times.Review guide
main(e4a9111). Not stacked.system-bench/src/engines_external/clickhouse.rs:Translator::finalized,stored_read,stored_chain,cover_window_condition,counter_readout. Thenplan_file.rs, and the counter path invictoriametrics.rs.cover_window_condition(the SQL form ofcover_windows), and the counter cover, which joins segments across level tables.system-bench/tests/fixtures/plans/(written byscripts/regenerate-plan-fixtures.shat 3ef265d), the regenerated VictoriaMetrics snapshottests/golden/victoriametrics/public_plans.txt, and test node-index updates.plan-suite.sh, then two preflight-test commits.Behavior: before → after
The user writes a suite workload, plans it with the current planner, and runs ClickHouse on the plans. This is the eval campaign's showcase-1h suite:
plan-suite.shasap_planner: unknown argument --executor-checkfor every variant, and with the flag removed,unknown variant Ratefor every capability filesum_rateand nojoint: the file rules out every counter function, as beforemax1hv1(60 s),v2(300 s),v3(900 s), each with a view from the source, and one query over their cover windowssum_rate1h, with substitutesCounterchain and a 300 s level, read as one segment-joined rate (thedeltaSumTimestampsubstitution as before)max1hThis serves the eval campaign, which runs every planner consumer on the latest planner.
Interfaces
system-bench/src/engines_external/plan_file.rsCapability files (
system-bench/capabilities/), read by ASAPPlanner 3ef265d:Scripts (
scripts/plan-suite.sh,scripts/regenerate-plan-fixtures.sh):Removed:
--executor-check, because asap_planner no longer has the flag. TheRate/Increasenames were removed because the planner refuses them.Usage (checked at this head on a ClickHouse 26.8.39.19 server; the run is the reduced smoke under Verification):
Algorithm changes
ClickHouse: reading a time-range cover
TimeRangeCover { levels: [900 s, 300 s, 60 s] }, and the old translator had no rule for it.TimeRangeover one chain:window_end_ms ∈ (t − R, t]of one table.stored_read,cover_window_condition):StoredChain: the base chain, or aSummaryMergeWindowslevel, which takes the base chain's state, labels and source with its own width and retention. Each level gets its own tablev<node>and a view from the source over its width. Merging the narrower windows gives the same state.(lo_i, hi_i], wherelo_i = ⌈(t−R)/w_i⌉·w_iandhi_i = ⌊t/w_i⌋·w_i(positiveModulo), minus the wider level's(lo_{i−1}, hi_{i−1}]. The narrowest level's bounds are the range itself, and itsthrowIfchecks that t is on its grid.UNION ALLof the levels' rows:-Mergefor Sum/Count/Min/Max, and the existing time-ordered segment join for a Counter.cover_intorecursion selects, and the windows are disjoint and tile the range. Tests:cover_answers_as_its_narrowest_levelcompares the cover with the same plan read from its narrowest level only. It runs at 8 times (including t < R, t off the wider grids, and t after the data), on Sum, Max, Count and Counter rate with resets. Dropping the "minus wider span" clause makes it fail (13430400 vs 6715200). The golden test checks hand-computed answers at three times.t, and one instant MetricsQL expression cannot express that.Counter readout (both translators)
ExactKind::Counterreplaces Rate and Increase. AFinalizeExactAccumulator'scounter_readoutpicks the readout: ClickHouse divides by the range forrate, and VictoriaMetrics uses therate(...)orincrease(...)rollup. Two finalizes of one counter chain give two queries over one table (rate_and_increase_5m_stored). These are refused: a counter finalize without a readout, a readout on another state, and a counter state read without a finalize.Decisions and open questions
Needs reviewer decision:
sum_rateandjointkeep a storedCounterchain, which carries thedeltaSumTimestampsubstitution.asap.exactallows no substitution, so the harness refuses these two cells: "variant asap.exact allows no substitutions, but the engine substituted". The other option is to run them as with-substitutes cells. This PR leaves the harness rule as it is.Decided (2026-12-03):
max_5m_label_filter,joint_5m, and the VictoriaMetrics query-time count. They are kept with test capability files (tests/fixtures/capabilities/: an engine file plus one exclusion), so the existing goldens still cover them.planevalfeature stays pinned to ASAPPlanner b822553. 3ef265d needsasap_sketchlib01f3333, and this workspace benchmarks a05b35c, so moving the pin also moves the measured sketch library. That belongs in its own PR.Verification
cargo test -p system-bench --testscargo clippy -p system-bench --tests,cargo fmt --checkclickhouse_translate+clickhouse_run,--ignored(clickhouse local26.8.39.19, githash ed6dc0f3)public_translations_run: every public plan, covers included, runsclickhouse_conformance --ignoredagainst a ClickHouse 26.8.39.19 servervictoriametrics_conformance --ignoredagainst VictoriaMetrics v1.154.1benchmark-externalsmoke (showcase-1mcount,max,sum_rate, 16 series, 3 min)count(now a 10 s stream output) andmaxhave error 0 against equivalent-only truth;sum_rateequivalent-only has no plan, as beforeplan-suite.shat 3ef265d, showcase-1m and showcase-1h, 6 variantssum_rateandjoint(counter_resets_not_handled), as beforerun_directory_plans_translateon those two run directoriessum_rateandjointcarry a substitution (see Decisions)benchmark-externalsmoke (showcase-1hmax,sum_rate,joint, 16 series)max), 3.5e-16 (sum_rate,joint); the 2 refused are asap.exact with a substitutionNew tests:
reads_a_multi_level_chain_and_its_cover,counter_readouts_decode: the wire-16 fields decode, and malformed ones are refused.cover_worked_example(golden),a_counter_cover_reads_its_levels_as_segments,a_counter_finalize_reads_rate_or_increase,counter_readouts_must_fit_the_state,cover_refusals: ClickHouse cover and readout translation.cover_answers_as_its_narrowest_level(ignored, clickhouse local): a cover's answers equal the single-level read, at 8 times and for 4 state kinds.a_time_range_cover_is_refused: VictoriaMetrics refuses covers by name.run_directory_plans_translate(ignored,AQPBM_RUN_DIR): a preflight that every plan in a run directory translates within its variant'ssubstitutions_allowed.Plan changes from 5400f93fd to 3ef265d in showcase-1m/1h:
count1m became a 10 sCountchain on all four files (it was a query-time count); the 1h ClickHouse plans ofcount,max,sum_over_time,jointandsum_rate(with substitutes) became covers. The VictoriaMetrics 1h shapes are unchanged. Planner wall time is at most 0.08 s per plan and peak RSS at most 36 MB.Follow-ups
planevalpin to 3ef265d together with anasap_sketchlibbump.clickhouse localtests and the benchmark smoke.🤖 Generated with Claude Code