🔍 Module Scanned\n (automated audit scan)\n\n## 📝 Summary\nIn , failures are silently swallowed with . When allocation fails (OutOfMemory), the just-computed slice is permanently lost, leaking the allocated memory. Additionally, subsequent LOD vegetation computations silently degrade since the cache stays empty for those chunks.\n\n## 📍 Location\n- File: and \n- Function/Scope: → → (line 405); called from (line 431)\n\n## 🔴 Severity: High\n- High: Memory leaks, incorrect behavior silently degrades to fallback values\n\n## 💥 Impact\nWhen fails with OutOfMemory:\n1. The just-computed slice (allocated in ) is permanently lost - the memory leaks\n2. The cache entry for that chunk key is never stored\n3. Every subsequent call to for this chunk will recompute and re-attempt to store the same hints, potentially leaking more memory on each call\n4. LOD vegetation hints degrade to empty values (lines 730-731), losing tree coverage information in distant terrain rendering\n\n## 🔎 Evidence\n\n\nThe is a where . Each entry stores a full chunk's worth of vegetation hints.\n\n## 🛠️ Proposed Fix\nReplace with proper error handling that also releases the computed hints if the cache store fails:\n\n\n\nOr better, avoid the allocation entirely by using a scratch buffer or by caching at a coarser granularity. For the LOD case specifically, the cache is only used to avoid redundant computation, not to share results across calls - so a simpler approach would be to compute hints on-demand and let the cache failures be silent (since the computation itself is the primary goal).\n\n## ✅ Acceptance Criteria\n- [ ] Memory allocated for in is properly released on cache put failure\n- [ ] No silent OOM errors - at minimum a warning is logged when cache insertion fails\n- [ ] LOD vegetation hints remain consistent even when cache insertion fails\n- [ ] Zig 0.16.0 + SDL3 Dev Environment
Compiler: 0.16.0
assets/shaders/vulkan/taa.vert
assets/shaders/vulkan/water.vert
assets/shaders/vulkan/lpv_propagate.comp
assets/shaders/vulkan/ui_tex.vert
assets/shaders/vulkan/taa.frag
assets/shaders/vulkan/shadow.vert
assets/shaders/vulkan/g_pass.frag
assets/shaders/vulkan/ssao_blur.frag
assets/shaders/vulkan/bloom_downsample.vert
assets/shaders/vulkan/bloom_upsample.vert
assets/shaders/vulkan/debug_shadow.vert
assets/shaders/vulkan/fxaa.vert
assets/shaders/vulkan/post_process.vert
assets/shaders/vulkan/shadow.vert
assets/shaders/vulkan/sky.vert
assets/shaders/vulkan/ssao.vert
assets/shaders/vulkan/taa.vert
assets/shaders/vulkan/terrain.vert
assets/shaders/vulkan/ui.vert
assets/shaders/vulkan/ui_tex.vert
assets/shaders/vulkan/water.vert
assets/shaders/vulkan/bloom_downsample.frag
assets/shaders/vulkan/bloom_upsample.frag
assets/shaders/vulkan/debug_shadow.frag
assets/shaders/vulkan/fxaa.frag
assets/shaders/vulkan/g_pass.frag
assets/shaders/vulkan/post_process.frag
assets/shaders/vulkan/shadow.frag
assets/shaders/vulkan/sky.frag
assets/shaders/vulkan/ssao.frag
assets/shaders/vulkan/ssao_blur.frag
assets/shaders/vulkan/taa.frag
assets/shaders/vulkan/terrain.frag
assets/shaders/vulkan/terrain_debug.frag
assets/shaders/vulkan/ui.frag
assets/shaders/vulkan/ui_tex.frag
assets/shaders/vulkan/water.frag
assets/shaders/vulkan/culling.comp
assets/shaders/vulkan/depth_pyramid.comp
assets/shaders/vulkan/lpv_inject.comp
assets/shaders/vulkan/lpv_propagate.comp
assets/shaders/vulkan/mesh.comp
assets/shaders/vulkan/mesh.comp
assets/shaders/vulkan/ssao.vert
assets/shaders/vulkan/terrain.vert
assets/shaders/vulkan/terrain.frag
assets/shaders/vulkan/depth_pyramid.comp
assets/shaders/vulkan/sky.frag
assets/shaders/vulkan/sky.vert
assets/shaders/vulkan/water.frag
assets/shaders/vulkan/ssao.frag
assets/shaders/vulkan/ui_tex.frag
assets/shaders/vulkan/shadow.frag
assets/shaders/vulkan/lpv_inject.comp
assets/shaders/vulkan/debug_shadow.frag
assets/shaders/vulkan/culling.comp
assets/shaders/vulkan/ui.frag
assets/shaders/vulkan/debug_shadow.vert
assets/shaders/vulkan/ui.vert passes\n\n## 📚 References\n- Zig error handling patterns\n- returns error on OOM\n- Related issue #706: OverworldGenerator.deinit() is a no-op (same module)
🔍 Module Scanned\n (automated audit scan)\n\n## 📝 Summary\nIn , failures are silently swallowed with . When allocation fails (OutOfMemory), the just-computed slice is permanently lost, leaking the allocated memory. Additionally, subsequent LOD vegetation computations silently degrade since the cache stays empty for those chunks.\n\n## 📍 Location\n- File: and \n- Function/Scope: → → (line 405); called from (line 431)\n\n## 🔴 Severity: High\n- High: Memory leaks, incorrect behavior silently degrades to fallback values\n\n## 💥 Impact\nWhen fails with OutOfMemory:\n1. The just-computed slice (allocated in ) is permanently lost - the memory leaks\n2. The cache entry for that chunk key is never stored\n3. Every subsequent call to for this chunk will recompute and re-attempt to store the same hints, potentially leaking more memory on each call\n4. LOD vegetation hints degrade to empty values (lines 730-731), losing tree coverage information in distant terrain rendering\n\n## 🔎 Evidence\n\n\nThe is a where . Each entry stores a full chunk's worth of vegetation hints.\n\n## 🛠️ Proposed Fix\nReplace with proper error handling that also releases the computed hints if the cache store fails:\n\n\n\nOr better, avoid the allocation entirely by using a scratch buffer or by caching at a coarser granularity. For the LOD case specifically, the cache is only used to avoid redundant computation, not to share results across calls - so a simpler approach would be to compute hints on-demand and let the cache failures be silent (since the computation itself is the primary goal).\n\n## ✅ Acceptance Criteria\n- [ ] Memory allocated for in is properly released on cache put failure\n- [ ] No silent OOM errors - at minimum a warning is logged when cache insertion fails\n- [ ] LOD vegetation hints remain consistent even when cache insertion fails\n- [ ] Zig 0.16.0 + SDL3 Dev Environment
Compiler: 0.16.0
assets/shaders/vulkan/taa.vert
assets/shaders/vulkan/water.vert
assets/shaders/vulkan/lpv_propagate.comp
assets/shaders/vulkan/ui_tex.vert
assets/shaders/vulkan/taa.frag
assets/shaders/vulkan/shadow.vert
assets/shaders/vulkan/g_pass.frag
assets/shaders/vulkan/ssao_blur.frag
assets/shaders/vulkan/bloom_downsample.vert
assets/shaders/vulkan/bloom_upsample.vert
assets/shaders/vulkan/debug_shadow.vert
assets/shaders/vulkan/fxaa.vert
assets/shaders/vulkan/post_process.vert
assets/shaders/vulkan/shadow.vert
assets/shaders/vulkan/sky.vert
assets/shaders/vulkan/ssao.vert
assets/shaders/vulkan/taa.vert
assets/shaders/vulkan/terrain.vert
assets/shaders/vulkan/ui.vert
assets/shaders/vulkan/ui_tex.vert
assets/shaders/vulkan/water.vert
assets/shaders/vulkan/bloom_downsample.frag
assets/shaders/vulkan/bloom_upsample.frag
assets/shaders/vulkan/debug_shadow.frag
assets/shaders/vulkan/fxaa.frag
assets/shaders/vulkan/g_pass.frag
assets/shaders/vulkan/post_process.frag
assets/shaders/vulkan/shadow.frag
assets/shaders/vulkan/sky.frag
assets/shaders/vulkan/ssao.frag
assets/shaders/vulkan/ssao_blur.frag
assets/shaders/vulkan/taa.frag
assets/shaders/vulkan/terrain.frag
assets/shaders/vulkan/terrain_debug.frag
assets/shaders/vulkan/ui.frag
assets/shaders/vulkan/ui_tex.frag
assets/shaders/vulkan/water.frag
assets/shaders/vulkan/culling.comp
assets/shaders/vulkan/depth_pyramid.comp
assets/shaders/vulkan/lpv_inject.comp
assets/shaders/vulkan/lpv_propagate.comp
assets/shaders/vulkan/mesh.comp
assets/shaders/vulkan/mesh.comp
assets/shaders/vulkan/ssao.vert
assets/shaders/vulkan/terrain.vert
assets/shaders/vulkan/terrain.frag
assets/shaders/vulkan/depth_pyramid.comp
assets/shaders/vulkan/sky.frag
assets/shaders/vulkan/sky.vert
assets/shaders/vulkan/water.frag
assets/shaders/vulkan/ssao.frag
assets/shaders/vulkan/ui_tex.frag
assets/shaders/vulkan/shadow.frag
assets/shaders/vulkan/lpv_inject.comp
assets/shaders/vulkan/debug_shadow.frag
assets/shaders/vulkan/culling.comp
assets/shaders/vulkan/ui.frag
assets/shaders/vulkan/debug_shadow.vert
assets/shaders/vulkan/ui.vert passes\n\n## 📚 References\n- Zig error handling patterns\n- returns error on OOM\n- Related issue #706: OverworldGenerator.deinit() is a no-op (same module)