Files
workinf_Blender_Wasm/docs/status/GPU-VULKAN-CRASH-FIX.md
mes123456 29cb38adb6
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
fix(web): rebuild offscreen region buffers whose storage was lost
the 3d viewport already recreates its attachments when a WebGL texture loses
live storage, but non-viewport regions only freed their offscreen on a size or
format change, so a lost color attachment could never regain pixels and the
region stayed blank. free and recreate the offscreen when its storage is gone,
matching the viewport recovery.

evidence: the mid-run blank was observed once (GPU-SOAK-20261205-185353, blank
from round 21 with a selection-abort notice) and did not reproduce in two
later fault soaks (each 50 rounds) or four targeted probes including a
cancel-then-toggle sequence. the rebuild was checked with a 3-minute fault
soak (GPU-SOAK-20261205-211912, 49 rounds, STABLE). the causal link to the
observed blank is unproven; acceptance stays NOT_CLAIMED.

wasm 6183479e78115f20e76dbdc6b98be5ce9e4c425a4e99abca9c3ed88972d236ae.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-05 22:05:18 +08:00

60 lines
4.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GPU 进程崩溃修复与原生画布冻结(交接记录)
## 断点
- 源码改动已全部落盘:引擎 `webgl_backend.cc`、`web/app/src` 的 compute/canvas 改动、文档。
- 剩余工作:完整验证矩阵(Vulkan 20 分钟 soak、SwiftShader 10 分钟对照、Clip 28 例)与提交。
## 已完成
1. **崩溃根因(已修复)**:`WebGLFrameBuffer::release_transfer_images()` 只把 `transfer_id_`
清零,没有 `glDeleteFramebuffers`,每次 clear/copy/blit/readback 泄漏一个 FBO。
`?glStats=1` 显示 53 秒空闲交互净增约 1.1 万个 framebuffer(创建 20806 / 删除 9458);
空闲显存 488 MiB → ~7.7 GiB(约 65 秒)后 GPU 进程被杀
(`vkCreateSwapchainKHR failed`,exit 133)。
2. **修复**:`release_transfer_images()` 在清零前调用
`glDeleteFramebuffers(1, &transfer_id_)`。增量构建 `web_engine` 并用
`node tools/web/sync-web-engine-runtime.mjs` 同步,产物 SHA-256
`74736b019744a148cc272607344190c95ee189d11cbd5e9f03b0469505021fc8`。
3. **修复后证据**:20 分钟 Vulkan 交互 soak 0 次 GPU 进程崩溃
(`tests/golden/GPU-SOAK-20261205-144451/report.json`,判定 CANVAS_STALL),
空闲显存稳定在 ~700 MiB。
4. **画布冻结(既有缺口,已修触发机制)**:约 5 分钟后原生画布的主区域
(视口/大纲/属性)停止绘出并变空白,页面、合成器、DOM HUD 仍存活;冻结后原生算子
仍生效(探针四:点击 `Add Monkey` 后状态栏变为 `Active CUBE · Objects 5`,画布哈希变化),
说明引擎与呈现仍在,坏在 `wm_draw.cc` 的 Browser region draw buffer 恢复路径。
触发机制:操作提示条以流内元素渲染,每次出现/消失都把原生画布在
`1440x900`/`1440x882` 之间 resize,反复释放/重建 region draw buffer。
修复:`WasmGPUCanvas` 的 `grabNotice` / `operationNotice` 改为绝对定位覆盖层,不再占布局。
A/B:改前同一探针约 5 分钟冻结;改后 12 分钟 222 轮画布区域零冻结。修复后的正式 20 分钟
Vulkan soak 连续三次判 `STABLE`(`tests/golden/GPU-SOAK-20261205-161007/`、`-165031/`、
`-171129/`:各 351 轮、画布全程存活、0 次 GPU 进程崩溃);SwiftShader 10 分钟对照同样
`STABLE`(`tests/golden/GPU-SOAK-20261205-162105/`:172 轮、0 崩溃)。
5. **A2/A3/A4/A5 排查结论**:shader/layout/pipeline 缓存(A2)与 staging 池(A3)保留,
统计显示 1751 次运行只建 3 条 pipeline、12962 次复用;device-lost 错误码与开发期故障注入
(`?computeFault=destroy-after-N`)保留,附着期 `COMPUTE_DEVICE_LOST` 已由 `failAttach`
有界重放接通(见下),`preserveDrawingBuffer=false`(A5)不稳定,已完整回退并记为排除项。
## 残余
- Clip 套件 28 例已通过(`tests/golden/CLIP-HEADED-20261205-162214/`,acceptance `NOT_CLAIMED`,
候选绑定 wasm SHA-256 `74736b01…`)。
- A4 的自动重挂载已接通:附着期 `COMPUTE_DEVICE_LOST` 现在经 `failAttach` 有界重放
(重放预算改为 ref,跨 effect 重跑仍生效)。注入探针 `?computeFault=destroy-after-3` 实测
attach #2、detach #1、`frame=1440x900`、`inputReady=true`,画面恢复渲染。
- 重放后主区域空白:单次观察(`GPU-SOAK-20261205-185353` 从第 21 轮起空白,画面停在
“选择操作已中止”),随后两次同参数故障 soak(`-203542`、`-203849`,各 50 轮)与 4 个定向
探针(含 cancel 后立即 hide/show 的复现尝试)均未复现,判为未复现竞态。
同时补上恢复缺口:离屏 region 的颜色附件丢失 GL 存储时现在会释放并重建(`wm_draw.cc`,
与 viewport 路径一致);重建后 3 分钟故障 soak(`GPU-SOAK-20261205-211912`)判 `STABLE`
(49 轮、画布存活)。该改动对原始空白的因果未确认,验收保持 `NOT_CLAIMED`。
- 选择着色器缺口已关闭:全部 12 个 `overlay_*_selectable` 变体可构建;视口点击选择、
空白处取消、`A` 全选经 `bpy.select_get()` 实测正确,点击不再出现“选择操作已中止”。
## 下一动作
- 若主区域空白再次出现,用同参数 soak 回执(含 `round-*.png` 与 `chrome-stderr.log`)定位首个
空白轮次与触发的交互。
- 更新 `docs/web/KNOWN_LIMITATIONS.md`、`docs/web/HEADED-TOOLS.md` 的最终措辞。
- 提交到 `web/mesh-decimate`,不自动合并。