Skip to content

Finish migrating HCC to BitFields API - #14154

Closed
pdillinger wants to merge 2 commits into
facebook:mainfrom
pdillinger:hcc_bitfields3
Closed

pdillinger wants to merge 2 commits into
facebook:mainfrom
pdillinger:hcc_bitfields3

Conversation

@pdillinger

Copy link
Copy Markdown
Contributor

This change builds on #14027 and #13965 to complete migration
of the HyperClockCache implementation to using the hygienic BitFields API.
No semantic change in the implementation details is intended, just
greatly improving readability and safety of the code while maintaining
the same performance.

In more detail,

  • Refactor the main metadata atomic for each slot in an HCC table into
    SlotMeta using BitFields.
  • Extended BitFields APIs with some additional features, and renamed
    BlahTransform classes to BlahTransformer to resolve potential naming
    conflicts with member functions to create them.

Test Plan: for correctness, mostly existing tests. but also added tests
for new BitFields features. I especially ran local TSAN whitebox crash
test extensively which caught a couple of refactoring errors.

For performance, I verified with release builds of cache_bench, using
default options, that there was no noticeable/consistent difference
after all these HCC migrations vs. backing them out. That test was with
GCC 11 and -O2, which is a reasonable baseline for expected compiler
optimizations.

@meta-cla meta-cla Bot added the CLA Signed label Nov 27, 2025
@meta-codesync

meta-codesync Bot commented Nov 27, 2025

Copy link
Copy Markdown

@pdillinger has imported this pull request. If you are a Meta employee, you can view this in D87960540.

Summary: This change builds on facebook#14027 and facebook#13965 to complete migration
of the HyperClockCache implementation to using the hygienic BitFields API.
No semantic change in the implementation details is intended, just
greatly improving readability and safety of the code while maintaining
the same performance.

In more detail,
* Refactor the main metadata atomic for each slot in an HCC table into
SlotMeta using BitFields.
* Extended BitFields APIs with some additional features, and renamed
  BlahTransform classes to BlahTransformer to resolve potential naming
  conflicts with member functions to create them.

Test Plan: for correctness, mostly existing tests. but also added tests
for new BitFields features. I especially ran local TSAN whitebox crash
test extensively which caught a couple of refactoring errors.

For performance, I verified with release builds of cache_bench, using
default options, that there was no noticeable/consistent difference
after all these HCC migrations vs. backing them out. That test was with
GCC 11 and -O2, which is a reasonable baseline for expected compiler
optimizations.
@pdillinger
pdillinger marked this pull request as ready for review December 2, 2025 01:13
@pdillinger
pdillinger requested a review from xingbowang December 2, 2025 19:43

@xingbowang xingbowang 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.

LTGM

@meta-codesync

meta-codesync Bot commented Dec 30, 2025

Copy link
Copy Markdown

@pdillinger has imported this pull request. If you are a Meta employee, you can view this in D87960540.

@meta-codesync

meta-codesync Bot commented Dec 30, 2025

Copy link
Copy Markdown

@pdillinger merged this pull request in 1cc1df8.

doxtop pushed a commit to flyingw/rocksdb that referenced this pull request Apr 7, 2026
Summary:
This change builds on facebook#14027 and facebook#13965 to complete migration
of the HyperClockCache implementation to using the hygienic BitFields API.
No semantic change in the implementation details is intended, just
greatly improving readability and safety of the code while maintaining
the same performance.

In more detail,
* Refactor the main metadata atomic for each slot in an HCC table into
SlotMeta using BitFields.
* Extended BitFields APIs with some additional features, and renamed
  BlahTransform classes to BlahTransformer to resolve potential naming
  conflicts with member functions to create them.

Pull Request resolved: facebook#14154

Test Plan:
for correctness, mostly existing tests. but also added tests
for new BitFields features. I especially ran local TSAN whitebox crash
test extensively which caught a couple of refactoring errors.

For performance, I verified with release builds of cache_bench, using
default options, that there was no noticeable/consistent difference
after all these HCC migrations vs. backing them out. That test was with
GCC 11 and -O2, which is a reasonable baseline for expected compiler
optimizations.

Reviewed By: xingbowang

Differential Revision: D87960540

Pulled By: pdillinger

fbshipit-source-id: e0257b7fea8a5c7709daef18911959201ce4e0f3
Tim-Reed pushed a commit to Tim-Reed/rocksdb that referenced this pull request Oct 1, 2026
Summary:
This change builds on facebook#14027 and facebook#13965 to complete migration
of the HyperClockCache implementation to using the hygienic BitFields API.
No semantic change in the implementation details is intended, just
greatly improving readability and safety of the code while maintaining
the same performance.

In more detail,
* Refactor the main metadata atomic for each slot in an HCC table into
SlotMeta using BitFields.
* Extended BitFields APIs with some additional features, and renamed
  BlahTransform classes to BlahTransformer to resolve potential naming
  conflicts with member functions to create them.

Pull Request resolved: facebook#14154

Test Plan:
for correctness, mostly existing tests. but also added tests
for new BitFields features. I especially ran local TSAN whitebox crash
test extensively which caught a couple of refactoring errors.

For performance, I verified with release builds of cache_bench, using
default options, that there was no noticeable/consistent difference
after all these HCC migrations vs. backing them out. That test was with
GCC 11 and -O2, which is a reasonable baseline for expected compiler
optimizations.

Reviewed By: xingbowang

Differential Revision: D87960540

Pulled By: pdillinger

fbshipit-source-id: e0257b7fea8a5c7709daef18911959201ce4e0f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants