Repository navigation
deps: asap_sketchlib 0.3.0 (capacity-independent top-k heap) - #183
Merged
Merged
Conversation
asap_sketchlib 0.2.2's HHHeap rebuilt its key index after every accepted update, so CMSHeap/CSHeap inserts cost O(k) in the heap capacity; 0.3.0 (asap_sketchlib#107) patches the index through each sift. With #182 sizing top-k heaps to m·k, the 0.2.2 cost grew with every merged window. - Pin asap_sketchlib 0.3.0 (aqpbm-planeval already used it). - Hydra: 0.3.0 fixes a grid's key columns at construction (with_schema) and queries positionally. hydra_shared's new_hydra/update/query/merge set the schema from the first record (one column per ';'-joined label), constrain the probe's leading label columns (the scored subpopulations group by column 0) and skip shards that saw no record. A probe now matches its column only, not an equal value in another label column. - DDSketch::merge now returns a Result; the wrappers expect it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
From the first review of #183: - build_hydra_* take the stream's label-column count (its first record's, label_columns) and new_hydra builds the schema once. The placeholder schema, the rebuild on the first update and the clone-on-empty merge are gone; grids built from one ParamSet and stream merge as before. - A record keeps an empty label in its own column (no dropped segments shifting the rest). A record or probe of another width is refused, naming the variant and both widths, instead of being resized. - A zero label-column count is a BuildError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
…idth checked at build From the second review of #183: - aqpbm_core::hh_heap_bytes(capacity, item_bytes): what 0.3's HHHeap holds per resident, the HHItem, its u64 digest (slots) and its share of the position index (hashbrown buckets at 7/8 load, power of two, each a u64 digest, a SmallVec<[usize; 2]> and a control byte). cms_heap, cs_heap, UnivMon and aqpbm-planeval use it in place of heap x HHItem. - aqpbm-planeval takes the workspace asap_sketchlib; stale 0.2.2 notes fixed (planeval Cargo.toml, hydra_kll). - build_hydra_* check every record's label width and return a BuildError naming the variant and both widths; the in-closure panic is a backstop. - polars_shared says its baseline keeps 0.2.2's any-column subset keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
Collaborator
Author
zzylol
added a commit
that referenced
this pull request
Oct 7, 2026
… in the planning flow From review on #181: - skew_summary.csv's kind, weight and range columns, and how ranges map onto data_shape (keyed by grouping: the worst case over its RAQEs' ranges). - A 'Fanning out over machines' section and scripts/merge_study_parts.py, which concatenates per-machine run directories, refusing a point in two parts. - Brought up to date: top-k needs no merge curves (heap m·k, #182), the guarantee fallback is merged (#180), main is through #183. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
zzylol
added a commit
that referenced
this pull request
Oct 11, 2026
…181) * docs: end-to-end planning flow from traces to an rqe-optimizer plan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: kind/weight/range and data_shape, fanning out, and #180/#182/#183 in the planning flow From review on #181: - skew_summary.csv's kind, weight and range columns, and how ranges map onto data_shape (keyed by grouping: the worst case over its RAQEs' ranges). - A 'Fanning out over machines' section and scripts/merge_study_parts.py, which concatenates per-machine run directories, refusing a point in two parts. - Brought up to date: top-k needs no merge curves (heap m·k, #182), the guarantee fallback is merged (#180), main is through #183. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
GordonYuanyc
added a commit
that referenced
this pull request
Oct 23, 2026
Brings phase2-ver3 up to main at a3753f2 (#226). The repository squash-merges pull requests, so main is unchanged and this branch lands as one commit. Conflicts and how they were resolved: - aqpbm-datagen: the branch moved the crate's tests out of lib.rs into the modules they test and replaced mix_connected_bits with splitmix64::finalize; main added child_of, fan_out, scale_by and scale_range (#197), the Pareto distribution and their tests in lib.rs. The moved tests stay in their modules. lib.rs keeps only the 17 tests and helpers main added, all of them, and imports the shared helpers from test_support, which now fills the four new ColumnSpec fields. main's scale_by hash calls splitmix64::finalize, the same function as mix_connected_bits. 50 tests, as on main, none duplicated. - aqpbm-planeval: the branch removed the old in-process evaluator, so main's edit to src/handle.rs (#183) is dropped with it and the branch's Cargo.toml is kept. The harness fills the new ColumnSpec fields. - Cargo.lock: main's lockfile, with the branch's dependencies added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In asap_sketchlib 0.2.2,
HHHeap::updaterebuilt its key index after every accepted update. That madeCMSHeap/CSHeapinserts O(k) in the heap capacity. 0.3.0 (asap_sketchlib#107) patches the index through each sift, so inserts no longer depend on capacity. Since #182 sizes top-k heaps to m·k, the 0.2.2 cost grew with every merged window and would have dominated the top-k cost table.CMSHeap3×256 FastPath, 1e6 Zipf(1.1) inserts over 1e4 keys, measured on clnode138:What
asap_sketchlib = 0.3.0(aqpbm-planeval already used it).with_schema) and queries positionally (&[Option<&str>]).build_hydra_*take the stream's label-column count (its first record's), andnew_hydrabuilds the schema once.updatekeeps every;-joined label in its column, empty labels included.queryconstrains the probe's leading columns (the scored subpopulations group by column 0) and leaves the rest open.BuildError.DDSketch::mergenow returns aResult; the wrappersexpectit.HHHeapholds per resident, via one helperaqpbm_core::hh_heap_bytes(capacity, size_of::<HHItem>()):capacity · (HHItem + 8 B digest) + hash_buckets(capacity) · 33 B, wherehash_bucketsis the next power of two of⌈capacity/7⌉·8and each bucket holds a u64 digest, aSmallVec<[usize; 2]>and a control byte. Used by cms_heap, cs_heap, UnivMon and aqpbm-planeval (which adds string keys' own bytes).asap_sketchlib.BuildErrornaming the variant and both widths.Known behavior changes (Hydra, not measured in the optimizer)
query_keyalso queries the empty template on every probe, so Hydra's query cost changes.;splits into extra columns, and the record is refused.group_columnsother than 0 would be misread.HHItems only.Verification
cargo clippy --all-targets -D warningsandcargo fmt --checkare clean.cargo testpasses for sketch-bench (92), aqpbm-core (94), aqpbm-cli, rqe-optimizer (74) and aqpbm-datagen (40), including the Hydra wrappers' own tests and new ones for a record of another width and an empty label.test_study_saturation,test_export_autosketch_eval_table) pass.Follow-up
Rerun
study_saturation.py --phase optimizer-coston an idle machine to price top-k at heaps 32/128/512/2048 on 0.3.0.🤖 Generated with Claude Code