Add WASM SIMD128 differential test harness and structural linter - #837
Draft
stereobooster wants to merge 1 commit into
Draft
Add WASM SIMD128 differential test harness and structural linter#837stereobooster wants to merge 1 commit into
stereobooster wants to merge 1 commit into
Conversation
stereobooster
force-pushed
the
pr-c-wasm-harness
branch
2 times, most recently
from
June 4, 2026 20:51
4c10bac to
68259b5
Compare
Adds the verification infrastructure for the WebAssembly SIMD128 work (issue RoaringBitmap#801), landing ahead of the SIMD code itself: - tests/wasm_diff_harness.c: deterministic-digest harness comparing native / wasm-scalar / wasm-simd128 amalgamation builds via bounded metamorphic membership oracles, iterator/export parity, inplace parity, cardinality laws and portable round-trip. The digest is integer-only (the floating-point jaccard index is excluded to avoid a 1-ULP native-vs-wasm divergence flipping a quantized value). - tools/run_wasm_differential_test.sh + ci_wasm_differential_digest.sh: build the three legs and compare digests (with wasm-objdump / LLVM IR SIMD-presence guards once SIMD paths exist). count_simd_ops wraps its grep in a set+e subshell so a zero-match baseline does not abort under pipefail. - tools/check_wasm_simd_neon_pairing.sh: structural #elif hygiene linter; wired into the emscripten CI workflow. - CMake targets wasm_differential_test / wasm_neon_simd_parity_check for local runs; README section documenting the approach. Only the NEON-pairing linter runs in CI here; the differential-digest CI step is enabled in the first SIMD PR (its SIMD-uplift guard needs SIMD code present), so every commit keeps CI green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
stereobooster
force-pushed
the
pr-c-wasm-harness
branch
from
June 5, 2026 06:38
68259b5 to
6ea2bc0
Compare
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.
Split out of #818 (which is being broken into small, single-purpose PRs). This is the verification infrastructure for the WebAssembly SIMD128 work (issue #801), landing ahead of the SIMD code itself so the test strategy can be reviewed in isolation.
Contents
tests/wasm_diff_harness.c: deterministic-digest harness comparing native / wasm-scalar / wasm-simd128 amalgamation builds via bounded metamorphic membership oracles, iterator/export parity, inplace parity, cardinality laws and portable round-trip.tools/run_wasm_differential_test.sh+tools/ci_wasm_differential_digest.sh: build the three legs and compare digests. A wasm-objdump SIMD-presence guard (a bring-up check that the-msimd128leg isn't vacuously scalar codegen) activates once SIMD paths exist; it is retired in the final SIMD PR once the three-way digest comparison stands on its own.tools/check_wasm_simd_neon_pairing.sh: structural#elifhygiene linter for files sharingCROARING_WASM_SIMDandCROARING_USENEONbranches — wired into the emscripten CI workflow.wasm_differential_test/wasm_neon_simd_parity_check; README section.Note on CI: only the NEON-pairing linter runs in CI here (it passes on a SIMD-free tree). The differential-digest CI step is intentionally added together with the first SIMD path (next PR in the split), because its SIMD-presence guard requires wasm SIMD code to be present — this keeps every PR green.
Follow-up SIMD PRs (run / bitset / array / nonempty) will build on this harness.
AI usage disclosure (per
AI_USAGE_POLICY.md): this change was prepared with significant AI assistance (Claude Code). It is opened as a draft; I am reviewing it personally before marking it ready for review, I remain the author and am accountable for the contribution, and I can answer questions about it. The commits also carry aCo-Authored-Bytrailer noting the AI assistance.