Skip to content

harness: declared statistics in workloads, --truth declared, and variants without plans - #269

Merged
GordonYuanyc merged 1 commit into
mainfrom
harness/declared-truth-and-plan-free-variants
Nov 25, 2026
Merged

GordonYuanyc merged 1 commit into
mainfrom
harness/declared-truth-and-plan-free-variants

Conversation

@GordonYuanyc

Copy link
Copy Markdown
Collaborator

Step 6a of #267 (decisions D7 and D12). The harness part only; the adapters and systemeval come in the next two pull requests.

What changes

  • Declared statistics move to aqpbm-core. Truth, Statistic, Series and the scoring of answers against a statistic computed from the raw samples (QueryTruth) move from aqpbm-usecase to aqpbm_core::accuracy::declared_truth. aqpbm-usecase re-exports them, so use-case specs and the planeval/systemeval outputs are unchanged.
  • WorkloadQuery.truth (optional): a query can declare the statistic it computes. Omitted when absent, so existing workload files and run directories read and write as before.
  • benchmark-external report --truth declared beside --truth <engine>/<variant>:
    • each declared query is scored against its statistic, computed from the workload's data;
    • the report refuses a workload that no longer generates the samples its cells ingested;
    • summary.csv and accuracy.csv keep their columns. Relative error follows the harness's rule (relative_error); points and missing points count every declared query, quantile and top-k included;
    • new scores.csv: every score per query (max, median, points), for example rank error for quantiles.
  • variant.json takes two optional fields:
    • plans: false: every workload runs with no plan file; the engine runs the query its own way (PlanEntry::QueryTextOnly, engine_options = {});
    • run_by_default: false: the variant runs only when named with --variant. If no variant runs by default and none is named, the run is refused.
  • report takes a ReportTruth.

Notes

  • run_by_default belongs to the variant, so it applies to every engine in the run directory. An engine with no plan-free mode (ClickHouse, VictoriaMetrics before step 6b) records NotRun for a plans: false variant.
  • ASAPPlanner devtools builds WorkloadQuery literals; it needs truth: None when it moves its pin (step 5).
  • Markdown is left for step 11.

Checked (macOS)

  • cargo fmt --check.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: only the two pre-existing Linux-only warnings in aqpbm-core/tests/harness_protocol.rs.
  • Tests: the new tests pass (plan-free and not-by-default variants, declared truth for distinct and quantile, the changed-data refusal, --truth parsing). The failures are the known Linux-only ones (thread pinning, cgroup, /proc), the same as on main.

🤖 Generated with Claude Code

…ants without plans

Step 6a of #267 (decisions D7 and D12):

- the declared statistic of a query (Truth, Statistic) and its scoring
  against the raw samples (QueryTruth, Series) move from aqpbm-usecase to
  aqpbm_core::accuracy::declared_truth; aqpbm-usecase re-exports them, so
  use-case specs read as before;
- WorkloadQuery has an optional truth field (omitted when absent, so
  existing workload files and run directories are unchanged);
- benchmark-external report takes --truth declared beside
  --truth <engine>/<variant>: each declared query is scored against its
  statistic computed from the workload's data, and scores.csv holds every
  score per query (max, median, points);
- variant.json takes plans: false (every workload runs with no plan file,
  the engine running the query its own way) and run_by_default: false
  (the variant runs only when named with --variant).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc merged commit 06410c3 into main Nov 25, 2026
2 checks passed
GordonYuanyc added a commit that referenced this pull request Nov 25, 2026
… plan

Step 6b of #267 (decisions D11, D12), stacked on 6a (#269):

- prometheus_api holds what the end-to-end systems share: the Remote
  Write encoder and sending (moved from systemeval, with a request built
  from harness samples) and the PromQL instant query over HTTP (moved
  from systemeval's query module, with extra parameters such as
  nocache=1). systemeval uses them from there; its output is unchanged.
- systemeval::asapquery_backend_server: ASAPQuery-backend as an engine
  under test. It writes each refresh chunk by Remote Write, closes the
  panes through the chunk end (watermark), and asks each query's PromQL.
  It takes no plan file and one arm per server start.
- The VictoriaMetrics adapter runs an arm with no plan file (a
  plans: false variant) the normal way: Remote Write, force_flush, the
  query's MetricsQL or PromQL text with nocache=1; the workload's metrics
  are deleted at install and at drop. Its cgroup and config file are
  optional; a plan arm still needs both.
- benchmark-external run takes --engine asapquery-backend with
  --asapquery-backend-url.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GordonYuanyc added a commit that referenced this pull request Nov 25, 2026
… plan (#270)

* system-bench: ASAPQuery-backend adapter and VictoriaMetrics without a plan

Step 6b of #267 (decisions D11, D12), stacked on 6a (#269):

- prometheus_api holds what the end-to-end systems share: the Remote
  Write encoder and sending (moved from systemeval, with a request built
  from harness samples) and the PromQL instant query over HTTP (moved
  from systemeval's query module, with extra parameters such as
  nocache=1). systemeval uses them from there; its output is unchanged.
- systemeval::asapquery_backend_server: ASAPQuery-backend as an engine
  under test. It writes each refresh chunk by Remote Write, closes the
  panes through the chunk end (watermark), and asks each query's PromQL.
  It takes no plan file and one arm per server start.
- The VictoriaMetrics adapter runs an arm with no plan file (a
  plans: false variant) the normal way: Remote Write, force_flush, the
  query's MetricsQL or PromQL text with nocache=1; the workload's metrics
  are deleted at install and at drop. Its cgroup and config file are
  optional; a plan arm still needs both.
- benchmark-external run takes --engine asapquery-backend with
  --asapquery-backend-url.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* system-bench: apply the independent review of the end-to-end adapters

- Answers of an arm without a plan follow the harness's keys:
  prometheus_api::query_text_arm drops __name__ unless the query is a
  bare selector, keeps non-finite values and refuses two answers for one
  series, as the plan arm does; both adapters use it.
- Each chunk is written in time order (as systemeval does), so a later
  metric of the chunk does not move the server's watermark past an
  earlier one.
- ASAPQuery-backend's footprint reads asap_view_bytes and
  asap_raw_data_bytes from /metrics; its adapter moves to engines_external
  beside the other server adapters, and both adapters need a cgroup again.
- VictoriaMetrics: the stream-aggregation config is needed only by arms
  with a plan file (the flag is optional); one connection type
  (VictoriaMetricsConnection, formerly Http) with one force_flush.
- Tests: __name__, NaN, duplicates, write order over three batches, a busy
  answer, the footprint, one VictoriaMetrics arm at a time, the fake
  engine refusing server flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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