Bringing MSBG to Apple Silicon: Porting a Sparse-Grid Powerhouse to macOS
Sergei Almazov2 min read

Several months ago, I came across a paper from SIGGRAPH 2025 that described water simulation using sparse grids and the phase field approach.
I give the full credit to these guys who did impressive job on water simulations.
The primary toolchain was developed for the x86/64 architecture. Since my primary device is a MacBook Pro, I decided to port MSBG to ARM64.
1. Toolchain archaeology
The original makefiles assumed GCC, GNU OpenMP, and x86 intrinsics. On macOS I had to pin Homebrew’s GCC 15, wire it into the project’s mk launcher, and ensure every third-party dependency was available locally (VectorClass, TBB, SIMDe). Once the toolchain stopped fighting me, the build farm finally agreed to emit an msbg_demo binary for arm64.
2. Replacing AVX/SSE with SIMDe
The heaviest lift was abstracting MSBG’s SIMD layer. We swapped direct <immintrin.h> usage for SIMDe, which emulates AVX/SSE instructions on non-x86 architectures. After vendoring SIMDe into external/simde and updating include paths, the vectorized kernels compiled cleanly on Apple Silicon without losing performance-critical code paths.
3. Validating performance
With the port in place I stress-tested the demo at multiple resolutions. On my M-series chip MSBG handles the 8K “bunny-of-bunnies” case in ~151.95 seconds and scales predictably as resolution doubles. CPU-only PDE smoothing and rendering both benefit from the wide cores + fast memory, which makes Apple Silicon surprisingly capable for sparse volumetric workloads.
4. Lessons learned
- Investing in a portable SIMD abstraction early pays off. SIMDe let me keep one codepath for x86, Arm, and beyond.
- Don’t underestimate the build tooling gulf between Linux and macOS—script your compiler/runtime detection to keep contributors productive.
5. Possible optimisations
I experimented with Metal renderer, but that task was challenging to adapt on GPU. I did it, but results were slower than my CPU port for now.
Bringing MSBG to macOS means researchers and studios can now iterate on adaptive fluid sims directly on their MacBooks, with full fidelity and without remote clusters.
Here is a fork of original repository ported to macOS system.
If you’re curious about pushing sparse volumetrics, as well as water simulations on Apple Silicon—or want to help push the GPU backend further—let’s connect!