Skip to content

refactor: align theta view and coupon naming#165

Open
tisonkun wants to merge 2 commits into
mainfrom
codex/theta-view-coupon-naming
Open

refactor: align theta view and coupon naming#165
tisonkun wants to merge 2 commits into
mainfrom
codex/theta-view-coupon-naming

Conversation

@tisonkun

Copy link
Copy Markdown
Member

Summary

This PR applies the two approved naming changes from the follow-up audit:

  • rename RawThetaSketchView::theta() to theta64()
  • rename Coupon::from_hash() directly to from_value() (option 8B)

The cached seed_hash fields 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

  1. 2aabb8aAlign the raw Theta threshold name. Renames RawThetaSketchView::theta() to theta64() 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.
  2. 5baab5eName the Coupon constructor after its input. Renames Coupon::from_hash(value) to Coupon::from_value(value) across the public API, documentation, examples, internal callers, and tests. The method hashes its generic input internally, so from_hash incorrectly 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

@tisonkun
tisonkun marked this pull request as ready for review July 25, 2026 15:36
/// 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 {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renames Coupon::from_hash(value) to Coupon::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?

@tisonkun
tisonkun requested a review from notfilippo July 25, 2026 15:43
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