Skip to content

feat(vector3d, count-hll): fill in Vector3D + per-bucket-HLL CountHll sketch#62

Open
GordonYuanyc wants to merge 2 commits into
mainfrom
feat/vector3d-count-hll
Open

feat(vector3d, count-hll): fill in Vector3D + per-bucket-HLL CountHll sketch#62
GordonYuanyc wants to merge 2 commits into
mainfrom
feat/vector3d-count-hll

Conversation

@GordonYuanyc

Copy link
Copy Markdown
Collaborator

What

  • Vector3D — fleshed out the stub to full Vector2D parity: a rows × cols grid where each (row, col) cell is a depth-length bucket. Adds init/from_fn/fill, element + bucket accessors, fast_insert, the fast_query_min/median/max[_with_key] + aggregate family over bucket slices, Nitro hooks, custom serde (recomputes col mask), Index/IndexMut.
  • CountHll — a Count Sketch grid whose cells are per-bucket HyperLogLogs (Vector3D<u8>, depth = 2^precision). Each item is routed to one column per row and recorded in that bucket's HLL. Exposes estimate() (per-key distinct, median across rows) and estimate_total_cardinality() (per-row partition sum), plus register-max merge and msgpack serde. HLL register/rank + classic estimator mirror sketches::hll.

API impact

Purely additive — Vector3D had no real callers; only a new module + re-export were added. No existing API changed.

Checks

  • cargo fmt --all -- --check clean
  • New code is clippy-clean (workspace has pre-existing uninlined_format_args lint debt in unrelated files, unaffected by this PR)
  • cargo test --all-features --locked: 489 lib + integration tests pass

🤖 Generated with Claude Code

GordonYuanyc and others added 2 commits June 12, 2026 19:18
… sketch

Flesh out the Vector3D<T> stub to full Vector2D parity: a rows x cols grid
where each (row, col) cell is a contiguous `depth`-length bucket. Adds
init/from_fn/fill, element + bucket accessors, fast_insert, the
fast_query_min/median/max[_with_key] + aggregate family over bucket slices,
Nitro hooks, custom serde (recomputes col mask), and Index/IndexMut.

Add CountHll<H>: a Count Sketch grid whose cells are per-bucket HyperLogLog
sketches (Vector3D<u8>, depth = 2^precision). Each item is routed to one
column per row and recorded in that bucket's HLL. Supports estimate() (per-key
distinct count, median across rows) and estimate_total_cardinality() (per-row
column partition sum), plus register-max merge and msgpack serde. The HLL
register/rank math and classic estimator mirror sketches::hll.

Purely additive: Vector3D had no real callers, and only a new module + re-export
were added. No existing API changed. fmt clean; new code is clippy-clean; all
489 lib + integration tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cargo doc --no-deps -D warnings rejected [`Vector3D<u8>`] because rustdoc
cannot resolve a path containing generics. Give the link an explicit target
(crate::Vector3D) so the display text keeps the generic. Doc-comment only;
no API change.

Co-Authored-By: Claude Opus 4.8 <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.

1 participant