Files
workinf_Blender_Wasm/docs/tasks/WBV2-P1424-001-compute-ssbo/CS11.md
mes123456 f3e21c6b98
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
chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer,
web workflow engine and protocol, tooling, docs and task records.
Large generated evidence, user-testing archives, build snapshots and
imported test assets remain untracked.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-10 11:18:01 +08:00

53 lines
3.1 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.
# CS11:设备限制、缓存和传输成本收敛
- queueTask: WBV2-P1424-001
- parentTask: WBV2-P1424-000
- packageStatus: planned
- dependsOn: CS07, CS09, CS10
- validation: NOT_RUN;acceptance: NOT_CLAIMED
## 业务与交付
连续编辑/重绘复用同一原生 shader 与资源,保持正确版本和有界 GPU 占用
适合主工作区持续使用的有界缓存与传输策略,记录性能数据未测量。
## 最小输入与源码依据
- `web/app/src/workers/gpu-compute.worker.ts`
- `web/app/src/engine-client/gpu-compute-host.ts`
- `web/protocol/gpu-compute.ts`
- `blender-5.2.0/source/blender/gpu/webgl/webgl_shader.cc`
- `blender-5.2.0/source/blender/gpu/webgl/webgl_backend.cc`
- worker 目前逐请求编译 shader、创建 pipeline,且每次上传和回读所有 buffer。
- 现有 ownedBuffers 有数量/字节上限;多 binding alias、staging、纹理和 pipeline 需要完整计入资源策略。
## 实现步骤
1. 在首次生产能力协商中记录真实 adapter/device limits/features,传回 native 创建路由,避免 JS 和 native 上限不一致。
2. pipeline cache 以预处理后 shader、specialization、binding ABI、compiler 版本和 device generation 为键;失败不可缓存成成功。
3. 实现明确的 dirty/version 传输规则,仅对消费需要的写资源回读;保留 CS03 原子提交与 CPU 可读语义,再进行多 pass 批处理。
4. 将持久+临时+staging+texture 资源纳入内存预算和可回收策略,抑制重复编译和无界累积;不在本阶段跑 benchmark。
## 失败边界
性能改动不能绕开同步、释放和失败提交;设备不支持的功能不能通过提高常量上限伪造。
发生阻塞时记录具体业务、原生函数/create-info、producer/consumer 和下一修复动作;保留既有产物,继续无此依赖的实现卡,不用缺失证据作为实现阻塞。
## 延后的用户场景(当前不执行)
- 重复重绘缓存失效与重用
- shader/constant/device 变更
- 预算不足、LRU 与重建
- 只读资源无脏数据回灌
没有在本次拆解中创建或运行测试 fixture。原生 shader、现有模板和真实业务数据是实现输入;需要新增用户使用 fixture 时在全项目实现完成后安排。
## 交接
每次报告填写:实际 workflow/route、源码函数与修改、仍未实现接口、产物元数据(仅生成时)、失败/no-mutation 策略、implementation 状态、validation=NOT_RUN、acceptance=NOT_CLAIMED、下一实现动作。记录 unitCount/verifiedUnits/unverifiedUnits/sourceTreeSha256 的来源;未绑定/未验证不增记覆盖。
执行约束:本卡属于 WBV2-P1424-001 / parent WBV2-P1424-000,nextTask=null 保持不变。全部功能实现前不执行测试、回归、冒烟、浏览器验收、类型/语法/上下文检查或证据审计。仅为产物生成进行必要增量编译。源码检索使用 tools/web/search-wbv2-batch-source.mjs 的精确 --source/--unit;GLSL fixture 只读取本卡列出的原文件。不加载完整专项规划、历史日志或源码 inventory。JS 仅承担浏览器 API/传输;几何算法仍使用 OCCT 出口,Three.js 仅显示。