fix(store): repair legacy string hash caches - #398
Merged
Conversation
singaraiona
marked this pull request as ready for review
August 12, 2026 20:47
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.
What changed
hashandwyhashbuiltins, declarations, and documentation while retaining internal structural hashingWhy
Before the string hash cache existed, the final four bytes of an on-disk string descriptor were padding and could contain arbitrary nonzero data. Treating those bytes as a valid cached hash can send equal strings to different join or group slots and silently return incorrect results. Validation now derives the cache from the validated string bytes instead of trusting persisted state. The mmap path uses the existing private copy-on-write mapping, so the source file is unchanged.
Structural hashing was introduced for engine internals and was unintentionally registered as public language API. This PR keeps that implementation detail internal before it becomes a compatibility commitment.
Validation
make(clean ASan/UBSan debug build)make test— 3,676/3,676 passedmkdocs build --strictgit diff --checkhashandwyhashUnblocks the audit on release PR #397.