Skip to content

fix uninitialized mul_one in AVX2 checksum and add SIMD checksum test#859

Merged
tridge merged 2 commits intoRsyncProject:masterfrom
tridge:pr-simd-uninit
Mar 1, 2026
Merged

fix uninitialized mul_one in AVX2 checksum and add SIMD checksum test#859
tridge merged 2 commits intoRsyncProject:masterfrom
tridge:pr-simd-uninit

Conversation

@tridge
Copy link
Member

@tridge tridge commented Feb 28, 2026

The AVX2 get_checksum1_avx2_64() read mul_one before initializing it, which is undefined behavior. Replace the cmpeq/abs trick with _mm256_set1_epi8(1) to match the SSSE3 and SSE2 versions.

Add a TEST_SIMD_CHECKSUM1 test mode that verifies all SIMD paths (SSE2, SSSE3, AVX2, and the full dispatch chain) produce identical results to the C reference, across multiple buffer sizes with both aligned and unaligned buffers.

thanks to Joshua Rogers for reporting

tridge and others added 2 commits March 1, 2026 08:42
The AVX2 get_checksum1_avx2_64() read mul_one before initializing it,
which is undefined behavior. Replace the cmpeq/abs trick with
_mm256_set1_epi8(1) to match the SSSE3 and SSE2 versions.

Add a TEST_SIMD_CHECKSUM1 test mode that verifies all SIMD paths
(SSE2, SSSE3, AVX2, and the full dispatch chain) produce identical
results to the C reference, across multiple buffer sizes with both
aligned and unaligned buffers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The new simd-checksum test is skipped on platforms where SIMD
instructions are unavailable (macOS ARM, Cygwin). Add it to the
RSYNC_EXPECT_SKIPPED lists so CI doesn't fail on the mismatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tridge tridge merged commit b905ab2 into RsyncProject:master Mar 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant