Skip to content

Compile Metal Gaussian raster from shared Slang shaders - #109

Merged
snkmcb merged 1 commit into
mainfrom
codex/metal-gaussian-slang
Sep 27, 2026
Merged

snkmcb merged 1 commit into
mainfrom
codex/metal-gaussian-slang

Conversation

@snkmcb

@snkmcb snkmcb commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

Metal Gaussian rasterization previously compiled a separate embedded MSL implementation when creating the backend. Compile it from shared Slang position/ellipse/alpha calculations into an embedded metallib at build time, preserving the CPU-sorted reference image and color/depth/picking behavior.

  • Share raster math with Vulkan and retain Metal-specific scalar stream bindings and combined color/ID outputs.
  • Package MSL, reflection, artifact identities, metallib and checksum; verify generated bindings, host offsets and installed consumers.
  • Provision pinned Slang in macOS CI and document Windows/Vulkan and macOS/Metal setup using the existing CMake presets.

Related issue: implements the first shared-raster step of the Metal Gaussian execution plan introduced in #108.

Impact

  • Affected areas: Metal, shared Vulkan raster math, shader build/packaging, CI, tests and documentation.
  • Metal source builds now require Slang 2026.8.x and Xcode's offline Metal tools. Core-only builds remain independent of both. Installed Metal consumers use the embedded library without shader search paths.
  • Public APIs and execution settings are unchanged. GPU Gaussian preparation/sorting/tiling remain unsupported on Metal; preferred execution falls back and required execution rejects. The scalar stream explicitly rejects sizes beyond its 32-bit byte-address limit.
  • README and the build guide separate Windows/Mac instructions, build/runtime dependencies, and Hydra/usdview host setup. No CMake preset definitions were changed.

Verification

Local runtime environment: Apple M3, macOS 15.7.9, Slang 2026.8, Xcode 16.4 Metal compiler 32023.620 with macOS SDK 15.5.

ctest --test-dir build-metal-release --output-on-failure
  23/23 passed, no skips; includes Metal image/AOV/lifetime, ABI,
  artifact identity, Vulkan Gaussian SPIR-V compilation and install consumers.

ctest --test-dir build-metal -R 'metal|install-consumer|release-metadata|gaussian-preparation' --output-on-failure
  9/9 passed, no skips.

cmake --preset core -B /tmp/merlin-core-slang-check -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build /tmp/merlin-core-slang-check -j 6
ctest --test-dir /tmp/merlin-core-slang-check --output-on-failure
  Clean Core-only build; 17/17 passed without Slang/Metal discovery.

cmake --list-presets=all
  Documented presets exist; Markdown links/code fences and git diff --check passed.

Rebuilt hdMerlin and manually opened a local 5,834,784-particle stage in usdview with OpenUSD 26.08. Rendering completed through HgiMetal GPU-copy and the displayed image was confirmed. The private scene and local raw reports are not included in this PR.

Not run: Windows/Vulkan GPU runtime, controlled performance measurements, and a native viewport image comparison. The shared Vulkan raster entry points compile to SPIR-V locally; this does not establish Vulkan GPU runtime coverage. The complete Phase 1 measurement/host-comparison gate remains open.

Review checklist

  • The change follows the contribution guidelines.
  • Observable behavior has tests or a documented reason tests are not needed.
  • User-facing changes are recorded under Unreleased in the changelog.
  • New support claims and command examples match validated behavior, with untested platforms/gates identified above.

@snkmcb
snkmcb merged commit c7be9d9 into main Sep 27, 2026
16 checks passed
@snkmcb
snkmcb deleted the codex/metal-gaussian-slang branch September 27, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant