M4 Max で F config 2000 iter の kernel ごと GPU timer total を計測。rasterize_backwards が 52.1% (24.1 ms/call) で dominant、atomic_fetch_add が律速と判定。step 33 prototype (SIMD prefix sum で 32× atomic 削減) の最有力ターゲット確定。
M4 Max 上で F config (L1+SSIM, λ=0.20, K=7) 2000 iter の kernel ごと GPU timer total を計測。rasterize_backwards が 52.1% / 24.1 ms/call で dominant、atomic float add が GPU compute を律速していると判定。step 33 prototype (SIMD prefix sum で 1 atomic per warp = 32× 削減) の最有力ターゲットを確定。
| kernel | total | calls | avg/call | %total |
|---|---|---|---|---|
| rasterize_backwards | 47.036 s | 1951 | 24.109 ms | 52.1% |
| radix_hist | 13.506 s | 31216 | 432.660 µs | 15.0% |
| project_soa | 8.341 s | 1951 | 4.275 ms | 9.2% |
| emit_pairs | 7.211 s | 1951 | 3.696 ms | 8.0% |
| ssim_fwd_bwd | 5.791 s | 1951 | 2.968 ms | 6.4% |
| rasterize_f32 | 3.126 s | 1951 | 1.602 ms | 3.5% |
| adam_step | 2.707 s | 9755 | 277.481 µs | 3.0% |
| project_backwards | 1.008 s | 1951 | 516.846 µs | 1.1% |
| radix_scatter | 825.828 ms | 31216 | 26.455 µs | 0.9% |
| extract_offsets | 748.205 ms | 1951 | 383.497 µs | 0.8% |
| TOTAL | 90.300 s |
→ step 33 prototype の最有力ターゲット確定
現行の rasterize_backwards.metal は per-pixel ループ内で per-splat に 9 field × atomic_fetch_add を発行している (atomic float add via M4 native support)。
最適化案 (SIMD prefix sum reduction):
simd_sum() (Metal 内蔵) で warp 内 reduction → 1 thread が代表atomic_fetch_add を 1 回 → 32× atomic 削減期待効果: atomic call 数 256 thread × 9 field → 8 warp × 9 field = 32× 削減。ただし atomic が時間支配なのか、その他 (memory bandwidth、warp divergence) なのかは実装後の再 profile で確認。
F (scale_reg) / G (MCMC) の formulation 失敗から学んだ早期 reject ポリシーを継続。kernel-level 計測で dominant hotspot を pre-commit gate 付きで attack する流れを Phase 5 で確立。