MASSIVELY PARALLEL / MONTE CARLO LOCALIZATION
Particle Storm65,536 guesses.
One robot.
Every green spark is a possible robot pose. Watch a cloud of hypotheses lock onto a moving LiDAR scan — then teleport the robot and make the GPU find it again.
SAME FLOAT32 POSES / SAME 32-BEAM SCAN
GPU vs CPU · LiDAR likelihood scoring
Preparing comparison…
—
—
—
Both backends score exactly the same seeded Float32 poses, particle count, sensor tolerance and live scan. This compares likelihood scoring only, not random prediction, CDF reduction, resampling or rendering. It never compares a 512-particle CPU preview against 65,536 GPU particles. GPU time includes uploads and all N weight readbacks (N × 4 bytes, unlike the live filter's 32-byte summary). CPU time includes worker messages when supported, or a labeled main-thread fallback. Input generation, compilation and setup are excluded. Three warmups, 15 alternating pairs; tolerance max(0.0001 absolute, 0.1% relative). Larger counts may take several seconds. WebGPU versus JavaScript, not native CUDA/C++; no GPU means CPU-only timings.
One invocation per pose. Transform 32 scan endpoints and evaluate their distance to mapped surfaces.
256-lane workgroups build a weight CDF. A second scan combines group totals and posterior moments.
Each invocation independently searches the CDF. Good hypotheses survive; 3% global proposals keep exploration alive.
Instanced particle sprites read the GPU state directly. Only 32 bytes of summary statistics return to the CPU.
This is the parallel part.
On WebGPU, all four compute passes and particle drawing run on the GPU. The CPU only generates the synthetic LiDAR scan, moves the ground-truth robot and draws the map/scan overlay. The beam counter is an upper bound of 32 tests per particle; invalid poses skip scoring. It is not measured hardware occupancy or ray-tracing throughput. Updates advance 0.1 simulation seconds, independent of wall-clock speed.
This is a browser-native WGSL demonstration of the CUDA-style particle-per-thread pattern, not CUDA executing in a browser or a native CUDA benchmark. It is likelihood-field Monte Carlo localization on a known 2D map, not SLAM. The posterior mean can lie between competing modes before convergence. Unsupported devices get a clearly labeled 512-particle CPU preview.
Interactive MPPI control ↗ · Native CUDA / Nav2 ↗ · Source ↗