This guide walks you through setting up your development environment for HydroChess WASM.
← Back to README | Contributing Guide | Roadmap
The following tools are required to build and test the engine. If you don't have them yet, follow the installation steps in the next section.
- Git - For version control
- Rust - The programming language
- wasm-pack - Tool for building Rust to WebAssembly
Download and run the installer from rustup.rs:
# Or use winget:
winget install Rustlang.Rustupcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shAfter installation, restart your terminal and verify:
rustc --version
cargo --versionrustup target add wasm32-unknown-unknowncargo install wasm-packVerify installation:
wasm-pack --version# Clone the repository
git clone <repository-url>
cd <repository-directory>
# Build for browser
wasm-pack build --target webThe built WASM package will be in the pkg/ directory.
# Run all unit tests
cargo test --lib
# Run tests with output
cargo test --lib -- --nocapture
# Run a specific test
cargo test test_name --lib# Install llvm-cov
cargo install cargo-llvm-cov
# Run coverage report
cargo llvm-cov --libThe engine supports parallel search in WebAssembly. This requires a nightly Rust toolchain and specific compilation flags to enable shared memory and atomics.
-
Install Nightly Rust:
rustup toolchain install nightly rustup component add rust-src --toolchain nightly
-
Build with Helper Script: Use the provided
build_mt.jsscript to build the engine with the correct flags and feature set:node build_mt.js
This script handles the complex configuration required for WASM threads and uses wasm-pack to generate the correct JS/WASM bindings in the pkg/ directory.
Recommended extensions:
- rust-analyzer - Rust language support
Settings (.vscode/settings.json):
{
"rust-analyzer.check.command": "clippy"
}Install the Rust plugin from JetBrains Marketplace.
- Contributing Guide - Learn the development workflow
- Roadmap - See planned features and where to help
- SPRT Testing - Validate engine strength changes
- Main README - Project overview