Skip to content

Docs follow the code after #281; usecase-study rename; sketch_runs scripts ported - #282

Merged
GordonYuanyc merged 52 commits into
mainfrom
docs/pr-281
Nov 30, 2026
Merged

GordonYuanyc merged 52 commits into
mainfrom
docs/pr-281

Conversation

@GordonYuanyc

Copy link
Copy Markdown
Collaborator

Documentation brought up to date with the code after #281, plus the code changes the review of the docs turned up.

Documentation

  • README: Quickstart rewritten. Two sketch examples (HyperLogLog; Hydra over UnivMon) and two system examples (ClickBench on DuckDB, ClickHouse and PilotDB; use case 5 on VictoriaMetrics and ASAPQuery-backend). Every command was run on this branch, and the steps before each run are spelled out. Reference grouped by level.
  • New: docs/system-bench.md, usecase-study/README.md.
  • docs/concepts.md → docs/terminology.md: now the terminology of the whole repository (operator level, system level, use-case study).
  • docs/aqpbm-planeval.md → docs/planeval.md.
  • Crate design docs (aqpbm-core, aqpbm-core-harness, aqpbm-cli, aqpbm-datagen, sketch-bench, planeval): outdated parts updated, missing parts added, same style.
  • docs/developer_guide.md: architecture first; how to add a sketch, a ground truth, data generation, a system and a use case, with the interfaces to implement; how to read, plot and check the output.
  • docs/sketch-bench-workflow.md: completed.
  • Use-case pages (docs/phase2-use-cases/, docs/approx-bench-use-cases.md): workloads, real datasets, implemented rules and measured metrics match the code; reproduce commands added.
  • Saturation study docs, figure READMEs, component walk-through, capabilities README, workload README, rust-microbench README: corrected.
  • Six AQP design notes moved to docs/archive/.

Code

  • aqpbm-usecase renamed usecase-study (crate, directory, imports, script paths).
  • sketch-runtime/ removed (it was excluded from the workspace and no longer built).
  • scripts/sketch_runs/: run_throughput_fast.sh, run_profiles.sh and example_config_override.py ported to approxbench sketchbench; run_throughput.sh, run_accuracy.sh, run_all.py and dump_cli_reference.sh removed (they depended on removed flags and on a deleted reference file).
  • scripts/studies/recommend_config.py: --summary is required instead of defaulting to one machine's path.
  • approxbench benchmark-external --help: report names scores.csv too.

Checks

  • Release build of approxbench and planeval; cargo test --workspace (690 passed, 0 failed); system-bench declared_truth test; the 13 Python tests in scripts/use_cases/; test_recommend_config.py.
  • The Quickstart's four examples run on this branch; the three ported scripts run on small inputs.
  • Every relative link and anchor in the non-archive Markdown files resolves.

Not changed

  • scripts/extbench-up.sh clickhouse does not mount the data directory, so its ClickHouse cannot read hits.parquet; the README says so.

🤖 Generated with Claude Code

GordonYuanyc and others added 30 commits November 29, 2026 21:26
Cargo.toml declares license = "MIT" for every crate, but the repository
had no license text. The file is asap_sketchlib's LICENSE, word for word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
… that version

rust-toolchain.toml pins the compiler to 1.100.0 (minimal profile, plus
rustfmt and clippy), so a build anywhere uses the same rustc. Both CI jobs
read the channel from that file and install it through
dtolnay/rust-toolchain instead of stable; the test job now also installs
clippy, which its last step runs. The cargo cache key includes the file,
so a new pin does not reuse a target directory built by another compiler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…timescaledb_toolkit

scripts/extbench-up-timescaledb.sh up|down follows extbench-up.sh: one
docker container from an image pinned by digest
(timescale/timescaledb-ha pg17.12-ts2.32.1, with timescaledb_toolkit
1.29.0), pinned to the given cores and NUMA node, host network, listening
only on a private or loopback LISTEN_HOST, running as the invoking user
with no CPU quota or memory limit. Every start initializes an empty data
dir, and the script deletes only a data dir it created.

The data dir is tuned as ClickBench sets TimescaleDB up: timescaledb-tune
over the container's cores and TUNE_MEMORY (all of the host's by
default), with timescaledb as the only preloaded library. The script
creates DATABASE (bench) with both extensions, trusts connections, names
the superuser after the invoking user, and writes versions.txt: image,
PostgreSQL and extension versions, the settings from the configuration
file, the connection string, the cpuset and the cgroup the harness reads.
DATA_DIRECTORY is mounted read-only at the same path for server-side
reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…ed commit

scripts/extbench-up-asapquery-backend.sh:
- build: clones ASAPQuery-backend, checks out commit 8263b22b (main on
  2026-11-29), refuses local changes, and builds control_plane and
  data_plane with cargo --locked into <build-dir>/target; build.txt
  records the commit, rustc and both binaries' sha256.
- plan: runs that control_plane on an ASAPPlanner PlanningWorkload, such
  as suites/*/<w>.planner.json.
- up/down: as extbench-up.sh does for ClickHouse, the data_plane binary
  runs bind-mounted in a base image pinned by digest (Ubuntu 26.04, glibc
  2.43), pinned to the given cores and NUMA node, as the invoking user,
  listening on a private or loopback LISTEN_HOST, with --no-forward and
  its views in an empty data dir; DATA_PLANE_ARGUMENTS adds arguments
  such as --stream-start-ms. Only a data dir the script created is
  deleted. versions.txt records the commit, the binary's and the plan's
  sha256, the image, the cpuset and the cgroup for
  `benchmark-external run --engine asapquery-backend`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
scripts/install-duckdb.sh <install-dir> downloads DuckDB v1.3.1's release
binary for Linux x86_64, Linux arm64 or macOS, checks it against the
sha256 GitHub lists for the asset, and writes <install-dir>/duckdb. 1.3.1
is the version PilotDB's duckdb package reads and the one #277 ran. An
existing duckdb of another version is refused, never replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…ran

scripts/install-pilotdb.sh <install-dir> checks PilotDB out at d1210ce
(refusing local changes), makes a virtual environment from PYTHON
(python3), installs the exact package versions of the environment #277
ran (duckdb 1.3.1, numpy 2.5.5, pandas 3.1.1, scipy 1.18.1, sqlglot
26.30.0 and the rest, without resolving other dependencies), then PilotDB
itself as editable, so the adapter's version line reads its commit. It
checks that PilotDB imports, which needs unixODBC's libodbc.so.2 for
pyodbc, and prints the PILOTDB_PYTHON to use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
scripts/extbench-up-druid.sh up|down runs Druid's single-server medium
profile, as ClickBench does, in one container from apache/druid 37.0.0
pinned by digest: ZooKeeper and the five services are started with the
image's own bin/run-zk and bin/run-druid (the image has no perl for
bin/supervise), so the whole of Druid, ingestion tasks included, is one
cgroup pinned to the given cores and NUMA node. The container runs as the
invoking user, with no CPU quota or memory limit, on its own network: the
profile opens fixed ports on every interface, so only the router is
published, on a private or loopback LISTEN_HOST.

The profile is copied into an empty data dir and edited as ClickBench's
install does (historical caches off, 1000MiB processing buffers, 21g
direct memory, a 5000000000 merging dictionary, 5g task direct memory),
and each ingestion task gets TASK_HEAP (8g): the profile's 1g ran out of
memory on ClickBench's 105-column table. DATA_DIRECTORY is mounted
read-only at the same path for local input sources. The script waits for
SQL and for a worker, deletes only a data dir it created, and writes
versions.txt: image, Druid version, task heap, URL, cpuset and cgroup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…le lists

What to compare was written into the script: five engines, their
configurations, duckdb/exact as the truth and each engine's exact run as a
baseline. A new engine meant editing the script.

When <run-directory>/comparison.json exists, the script runs the
configurations it lists, in order, through one-shot-queries, then
one-shot-report with the file's truth and baselines. Each configuration
names the system (any --engine approxbench knows), the configuration, the
arguments passed after --engine and --configuration ({run_directory} and
{workload} are replaced), optionally a query variant and runs (RUNS, else
3). The arguments are passed as given, so an engine's options, or any
flag one-shot-queries accepts, need no change to the script. The file is
JSON, read with the python3 the script already needs; it is checked before
any engine starts: known fields, result-file names, no configuration
twice, variants of the workload, and a truth and baselines among the
listed configurations. ENGINE_CPUS, COLD_FIRST_RUN, CPU_FREQUENCY_GOVERNOR
and APPROXBENCH still apply; the engine options in the environment do
not. DuckDB is then needed only to read the group columns of a query that
does not declare them.

Without the file nothing changes: on a 2000-row table with DuckDB the
results, the report and the printed output equal those of the script
before this change, and a file listing only duckdb/exact and
duckdb/approximate with the same options gives the same answers and
report values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…way periodic queries do

A one-shot adapter now tells the harness where its work runs, and the
harness reads CPU and peak memory around every run with the same code as
for periodic queries:

- ClickHouse, PostgreSQL and Druid: the server's cgroup, given with the
  periodic flags --server-cgroup-directory, --server-ssh-host and
  --ssh-program; CPU from cpu.stat around the run, peak memory from
  memory.peak. Without the flags nothing is measured and the results are
  as before.
- DuckDB and PilotDB, which start a process for every run: that process's
  user and system CPU and largest resident set size, from wait4.

Each run records harness_cpu_seconds and peak_memory_bytes, each result
cpu_and_memory_source. one-shot-report appends the source and the first
run, hot minimum, median and maximum of both to one-shot-summary.csv, and
the hot medians to one-shot-summary.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…, and the hot minimum and maximum of engine CPU

one-shot-summary.csv gave the first run, the hot minimum and the hot
median of wall and engine time, and only the hot median of the engine's
own CPU, so a reader could not see how far the runs spread. It now
appends hot_max_wall_seconds, hot_max_engine_seconds,
hot_min_engine_cpu_seconds and hot_max_engine_cpu_seconds, so each time
and CPU quantity has its count (runs), minimum, median and maximum.
Existing columns keep their names, positions and values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…t and query CPU

summary.csv gave one number each for ingest_cpu_ns_per_sample (the sum
over refresh chunks of each chunk's median CPU, per sample) and
query_cpu_ms_per_evaluation (the mean over evaluation times of each
time's median CPU), so the spread between runs was not visible. It now
appends, for each, the number of measured runs and the same sum or mean
taken over each step's least and greatest measured run:
ingest_cpu_ns_per_sample_measured_runs, ingest_cpu_ns_per_sample_min,
ingest_cpu_ns_per_sample_max, query_cpu_ms_per_evaluation_measured_runs,
query_cpu_ms_per_evaluation_min and query_cpu_ms_per_evaluation_max.
Taken per step like the median, the minimum and maximum always bound the
existing value. Existing columns keep their names, positions and values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…per run

run_arm gives every warm-up and measured run its own install up front
and runs each step on all of them in turn. An engine that cannot hold two
installs (a server whose state one install owns) could therefore only run
with --warmup 0 --runs 1.

EngineUnderTest::holds_one_install_at_a_time (false by default) now makes
run_arm install, run every step and drop the install once per run, one
after another; each step's job then holds that step's call from every
measured run, with its median, so the record has the same shape as with
every install at once. installs_held is 1, and server_cpu_ns_whole_arm
sums each install's span, from its install (the first from before it),
so a server restarted at an install is counted from its restart. With one
run nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…an file run more than once

Both adapters refused any protocol but --warmup 0 --runs 1. They now hold
one install at a time, so the harness runs their arms one run after
another:

- victoriametrics: an arm without a plan file deletes the workload's
  series when it installs and when it is dropped, so it repeats as is. An
  arm with a plan file feeds its data on the wall clock and is still
  refused more than one run, now when it installs.
- asapquery-backend keeps every sample written to it, so a run after the
  first needs a fresh server: the new --asapquery-backend-restart-command
  is run before every install after the first, followed by a wait for the
  server to answer. Without it the limit stays as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
planeval --samples-out PATH writes every generated series of the spec as
one JSON line: its labels, sample times in ms and values. Without the flag
nothing changes. The error injection in scripts/use_cases/ reads it to
turn a rank error into a value with each window's samples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
… rule

scripts/use_cases/inject_errors.py is an approximation source without a
sketch: it takes the exact run's answers, adds error and hands them to the
use case's derive functions, as an arm's answers. Sizes 0.001, 0.005, 0.01,
0.05, 0.1, 0.2, 0.5 and 1 by default (--size); shapes high (always plus the
size), low (always minus) and random (uniform in plus or minus the size per
answer, seeds 1 to --seeds, default 5). Quantile queries (declared truth
statistic quantile) move by rank: the answer becomes the sample that many
ranks above or below it in its window, stopping at the window's smallest
and largest sample; the other queries move by relative error.

The exact run comes from planeval --samples-out, or from --exact and
--samples. Each size, shape and seed is one run named
uc<N>-inject-<shape>-<size>[-seed<S>] with the same rows as an arm, written
to target/grafana-data/injected; its details carry the size, shape, seed
and the measured rank and relative errors. uc<N>-injected.csv lists every
rule's agreement, and the script prints the smallest size at which each
rule's decisions first differ from the exact ones, per shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…them

rollout.py's thresholds and counts stay module constants, and each check
and decide function takes them as keyword arguments that default to the
constants. rule_set(changed) builds the five rules from PARAMETERS with
some of them changed, and RULES = rule_set(). scaled(threshold, count)
gives the changed parameters for one pair of multipliers: a threshold
multiplier scales each threshold's distance from where a check surely
passes (tolerance from 1, success rates from 1, the p99 and p95 limits
from 0 s); a count multiplier scales the failed checks each rule rolls
back after (streak, Flagger's failure threshold, Argo Rollouts' failure
limit, CloudWatch's M and the last N it counts them in), rounded half up
and at least 1.

scripts/use_cases/sweep_rollout_parameters.py scores use case 4's arms
again for each pair, thresholds 0.8, 0.9, 1, 1.1, 1.25 by counts 0.5, 1, 2
by default, from the planeval outputs run_use_case.py 4 wrote, so every
pair scores the same answers. Each pair is a run named
<arm run>-threshold<T>x-count<C>x with the rule parameters in its
details, written to target/grafana-data/rollout-parameters; the pair 1, 1
keeps the arm's own run name and writes the same rows and details as
run_use_case.py, except details.process, which stays empty since no
planeval runs. uc4-rollout-parameters.csv lists every rule's agreement.

write_arm takes extra_details, merged into the run's details.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…rom their own random streams

Fixes #254. The phase-choice stream is seeded from the spec seed tagged as
the phase choice, and each distribution of a series group after its
baseline from its own seed tagged with its position in the group. The
baseline keeps its stream, so it still draws what a TimeSeriesDescription
with the same seed draws. So a baseline seed equal to the spec seed, or two
distributions of one group with one seed, no longer replay one sequence.

The generated data changes for every spec with a mix phase:
uc1_syn_flood, uc3_video, uc4_canary, uc5_top_clients, and the generated
metrics of uc4_canary_real and uc4_canary_real_native. uc2_autoscaling and
every imported table draw the same samples as before. The uc1 golden hash
is re-recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…etrics, and each query's threshold, unit and accuracy metric

WorkloadSpec gains, all optional and under the use-case Spec's names:
start_ms, duration_ms and seed, and metrics (series groups with phases,
floor, non_negative, label_from_value, planned_series_count,
max_distinct_per_evaluation, and tables to import). WorkloadQuery gains
threshold, unit and accuracy_metric. data may be left out. Every existing
field keeps its name and meaning, so existing workloads read unchanged.

The use-case sample generator moves into aqpbm-core (harness::data,
metric_series and workload_series), with the random streams of the #254
fix, so it draws the same samples. Importing a table needs aqpbm-core's
new import feature, which approxbench turns on.

The harness reads both kinds of data: the schedule, run_arm's refresh
chunks (workload_sample_chunks), the declared-truth report and the
victoriametrics and clickhouse adapters. benchmark-external run and report
take --data-root (ASAP_DATASETS, default datasets), as planeval does, for
the tables a workload imports; run_arm and report take the data root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…systemeval read WorkloadSpec; the use-case Spec is removed

The files under aqpbm-usecase/workloads keep their names and data; three
names change to WorkloadSpec's: use_case is name, interval_ms is
evaluation_interval_ms, and promql is a PromQl entry of texts. Every other
field keeps the Spec's name. Each file generates the same samples as
before (checked file by file, with the import feature planeval and
approxbench build with; the real-trace files' imported tables are not on
this machine, so only their generated metrics were checked).

planeval and systemeval read any WorkloadSpec, including the
*.workload.json suites: they generate data records and metrics alike, and
plan with the data records as sources too. Their output files keep every
field. The Spec and the generator copy in aqpbm-usecase are removed;
aqpbm-usecase keeps the scoring, the output layout and read_workload.

The Python that reads the use-case files (run_use_case.py through bounds
and scenario, run_use_case_on_systems.py, tools/grafana and the uc3
workload writers) reads the new names; the dashboards it generates are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…ngines

The two engines' arms without a plan file can replay the data at a
multiple of its own rate, as systemeval's --speed does: a sample is
written no earlier than its time after the data start divided by the
speed, counted from the arm's first write, in requests that span at most
one second of data time, and each refresh's visibility call (VictoriaMetrics'
flush, ASAPQuery-backend's watermark) waits for the refresh's end the same
way. Without --speed they write as fast as the server accepts, as before.
A VictoriaMetrics arm with a plan file, which is fed in real time, refuses
--speed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…nch benchmark-external run; reference and candidate are options

Each server is run by approxbench benchmark-external run instead of
systemeval: the script writes a run directory with one workload per query
(the use-case WorkloadSpec with that query alone, so each query is
evaluated at its own times and a query a system cannot answer fails only
its own cell), starts the server, runs the engine with --warmup 0 --runs 1
and reads the answers and per-evaluation wall times from the results.
VictoriaMetrics runs every query on one server; ASAPQuery-backend, which
keeps every sample written to it, starts once per query with its group's
plan. The answers are scored against the exact answers by planeval's new
--score-answers (rank errors need the samples), as systemeval scored them.

--reference and --candidate (victoriametrics or asapquery-backend; by
default VictoriaMetrics is the exact arm and ASAPQuery-backend the
approximate one, as ARM_OF had it) replace the fixed roles. --approxbench
replaces --systemeval; --batch-samples is gone, since the engines write
10,000 samples per request; --max-core-busy is passed to the run. --spec
refuses an arm that keeps raw samples, since no raw store is filled.

On Linux each server starts in its own cgroup v2 group (systemd-run --user
--scope, no root needed) whose directory is passed as
--server-cgroup-directory; the harness reads a group's cores from its
nearest ancestor that has cpuset files, as cgroup v2 runs a group without
the cpuset controller on its parent's cores. The CPU and memory columns of
the summary still come from ps here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…er without a cgroup, or a host off Linux, runs unmeasured and unpinned

CpuAccounting gains NotMeasured: the harness reads no CPU or memory for the
engine, so its steps carry wall time only, its idle probe reads nothing,
and its result's cpu_source is "not measured", with the CPU and memory
columns of summary.csv empty. The victoriametrics and asapquery-backend
engines run so when no --server-cgroup-directory is given, instead of
refusing; a VictoriaMetrics arm with a plan file, which replaces the
stream-aggregation config through the cgroup source, still needs one.

Off Linux the harness runs its jobs without pinning the thread instead of
refusing, and marks each job NotPinned; a job whose idle check read
nothing is marked IdleNotChecked. On Linux pinning is unchanged.

run_use_case_on_systems.py no longer reads ps or the servers' rusage: each
system's cpu seconds, peak resident bytes and resident bytes at end come
from the harness results of its cells (the cgroup's cpu.stat over the
whole arm, memory.peak and memory.current), and the summary says where
they were read and whether the harness thread was pinned. On a host
without systemd-run --user (macOS, a container without a user manager) the
servers run without a cgroup and these fields are empty. The numbers
differ from the ps-based ones: they cover the server's cgroup, and each
cell writes the data once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
run_use_case_on_systems.py runs the systems through approxbench
benchmark-external run since the previous commits, and the
victoriametrics and asapquery-backend engines replay at a given speed, so
nothing runs systemeval. Its binary, system-bench's systemeval module and
feature (the default feature, so system-bench now has none) and the
systemeval output types in aqpbm-usecase are removed. The system level is
approxbench benchmark-external, plus planeval for comparing plans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
--trials N runs both systems N times for every arm. Each run starts both
servers afresh and writes the data again; the in-process exact plan, which
does not vary, runs once. Runs after the first are named and filed as
run_use_case.py names its trials: <run>-trialN, in <work directory>-trialN,
with the trial number in the run's details. --trials 1, the default, runs
and names everything as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…al run, write-throughput and one-shot-queries

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…hine

engine-run-*.json, *.one-shot.json, each line of write-throughput.jsonl
and planeval's output gain two fields: harness_version, the package
version plus the commit it was built from, and machine, the harness's
MachineDescription (unchanged: CPU architecture and model, logical cores,
memory type, MemTotal, OS; no host name). Both are optional, so result
files written before read as before.

The version is the package version alone when the build cannot read a
commit (no git, or not a checkout of this repository), and ends in -dirty
when a tracked file of a workspace crate, Cargo.toml, Cargo.lock or
rust-toolchain.toml differed from that commit at build time; untracked
files and files outside the crates do not count. system-bench's build
script computes it and runs again when HEAD moves (HEAD, its branch ref,
packed-refs, logs/HEAD) or one of those tracked files changes, so a build
with nothing changed stays fresh, and a HEAD move rebuilds only
system-bench and aqpbm-cli.

Off Linux the machine is read with sysctl (the macOS names). Where it
cannot be read, a warning is printed and the result has no machine
field. AQPBM_MEMORY_TYPE overrides the memory type, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…, the commit extbench-up-asapquery-backend.sh pins

The planner workload the script hands the control plane takes ASAPPlanner
main's format, as ASAPQuery-backend reads it since 12aa458c (#852): a
query's demand is fixed_interval_at, every evaluation_interval_ms at phase
0 (the use cases' evaluations end on the epoch grid), and a non-negative
metric is declared as column_signs {"value": "non_negative"} instead of
values_non_negative. The plan file is read in its wire version 15 layout:
each query's root is dag.roots at its query_texts position, a node's
sketch and its parameters are its parameters field, and a materialized
view is a node kept across evaluations that is not a raw-data scan, so a
plan reads as, e.g., CmsWithHeap {"width":28,"depth":5,"heap_size":10}
(1 materialized views).

The data plane persists its views: each start gets --view-dir in the work
directory, sized into the summary's disk bytes and removed after the run
unless --keep-data. The script refuses an ASAPQuery-backend built from
another commit than the one scripts/extbench-up-asapquery-backend.sh pins
(read from that build's build.txt, or its source checkout), naming how to
build the pinned one; it warns when it cannot tell, and backend_rev reports
that commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…es the saved views and starts the same container; --asapquery-backend-restart-command's example uses it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…toriaMetrics on an empty data dir before every install after the first; repeated runs need it; extbench-up-victoriametrics.sh restart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…g_hba.conf, and mounts its data dir at its own path so DATA_DIRECTORY=/data does not clash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
GordonYuanyc and others added 22 commits November 30, 2026 01:48
…s --speed, extbench-up-asapquery-backend.sh refuses binaries build.txt does not record, install-pilotdb.sh without realpath -m, one-shot-workload.sh chowns the comparison file's DuckDB databases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…le run, not each step's extremes added up

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…ss measures no CPU

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…he existing columns

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…10 ms during each run, of the processes' VmHWM or a local cgroup's memory.current; over SSH, memory.peak since the group started

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…its file; the use-case label comes from the use-case module

benchmark-external run reads a workload only from a file named after it,
and the 16 files in aqpbm-usecase/workloads/ were not: their name was the
use case's label (top_clients for five files, ddos_syn_flood for four,
...). Each file's name is now its stem, e.g. uc5_top_clients and
uc5_top_clients_real_nasa, so any of them goes into a run directory as it
is. video_spec.py and real_data_video.py write the stem of the file they
write.

The label the runs and dashboards show (ddos_syn_flood, k8s_autoscaling,
video_experience, canary_release, top_clients) is now each use-case
module's CASE["use_case"]. run_use_case.py and inject_errors.py take it
from the case, the Grafana dashboards from the module, and scenario.py and
run_use_case_on_systems.py through cases.use_case_of(spec), which maps a
use case's workload, or one of its _real variants, to the use case's label
and any other spec to its own name. Run rows, run ids, the index and the
dashboards are byte for byte as before.

planeval still writes the workload's name as its output's use_case, so
that field now reads e.g. uc5_top_clients; no reader takes the label from
it any more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
… sizes a query could not take, and leaves use case 5's top-10 membership out of its table

The method is unchanged. A rank error moves a quantile answer by
floor(size x window samples) samples, so a size can move nothing (0.001
on a 600-sample window), and an answer cannot move past its window's
largest or smallest sample, so a p99 answer moved up by more than about
0.01 stops at the window's maximum: upward a rank error is at most 1 - q.

uc<N>-injected-queries.csv is new: per run and query, the error metric
(rank or relative), the shape, size and seed, the answers, the mean and
the largest error the answers reached, the answers the size could not
move (a rank step of 0, or a relative error on an answer of 0), and the
answers that stopped at the window's smallest or largest sample.
uc<N>-injected.csv gains two columns after the existing ones,
queries_not_expressed and queries_capped: the queries the rule reads that
had such answers in that run.

The summary of the smallest size at which a rule's decision changes marks
a size where a query the rule reads could not take the size (n) or
stopped at its window's edge (c), the "> largest size" cells included,
and explains the marks below the table.

A top-k membership signal, use case 5's top_clients, is not in the table
or the summary, and the summary says why: a membership error would need
counts beyond the top 10, which the exact answers do not hold. Each of
those runs records the same in details.not_in_injection_table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…m, so two distributions with one seed do not trade streams across series

A group's distribution with tag t (0 the baseline, 1, 2, ... its other
distributions, u64::MAX the phase choices) on stream s drew from
splitmix64(seed ^ splitmix64(t) ^ splitmix64(s)). XOR commutes, so tag a
on stream b and tag b on stream a drew the same values when the two
distributions had the same seed: e.g. two mix distributions with one seed
in a group of three or more series. A tag t >= 1 now seeds its stream
from splitmix64(seed ^ splitmix64(t)) before the stream is combined with
it; tag 0 is the seed as before, so a baseline draws what it drew.

None of the 16 use-case files had such a pair, but every file with a mix
phase draws other samples again, as after the change that gave these
distributions their own streams: uc1_syn_flood, uc3_video, uc4_canary,
uc5_top_clients, and the generated metric of uc4_canary_real and
uc4_canary_real_native. uc2_autoscaling (scale phases only) and the
imported metrics are unchanged; every file keeps its series and sample
counts. The use case 1 golden hash is recorded again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…rollout_parameters.py record the harness version and the machine

Each run's details gain harness_version and machine next to planner_rev,
copied from the planeval output the run scores: the approximate arm's for
run_use_case.py and sweep_rollout_parameters.py (which writes through
run_use_case.py's write_arm), the exact run's for inject_errors.py. They
are null for a planeval output written before planeval recorded them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…art plus its own window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…VictoriaMetrics runs every query from one write, ASAPQuery-backend one data plane per planning group

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…e reference: a spec is not scored without truth, and a query the backend cannot plan is in its answers as unsupported

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…f failing, on a kernel without the cgroup's memory.peak

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…ed run: a query VictoriaMetrics refuses before the data, or the backend cannot plan, is unsupported; a run that fails is a failure with the harness's reason

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…he machine of its engine runs beside planner_rev

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…an ASAPQuery-backend built from another commit than the pinned one and records both

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
…st truth reference_vs_truth; victoriametrics_vs_truth stays when the reference is VictoriaMetrics

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nTLXH7ht3wiMWxCGSc
# Conflicts:
#	aqpbm-cli/tests/benchmark_external_cli.rs
#	aqpbm-cli/tests/benchmark_external_one_shot_cli.rs
#	aqpbm-core/src/harness/arm_run.rs
#	aqpbm-core/src/harness/benchmark_external.rs
#	aqpbm-core/src/harness/cgroup.rs
#	aqpbm-core/src/harness/one_shot.rs
#	aqpbm-core/src/harness/one_shot_report.rs
#	aqpbm-core/src/harness/protocol.rs
#	aqpbm-core/src/harness/records.rs
#	aqpbm-core/tests/harness_benchmark_external.rs
#	aqpbm-core/tests/harness_cgroup.rs
#	aqpbm-core/tests/harness_one_shot.rs
#	aqpbm-core/tests/harness_one_shot_report.rs
#	scripts/extbench-up-timescaledb.sh
#	scripts/install-pilotdb.sh
#	scripts/use_cases/inject_errors.py
#	scripts/use_cases/run_use_case_on_systems.py
#	scripts/use_cases/test_inject_errors.py
#	scripts/use_cases/test_run_use_case_on_systems.py
#	system-bench/src/engines_external/clickhouse_server.rs
#	system-bench/src/engines_external/victoriametrics_server.rs
#	system-bench/src/registry.rs
#	system-bench/tests/end_to_end_adapters.rs
…med names updated, AQP notes archived; sketch-runtime removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h.md and usecase-study README added; concepts.md becomes terminology.md for the whole repository; developer guide covers data generation, systems and use cases; README Quickstart checked against real runs, Reference grouped by level

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…style; system-bench.md follows the same template; sketch-bench workflow completed; developer guide adds ground truth and output checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rected; scripts/sketch_runs ported to sketchbench, obsolete ones removed; recommend_config.py requires --summary; benchmark-external report help names scores.csv

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc merged commit 2194f39 into main Nov 30, 2026
0 of 2 checks passed
GordonYuanyc added a commit that referenced this pull request Nov 30, 2026
…a release (#283)

* CI: rustfmt after the usecase-study rename; dd peak-memory bound fits the runner

rustfmt reorders the usecase_study imports that #282 renamed. The child
peak-memory test allowed dd 64..68 MiB; the GitHub runner's dd peaks at
71 MiB (64 MiB buffer plus its own pages), so the bound is now 64..96 MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nP6BDs8xKTsK4ANbnP

* Sketch names follow the papers: count-min-sketch, hyperloglog, ddsketch, ...

Registry algorithm and variant names, and the library names, as agreed:
cms -> count-min-sketch, countsketch -> count-sketch, hll -> hyperloglog,
dd -> ddsketch, bloom -> bloom-filter, elastic -> elastic-sketch,
coco -> cocosketch, nitro -> nitrosketch, cdf -> cumulative-distribution,
count-min-* -> count-min-sketch-*; lib -> asap_sketchlib,
oxide -> sketch_oxide. kll, kmv, hip, univmon, univmon-q, hydra,
space-saving and the fastpath/vector2d/topk parts keep their names.

count-min-sketch and count-sketch now prefix the space-saving, fold,
hyperloglog and l2-norm algorithms, so their params types exclude those.
A record written before the rename still parses: ParamSet maps an old
variant name to the new one (RENAMED_VARIANTS), and the study scripts map
old names in result files (scripts/studies/sketch_names.py).

ASAPQuery's family names (cms, countsketch, topk, kll, dd, hll) in the
study scripts are unchanged. Commands, scripts, configs and docs follow;
docs/archive, docs/figures and the committed ASAPQuery tables keep the
names they were written with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nP6BDs8xKTsK4ANbnP

* Pin ClickHouse to the v26.8.39.19-lts release build

26.8.39.13 was a 26.8 branch build from builds.clickhouse.com/26.8/amd64compat,
a URL that follows the branch; it now serves 26.8.52.6, and 26.8.39.13 has no
release to download again. v26.8.39.19-lts is a GitHub release 12 commits
later; none of the cited source files changed, so the README anchors hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fj92nP6BDs8xKTsK4ANbnP

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc deleted the docs/pr-281 branch November 30, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant