Add WASM support - #18
Merged
Merged
Conversation
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 this changes
This PR introduces comprehensive support for the
wasm32-unknown-unknowntarget and resolves a shuffling limitation on 32-bit architectures.WASM Support & Fixes:
ahashwithoutgetrandom: Onwasm32-unknown-unknown,ahashnow uses thecompile-time-rngfeature. This drops thegetrandomdependency (which requires a backend opt-in on WASM), allowing the crate to build out-of-the-box. (Closes makeahashoptional #17)rayonon WASM: Since WASM lacks native threads,rayononly ran its single-thread fallback. It is no longer a dependency on WASM targets.FastAutomaton::union_all_parandFastAutomaton::intersection_all_parare excluded on WASM, while keeping theparallelfeature harmless if enabled by another crate in the dependency graph.ExecutionProfileBuilder::clock,ExecutionProfile::with_clock, andexecution_profile::Clock. This allows WASM hosts to supply their own monotonic clock (e.g.,performance.now()) to prevent timeouts from panicking onInstant::now, while also enabling fully deterministic timeout testing across all targets.32-bit Fix:
wasm32,i686,armv7, etc.) whereCharacterOrder::ShuffledandPathOrder::Shuffledwere restricted to 2^32 combinations due tousizeindexing. The window is now strictly 64-bit on all targets.Checklist
cargo fmt --all --checkandcargo clippy --all-targets -- -D warningspasscargo testandcargo test --no-default-featurespassCHANGELOG.mdis updated under## [Unreleased]