Skip to main content

Avalanche Simulation with Rust and WebGPU

Try it yourself!

Most modern browsers now support WebGPU (check the current status). The application has been tested on Windows, Linux, and Android, though support on mobile devices may still be limited.

You can explore one of the predefined AvaFrame examples using the dropdown menu, or upload your own Austrian GPX file to run a custom simulation.

This project was initiated to streamline the development of avalanche simulations using WebGPU, building on concepts from weBIGeo. It provides an easy way to visualize results directly in the browser.

The core has since been rewritten in Rust, with Python and WebAssembly (WASM) bindings available. The underlying model is a block-based approach without particle interactions, enabling fast initial estimates of runout distance and flow routing.

Get started with Python

pip install avalanchers[viz]

import avalanchers

sim = avalanchers.PySimulation.new()
sim.create_example("frontend/data/avaframe/avaMal.png")
sim.run()

# needs the viz option
avalanchers.plot2d(sim, "max_velocity")
avalanchers.plot3d(sim, "max_velocity")

Known Issues with Chrome

  • Chromium on Windows currently ignores the high-performance option in powerPreference WebGPU flag if you have multiple GPUs [Issue]. Options are:
    1. Run slow on integrated GPU
    2. Start Chrome with high performance gpu flag "C:\Program Files\Google\Chrome\Application\chrome.exe" --force_high_performance_gpu
    3. Activate flag in Chrome chrome://flags/#force-high-performance-gpu. I got slow runs about 50% of the time even though it actually runs on the fast GPU. Might work by now.
    4. Activate the dedicated GPU for Chrome in the system settings.

Development Setup

Windows

Install Rust Install Python

# wasm bindings
cargo install wasm-bindgen-cli
cargo install wasm-pack

# coverage
cargo install cargo-tarpaulin

# python bindings
python -m venv .venv
.venv\Scripts\Activate.ps1  
python -m pip install maturin

Linux

Install dependencies

Install Rust (WSL (2026.04.04): curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh) Install Python

sudo apt update
sudo apt install -y python3-venv python3-dev build-essential clang lld pkg-config libssl-dev

# wasm bindings
cargo install wasm-bindgen-cli
cargo install wasm-pack

# python bindings
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install maturin

Build


# cli tool
cargo build -p cli --release

# python bindings
maturin develop 
maturin build --release

# wasm bindings
wasm-pack build crates/wasm_bindings --target web --out-dir ../../frontend/js/pkg --no-opt
wasm-pack build crates/wasm_bindings --target web --out-dir ../../frontend/js/pkg --release

Run

Python

python avalanchers_example.py

Frontend

  1. Install OpenSSL
  2. Go to the project directory
  3. Start the development server: python .\frontend\dev_server.py This launches the app with caching disabled and HTTPS enabled using self-signed certificates, which are required for WebGPU support in most browsers.
  4. Open your browser and go to: https://localhost/ If you are accessing the server from another device on the same network, replace localhost with the host machine’s IP address.

Benchmarks

cargo bench -p simulation

Code Guidelines

Before pushing use:

Install pip install ruff

cargo fmt
cargo clippy -- -D warnings
cargo test -p compute_core -p data_processor -p simulation
ruff check ./python_module
pytest python_module

Data Sources

Test examples are from AvaFrame under EUPL-1.2 license

Vals data: D'Amboise Christopher J. L., Neuhauser Michael, Teich Michaela, & Fischer Jan-Thomas. (2021). Maverick-bfw/Flow_py_inputs_results: First releases (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.5154787

Metadata

Release files for avalanchers 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for avalanchers 0.2.0
File Interpreter ABI Platform
avalanchers-0.2.0-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
avalanchers-0.2.0-cp37-abi3-manylinux_2_38_x86_64.whl CPython 3.7 abi3 Linux glibc 2.38+ x86-64 Details
avalanchers-0.2.0-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details

Total release size: 19.8 MB

Release files / avalanchers-0.2.0-cp37-abi3-win_amd64.whl

Download URL avalanchers-0.2.0-cp37-abi3-win_amd64.whl
Size 6.4 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
58aa14814c9629dbfadb3d08893c912d4061c9cfe5dc47d810243264a3b33776
BLAKE2b-256 checksum
How to use checksums
7f43c37da6494f23fe3d5e20eb73d2cdcf22488179f27158542213873375ada6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Release files / avalanchers-0.2.0-cp37-abi3-manylinux_2_38_x86_64.whl

Download URL avalanchers-0.2.0-cp37-abi3-manylinux_2_38_x86_64.whl
Size 7.3 MB
Tags CPython 3.7 Linux glibc 2.38+ x86-64 abi3
SHA-256 checksum
How to use checksums
f2a8e2c17ce8e69bc4e968166b720104b12ca9f226b489d16d68912aa8bb56c3
BLAKE2b-256 checksum
How to use checksums
6f1d17a739cd5596b9ad0ca1b97884dc4b009f87d0ee41c71498955993a25122
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Release files / avalanchers-0.2.0-cp37-abi3-macosx_11_0_arm64.whl

Download URL avalanchers-0.2.0-cp37-abi3-macosx_11_0_arm64.whl
Size 6.1 MB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
be3c164ab70d1a8e0a538a916e28586a2bb8cb3b312d8c1f7de7d580b28d44bc
BLAKE2b-256 checksum
How to use checksums
3d01e59a06ded36fd813a5b7d3581368e39c7a9aa449558cc8db6df6bc022120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

Security for avalanchers 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for avalanchers-0.2.0-cp37-abi3-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

3 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page