Fix stale bit-layout comment in HashBucketEntry - #2000
Open
foobar wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the bit-layout documentation comment for HashBucketEntry in Tsavorite to match the current LogAddress.kAddressBits = 48 definition and the derived tag sizing logic used by the struct.
Changes:
- Corrected the described layout from
[1-bit tentative][13-bit TAG][50-bit address]to[1-bit tentative][15-bit TAG][48-bit address]. - Updated the “physical little endian memory layout” line to reflect the corrected field widths.
- Added a note pointing to
LogAddressfor the readcache-indicator bit in the address field.
The layout comment claimed [1-bit tentative][13-bit TAG][50-bit address], but kAddressBits is 48 (LogAddress.cs), so kTagSize = 63 - kAddressBits = 15. Update to [1-bit tentative][15-bit TAG][48-bit address] and note the readcache indicator occupies the top bit of the 48-bit address.
foobar
force-pushed
the
fix/hashbucket-entry-layout-comment
branch
from
July 31, 2026 00:43
ae10d4b to
9c1c353
Compare
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
The layout comment atop
HashBucketEntry.csclaimed[1-bit tentative][13-bit TAG][50-bit address],but
kAddressBits = 48(LogAddress.cs), sokTagSize = 63 - kAddressBits = 15.The actual layout is
[1-bit tentative][15-bit TAG][48-bit address]. The top bit of the48-bit address is the readcache indicator (already documented in
LogAddress.cs); added a pointer here.Change
Comment-only — updated the two layout lines and added the readcache-indicator note. No code/behavior change.
Verified: kTagSize = 63-48 = 15; kTagShift = 48 (TAG = bits 48–62); tentative = bit 63; address = bits 0–47.