Skip to content

feat(deploy): paper baseline matrix (B0 raw / B1 Serf / B2 full / B3 delta / B4 tunable window) - #176

Merged
zzylol merged 1 commit into
mainfrom
feat/baseline-matrix-b0-b4
Apr 21, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/baseline-matrix-b0-b4

Conversation

@zzylol

@zzylol zzylol commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the five paper §6.2 baselines as agent-pipeline configs + compose overlays. Same `asap/sketchcol:dev` binary serves all of them; only the mounted config + env differ.

Baseline Config Mechanism
B0 raw OTel `sketchcol-agent-b0-raw.yaml` No sketching, no compression
B1 Serf `…-b1-serf.yaml` Gorilla-style XOR compression to local tmpfs (requires serfprocessor in sketchcol — added to builder-config.yaml)
B2 full sketch `…-b2-full.yaml` DDSketch + HLL, `transmit_sketch:true, mode:batch` (today's default)
B3 delta sketch `…-b3-delta.yaml` Same sketches, `mode:window, window_duration:60s, delta_transmission:true`
B4 tunable window `…-b4-tunable.yaml` Same as B3 but `window_duration: ${env:SKETCH_WINDOW}` — sweep 5s/30s/60s/300s

Switching:
```
AGENT_CONFIG=sketchcol-agent-b3-delta.yaml \
docker compose -f base.yml -f agents-N1.yml -f baseline-b3-delta.yml up -d

SKETCH_WINDOW=10s AGENT_CONFIG=sketchcol-agent-b4-tunable.yaml \
docker compose -f base.yml -f agents-N1.yml -f baseline-b4-tunable.yml up -d
```

Test plan

  • All 5 compose compositions parse clean (`docker compose config --quiet` for each).
  • Sketchcol rebuilt with serfprocessor; `docker run asap/sketchcol:dev components` lists serf alongside DDSketch/HLL/KLL/countsketch/countmin.
  • B3 delta live-validated at N=1: DDSketch input 1.31 GiB, output 3.21 MiB per window → 408× bandwidth reduction. vs B2's 177% output/input ratio, B3 is ~720× smaller per flush.
  • B0/B1 not yet live-validated end-to-end — would follow during paper eval runs.

🤖 Generated with Claude Code

                B3 delta / B4 tunable window)

Adds the five baselines paper §6.2 compares head-to-head. Each
baseline is one agent-pipeline YAML + one compose overlay; the
same asap/sketchcol:dev binary serves all of them — only the
mounted config + env differ.

  * B0 raw OTel (`sketchcol-agent-b0-raw.yaml`): OTLP →
    batch → OTLP. Control — no sketching, no compression.
  * B1 Serf (`…-b1-serf.yaml`): Gorilla-style XOR compression
    written to local tmpfs. Rebuild sketchcol to include
    `serfprocessor` (added to builder-config.yaml).
  * B2 full sketch (`…-b2-full.yaml`): DDSketch + HLL,
    `transmit_sketch: true, mode: batch`. Today's default.
  * B3 delta sketch (`…-b3-delta.yaml`): same sketches,
    `mode: window, window_duration: 60s,
    delta_transmission: true`. Wire payload = sparse diff
    of only-changed buckets since last flush.
  * B4 tunable window (`…-b4-tunable.yaml`): same as B3 but
    `window_duration: ${env:SKETCH_WINDOW}` — sweep 5s / 30s /
    60s / 300s without rebuilding.

Switching baselines:

  AGENT_CONFIG=sketchcol-agent-b3-delta.yaml \
    docker compose -f base.yml -f agents-N1.yml \
      -f baseline-b3-delta.yml up -d

  SKETCH_WINDOW=10s \
    AGENT_CONFIG=sketchcol-agent-b4-tunable.yaml \
    docker compose -f base.yml -f agents-N1.yml \
      -f baseline-b4-tunable.yml up -d

The `AGENT_CONFIG` env var threads through agents-N*.yml's
mounted config path. `SKETCH_WINDOW` is plumbed to every agent
by gen-agents.sh (default 60s). Baseline overlays are thin
naming markers that stamp `controller.labels.asap.baseline`;
all five coexist so a single bring-up run can identify its
baseline from `docker inspect`.

sketchcol binary rebuild required (binary bundles serfprocessor
now). Host build chain unchanged — see Dockerfile.sketchcol
header for the submodule + sketchlib-go sibling prereqs.

Live-validated B3 at N=1 after one 60s window flush:
  * DDSketch input = 1.31 GiB, output = 3.21 MiB → **408×
    bandwidth reduction** on the wire.
  * Compared to B2 (same workload, full-sketch batch mode):
    output/input ratio was 177% — B3 is ~720× smaller per
    window-flush than B2.

Follow-up before the full eval:
  * Paper §6.4 accuracy comparison between B2 and B3 needs the
    backend's sketch-reconstitution path to handle delta wire-
    format — existing `sketchlib-go` delta codec work
    (Phase 1 packed arrays) covers this.
  * `fake-exporter` could emit a more faithful Google-trace
    replay instead of synthetic log-normal — DC TODO #4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 19ea89b into main Apr 21, 2026
@zzylol
zzylol deleted the feat/baseline-matrix-b0-b4 branch April 21, 2026 22:07
zzylol added a commit that referenced this pull request Apr 22, 2026
Adds two small stdlib-only scripts for the paper §6 eval:

  deploy/scripts/measure-baseline.py
    One-shot Prometheus query → single-row CSV with every
    §6.2 / §6.3 signal: per-agent CPU + RSS + input/output
    bytes, gateway CPU + RSS + points + out-series, backend
    ingest rate + query P99, plus backend CPU/RSS via
    `docker stats` (the backend doesn't self-report them).

  deploy/scripts/run-baseline-sweep.sh
    Iterates (baseline × rate × cardinality) triples,
    bringing the stack up/down for each combo, soaking,
    calling measure-baseline.py, and concatenating into a
    single CSV. Overrides via env: BASELINES / SCALE /
    RATES / CARDS / SOAK_S.

Query-shape notes worth the comment blocks in the script:
  * Agent side (v0.141): counters have `_total` suffix
    (`otelcol_process_cpu_seconds_total`,
    `otelcol_receiver_accepted_metric_points_total`). Prefer
    these — the patched-processor `otelcol_datacollector_processor_*`
    family gives finer per-processor breakdown but only
    exists on sketch baselines (B2/B3/B4), so the universal
    `otelcol_process_*` covers B0/B1/B5 too.
  * Gateway (v0.108): no `_total` suffix on process/receiver
    metrics. Duplicated queries aren't accidental.
  * Per-baseline NaN columns are semantically correct and
    not a script bug: e.g. B5 Gorilla `agent_in_kib_per_s`
    is NaN because gorillaprocessor isn't ASAP-patched and
    thus doesn't emit `otelcol_datacollector_processor_*`.

Live-validated at N=1 with a 75 s B2 soak, 2 min rate window:
  * Agent CPU 0.44 cores, RSS 474 MiB
  * Agent in/out 1.46 MiB/s / 73.2 MiB/s (50× sketch-state
    expansion vs raw, matching PR #176 B2 numbers)
  * Gateway 0.09 cores, 226 MiB, 8617 points/s in
  * Backend ingest 8792 samples/s
  * All 16 CSV columns populate for the B2 row.

Co-authored-by: Claude Opus 4.7 (1M context) <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