Unpoison SIMD dispatch results for MemorySanitizer#304
Merged
ashvardanian merged 1 commit intoashvardanian:main-devfrom Mar 7, 2026
Merged
Unpoison SIMD dispatch results for MemorySanitizer#304ashvardanian merged 1 commit intoashvardanian:main-devfrom
ashvardanian merged 1 commit intoashvardanian:main-devfrom
Conversation
MSan cannot track initialization through SIMD intrinsics (SVE, NEON, SSE, AVX), causing false-positive "use-of-uninitialized-value" reports. Add `__msan_unpoison` calls after every dispatch macro to mark results as initialized. Co-Authored-By: Claude Opus 4.6 <[email protected]>
ashvardanian
pushed a commit
that referenced
this pull request
Mar 7, 2026
MSan cannot track initialization through SIMD intrinsics (SVE, NEON, SSE, AVX), causing false-positive "use-of-uninitialized-value" reports. Add `__msan_unpoison` calls after every dispatch macro to mark results as initialized. Co-authored-by: Alexey Milovidov <[email protected]>
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.
Summary
__msan_unpoisoncalls after every dispatch macro to mark results as initialized__has_feature(memory_sanitizer)to detect MSan builds; compiles to no-op otherwiseThe error was triggered in ClickHouse ARM MSan stress test:
simsimd_cos_f32_sve→svdupq_n_f32is opaque to MSan.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98677&sha=7d4c987f3c650a78b950b264d2676b8b7bc0979e&name_0=PR&name_1=Stress%20test%20%28arm_msan%29
ClickHouse PR: ClickHouse/ClickHouse#98807