Skip to content

Fix stale bit-layout comment in HashBucketEntry - #2000

Open
foobar wants to merge 1 commit into
microsoft:mainfrom
foobar:fix/hashbucket-entry-layout-comment
Open

Fix stale bit-layout comment in HashBucketEntry#2000
foobar wants to merge 1 commit into
microsoft:mainfrom
foobar:fix/hashbucket-entry-layout-comment

Conversation

@foobar

@foobar foobar commented Jul 30, 2026

Copy link
Copy Markdown

Summary

The layout comment atop HashBucketEntry.cs claimed [1-bit tentative][13-bit TAG][50-bit address],
but kAddressBits = 48 (LogAddress.cs), so kTagSize = 63 - kAddressBits = 15.
The actual layout is [1-bit tentative][15-bit TAG][48-bit address]. The top bit of the
48-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.

Copilot AI review requested due to automatic review settings July 30, 2026 11:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 LogAddress for 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
foobar force-pushed the fix/hashbucket-entry-layout-comment branch from ae10d4b to 9c1c353 Compare July 31, 2026 00:43
@foobar
foobar requested a review from Copilot August 1, 2026 00:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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.

2 participants