[{"data":1,"prerenderedAt":239},["ShallowReactive",2],{"finding:phase5-step30b-timing":3,"finding-runs:phase5-step30b-timing":219,"finding-related:phase5-step30b-timing":220},{"meta":4,"impact":28,"sections":32},{"id":5,"title":6,"subtitle":7,"eyebrow":8,"date":9,"status":10,"category":11,"polarity":12,"axes":13,"tags":15,"task_code":23,"related_runs":24,"related_findings":26},"phase5-step30b-timing","Phase 5 step 30b — kernel-by-kernel timing 計測結果","M4 Max で F config 2000 iter の kernel ごと GPU timer total を計測。rasterize_backwards が 52.1% (24.1 ms\u002Fcall) で dominant、atomic_fetch_add が律速と判定。step 33 prototype (SIMD prefix sum で 32× atomic 削減) の最有力ターゲット確定。","Phase 5 · step 30b kernel timing","2026-04-30","stable","speed","positive",[14],3,[16,17,18,19,20,21,22],"phase-5","step-30b","kernel-timing","rasterize-backwards","atomic-bottleneck","m4-max","hotspot","#5.30b",[25],"phase5-step30b",[27],"phase5-step30-profile",{"summary":29,"rank":30,"verdict":31},"kernel-level GPU timer で rasterize_backwards が 24.1 ms\u002Fcall \u002F 52.1% total と確定 dominant。atomic float add が律速と判定し、step 33 SIMD prefix sum reduction prototype の最有力ターゲットを確定。期待 ROI は 50% 削減で iter -13%、80% 削減で -21%。","high","accepted",[33,36,60,63,132,134,141,143,145,151,154,156,162,164,169,171,176,178,183,185,190,192,194,196,198,205,207,209,214],{"type":34,"text":35},"lead","M4 Max 上で F config (L1+SSIM, λ=0.20, K=7) 2000 iter の kernel ごと GPU timer total を計測。\u003Cstrong>rasterize_backwards が 52.1% \u002F 24.1 ms\u002Fcall で dominant\u003C\u002Fstrong>、atomic float add が GPU compute を律速していると判定。step 33 prototype (SIMD prefix sum で 1 atomic per warp = 32× 削減) の最有力ターゲットを確定。",{"type":37,"items":38},"kv",[39,42,45,48,51,54,57],{"key":40,"value":41},"実施","2026-04-30 17:42、commit 9617683 (timing instrumentation 直後)",{"key":43,"value":44},"Hardware","M4 Max",{"key":46,"value":47},"設定","F config + L1+SSIM (λ=0.20, K=7)、2000 iter",{"key":49,"value":50},"集計範囲","iter 50 で reset (cold cache + ramp 排除)、iter 50-2000 の 1951 iter ぶん",{"key":52,"value":53},"splat 数","iter 500 まで 5207、refine 範囲 [500, 1500] で 76,363 まで成長、その後固定",{"key":55,"value":56},"Script","3dgs-rs\u002Fscripts\u002Fphase5\u002Frun_step30b_timing.sh",{"key":58,"value":59},"Log","3dgs-rs\u002Fruns\u002Fphase5-step30b\u002Fstep30b_2000iter_F.log (gitignored)",{"type":61,"text":62},"heading","計測結果",{"type":64,"columns":65,"align":71,"rows":74},"table",[66,67,68,69,70],"kernel","total","calls","avg\u002Fcall","%total",[72,73,73,73,73],"left","right",[75,81,87,92,97,102,107,113,118,123,128],[76,77,78,79,80],"rasterize_backwards","47.036 s",1951,"24.109 ms","52.1%",[82,83,84,85,86],"radix_hist","13.506 s",31216,"432.660 µs","15.0%",[88,89,78,90,91],"project_soa","8.341 s","4.275 ms","9.2%",[93,94,78,95,96],"emit_pairs","7.211 s","3.696 ms","8.0%",[98,99,78,100,101],"ssim_fwd_bwd","5.791 s","2.968 ms","6.4%",[103,104,78,105,106],"rasterize_f32","3.126 s","1.602 ms","3.5%",[108,109,110,111,112],"adam_step","2.707 s",9755,"277.481 µs","3.0%",[114,115,78,116,117],"project_backwards","1.008 s","516.846 µs","1.1%",[119,120,84,121,122],"radix_scatter","825.828 ms","26.455 µs","0.9%",[124,125,78,126,127],"extract_offsets","748.205 ms","383.497 µs","0.8%",[129,130,131,131,131],"TOTAL","90.300 s","",{"type":61,"level":14,"text":133},"Wall-clock 整合",{"type":135,"items":136},"list",[137,138,139,140],"GPU timer total: 90.3 s","Wall-clock total: 132.4 s","比率: 68% GPU compute \u002F 32% CPU encoding + IPC","step 30 findings の「~70% GPU compute \u002F ~30% CPU encoding」と一致 ✅",{"type":61,"text":142},"ホットスポット ranking",{"type":61,"level":14,"text":144},"1. rasterize_backwards: 52.1% (dominant) ⭐⭐⭐",{"type":135,"items":146},[147,148,149,150],"24.1 ms\u002Fcall、最遅 kernel","1 iter に 1 回呼ばれる、全 splat の 9 field gradient を atomic float add で accumulate","atomic ADD が GPU compute を律速していると仮定 → SIMD prefix sum で warp 内 reduction → 1 atomic per warp に削減可能","\u003Cstrong>期待 ROI\u003C\u002Fstrong>: 50% 削減で iter 速度 90s → 78s (-13%)、80% 削減で → 71s (-21%)",{"type":152,"text":153},"paragraph","→ \u003Cstrong>step 33 prototype の最有力ターゲット確定\u003C\u002Fstrong>",{"type":61,"level":14,"text":155},"2. radix_hist: 15.0% (radix sort histogram phase)",{"type":135,"items":157},[158,159,160,161],"432 µs\u002Fcall、16 pass × 1951 iter = 31,216 calls (1 iter あたり 16 calls)","1 iter あたり 6.9 ms","削減余地: ICB (将来) で 16 pass を 1 commit に、または workgroup サイズ tuning","ROI 中、step 32 (ICB) で取り組む候補",{"type":61,"level":14,"text":163},"3. project_soa: 9.2% (forward projection)",{"type":135,"items":165},[166,167,168],"4.3 ms\u002Fcall、1 iter 1 回","削減余地: SH 評価が dominant な可能性、SIMD 化で短縮余地あり","ROI 中、step 33 後の候補",{"type":61,"level":14,"text":170},"4. emit_pairs: 8.0% (tile binning)",{"type":135,"items":172},[173,174,175],"3.7 ms\u002Fcall、1 iter 1 回","削減余地: tile_id 計算 + atomic counter 更新、SIMD 化","ROI 低 → 中、step 32 \u002F 33 の後",{"type":61,"level":14,"text":177},"5. ssim_fwd_bwd: 6.4% (SSIM forward + backward in 1 cmd buffer)",{"type":135,"items":179},[180,181,182],"3.0 ms\u002Fcall (forward + backward 計)、1 iter 1 回","削減余地: 7×7 gaussian conv 2 pass を tile shader \u002F imageblock_data で TBDR 高速化","step 34 (tile shader) のターゲット候補、ROI 中",{"type":61,"level":14,"text":184},"6. rasterize_f32: 3.5% (forward rasterize)",{"type":135,"items":186},[187,188,189],"1.6 ms\u002Fcall、forward と比較対称な kernel","backward が 24ms なら forward が 1.6ms = 15× の速度差 → atomic が backward を律速の証拠","改善余地: forward 自体は速いので priority 低",{"type":61,"text":191},"結論と次着手",{"type":61,"level":14,"text":193},"step 33 prototype 確定 (rasterize_backwards atomic 削減)",{"type":152,"text":195},"現行の \u003Ccode>rasterize_backwards.metal\u003C\u002Fcode> は per-pixel ループ内で per-splat に 9 field × \u003Ccode>atomic_fetch_add\u003C\u002Fcode> を発行している (atomic float add via M4 native support)。",{"type":152,"text":197},"\u003Cstrong>最適化案\u003C\u002Fstrong> (SIMD prefix sum reduction):",{"type":135,"ordered":199,"items":200},true,[201,202,203,204],"tile (16×16 = 256 pixels = 8 warps × 32 threads on M-series GPU) 内で","各 thread が自分の (pixel, splat) 寄与を計算","SIMD group (32 threads = 1 warp) 内で \u003Ccode>simd_sum()\u003C\u002Fcode> (Metal 内蔵) で warp 内 reduction → 1 thread が代表","代表 thread が \u003Ccode>atomic_fetch_add\u003C\u002Fcode> を 1 回 → 32× atomic 削減",{"type":152,"text":206},"\u003Cstrong>期待効果\u003C\u002Fstrong>: atomic call 数 256 thread × 9 field → 8 warp × 9 field = 32× 削減。ただし atomic が時間支配なのか、その他 (memory bandwidth、warp divergence) なのかは実装後の再 profile で確認。",{"type":61,"level":14,"text":208},"gate (step 33 採否判断)",{"type":135,"items":210},[211,212,213],"✅ 採用: rasterize_backwards avg\u002Fcall が \u003Cstrong>24 ms → ≤ 12 ms\u003C\u002Fstrong> (≥ 1.5× 短縮)","❌ 見送り: 24 ms → > 19 ms (\u003C 1.2× 短縮)","中間 (1.2-1.5×): 個別判断、コード明確性とのトレードオフ",{"type":215,"label":216,"variant":217,"text":218},"callout","Methodology","info","F (scale_reg) \u002F G (MCMC) の formulation 失敗から学んだ早期 reject ポリシーを継続。kernel-level 計測で dominant hotspot を pre-commit gate 付きで attack する流れを Phase 5 で確立。",[],[221],{"id":27,"title":222,"date":9,"status":10,"polarity":223,"category":11,"axes":224,"tags":225,"task_code":231,"related_runs":232,"delta_psnr":-1,"delta_wallclock":234,"rank":235,"verdict":236,"impact_summary":237,"detail_path":238},"Phase 5 step 30 — Instruments \u002F Metal System Trace 分析結果","mixed",[14],[16,226,227,228,21,229,230],"step-30","instruments","metal-system-trace","profiling","fusion-reject","#5.30",[233],"phase5-step30","B-mini: -1% (noise floor)","mid","investigative","30s Metal System Trace で 14,909 encoder \u002F iter 40 encoder を観測。当初の「STIME 70% = sync overhead」解釈は B-mini プロト (scatter wait 削除、\u003C 1% 改善) で撤回。真の breakdown は GPU compute ~70% \u002F CPU encoding ~30%、dispatch fusion ROI は小さく Phase 4 後続 (C\u002FD\u002FF) 進行に戻る判断。","\u002Ffindings\u002Fphase5-step30-profile\u002F",1782449788682]