From 9c1c353e53fa53ba10740121f913e1b3f9dac401 Mon Sep 17 00:00:00 2001 From: Tristan Su Date: Thu, 30 Jul 2026 19:50:17 +0800 Subject: [PATCH] Fix stale bit-layout comment in HashBucketEntry 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. --- .../Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs b/libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs index 3ce675dc325..7da85786a1f 100644 --- a/libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs +++ b/libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs @@ -9,8 +9,9 @@ namespace Tsavorite.core { - // Long value layout: [1-bit tentative][13-bit TAG][50-bit address] - // Physical little endian memory layout: [50-bit address][13-bit TAG][1-bit tentative] + // Long value layout: [1-bit tentative][15-bit TAG][48-bit address] + // Physical little endian memory layout: [48-bit address][15-bit TAG][1-bit tentative] + // The top bit of the 48-bit address is the readcache indicator (see LogAddress). [StructLayout(LayoutKind.Explicit, Size = 8)] internal struct HashBucketEntry {