Skip to content

refactor!: finish #209 — runtime strings, Coco (rows, cols), L2HH removal, deletions, merges, refactors, doc fixes - #240

Merged
GordonYuanyc merged 11 commits into
mainfrom
p3/finish
Oct 20, 2026
Merged

GordonYuanyc merged 11 commits into
mainfrom
p3/finish

Conversation

@GordonYuanyc

Copy link
Copy Markdown
Collaborator

Closes #209. Part of #179. Follows #239.

  • Runtime strings (errors, panics, sketch_type()) spell the new names. Wire strings are unchanged.
  • Coco constructors take (rows, cols).
  • The L2HH enum is gone. CountSketchWithL2Norm lives in sketches::countsketch_l2_norm, its codec in countsketch_l2_norm/wire.rs.
  • Deleted: Kll::wire_k, precompute_sample2, common::hashspec and dead helpers.
  • Merged duplicates: UnivMon-Q update, estimate_g_sum, the quickstart and default dimensions, and the heap-size default.
  • Refactors: OwnedDataInput::as_data_input, DataInput::to_owned_input, UnivMonPool in univmon, kll::DEFAULT_M, Vector2D::filled, nitro_skip(&self).
  • Doc fixes:
    • Hash-path docs.
    • UnivMon total_weight.
    • Entropy units: bits for UnivMon, nats for UnivMon-Q.
    • Spec §3.15/§3.16: layers <= 19.
  • Review follow-ups for refactor(names)!: code-level renames (#209) #239: algorithm names restored in prose, stale names in docs, a CHANGELOG entry per section.

No wire change: asapv1_golden passes and is unchanged. Locally: cargo check, fmt, clippy with all features, the lib tests of the touched modules, and asapv1_golden.

🤖 Generated with Claude Code

GordonYuanyc and others added 11 commits October 20, 2026 05:48
Error, panic and assert messages, sketch_type() labels and test output
that named an old type, method or field from #209 now name the new one.
Algorithm names in prose and ASAPv1 wire strings are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CocoSketch::init_with_size(w, d) and init_with_size_and_seed(w, d, seed)
become with_dimensions(rows, cols) and with_dimensions_and_seed(rows,
cols, seed); CocoSketchWorker::new and with_seed take (rows, cols) too.
Every call site swaps its two arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… L2HH enum

UnivMon and UnivMonTwoTier hold CountSketchWithL2Norm layers directly.
The type and its ASAPv1 codec move to sketches::countsketch_l2_norm
(countsketch_l2_norm.rs, countsketch_l2_norm/wire.rs). No wire change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Algorithm names in prose say Count-Min, KLL and Count Sketch again; stale
old names in docs and comments (KLL constructors, EH bucket and Hydra
variants, bare Count) follow the renames; the CHANGELOG write-verb bullet
states the rule and the odd cases, and the Unreleased entries use current
names. The crate doc qualifies the legacy DTOs with portable::, Uniform keeps
a DEFAULT_SEED alias, and the Space-Saving debug assert says count again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kll::wire_k, PRECOMPUTED_SAMPLE_RATE_1PERCENT with common::precompute_sample2,
common::hashspec, Vector2D::get_row/get_col, HeapEntry::init_item and
CountSketchWithL2Norm::fast_update_and_est_without_l2 have no remaining
callers (wire_k callers use k()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UnivMonQ::update is generic over NumericalValue and replaces add;
UnivMon::estimate_g_sum is the recurrence itself, without the
calc_g_sum_heuristic alias. QUICKSTART_ROWS/COLS and DEFAULT_ROWS/COLS
come from fixed_structure, the heap-size default of 32 from common::heap,
and KllDynamic reads Kll's MAX_K.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OwnedDataInput::as_data_input and DataInput::to_owned_input replace the free
conversion functions; UnivMonPool moves into univmon; the private
find_bottom_layer_num wrappers are inlined as UnivMon::bottom_layer_for_hash;
heap_count_from_estimate is pub(crate); KLL names its default m DEFAULT_M;
Vector2D::filled replaces the unfilled + fill(0) pairs; nitro_skip takes &self.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FastPath/RegularPath, MatrixFastHash and FastPathHasher describe the
hashing they select; UnivMon and UnivMonTwoTier total_weight is the total
inserted weight; UnivMon entropy is in bits and UnivMon-Q entropy in nats;
spec rule 3 of 3.15/3.16 bounds layers by 19, as UNIVMON_MAX_LAYERS does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/api pages take their type's name in snake_case (api_count_min_sketch,
api_count_min_sketch_with_heap, api_eh_bucket_sketch,
api_exponential_histogram_univmon, api_univmon_two_tier, ...);
hhheap_acceleration.md and the hhheap_probe example become topk_heap_*;
message_pack_format::native::countsketch_topk becomes countsketch_l2_norm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test functions that spelled a renamed write verb or type (insert,
bulk_insert, insert_many, CMSHeap, CSHeap, CountL2HH, FoldCMS/FoldCS,
EHSketchList, EHUnivOptimized, UnivMonPyramid, CmDelta, HllDelta, the
*_PROMASK constants, ...) use the new names; docs/tests.md follows.
Test names that name a golden file keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CocoOctoWorker, CocoOctoAggregator and CocoOctoPlan constructors take
(rows, cols), as CocoSketch::with_dimensions does;
CocoSketchWorker::width()/depth() -> cols()/rows().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc merged commit f3f4cb8 into main Oct 20, 2026
6 checks passed
@GordonYuanyc
GordonYuanyc deleted the p3/finish branch October 20, 2026 06:05
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.

Code-level names

1 participant