skills/gsplat-optimizer/SKILL.md
Optimize 3D Gaussian Splat scenes for real-time rendering on iOS, macOS, and visionOS. Use when working with .ply or .splat files, targeting mobile/Apple GPU performance, or needing LOD, pruning, or compression strategies for 3DGS scenes.
npx skillsauth add ckorhonen/claude-skills gsplat-optimizerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Optimize 3D Gaussian Splatting scenes for real-time rendering on Apple platforms (iOS, macOS, visionOS) using Metal.
.ply or .splat files for mobile/Apple GPU targetsInput: Provide a .ply/.splat file path, target device class, and FPS target.
# Analyze a splat file
python ~/.claude/skills/gsplat-optimizer/scripts/analyze_splat.py scene.ply --device iphone --fps 60
Output: The skill provides:
First, understand your scene characteristics:
| Device Class | GPU Budget | Max Gaussians (60fps) | Storage Mode | |-------------|-----------|----------------------|--------------| | iPhone (A15+) | 4-6GB unified | ~2-4M | Shared | | iPad Pro (M1+) | 8-16GB unified | ~6-8M | Shared | | Mac (M1-M3) | 8-24GB unified | ~8-12M | Shared/Managed | | Vision Pro | 16GB unified | ~4-6M (stereo) | Shared | | Mac (discrete GPU) | 8-24GB VRAM | ~10-15M | Private |
If gaussian count exceeds device budget:
See references/pruning-strategies.md for details.
For scenes exceeding single-frame budget:
See references/lod-schemes.md for details.
For bandwidth/storage constraints:
| Method | Compression | Use Case | |--------|-------------|----------| | SOGS | 20x | Web delivery, moderate quality | | SOG | 24x | Web delivery, better quality | | CodecGS | 30x+ | Maximum compression | | C3DGS | 31x | Fast rendering priority |
See references/compression.md for details.
See references/metal-profiling.md for details.
Problem: Gaussian count doesn't match your scene complexity, causing either visual artifacts or wasted GPU resources.
Debugging:
# Analyze gaussian distribution
python ~/.claude/skills/gsplat-optimizer/scripts/analyze_splat.py scene.ply --histogram
# Check against device budget
# Compare total_gaussians vs. device_max in the output table
Strategy:
Problem: During optimization (if fine-tuning on device), gaussian parameters diverge, causing:
Debugging:
# Monitor loss during training
tail -f training.log | grep -E "loss|nan|inf"
# Check gradient magnitudes
python -c "
import numpy as np
from plyfile import PlyData
ply_data = PlyData.read('scene.ply')
scales = ply_data['vertex']['scale_0'].data
print(f'Scale range: {scales.min():.6f} to {scales.max():.6f}')
print(f'Any NaN: {np.isnan(scales).any()}')
"
Strategy:
Problem: Scene exceeds available unified memory, causing allocation failures or GPU stalls.
Debugging:
# Estimate memory footprint
python << 'EOF'
num_gaussians = 5_000_000 # Your count
bytes_per_gaussian = 56 # pos (12) + scale (12) + rot quaternion (16) + opacity (4) + SH DC (12)
total_mb = (num_gaussians * bytes_per_gaussian) / (1024 ** 2)
print(f"Est. memory: {total_mb:.1f} MB")
print(f"Safe for iPhone A15: {total_mb < 2000}") # Leave headroom for app
EOF
# Monitor live memory in Xcode
# Memory graph + Allocations instrument during scene load
Strategy:
Problem: Optimizing heavily for one metric breaks another:
Debugging:
# Profile before/after each change
python << 'EOF'
metrics = {
"original": {"fps": 60, "gaussians": 5_000_000, "artifacts": "none"},
"after_pruning": {"fps": 58, "gaussians": 3_500_000, "artifacts": "block edges visible"},
}
for label, m in metrics.items():
print(f"{label}: {m['fps']}fps, {m['gaussians']/1e6:.1f}M, {m['artifacts']}")
EOF
Strategy:
Problem: Rendering pipeline stalls despite low gaussian count:
Debugging:
# Capture Metal frame statistics
# In Xcode: Product > Scheme > Edit > Run > Diagnostics
# Enable: Metal API Validation, GPU Frame Capture
# Check shader compilation time
python ~/.claude/skills/gsplat-optimizer/scripts/metal_profile.py \
--capture-shader-compile \
--target iphone14
# Monitor frame time distribution
tail -f xcode.log | grep -E "frame_time|stutter"
Strategy:
| Metric | Target | How to Measure | |--------|--------|----------------| | Frame time | 16.6ms (60fps) | Metal System Trace | | GPU memory | < device budget | Xcode Memory Graph | | Bandwidth | < 50GB/s | GPU Counters | | Shader time | < 10ms | GPU Frame Capture |
MetalSplatter is the primary reference for Swift/Metal gaussian splatting:
git clone https://github.com/scier/MetalSplatter.git
cd MetalSplatter
open SampleApp/MetalSplatter_SampleApp.xcodeproj
# Set to Release scheme for best performance
documentation
Create or expand an Idea.md / IDEA.md file from a rough description, existing repo, conversation history, notes, or other early-stage product inputs. Use when the user asks to "write an Idea.md", "turn this into an idea file", "capture this product idea", "expand this concept", or wants a repo-grounded concept brief before validation, PRD, or implementation work.
development
Write structured implementation plans from specs or requirements before touching code. Use when given a spec, requirements doc, or feature description, when user says "plan this out", "write a plan for", "how should we implement", or before starting any multi-step coding task.
testing
Expert guidance for video editing with ffmpeg, encoding best practices, and quality optimization. Use when working with video files, transcoding, remuxing, encoding settings, color spaces, or troubleshooting video quality issues.
development
Opinionated constraints for building better interfaces with agents. Use when building UI components, implementing animations, designing layouts, reviewing frontend accessibility, or working with Tailwind CSS, motion/react, or accessible primitives like Radix/Base UI.