Repository navigation
refactor(hydra)!: ASAPv1 only — drop proto and portable HydraKLL, add goldens - #171
Closed
GordonYuanyc wants to merge 2 commits into
Closed
GordonYuanyc wants to merge 2 commits into
GordonYuanyc wants to merge 2 commits into
Conversation
Hydra serializes as ASAPv1 only. Remove the portable HydraKllSketch and HydraKllSketchWire, hydra/hydra.proto (HydraState, HydraCell, HydraCounterType) and SketchEnvelope's hydra field (16, now reserved), with the tests, example section and docs that used them. The two portable property laws give way to a KLL-counter ASAPv1 round-trip law on the native Hydra. Add ASAPv1 golden fixtures for all five Hydra counter variants (0x07 0x00-0x07 0x04), bumping asapv1_golden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
State no fixture count; point at asapv1_golden/README.md's Coverage section. The cross-language proto test reads eight envelope files. The CHANGELOG entry notes that native Hydra routes subkeys differently from HydraKllSketch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
Collaborator
Author
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.
Part of the ASAPv1-only series: one PR per sketch group, each off
main. This one removes Hydra's protobuf format and the portableHydraKllSketch; ASAPv1 (0x07 0x00–0x07 0x04) is the only Hydra format left, and all five counter variants get goldens.Draft because of the downstream question below.
Removed
proto/hydra/hydra.proto(HydraState,HydraCounterType,HydraCell);SketchEnvelope.hydra(16) is nowreserved 16; reserved "hydra";.KLLState,CountSketchState,CountMinState,HyperLogLogState,UnivMonStatestay (other sketches onmainstill use them).message_pack_format::portable::hydra_kll:HydraKllSketch(incl.update,quantile,merge_refs,aggregate_hydrakll,MessagePackCodec),HydraKllSketchWire; crate-root re-exportHydraKllSketch.Added
hydra_kll_2x2_k200,hydra_cm_2x2_counter_2x2,hydra_cs_2x2_counter_2x2,hydra_hll_1x2_p14(registers set via crafted hashes, asserted),hydra_univmon_1x2(cells, heaps, total weight and an incomplete layer set through public setters). Each is checked in both directions. The reviewer hand-decoded all five against spec §3.9.Open question
HydraKllSketchis a production type: ASAPQuery uses it in memory and ASAPQuery-backend writes it with portableto_msgpack. Its nearest replacement, nativeHydrawith a one-column schema overHydraCounter::KLL, routeslabel:valuesubkeys through the matrix hash atHYDRA_SEEDinstead ofxxh32(key, row) % cols. Stored HydraKLL data therefore cannot be mapped cell for cell; the backend and ASAPQuery must switch together and old data becomes unreadable. The CHANGELOG says so.Verification (rustc 1.99)
cargo fmt --check; clippy-D warningsfor all four CI feature sets;RUSTDOCFLAGS="-D warnings" cargo doc; gen-proto drift clean; filtered tests (asapv1_golden,pbt -- hydra::,--lib -- hydra,msgpack_compat,xtest_consumer,e2e -- quantiles). Implemented and reviewed by separate agents; review findings are addressed in the second commit.🤖 Generated with Claude Code