Skip to content

Tracking: move main to the two-level layout of the interface design #267

Backlog

Description

@GordonYuanyc

Goal

Bring main in line with docs/interface-design.md (#266). The design has two levels:

  • Operator level: the sketch-bench crate (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 EngineUnderTest and InstalledArm.

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

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.

  1. Merge docs: interface design for the operator and system levels #266. Every later step is checked against it.
  2. Rename the crates and the program, only if D2 says so.
  3. Create the system-level crate and move the three crates into it, as modules, with no change in behavior.
  4. Restack the draft pull requests, one at a time, each checked against the interface design:
  5. 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.
  6. End-to-end systems become adapters. ASAPQuery-backend and VictoriaMetrics, used the normal way, implement EngineUnderTest and InstalledArm; the System trait goes away. Reuse systemeval's Remote Write encoder and the real-time sending from 4c. Needs 4c, D7, D11 and D12.
  7. 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.
  8. Apply D5 to the traits and to the gate, sweep and fit modules.
  9. 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; the impl field, SCHEMA_VERSION and tests in benchmark_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.
  10. Close what is superseded, as D8 and D10 decide.
  11. 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-bench crate and one system-level crate; the aqpbm-planeval, aqpbm-engines-external and aqpbm-systemeval directories are gone.
  • Every system runs through EngineUnderTest, and approxbench benchmark-external run can 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions