docs: wasm32 SIMD is a shipped compile-time arm, not a future runtime tier - #284
Merged
Merged
Conversation
… tier simd_dispatch.rs closed its runtime-tier table with 'On wasm32 (future): tier would be WASM SIMD (128-bit, +simd128)'. Stale twice over. It is not future: crate::simd re-exports the native v128 types from simd_wasm::wasm32_simd under cfg(all(target_arch = "wasm32", target_feature = "simd128")), with a scalar fallback when simd128 is absent — and CI's wasm-simd/parity-node job builds those real types and runs a lane-vs-scalar selfcheck under node via scripts/wasm-parity.sh. Nor would it ever be a tier in THIS table, which is runtime dispatch over simd_caps(). wasm SIMD is selected at compile time; there is no runtime feature probe to dispatch on, so nothing belongs in SimdTier. Saying 'tier would be' invited a future session to add one. Docs only — no code, no cfg, no dispatch change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCfrD5y19cvFc4AoyydXYv
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_a72c4e09-4b51-4f37-af9e-fca093fe8586) |
AdaWorldAPI
marked this pull request as ready for review
August 27, 2026 05:24
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.
The drift
src/hpc/simd_dispatch.rsclosed its runtime-tier table with:Stale twice over, and the second half is the one that would have cost someone time.
It is not future
crate::simdre-exports the nativev128types fromsimd_wasm::wasm32_simdundercfg(all(target_arch = "wasm32", target_feature = "simd128"))(simd.rs:402-408), with a full scalar fallback whensimd128is absent (simd.rs:416-421).U32x16— built as[U32x4; 4]— carriesAdd/BitXor/rotate_left, the ARX lane the ChaCha20 backend rides.And it is CI-verified, not merely present: the
wasm-simd/parity-nodejob (ci.yaml:114) builds those real+simd128types via the excludedwasm-simd-paritycdylib and runs a lane-vs-scalar numeric selfcheck under node 22 (scripts/wasm-parity.sh), plus guards that thechacha20fork'sndarray_simdbackend keeps compiling forwasm32+simd128.Nor would it ever be a tier in this table
The more useful correction. That table is runtime dispatch over
simd_caps()behind aLazyLock. wasm SIMD is selected at compile time — there is no runtime feature probe to dispatch on, so nothing belongs inSimdTier. Phrasing it as "tier would be" invited a future session to add one and discover only afterwards that the mechanism doesn't fit.The replacement says both things: why wasm is absent from the table by construction, and where the shipped arm actually lives.
Scope
Documentation only. No code, no
cfg, no dispatch change — 11 insertions, 1 deletion, one doc comment.Gates:
cargo doc --no-deps -p ndarrayproduces zero warnings mentioningsimd_dispatch(the 111 pre-existing lib-doc warnings are untouched and unrelated);cargo fmt -p ndarray --checkclean.One thing this does not claim
The node job proves the lane bit-exact, and the chacha20 step is compile-only. No keystream-vs-RFC-8439 vectors run on wasm, so a backend-selection bug yielding a valid-looking-but-wrong keystream would pass both. Out of scope here — recorded so it isn't mistaken for covered.
Generated by Claude Code