Skip to content

controller: sketch planner and agent config - #96

Merged
zzylol merged 4 commits into
mainfrom
debs_controller
Apr 1, 2026
Merged

zzylol merged 4 commits into
mainfrom
debs_controller

Conversation

@GnaneshGnani

@GnaneshGnani GnaneshGnani commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Controller changes so the planner and OpAMP agent can emit collector configs that match DEBS benchmark workloads: sketch family selection, parameters, optional sketch_type_override, and delta-related fields where applicable.

Files

  • controller/src/config/agent.rs — Maps internal SketchType to collector component identifiers in generated YAML; delta transmission / threshold blocks for supported sketches; HLL and KLL handling (e.g. KLL delta validation, HLL precision notes).
  • controller/src/planner/rules.rs — Chooses sketch type from workload hints (e.g. quantile vs cardinality vs frequency priority); default parameters for DDSketch, KLL, HLL precision bands, CountSketch / CountMinSketch rows, columns, epsilon/delta; window vs batch strategy from latency SLA.
  • controller/src/types.rssketch_type_override on workloads; extended SketchParams (CountSketch epsilon/delta, CountMin metric_name); AgentCollectorConfig fields for delta transmission aligned with the cost model path.

Context

Stacked on debs_benchmarking (docs + download script). Downstream PR adds datasets_eval/debs/benchmark/ and exercises POST /api/v1/plan with metric_name, aggregations, and time_window: "5m" as described in DEBS_2022/03_benchmark_methodology.md.

Testing

Run existing controller unit tests after merge; no change to HTTP API shape beyond richer config payloads where sketches apply.

@GnaneshGnani
GnaneshGnani requested a review from zzylol April 1, 2026 01:35
@zzylol
zzylol force-pushed the debs_controller branch from 58c791f to b173612 Compare April 1, 2026 18:46
zzylol added a commit that referenced this pull request Apr 1, 2026
SketchParams is now a tagged enum with per-sketch-type variants:
- DDSketch { relative_accuracy, quantiles }
- KLL { k, quantiles }
- HLL { precision }
- CountSketch { epsilon, delta }
- CountMinSketch { rows, cols, metric_name }

Each variant carries only its relevant fields — no more bag of
unrelated defaults.  DEFAULT_QUANTILE_GRID constant replaces the
hardcoded vec![…] in default_sketch_params_with_quantiles.

Also fixes 3 test failures from the PR #96 rebase: KLL/HLL processor
key casing, all_sketch_types test table, transmit_sketch default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol
zzylol changed the base branch from debs_benchmarking to main April 1, 2026 18:53
zzylol added a commit that referenced this pull request Apr 1, 2026
SketchParams is now a tagged enum with per-sketch-type variants:
- DDSketch { relative_accuracy, quantiles }
- KLL { k, quantiles }
- HLL { precision }
- CountSketch { epsilon, delta }
- CountMinSketch { rows, cols, metric_name }

Each variant carries only its relevant fields — no more bag of
unrelated defaults.  DEFAULT_QUANTILE_GRID constant replaces the
hardcoded vec![…] in default_sketch_params_with_quantiles.

Also fixes 3 test failures from the PR #96 rebase: KLL/HLL processor
key casing, all_sketch_types test table, transmit_sketch default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the debs_controller branch from 1a29abe to 82df925 Compare April 1, 2026 18:55
SketchParams is now a tagged enum with per-sketch-type variants:
- DDSketch { relative_accuracy, quantiles }
- KLL { k, quantiles }
- HLL { precision }
- CountSketch { epsilon, delta }
- CountMinSketch { rows, cols, metric_name }

Each variant carries only its relevant fields — no more bag of
unrelated defaults.  DEFAULT_QUANTILE_GRID constant replaces the
hardcoded vec![…] in default_sketch_params_with_quantiles.

Also fixes 3 test failures from the PR #96 rebase: KLL/HLL processor
key casing, all_sketch_types test table, transmit_sketch default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the debs_controller branch from 82df925 to 70e5d75 Compare April 1, 2026 19:01
All sketch parameter defaults are now loaded from a YAML config file
at startup via CONTROLLER_SKETCH_DEFAULTS env var (falls back to
compiled-in defaults when the file is absent or malformed).

Configurable parameters:
- quantile_grid: fallback quantile φ values
- ddsketch.relative_accuracy
- kll.min_k
- hll.precision_coarse, precision_fine, precision_threshold
- count_sketch.epsilon, count_sketch.delta
- count_min_sketch.rows, cols, metric_name

SketchDefaults struct flows: main.rs → CostModelPlanner →
RulesPlanner → build_sketch_params().  The old DEFAULT_CS_EPSILON /
DEFAULT_CS_DELTA / DEFAULT_QUANTILE_GRID constants are replaced by
the struct's Default impl.

Includes sketch_defaults.yaml example with all compiled-in defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the debs_controller branch from f97695d to 882c512 Compare April 1, 2026 19:10
…ch Go factories

SketchType::Display now outputs the exact component type strings that
the Go processor factories register (HLL, KLL, countmin) — eliminating
the separate collector_processor_component_id() function.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zzylol
zzylol merged commit a3a10cc into main Apr 1, 2026
@zzylol
zzylol deleted the debs_controller branch April 1, 2026 20:42
zzylol added a commit that referenced this pull request Apr 4, 2026
Rebased on latest main. Dropped stale controller changes (already on
main via PRs #96, #116, #117, #119).

Only benchmark tooling remains:
- replay.py: replay DEBS dataset through OTel collector
- run.py: orchestrate benchmark runs
- scrape.py: collect Prometheus metrics during run
- analyze.py: parse benchmark results
- compare.py: compare sketch results to ground truth
- summarize.py: generate summary tables
- ground_truth/: ground truth computation for accuracy checking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zzylol added a commit that referenced this pull request Apr 4, 2026
Rebased on latest main. Dropped stale controller changes (already on
main via PRs #96, #116, #117, #119).

Only benchmark tooling remains:
- replay.py: replay DEBS dataset through OTel collector
- run.py: orchestrate benchmark runs
- scrape.py: collect Prometheus metrics during run
- analyze.py: parse benchmark results
- compare.py: compare sketch results to ground truth
- summarize.py: generate summary tables
- ground_truth/: ground truth computation for accuracy checking

Co-authored-by: zz_y <zeyingz@umd.edu>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SieDeta pushed a commit that referenced this pull request Apr 17, 2026
* controller: sketch planner and agent config

* refactor: SketchParams flat struct → per-type enum

SketchParams is now a tagged enum with per-sketch-type variants:
- DDSketch { relative_accuracy, quantiles }
- KLL { k, quantiles }
- HLL { precision }
- CountSketch { epsilon, delta }
- CountMinSketch { rows, cols, metric_name }

Each variant carries only its relevant fields — no more bag of
unrelated defaults.  DEFAULT_QUANTILE_GRID constant replaces the
hardcoded vec![…] in default_sketch_params_with_quantiles.

Also fixes 3 test failures from the PR #96 rebase: KLL/HLL processor
key casing, all_sketch_types test table, transmit_sketch default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: YAML-configurable sketch defaults (SketchDefaults)

All sketch parameter defaults are now loaded from a YAML config file
at startup via CONTROLLER_SKETCH_DEFAULTS env var (falls back to
compiled-in defaults when the file is absent or malformed).

Configurable parameters:
- quantile_grid: fallback quantile φ values
- ddsketch.relative_accuracy
- kll.min_k
- hll.precision_coarse, precision_fine, precision_threshold
- count_sketch.epsilon, count_sketch.delta
- count_min_sketch.rows, cols, metric_name

SketchDefaults struct flows: main.rs → CostModelPlanner →
RulesPlanner → build_sketch_params().  The old DEFAULT_CS_EPSILON /
DEFAULT_CS_DELTA / DEFAULT_QUANTILE_GRID constants are replaced by
the struct's Default impl.

Includes sketch_defaults.yaml example with all compiled-in defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove collector_processor_component_id, fix Display to match Go factories

SketchType::Display now outputs the exact component type strings that
the Go processor factories register (HLL, KLL, countmin) — eliminating
the separate collector_processor_component_id() function.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: zz_y <zeyingz@umd.edu>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
SieDeta pushed a commit that referenced this pull request Apr 17, 2026
Rebased on latest main. Dropped stale controller changes (already on
main via PRs #96, #116, #117, #119).

Only benchmark tooling remains:
- replay.py: replay DEBS dataset through OTel collector
- run.py: orchestrate benchmark runs
- scrape.py: collect Prometheus metrics during run
- analyze.py: parse benchmark results
- compare.py: compare sketch results to ground truth
- summarize.py: generate summary tables
- ground_truth/: ground truth computation for accuracy checking

Co-authored-by: zz_y <zeyingz@umd.edu>
Co-authored-by: Claude Opus 4.6 (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.

2 participants