fix(web): keep the native viewport usable after opening a large project
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

root cause chain, matching desktop semantics: the desktop runs a file load on
the WM thread, so nothing else is dispatched while it runs. the web port sends
pythonExec/viewportObjectAxis while an 85 s open (and a frame posted before it)
still own the worker; those requests pass the 30 s timeout, the client marks
Main uncertain, and every later frame is rejected with "WebEngine Main 状态待恢复"
until the surface stops. the test helper exposeWebTools() also switches to the
web view, idling the pump and producing the old "needs a wake-up" artefact.

fixes:
- client: timeouts of read-only sync commands no longer mark Main uncertain;
  only commands that may mutate it do.
- canvas: a frame rejected for Main recovery keeps the pump alive with a bounded
  250 ms retry, and the frame carrying a new owner counts as the first
  acknowledged frame so readiness returns one round-trip sooner.
- worker: publish the scene only when Main's revision advanced or the frame
  carried input; publish geometry only with a revision change and let the app
  retain the previous buffers. response payloads drop from 1888 transfers to a
  small snapshot instead of a full SceneIR and geometry projection per frame.

regression case: opening the 238-object fixture inside the native view reaches
readiness with no pointer input and consumes a middle-drag; headed run passes
in ~2.4 minutes. acceptance stays NOT_CLAIMED.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-12-06 08:32:19 +08:00
parent 1a2968bbcf
commit 5a21a34c34
7 changed files with 78 additions and 26 deletions

View File

@@ -12,7 +12,7 @@
| # | 未完成项 | 来源计划 | 现状与证据 | 建议处理 |
|---|---|---|---|---|
| 1 | 大工程打开后视口输入未就绪:打开 `yt2-imported.blend`(238 对象 / 40 万顶点)后 `data-native-input-ready` 持续 `false`,指针输入也无法唤醒 | `glowing-petting-map.md`(`WBV2-COLLADA-001` 残余 1) | 已用插桩探针推翻旧假设:worker 端每帧的原生绘制、SceneIR 与几何发布全部成功(`ok=true`,且每帧 `mutated=true`,单帧约 20 s),但页面在 ownerGeneration 变更帧之后不再投递新帧;`data-native-display=acknowledged`、`data-native-frame-size` 有值、区域 `visible`,就绪仍为 `false` 超过 10 分钟;单次指针移动不产生新帧。原生画布同时出现主区域空白(与 soak 残余同一形态)。有头用例已加入 `collada-model-pipeline.spec.ts` 并标 `test.fail` 作为复现器 | 分三步:① 定位 owner 变更后页面停止投递帧的原因(`invoking`/`pendingInvoke` 挂起 vs 响应未返回);② 帧路径不再每帧重发整场景(改为按需/变更时发布);③ 修复大工程 open 后原生主区域空白。P0 |
| 1 | ~~大工程打开后视口输入未就绪~~(已修复) | `glowing-petting-map.md`(`WBV2-COLLADA-001` 残余 1) | 根因:open 期间/之前的同步命令超时使客户端判定 Main 不确定,帧被拒绝且画布终止;测试的 `exposeWebTools()` 切到 Web 视图进一步造成“需额外输入”的假象。已修:只读命令超时不判定不确定、Main 恢复等待重试、owner 变更帧计入就绪、按 revision 发布场景与几何(响应从 1888 个 transfer 降到小负载)。有头回归用例在原生视图内无输入恢复就绪并通过(约 2.4 分钟) | 已关闭;保留用例防止回归,验收仍 `NOT_CLAIMED` |
| 2 | 渲染课程成片缺失:`rendering-lesson-720p.mp4` 已撤回,未重录 | `binary-dreaming-ladybug.md`;`RENDER_PATHS_20261116` 残余 4 | 旧片 1477.8 s 与 `timeline.json` 13 章只覆盖到 1125 s 不符而撤回;`check-render-tutorial.mjs` 现输出 `AWAITING_RERECORD` | 按现有章节重录并重新混音,跑 `check-render-tutorial.mjs` 到非 `AWAITING_RERECORD`;保持 `NOT_CLAIMED` |
| 3 | 满尺寸场景 undo/redo 超出单例窗口:YT2 `setObjectOrigin` 后 undo/redo 在 185 s 内未完成 | `glowing-petting-map.md`(残余 4) | 两次尝试均被上限终止;小场景同一路径 PASS(`attempt-OFrAEc`) | 评估 13 MB Main + 236 网格的历史重建耗时;先量化再决定预算或增量恢复;单独开批次 |
| 4 | 编辑模式 `INDIVIDUAL_ORIGINS` 回退为中位点枢轴;视口元素点选只更新 React 选择、不同步引擎 BMesh 选择 | `mossy-giggling-moonbeam.md`;`VIEWPORT-NAV_20261125` 残余 | `docs/status/VIEWPORT-NAV-20261125.md` 明列;批次二/三已接入,残余保留 | 分别开小批次:枢轴语义按桌面源码补;元素选择同步 BMesh 需原生选择接口证伪后再定范围 |

View File

@@ -52,7 +52,7 @@
## 残余缺口(真实、未修复)
1. **大工程打开后视口输入就绪标志不恢复**:打开 `yt2-imported.blend` 后 `data-native-input-ready` 保持 `false` 超过 10 分钟,`data-native-display=acknowledged`、`data-native-frame-size` 有值、原生区域仍 `visible`,单次指针移动也不产生新帧;原生画布同时主区域空白(与 soak 残余同形态)。插桩结论(此后测量):worker 端每帧的原生绘制、SceneIR 与几何发布全部完成(`ok=true`),且每帧 `mutated=true`(单帧约 20 s),说明瓶颈不是 `readyOwnerFrames>=2` 判定,而是 ownerGeneration 变更帧之后页面不再投递帧、且帧路径每帧重发整场景。影响:打开大工程后用户需要一次额外的输入唤醒才可继续操作视口。复现器:`web/tests/e2e/collada-model-pipeline.spec.ts` 的 `test.fail` 用例;修复需分三步(定位停帧原因、按需发布场景、修复主区域空白)。
1. **大工程打开后视口输入就绪标志不恢复(已修复)**:根因链——open 期间与 open 之前发出的同步命令(`pythonExec`、`viewportObjectAxis`)排在 85 s 的 open 和先前那一帧之后,超过 30 s 默认超时,使客户端 `mainUncertain=true`;此后所有帧被拒绝为“WebEngine Main 状态待恢复”,绘制循环终止。测试侧 `exposeWebTools()` 还会切到 Web 视图使帧泵空闲,放大了“需要额外输入唤醒”的假象。按桌面“文件加载独占事件循环”的语义修复:只读同步命令超时不再判定 Main 不确定(`WebEngineClient`);应用遇到该拒绝时保持帧泵并按 250 ms 重试等待迟到响应,owner 变更帧计入第一帧就绪(`WasmGPUCanvas`);帧路径仅在 Main revision 变化或携带输入时发布场景、几何仅在 revision 变化时发布且页面保留上一份几何(`web-engine.worker.ts` + `App.tsx`)。回归用例 `COLLADA large open republishes viewport readiness without extra input` 在原生视图内打开工程,无输入断言就绪恢复,再以中键拖拽确认原生帧回执前进;有头通过(约 2.4 分钟)。open 期间仍会记录两条超时日志,但不再终止画布。`acceptance` 保持 `NOT_CLAIMED`。
2. **完成度评估器**:`tools/web/evaluate-wbv2-completion.mjs` → `coverage-baseline.mjs:47` “historical references must be an array”,使 manifest 落为 `BLOCKED`,与用例执行结果无关。
3. ~~**失败导入的状态文案**:状态栏直接显示转换错误堆栈。~~ 已修复(2026-11-22):`model-convert.worker.ts` 只回传 `error.message` 不再回传 `error.stack`;`App.tsx` 的 `importColladaFile` 只取首行并去掉 `Error:` 前缀。负例 `attempt-PuR5JL` 断言状态栏含 `COLLADA 导入失败` 且不含堆栈行(PASS)。
4. **满尺寸场景的 undo/redo 超出单例窗口**:对 YT2 场景执行 `setObjectOrigin` → undo/redo 在 185 s 上限内未完成(历史恢复需重开 13 MB Main 并重建 236 网格),两次尝试均被上限终止、无回执。小场景(nested_hierarchy 导入)同一路径 PASS(`attempt-OFrAEc`)。需单独评估满尺寸历史重建的耗时与预算。