Repository navigation
fix(dynamicemb): clear score block in insert() Reclaim branch - #467
Merged
shijieliu merged 1 commit intoSep 1, 2026
Merged
Conversation
Contributor
Greptile SummaryThe PR fixes stale LRU/LFU frequency state when inserting into a slot previously vacated by
Confidence Score: 5/5The PR appears safe to merge, with the reclaimed-slot score reset matching existing score-layout and insertion semantics. The new clearing loop operates on the bucket’s contiguous score block before policy update and key publication, and the regression test covers the reported stale-frequency behavior. Important Files Changed
Reviews (1): Last reviewed commit: "fix(dynamicemb): clear score block in in..." | Re-trigger Greptile |
Collaborator
|
/build |
Collaborator
|
❌ Pipeline #65407542 -- failed
Result: 13/16 jobs passed |
shijieliu
approved these changes
Sep 1, 2026
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.
Description
Checklist
Summary
Fixes a phantom-frequency bug in DynamicEmb's
LruLfuscore policy: a new key inserted into a slot reclaimed byerase()inherited the erased key's residual frequency, corrupting LFU eviction order.Root Cause
table_erase_kernelresets only score word 0 (the timestamp), leaving word 1 (frequency) stale. Theinsert()Evict branch already clears the full AoS score block when displacing a live key, but the Reclaim branch (slot vacated byerase(), keyed asReclaimKey) was overlooked.ScorePolicy<LruLfu>::update()accumulatesscore += table_score[1], so the incoming key received a phantom frequency boost (stale frequency + its own delta), corrupting LFU eviction ranking.Fix
In
insert()(src/table_operation/kernels.cuh), the Reclaim branch now clears the full multi-word score block before the caller runsPolicy::update(), mirroring the Evict branch: