Repository navigation
polars: tag Hydra baseline subset keys by column (#74) - #195
Merged
Merged
Conversation
The polars exact baselines keyed a label subset by its `;`-joined values,
asap_sketchlib 0.2.2's subkey. 0.3.0's Hydra tags each value with its
column (`label0:a;label1:b`), so on label columns that share a value
domain the baseline merged a key1 group with the same key2 group and
scored nonzero against itself. subset_key now builds the 0.3.0 key over
hydra_shared's `label{i}` schema (escaping `\`, `:` and `;`), empty
labels keep their column, and every lookup goes through it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
…mment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
zzylol
force-pushed
the
74-polars-tagged-subkeys
branch
from
October 11, 2026 16:35
912c3ab to
4149b7e
Compare
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.
Closes #74. This is PR 1 of the Hydra measurement plan in #193 (
docs/rqe_optimizer_hydra.md§5.2).Problem. asap_sketchlib 0.3.0's Hydra keys each label subset by column (
label0:abc;label1:x), so equal values in different label columns never alias in the sketch. Thepolarsexact baselines still built 0.2.2's untagged key (abc;x). On label columns that share a value domain, such asconfigs/datagen/hydra_columns.yaml's shared alphabet, they merged a key1 group with the key2 group of the same value. As a result the exact rows scored nonzero.Change
polars_shared::subset_keybuilds the 0.3.0 subkey overhydra_shared'slabel{i}schema, escaping\,:and;as the library does.prefix_keyis the lookup for a probe of the leading columns, and every polars lookup uses it: frequency, cardinality, univmon and hydra-kll.Tests
subset_keys_tag_each_value_with_its_column.a_value_shared_by_two_columns_is_counted_once: recordsa;aanda;b. Groupain column 0 holds 2 records; the old key counted 3.cargo test -p sketch-benchpasses (98), as do fmt and clippy.Evidence. These are the polars rows on the shared-alphabet data:
hydra_columns.yaml, and its_f64version for KLL. Grids: cms 3×128 with 3×512 cells, hll 3×128, kll 3×64 with k=200.--operations query --metrics accuracy.hydra-cmspolarsare_all0.596,aae_all3.74hydra-hllpolarsare_all0.249,aae_all56.8hydra-kllpolarsmean_rank_err0.00093,max_rank_err0.036🤖 Generated with Claude Code
https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis