fix(core): preserve instance buffer during resource gc#3065
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Walkthrough
ChangesInstance buffer lifetime
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev/2.0 #3065 +/- ##
===========================================
+ Coverage 79.52% 79.66% +0.13%
===========================================
Files 904 904
Lines 101168 101221 +53
Branches 11377 11431 +54
===========================================
+ Hits 80456 80638 +182
+ Misses 20528 20399 -129
Partials 184 184
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
GuoLei1990
left a comment
There was a problem hiding this comment.
二轮审查 @ 882db26c — 唯一 P3 已闭环,LGTM
自首轮 207d03584c 起线性 +1 commit(compare ahead_by:1/behind_by:0 无 force-push):882db26c chore(core): remove instance buffer comments,仅 InstanceBuffer.ts 删 2 行注释、isGCIgnored=true 逻辑逐字不变。
首轮唯一 [P3](新增两行 // 注释末尾带句号、不合本目录 // 惯例)作者选择整段删除这两行 // 注释——闭环,本目录 // 无句号惯例恢复。核心修复(InstanceBuffer 裸 buffer 打 isGCIgnored=true 防 ResourceManager.gc() 回收 active GPU-instancing buffer)与首轮逐字一致,本轮零逻辑改动无需复核。CI 全绿。
无 P0/P1/P2/P3。可合。
Summary
BatcherManager.destroy()and engine teardownRoot cause
InstanceBufferretained its GPUBufferthrough a plain engine-owned field, so it had no component reference count. Because the buffer was not excluded from ordinary resource GC,ResourceManager.gc()could destroy it while the render pipeline still held and reused the wrapper. The next upload then reached a destroyedGLBuffer, causing repeatedbindBufferfailures and WebGL context loss.Validation
HEADLESS=true pnpm exec vitest run tests/src/core/RenderPipeline/InstanceBuffer.test.tspnpm run b:modulepnpm run b:typespnpm run lint(0 errors)git diff --checkFixes #3064
Summary by CodeRabbit
Bug Fixes
Tests