Skip to content

docs(asapv1): metadata key names; SetAggregator delta at 08 80 - #217

Merged
GordonYuanyc merged 1 commit into
mainfrom
asapv1-p1/wire-names
Oct 11, 2026
Merged

GordonYuanyc merged 1 commit into
mainfrom
asapv1-p1/wire-names

Conversation

@GordonYuanyc

Copy link
Copy Markdown
Collaborator

Closes #187. Part of #179.

Spec only: docs/asapv1_wire_format.md. Rust and Go code, the API docs and the golden files follow in phase 2.

What the bytes changes reach

  • Golden files regenerated (18): the 5 CMSHeap, 1 CSHeap, 3 UnivMon, 5 Hydra, 2 KLL with a seed, and 2 SetAggregator delta files.
  • ExponentialHistogram and EHSketchList carry a nested sketch's metadata verbatim, so they change wherever they hold a UnivMon or a seeded KLL.
  • Stored or sent downstream:
    • ASAPQuery-backend persists UnivMon summaries as ASAPv1 in its on-disk SketchStore parts.
    • ASAPCollector-public writes seed into KLL frames when its OTAP KLL sketch is configured with a seed.

1. Metadata keys

Sketch Key today New key What it holds
CMSHeap, CSHeap k heap_size how many entries the top-k heap keeps
UnivMon, UnivMon Optimized layer_size layers number of layers
UnivMon sketch_row, sketch_col rows, cols rows and columns of every layer's sketch
UnivMon Optimized elephant_row, elephant_col, mouse_row, mouse_col elephant_rows, elephant_cols, mouse_rows, mouse_cols rows and columns of the elephant-tier and mouse-tier sketches
UnivMon-Q candidates heap_size how many entries each terminal stratum's candidate heap keeps
UnivMon-Q levels layers number of layers
UnivMon-Q depth, width rows, top_layer_cols rows of every layer's sketch; columns of the top layer's sketch
UnivMon-Q width_halving_period cols_halving_period layers between halvings of the column count
Hydra (KLL cells) counter_k, counter_m, counter_item_type cell_k, cell_m, cell_item_type the KLL in each grid cell
Hydra (Count-Min / Count Sketch cells) counter_rows, counter_cols, counter_type, counter_mode cell_rows, cell_cols, cell_counter_type, cell_mode the Count-Min or Count Sketch in each grid cell
Hydra (HLL cells) counter_precision cell_precision the HLL in each grid cell
Hydra (UnivMon cells) counter_layer_size, counter_sketch_row, counter_sketch_col, counter_heap_size, counter_key_type cell_layers, cell_rows, cell_cols, cell_heap_size, cell_key_type the UnivMon in each grid cell
KLL seed compaction_seed seed of the compaction RNG
HLL, Count-Min, Count Sketch, DDSketch sample_p admission_rate probability that an update is admitted

2. kind_id: SetAggregator delta moves from 09 00 to 08 80

A delta's kind_id is its state's kind_id with the top bit of the variant byte set. SetAggregator is 08 00, so its delta is 08 80. 09 00 is retired and never reassigned.

The spec also states that the seedlist in the hash_profile_id value is part of the fixed id, and writes UnivMon-Q's section in layers.

🤖 Generated with Claude Code

Renames the metadata keys listed in #187 so one concept has one key in
every kind: heap_size, layers, rows/cols, plural tier dimensions,
cell_* for Hydra cells, compaction_seed for KLL, admission_rate for the
sampling probability. SetAggregator delta moves to 08 80 and 09 00 is
retired. UnivMon-Q's section is written in layers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc merged commit 3fc3442 into main Oct 11, 2026
1 check passed
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.

ASAPv1: wire-visible names

1 participant