Skip to content

fix(director): tolerate slow GPU startup and recover lost devices - #136

Merged
Shuang-su merged 8 commits into
mainfrom
codex/acg-director-device-selection
Oct 9, 2026
Merged

Shuang-su merged 8 commits into
mainfrom
codex/acg-director-device-selection

Conversation

@Shuang-su

@Shuang-su Shuang-su commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

浏览器在电源或驱动状态变化后可能迟迟不返回 WebGPU 设备。Director 原来在20秒直接终止,设备丢失后也缺少保留编辑的恢复入口。此修改采用浏览器默认适配器策略,把20秒改为慢提示,继续等待同一请求;90秒无响应时提供明确错误、重试和对应资源Viewer入口。取消后迟到的设备会释放。

GPU丢失立即停止预览、输出和异步缩略图,显示“画面已暂停”。重新创建同一资源的设备保留工作机位、光圈、视频机位、播放位置、精细度及撤销历史;失败结束后清除过期的等待提示。WebGPU/RGBA32F能力、模型点数、分辨率、孔径和最终128/256/512采样要求保持。

验证:

  • Director44项单元与类型通过;Viewer148项通过;release-contract和MCL通过。
  • 延迟真实原生设备请求的诊断中,重试创建2设备、旧设备销毁1次,主体和环境完成128样本。
  • 闲置GPU丢失后重建:3个视频机位、1.5秒位置、非默认光圈及完整工作状态逐字段相同;撤销恢复2机位。
  • 真实OS低电量模式尚未由Agent开启或测试;用户关闭低电量后当前浏览器已恢复,不能据此断言所有历史故障的唯一原因。
  • rc2的CI37899588517发现Ledger规范行和documentedThrough两个记录不一致,已修正实际记录并重跑148项,未削弱检查。最终HEAD43a2adc6b的CI37900845431等待检查完成。

Refs: MF-106,MF-62。唯一Spec/Plan/证据为docs/changes/106-acg-director/。

来源:完整产品候选3aecaba6b0a7242570c0b03c38fad6a331672b86;初始62d5936由rc1保留,慢启动b708555由rc2保留,最终完整候选由viewer-v5.21.9-rc3保留。5.21.9尚未生产发布;预览及正式SHA、部署和输出将在通过后回填。回退为5.21.8部署6ac87f543e88e78932eb4e4e。


Note

Medium Risk
Changes Director WebGPU initialization, cancellation, and GPU-loss recovery paths—user-visible if mishandled—but scope is limited to photography startup/runtime and does not alter Viewer SDK or final render contracts.

Overview
5.21.9 hardens Director WebGPU startup and recovery without changing photography quality (RGBA32F, aperture, sampling targets).

Graphics creation now uses the browser-default adapter (powerPreference: "default") and a new waitForGraphicsDevice flow: 20s is only a slow-start hint with retry/Viewer actions, 90s is the real failure boundary, and cancel/retry aborts in-flight work and destroys late devices so stale GPUs cannot update the UI. Model loading and display callbacks honor the active AbortSignal.

On GPU loss, a shared observeFailure hub stops preview/export work immediately; the app can recreate the device for the same resource and restore camera, project/shots, video timeline state, selection, and dirty flag. Error UI distinguishes “retry frame” vs “recreate graphics device,” and controls pause while the device is unusable.

Release metadata (data/index.json, version history, ledger, MF-106 docs) and metaflow-viewer 5.21.9 version mirrors are updated; new unit tests cover startup timers and device-loss observation.

Reviewed by Cursor Bugbot for commit 43a2adc. Bugbot is set up for automated code reviews on this repo. Configure here.

Keep float capability checks and the full aperture model unchanged. Record the initialization failures and bounded device-selection comparison.

Refs: MF-106, MF-62
Keep resource objects unchanged and retain prior release history. Refs: MF-106
Copilot AI balanced review requested due to automatic review settings October 9, 2026 06:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T07:55:51.285379Z 43a2adc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 9da97d9e-078c-414d-8380-a8c79da445e3)

@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: c830eae9-953c-437a-a73b-43f9a1036aac)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f54794bb53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread metadata/version-history.json Outdated
Refs: MF-106, MF-62

Validation: 44 Director tests, type check, native slow-request cancellation and GPU-loss recovery
Refs: MF-106, MF-62

Validation: release mirrors and provenance witness
Refs: MF-106, MF-62

Validation: release contract and all resource objects unchanged
@Shuang-su Shuang-su changed the title fix(director): use the available WebGPU adapter fix(director): tolerate slow GPU startup and recover lost devices Oct 9, 2026
@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 705a2046-86c6-47e2-ac05-a165c2651c4a)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 150c307ab8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread metadata/version-history.json Outdated
Comment thread docs/metaflow-viewer-change-ledger.md
@cursor

cursor Bot commented Oct 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 54c5a537-dd17-45e1-82cc-939a096dab19)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43a2adc6b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread metadata/version-history.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants