Repository navigation
Description
Goal
Bring main in line with docs/interface-design.md (#266). The design has two levels:
-
Operator level: the
sketch-benchcrate (sketch registry and wrapper functions). -
System level: one crate, called "the system-level crate" below, that holds three comparisons:
- plan comparison: different plans on one executor, ASAPPlanner's (today
aqpbm-planeval); - executor comparison: one plan, translated and run on different systems, such as ClickHouse materialized views or VictoriaMetrics stream aggregation (today
aqpbm-engines-external); - end-to-end comparison: each system used the normal way, choosing its own plan (today
aqpbm-systemeval).
Every system plugs in through
EngineUnderTestandInstalledArm. - plan comparison: different plans on one executor, ASAPPlanner's (today
The shared crates stay: aqpbm-core, aqpbm-datagen, aqpbm-usecase, aqpbm-cli.
This issue replaces #259. #259 plans an earlier layout: a separate aqpbm-harness crate, aqpbm-planeval deleted, and aqpbm-engines-external absorbing aqpbm-systemeval.
Where main is today (30a270b)
| Crate | What it holds today | In the new layout |
|---|---|---|
aqpbm-core |
the harness (EngineUnderTest, InstalledArm, running one arm, clocks, run directory, conformance check), measurement, result records |
stays |
aqpbm-datagen |
data generators | stays |
aqpbm-usecase |
use-case specs and scoring against declared statistics | stays |
aqpbm-cli |
the approxbench program |
stays |
sketch-bench |
sketch registry and wrapper functions | operator level; names spelled out (step 9) |
aqpbm-planeval |
plan comparison: runs ASAPPlanner's planner and executor in process, through its own Driver; pins ASAPPlanner b822553 |
moves into the system-level crate (step 3), then becomes an adapter (step 7) |
aqpbm-engines-external |
a translator from ASAPPlanner plan files to ClickHouse materialized views; no adapter yet | moves into the system-level crate (step 3) |
aqpbm-systemeval |
writes by Prometheus Remote Write and queries over HTTP, through its own System trait (ASAPQuery-backend, VictoriaMetrics) |
moves into the system-level crate (step 3), then its systems become adapters (step 6) |
approxbench benchmark-external run can only run the fake system today. A remote server's cgroup is read over SSH.
Open pull requests
To restack a pull request means to rebuild its branch on top of main, keeping only its own commits.
| PR | Author | What it adds beyond main | Plan |
|---|---|---|---|
| #266 | GordonYuanyc | the interface design document | merge first (step 1) |
| #264 | zzylol | VictoriaMetrics translator: plan files to stream aggregation and MetricsQL | restack (step 4a) |
| #263 | zzylol | ClickHouse adapter, conformance on a real server, scripts/extbench-up.sh |
restack (step 4b) |
| #265 | zzylol | VictoriaMetrics adapter that sends samples at the pace of real time; stacked on #264 | restack after #264 (step 4c) |
| #262 | zzylol | two sets of showcase workloads (1 minute and 1 hour), scripts/plan-suite.sh that plans them, MetricsQL as a query language |
restack (step 4d) |
| #128 | GordonYuanyc | planeval with SQL input on DataFusion (September) | decision D8 |
| #86 | GordonYuanyc | registration axis and dependent columns (August) | decision D8 |
#262–#265 branch from 26283012, before #256, #260 and #261 were squash-merged. Each branch still carries its own copies of those harness commits. A restack also has to follow what main renamed:
bench_external.rs→benchmark_external.rs,rundir.rs→run_directory.rs,bench_external_cmd.rs→benchmark_external_cmd.rs;run_lane→run_engine,LaneSetup→EngineRunSetup,LaneCell→EngineRunCell,RunDir→RunDirectory;- the command line
bench-external --lane --run-dir→benchmark-external --engine --run-directory.
#263 and #265 also depend on an HTTP agent that reads a server's cgroup and replaces its configuration. Main reads a remote cgroup over SSH instead (decision D3).
Other repositories
- ASAPPlanner
crates/devtoolsdepends onaqpbm-core, and onaqpbm-datagenfor its tests, both at7c0d121and through the URLgithub.com/ProjectASAP/sketch-bench. That commit exists only on the branches of bench-external: showcase-1m and showcase-1h suites and the plan step #262–engines-external, harness, cli: run translated plans on a real VictoriaMetrics server with a paced wall-clock feeder #265, not on main. devtools uses the old names (bench_external::run_lane,LaneSetup,LaneCell) andrecords::ArmResult. Step 5 moves it. - ASAPPlanner
crates/devtools/src/rqe_atomic_costs.rsreads sketch names such ascms,kll,dd,hll,kmv,hydra-andexact-fromrqe_atomic_costs.json. Step 9 changes it. - ASAPBench refers to three ASAPPlanner revisions:
b822553(aqpbm-planeval),5400f93(aqpbm-engines-external/tests/fixtures/plans/REV) and the one cited incapabilities/README.md. Step 7 moves them to one, the newest that works.
Decisions needed
Each decision blocks only the steps named.
| # | Decision | Blocks |
|---|---|---|
| D1 | the name of the system-level crate | step 3 |
| D2 | whether to rename the aqpbm-* crates and the approxbench program. If yes, the rename is step 2 and must land before steps 4 and 5, so the branches and the ASAPPlanner pins move once |
step 2 |
| D3 | how the harness reads a remote server's cgroup and replaces its configuration: over SSH (main) or through the HTTP agent (#263, #265) | steps 4b, 4c |
| D4 | what ASAPPlanner may use: add benchmark_external and records to the public modules in #266, or change devtools to use only the modules #266 lists |
step 5 |
| D5 | keep or remove the optional methods that serve an optimizer (predicted, price, node_profiles, calibration; #266 open question 1), and with them the harness modules gate, sweep and fit |
step 8 |
| D6 | how plan comparison runs a plan on ASAPPlanner's executor: its own Driver; ASAPPlanner's AsapEngine (ASAPPlanner#1410), which needs step 5 first because it brings its own copy of aqpbm-core; or a public entry point that ASAPPlanner adds |
step 7 |
| D7 | whether the declared statistic of a query moves from the use-case spec into WorkloadQuery (#266 open question 2) |
steps 6, 7 |
| D8 | close or rebase #128 and #86. A rebased #128 must land before step 3, a rebased #86 before step 9 | steps 3, 9, 10 |
| D9 | whether to rename SketchId, --list-impls and the impl field, and OperationMask / MetricsMask |
step 9 |
| D10 | close #259 and #257 as superseded, or keep #257 as a use of the system-level crate | step 10 |
| D11 | whether the planeval and systemeval programs and their output files stay after steps 6 and 7. scripts/use_cases/ and the one-click Grafana run read them |
steps 6, 7 |
| D12 | VictoriaMetrics used the normal way (step 6) and with a translated plan (4c): one adapter with two kinds of arm, or two adapters | step 6 |
#266 open questions 3–7 do not block this migration.
Steps, in order
Steps 2, 3, 5–9 are one pull request each; step 4 is four. Markdown files are not edited before step 11: a restack leaves out the markdown changes of its pull request, and step 11 makes them. Files that only move with their crate in step 3 keep their content.
- Merge docs: interface design for the operator and system levels #266. Every later step is checked against it.
- Rename the crates and the program, only if D2 says so.
- Create the system-level crate and move the three crates into it, as modules, with no change in behavior.
- Root
Cargo.toml: workspace members, and therepositoryfield and comments that still saysketch-bench.Cargo.lockchanges with it, since CI builds with--locked. - Move the crates' tests and fixtures.
- Plan comparison sits behind a cargo feature that turns on the ASAPPlanner dependency, so the default build has no ASAPPlanner.
- CI (
.github/workflows/rust.yml) gets a test job with that feature on; otherwise the plan comparison tests stop running. - The
planevalandsystemevalprogram names and their output stay as they are.scripts/use_cases/run_all_use_cases.shbuilds the new package with the feature instead of-p aqpbm-planeval. - This comes before the restacks so that bench-external: showcase-1m and showcase-1h suites and the plan step #262–engines-external, harness, cli: run translated plans on a real VictoriaMetrics server with a paced wall-clock feeder #265 are rebuilt once, onto the final layout.
- Root
- Restack the draft pull requests, one at a time, each checked against the interface design:
- a. engines-external: translate plan files to VictoriaMetrics stream aggregation and MetricsQL #264, VictoriaMetrics translator.
- b. engines-external: ClickHouse adapter, the clickhouse lane, and conformance on a real server #263, ClickHouse adapter; needs D3.
clickhousejoins the systemsbenchmark-externalcan run, soaqpbm-clistarts to depend on the system-level crate and passes the plan comparison feature through. - c. engines-external, harness, cli: run translated plans on a real VictoriaMetrics server with a paced wall-clock feeder #265, VictoriaMetrics adapter; needs 4a and D3.
- d. bench-external: showcase-1m and showcase-1h suites and the plan step #262, showcase workloads and
scripts/plan-suite.sh. Adding MetricsQL toQueryLanguagechanges the interface; step 11 updates the document.
- ASAPPlanner: move both devtools pins (
aqpbm-core,aqpbm-datagen) to a main commit of ASAPBench and the new URL, and follow the renames. Needs step 4 and D4. This is a pull request in ProjectASAP/ASAPPlanner. - End-to-end systems become adapters. ASAPQuery-backend and VictoriaMetrics, used the normal way, implement
EngineUnderTestandInstalledArm; theSystemtrait goes away. Reuse systemeval's Remote Write encoder and the real-time sending from 4c. Needs 4c, D7, D11 and D12. - Plan comparison becomes an adapter, as D6 decides, and ASAPBench moves to one ASAPPlanner revision. Needs step 3, D6, D7 and D11, and step 5 if D6 picks
AsapEngine. - Apply D5 to the traits and to the
gate,sweepandfitmodules. - Operator-level names in code. Spell out the registry names: 29 algorithm names, 71 variant names (in 94 registry entries) and the library names, for example
cms→count-min,lib→asap_sketchlib,oxide→sketch_oxide; plus the D9 names. Needs D9.- Code that uses them:
sketch-bench,aqpbm-core(metrics/mask.rs; theimplfield,SCHEMA_VERSIONand tests inbenchmark_result/schema.rs),aqpbm-cli,scripts/sketch_runs/,scripts/studies/,configs/datagen/. - ASAPPlanner
crates/devtools/src/rqe_atomic_costs.rs: a pull request in ProjectASAP/ASAPPlanner. - Result files written before the rename keep the old names; code that reads them needs a mapping.
- Independent of steps 3–8; it can run in parallel.
- Code that uses them:
- Close what is superseded, as D8 and D10 decide.
- Documentation. Update these files.
docs/archive/stays as it is.
| File | What changes |
|---|---|
README.md |
repository name, crate list, commands, sketch names |
docs/interface-design.md |
MetricsQL (4d); answers to its open questions |
docs/sketch-bench.md |
registry entry and wrapper function shapes, as in the interface design |
docs/sketch-bench-workflow.md |
sketch names; old --algorithm / --impl flags |
docs/developer_guide.md |
how to register a sketch |
docs/aqpbm-core.md |
the role of the crate |
docs/aqpbm-core-harness.md |
harness modules; the system-level crate |
docs/aqpbm-planeval.md |
plan comparison inside the system-level crate |
docs/aqpbm-cli.md |
commands; sketch names in examples |
docs/component_walk_through.md |
crate layout; planeval and systemeval |
docs/concepts.md |
sketch names |
docs/saturation_study.md |
sketch names in commands |
docs/approx-bench-use-cases.md, docs/AQP_ASAPQUERY_PROMQL_CASE_STUDY.md |
repository name |
docs/phase2-use-cases/canary.md, ddos.md, rate-limiting.md, resource-scaling.md, results.md, video-experience.md |
planeval commands |
configs/workloads/README.md |
sketch names |
capabilities/README.md (moved in step 3) |
its path; the ASAPPlanner revision; the changes #263 and #264 make to it |
suites/README.md (added by #262) |
the showcase workloads |
Done when
- main has the
sketch-benchcrate and one system-level crate; theaqpbm-planeval,aqpbm-engines-externalandaqpbm-systemevaldirectories are gone. - Every system runs through
EngineUnderTest, andapproxbench benchmark-external runcan run ClickHouse, VictoriaMetrics, ASAPQuery-backend and, with the feature on, ASAPPlanner's executor. - The default build has no ASAPPlanner dependency, and CI tests the build with the feature on.
- ASAPPlanner pins a main commit of ASAPBench.
- The files in step 11 are updated.
Activity
system-bench: one system-level crate holding planeval, engines-extern…
engines-external, cli: the ClickHouse adapter and the clickhouse engi…
engines-external, cli: the VictoriaMetrics adapter and the victoriame…
engines-external: ClickHouse adapter, the clickhouse lane, and confor…
engines-external, cli: the VictoriaMetrics adapter and the victoriame…
engines-external, cli: the VictoriaMetrics adapter and the victoriame…
harness: declared statistics in workloads, --truth declared, and vari…
system-bench: ASAPQuery-backend adapter and VictoriaMetrics without a…
systemeval: drive the adapters' server connections; remove the System…
system-bench: ASAPQuery-backend adapter and VictoriaMetrics without a…
systemeval: drive the adapters' server connections; remove the System…
systemeval: drive the adapters' server connections; remove the System…