refactor: align theta view and coupon naming#165
Open
tisonkun wants to merge 2 commits into
Open
Conversation
tisonkun
marked this pull request as ready for review
July 25, 2026 15:36
tisonkun
commented
Jul 25, 2026
| /// becomes the 6-bit register value. | ||
| #[inline(always)] | ||
| pub fn from_hash<T: Hash>(v: T) -> Self { | ||
| pub fn from_value<T: Hash>(value: T) -> Self { |
Member
Author
There was a problem hiding this comment.
Renames
Coupon::from_hash(value)toCoupon::from_value(value). The method hashes its generic input internally, so from_hash incorrectly implied that callers supplied an already-computed hash.
cc @notfilippo is this rename reasonable?
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.
Summary
This PR applies the two approved naming changes from the follow-up audit:
RawThetaSketchView::theta()totheta64()Coupon::from_hash()directly tofrom_value()(option 8B)The cached
seed_hashfields remain unchanged following the final decision on item 6. The raw-view visibility strategy (item 1) and changelog work (item 5) remain deferred.Commit-by-commit rationale
2aabb8a— Align the raw Theta threshold name. RenamesRawThetaSketchView::theta()totheta64()and updates every implementation and set-operation call site. The suffix makes the raw 64-bit threshold representation explicit and avoids conflating it with higher-level theta terminology. This is a naming-only change; threshold values and algorithms are unchanged.5baab5e— Name the Coupon constructor after its input. RenamesCoupon::from_hash(value)toCoupon::from_value(value)across the public API, documentation, examples, internal callers, and tests. The method hashes its generic input internally, sofrom_hashincorrectly implied that callers supplied an already-computed hash. Per option 8B, this is a direct rename without a deprecated compatibility alias.Compatibility notes
Both commits rename public methods. The changelog entry is intentionally deferred until the release review requested in item 5.
Validation
cargo x testcargo x lintgit diff --check origin/main...HEADmain(including refactor: align seed and internal naming #164)