Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

Integrate tested Claude fixes and detach watchdog safely at shutdown

Veyra Goal Agent9c14ee28a917
diff --git a/AGENTS.md b/AGENTS.md
index 8c15e189..0a6c8b0e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Veyra 项目 Agent 执行规则
+> **2026-10-11 Claude 修复本地整合**:用户明确要求将目前 Claude 分支修复合入 main。按 docs/MERGE_CLAUDE_FIXES_PLAN_2026-10-11.md,在 codex/merge-claude-fixes-20261011 从 main5ba186a 整合六个已提交的 Claude 修复分支及已验 UI29e33df;保留分支内负优化回退,只做必要冲突/生命周期适配、构建与定向回归,覆盖这些接点的历史冻结及 no-merge。通过后允许本地 main 合并,不 push/Release/打包/关机。独立 start/bundle 保护54旧工作树/496脏文件,来源分支不改;不派Agent、不改运行库/驱动/模型/真实配置,保持33ms统计和普通GPU优先级。所有产物E盘;每测试≤300秒、构建≤900秒,现场未验边界如实记录,不把各分支历史通过冒充合并验证。
+
> **2026-10-10 VFG 优化(Claude,任务一)**:用户“开始进行优化吧,全部搞定掉”“开始之前先创建存档,然后开分支弄,如果是结果是性能反而倒退,直接退回”。存档 `checkpoint/pre-claude-perf-20261010`(main 5ba186a)与 E 盘 `archives/claude-perf-20261010`(bundle 已 verify、46 工作树/495 脏文件 start.json);在 `claude/vfg-20261010` 只改 VFG 后端/图内 VFG 分支/实时 VFG 准入/状态提示,软件链路在独立分支,二者不互相依赖。同 EXE 测试开关 A/B,负优化当场退回并留证:V1 保留(4X 201→215 fps),V2、V3 退回,V5 状态提示保留。不改 DLSS/XeSS/FSR、运行库/模型/驱动/用户配置;无 merge/push/Release,测试≤300 秒、构建≤900 秒。详见 docs/VFG_TASK_2026-10-10.md。
> **2026-10-10 软件链路优化(Claude,任务二)**:用户“开始进行优化吧,全部搞定掉”“开始之前先创建存档,然后开分支弄,如果是结果是性能反而倒退,直接退回”。存档 `checkpoint/pre-claude-perf-20261010`(main 5ba186a)与 E 盘 `archives/claude-perf-20261010`;在 `claude/pipeline-20261010` 只改采集→效果衔接→送显/上屏及其诊断与提示,VFG 在独立分支。同 EXE 测试开关 A/B 并用 PresentMon 对齐上屏:C1 上屏时间日志与 C2 提示保留,C3 配对节奏样本保留,C7 交换链等待负优化已退回,C4/C5/C6 经实测无可得收益未实施。不改 NR/SR/FG 模型与运行库/驱动/用户配置;无 merge/push/Release,测试≤300 秒、构建≤900 秒。详见 docs/PIPELINE_TASK_2026-10-10.md。
> **2026-10-10 采集中卡死(Claude,logs(15))**:用户要求排查修复“玩着玩着卡死”,并按“NVIDIA 信息浮窗开启后 2.0 以后卡死”的线索参照小飞机适配处理,游戏加加一起适配。存档 `checkpoint/pre-claude-freeze-20261010`(main 5ba186a)与 E 盘 `archives/claude-freeze-20261010`;分支 `claude/freeze-fix-20261010` 只改监控/叠加软件兼容(启动检测 NVIDIA Overlay.exe / NVIDIA Share.exe / GamePP*.exe → 软件界面,运行中出现提示重启)、引擎卡死监视([engine-hang] 栈、veyra-hang-*.dmp、提示)与有界退出。nvspcap64.dll 浮窗关闭时也会加载,不能作为开启信号;GPU 优先级“高”同样卡死,默认值不改。本机未复现,现场效果待用户确认。无 merge/push/Release。详见 docs/FREEZE_FIX_2026-10-10.md。
diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.md
index dc774f1d..e185c652 100644
--- a/docs/CURRENT_STATUS.md
+++ b/docs/CURRENT_STATUS.md
@@ -1,5 +1,9 @@
# 当前项目状态 / Current Status
+## 2026-10-11 Claude修复整合验收完成
+
+六个Claude修复分支(VFG/配对统计/浮窗卡死诊断/内容节奏/音频预读/Elgato)及已验UI29e33df已在隔离分支完成整合,补退出回调竞态,负优化均保持撤回。50对象依赖闭包/19EXE、完整CMake、26项回归、滚动裁剪和卡死注入、普通class2 GTA NR性能守卫通过;没有恢复高频UI绘制。实测候选准备合入本地main;最终提交与保护核对见本轮收尾。原54工作树/496脏文件与1626文件测试包保持;没有新包、推送或发布,NV显存和实卡边界不变。详见[整合验收](MERGE_CLAUDE_FIXES_REPORT_2026-10-11.md)。下方未合并语句是各任务历史状态。
+
## 2026-10-11 软件 UI 残影及超分图标裁剪
在 `codex/ui-smear-handoff-20261011` 接手 Claude 未完成修复。已复现 Qt6.8.3 软件 Shape 的空裁剪越界;旧环境变量没有实际作用。最终仅软件图标/虚线边框改用缓存 SVG Image,GPU 保留 Shape。整窗重绘、条件重绘、软件 Shape layer 原型均撤回;没有新持续绘制或修改 33ms 统计策略。
diff --git a/docs/MERGE_CLAUDE_FIXES_PLAN_2026-10-11.md b/docs/MERGE_CLAUDE_FIXES_PLAN_2026-10-11.md
new file mode 100644
index 00000000..d19970cc
--- /dev/null
+++ b/docs/MERGE_CLAUDE_FIXES_PLAN_2026-10-11.md
@@ -0,0 +1,27 @@
+# Claude 修复本地合并与交互验收
+
+用户要求“把目前分支claude做的一些修复合并到main”。按最近未合入的完整修复分支整合;历史 no-merge 被本次明确授权覆盖。没有新推送、包、发布或关机。
+
+## 来源固定
+
+| 分支 | tip | 最终范围 |
+| --- | --- | --- |
+| claude/vfg-20261010 | d3803ab | 跳过预算组时保留VFG输入历史、测试诊断、负载提示;倍率降档和连续CUDA实验已撤回 |
+| claude/pipeline-20261010 | be834fd | Present统计、重复/失效组配对校准、同步说明;交换链预等实验已撤回 |
+| claude/freeze-fix-20261010 | d0694d7 | NVIDIA浮窗/游戏加加兼容、引擎无进展诊断、有限等待退出 |
+| claude/dedup-cadence-20261011 | 67574f2 | CPU画面内容去重与有界内容节奏;硬解来源保留原兜底 |
+| claude/audio-reader-20261011 | 87ca1e5 | 文件音频独立读包、有界队列、读盘阻塞诊断 |
+| claude/elgato-hdr-20261011 | 147e76c | Elgato格式/色调映射和P010混合色度范围 |
+| codex/ui-smear-handoff-20261011 | 29e33df | 软件图标/虚线裁剪、保持局部更新与33ms统计 |
+
+各分支详细原因、失败与边界分别见自身同日记录,不将待实卡确认的候选宣传为根治。
+
+## 顺序及保护
+
+1. main基线5ba186a;独立不可变archives/merge-claude-fixes-20261011/start.json与source-before.bundle保护54旧工作树/496脏文件,保留各来源tip。隔离worktrees/merge-claude-fixes-20261011,所有产物E:/项目/Veyra对应用途子目录。
+2. 按表顺序merge --no-ff完整tip,防止挑选提交漏掉负优化revert。AGENTS/WORKLOG独立历史追加冲突用三方union保留记录,源码/翻译不用union。初次整合源码自动合并,无源文件冲突。
+3. 复查共同接点:EngineController的去重/配对/看门狗、EnhanceGraph的VFG/输入范围、QmlPlayerBridge的状态/浮窗、软件UI的clip。已发现看门狗通知读取的hangPreviousStatus在watchdog成员前销毁,须在控制器析构体内join后解除回调,以避免退出竞态。
+4. 重编所有变更及头文件依赖闭包,显式新Watchdog/DeckLink、MOC、catalog和YUV shader;复用已验不可变对象时核对SHA并如实标明。实际CMake配置检查新增源、测试栈选项及依赖,不用关闭功能的配置冒充最终GUI能力。
+5. 合并后定向覆盖音频拖动/恢复/慢读、内容节奏/60→30、Elgato颜色/采集合同、VFG GPU、设置重建/回退/关闭项、生命周期、QML输入布局、真实GTA播放、软件UI裁剪与卡死诊断。GPU测试串行、不加竞争负载,每进程≤300秒。优先复用既有测试入口,只在共同接点确有缺口时补充。
+6. 保持VTelemetryValue SHA、默认GPU优先级、既有SR实验撤回;核对DLL/SDK/模型及原测试包逐文件SHA,真实配置不动。记录所有失败并修复后再计通过。
+7. 测试通过后冻结整合tip,main --no-ff合入,确认完整Git树相同;文档记录源码/构建/日志/现场边界。源分支/其它工作树不改、不删除;本地main最终干净,checkpoint/bundle/最终回执保全。
diff --git a/docs/MERGE_CLAUDE_FIXES_REPORT_2026-10-11.md b/docs/MERGE_CLAUDE_FIXES_REPORT_2026-10-11.md
new file mode 100644
index 00000000..3a768b5f
--- /dev/null
+++ b/docs/MERGE_CLAUDE_FIXES_REPORT_2026-10-11.md
@@ -0,0 +1,46 @@
+# Claude 修复整合验收记录(2026-10-11)
+
+本次只执行用户授权的本地 main 整合。起点 `5ba186a91e868c28b4b5ec46c9166aa321d90998`,隔离分支 `codex/merge-claude-fixes-20261011`。六个已完成 Claude 分支及已验 UI 完整 tip 依次 --no-ff 合入,所有负优化 revert 随完整分支保留;来源和顺序见 [方案](MERGE_CLAUDE_FIXES_PLAN_2026-10-11.md)。本文件记录实测候选;main 合并与最终提交另由本任务 final.json 和后续工作记录确认。
+
+## 保留的修复与适配
+
+- VFG 跳过预算组时保留输入历史与负载提示;自动降低倍率、连续 CUDA 等负优化保持撤回。
+- 呈现统计和重复/禁用但已完成计算的组参与配对节奏校准;交换链预等实验保持撤回。DXGI Present→vblank 统计不是屏幕光学延迟。
+- NVIDIA 信息浮窗/游戏加加的兼容选择、8 秒无进展栈/小型 dump 诊断与有界退出。现场卡死仍是候选修复,不能把注入成功当真实根因已复现。
+- CPU 可见采集画面的内容去重/有界节奏与 60→30;硬解来源保留没有 CPU 图像时的原有兜底。微小物体可能不落在 64×36 采样点,最迟保持上限会留帧;未宣称所有画面无误判。
+- 文件音频独立读包、2.5 秒/4096 包/16MiB 有界队列及慢读诊断;seek 仍同步清空与预填充,稳态端点线程不读盘。
+- Elgato 8 位卡内色调映射及非 MK.2 P010 混合色度范围,手动范围优先;官方控制属性失败边界保留。
+- 软件 UI 图标与虚线使用缓存 SVG Image,GPU 原 Shape、33ms 统计不变,整窗重绘和 QuickPrivate 方案保持撤回。
+
+源码自动合并没有冲突。只有 AGENTS/WORKLOG 的独立追加历史冲突,用三方对照保留全部记录,没有对源码或翻译做 union。人工复查共同接点发现 `hangPreviousStatus_` 声明在 `watchdog_` 后,逆序析构会先释放回调读取的字符串;本轮在 EngineController 析构体内等待 worker 后显式 reset watchdog,提前解除回调,避免退出竞态。没有顺手更改其它模型、倍率或调度默认值。
+
+## 本轮构建和回归
+
+`py -3.11 -I scripts/acceptance/merge-claude-fixes-build.py` 成功:50 个变更/头文件依赖闭包对象重新编译,19 个 EXE 重链接,76.6 秒。显式包含新 EngineWatchdog、Bridge MOC、翻译资源、DeckLink 及 YuvToLinearRgb shader。其余已验对象、静态库和 SDK 以 SHA 核对复用,**不是 clean 全量重编**。GUI SHA256 `d4e5aa25cf78120c51eb7793165452101b10798bfd67e1c6cdc724f6ba9d078a`,仍是本地 2.0.6 开发标识,没有改发布版本。
+
+`...merge-claude-fixes-configure.py` 实际配置当前完整 CMake:QML、PS5、Moonlight、Xbox、DeckLink、Magewell 和现有实验运行接口保留;Watchdog 编译单元、8MiB 回放测试栈、无 QuickPrivate 均核对。私有滚动 probe 只替换主程序测试驱动,链接本轮全部产品对象,生产 EXE 不含该驱动。
+
+`...merge-claude-fixes-test.py` 26 项全部 exit0:效果合同/时间线、HDR/采集颜色、呈现生命周期、设置重建及回退、关闭项编辑的列表/节点两路径、SR 已有回归、数字输入/菜单/组件、VFG GPU、60→30、音频抖动/起播跳转/欠速/慢读/旧读法对照/倍速、反复跳转和文件端点。文件播放使用用户 GTA 原视频;内容节奏使用已有测试渲染文件,不替换用户媒体。
+
+`py -3.11 -B scripts/acceptance/merge-claude-fixes-gui.py pixels`:生产 Main/ProPage、150% DPI、3 NR 层、80 步滚动至100px,QScreen 只读已呈现像素。旧 QML 对照残影1237像素、完整重绘后的头部越界209像素;合并后 OBS/RTSS 兼容选择均0,37图标 Ready,空闲3秒分别3/2帧,没有持续绘制。PNG、逐项 JSON 和人工截图复核保留。这里没有重新执行 OBS 实际采集或 RTSS 真实注入。
+
+`...merge-claude-fixes-gui.py watchdog`:12秒延迟注入在8047ms报告,10帧栈、1个1239193字节 dump,随后恢复并正常退出;永久阻塞注入在8172ms报告,10帧栈、1个1245672字节 dump,关闭后3015ms结束等待并终止本进程。两个进程 exit0,预期 engine-hang 错误日志单独校验,未把其它错误过滤掉。这证明诊断/恢复/退出机制,不证明反馈者的驱动卡死根因。
+
+## 普通调度性能核对
+
+`...merge-claude-fixes-gui.py performance`:GTA 原4K30、NVIDIA原版 NR 单层内部1080p/强度1/风格0,SR/FG/自动调控关,实际 GPU 调度 class2。每例40秒有效播放、29个前台一秒样本。NR 数字为一秒 GPU 均值的中位数;CPU 为进程 CPU 秒/墙钟秒,既不是整机百分比,也不是纯 UI 耗时。
+
+| 界面 | NR 前→后 | UI 次/秒 | 进程 CPU 秒/秒 |
+| --- | --- | --- | --- |
+| gpu | 5.847270 → 5.862661 ms(+0.26%) | 36 → 35 | 0.262846 → 0.237482 |
+| obs | 5.850922 → 5.820384 ms(-0.52%) | 35 → 36 | 0.219905 → 0.253086 |
+
+GPU 对照是原已验完整包与整合产品;软件对照使用同一整合 EXE,仅切换旧/新 VIcon 和 ProPage,以排查绘制退化。四例视频提交均30fps,不冒充物理屏幕刷新率。原短测守卫:UI增加≤3次/秒、NR增加≤3%、CPU增加≤15%。首轮软件 CPU +15.09% 超线,因此没有直接计通过或放宽阈值;产品不改,以新→旧倒序额外复测两例。倒序 NR 5.949594→5.796090ms,UI 35→36次/秒,CPU 0.238783→0.235530秒/秒。倒序本身及两种顺序平均 CPU 0.229344→0.244308(+6.52%)通过同一15%守卫;所有 NR/UI 守卫保持。首轮失败和复测数据一起保留,不把这几次短测当严格性能等价证明,更不宣传算法提升或跨机保证。统计 QML SHA `e88541114240fad417f7d1f08bde0b8236964ff7e9005c8fc8214743c006958b` 保持。
+
+## 证据、失败与边界
+
+所有新构建、日志、私有配置、缓存和诊断在 `E:/项目/Veyra/{build,logs,tests,tmp,reports,archives}/merge-claude-fixes-20261011`。本任务 `reports/.../validation.json` 固定构建/测试/像素/性能回执 SHA;`archives/.../start.json` 和 source-before.bundle 为不可变保护点,原54工作树/496脏文件、七来源分支、原测试包1626文件逐项核对保持。
+
+初次完整配置遗漏旧缓存的显式 protoc 路径,退出1;补齐旧已验工具位置后配置通过。随后检查脚本误用正斜线匹配 Windows Ninja 反斜线,断言失败;修正检查后完整配置/私有 probe 编译链接通过。日志均保留,不计为产品故障或伪造通过。GUI Python -I 隔离模式无法读取既有用户站点 psutil,GUI按既有 -B 方式运行,无新依赖安装。i18n 合并前后均29项未翻译/语言,placeholder问题0,未新增缺口。
+
+Elgato/Blackmagic 真卡、现场 5060Ti 卡死和所有叠加软件组合、AMD 串流及长时间显存增长没有在此次本机全面验收。Claude 文档中的旧实验 FPS/音频改进只作原记录,本轮没有冒用那些数据。NVIDIA 显存持续增长仍未根治。没有推送、GitHub 发布、重新打包或关机;原测试包不代表已包含本轮修复。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 895c6f1e..4bb231af 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -9079,3 +9079,8 @@ ui-software-damage-test.py performance-final四例顺序40秒有效播放、各5
本轮临时缓存清理被自动审批拒绝:目标E:/项目/Veyra/tmp/ui-smear-handoff-20261011的PowerShell递归删除返回blocked by policy,命令未执行。560文件/80127256逻辑字节保留,未绕过重试,不计为已释放磁盘;cleanup.json如实记录。修复、构建和验收结果不受影响。
+
+
+## 2026-10-11 Claude六分支及UI整合验收
+
+用户授权本地main整合,隔离codex/merge-claude-fixes-20261011从5ba186a依次完整合入六Claude修复tip及UI29e33df,负优化revert保留;仅历史文档冲突,源码无冲突。补看门狗回调先于相关成员析构的退出竞态。全产物E盘同名目录,54旧树/496脏文件和七来源保持。构建50依赖闭包/19EXE,76.6秒,GUI d4e5aa25cf78120c51eb7793165452101b10798bfd67e1c6cdc724f6ba9d078a,不是clean全量重编;完整CMake保留PS5/Moonlight/Xbox/DeckLink。26项回归、150%滚动clip0/37图标、两种卡死注入/一次dump/恢复及3015ms有界退出、GTA普通class2四例性能守卫通过。i18n旧29空翻译保持/placeholder0。配置protoc路径遗漏、Ninja路径检查断言和Python隔离依赖失败均已如实记录,详见docs/MERGE_CLAUDE_FIXES_REPORT_2026-10-11.md与reports同名/validation.json。冻结实测候选后执行main合并;最终提交/保护核对见后续收尾。无push/打包/发布/关机,实卡和NV显存边界保持。
diff --git a/scripts/acceptance/merge-claude-fixes-build.py b/scripts/acceptance/merge-claude-fixes-build.py
new file mode 100644
index 00000000..f99a1a37
--- /dev/null
+++ b/scripts/acceptance/merge-claude-fixes-build.py
@@ -0,0 +1,220 @@
+"""Build the merged Claude fixes against immutable accepted main objects.
+All changed-header includers are recompiled; new watchdog is linked explicitly.
+Actual full CMake configuration is independently checked before promotion.
+"""
+from pathlib import Path
+import ctypes, hashlib, json, os, re, subprocess, sys, time
+from concurrent.futures import ThreadPoolExecutor
+
+BASE = Path('E:/项目/Veyra')
+NAME = 'merged'
+TASK = 'merge-claude-fixes-20261011'
+ROOT = BASE / 'worktrees' / TASK
+BASE_COMMIT = '5ba186a91e868c28b4b5ec46c9166aa321d90998'
+CACHE = BASE / 'build/vfg-next-20261007'; OUT = BASE / 'build' / TASK
+SDK = BASE / 'deps/decklink-sdk-obs31-20261009'
+LABEL = '2.0.6-fixes-20261010'
+PREVIOUS = BASE / 'logs/sr-visual-quality-20261010/build-20261010-153535/receipt.json'
+LOG = BASE / 'logs' / TASK / ('build-' + time.strftime('%Y%m%d-%H%M%S')); TMP = BASE / 'tmp' / TASK / 'build'
+for p in (OUT, LOG, TMP): p.mkdir(parents=True, exist_ok=True)
+def sha(p): return hashlib.sha256(Path(p).read_bytes()).hexdigest()
+shell = ctypes.WinDLL('shell32'); shell.CommandLineToArgvW.argtypes = [ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_int)]; shell.CommandLineToArgvW.restype = ctypes.POINTER(ctypes.c_wchar_p); ctypes.windll.kernel32.LocalFree.argtypes = [ctypes.c_void_p]
+def args(s):
+ n = ctypes.c_int(); p = shell.CommandLineToArgvW(s, ctypes.byref(n)); a = [p[i] for i in range(n.value)]; ctypes.windll.kernel32.LocalFree(p); return a
+def unescape(s): return s.replace('$ ', ' ').replace('$:', ':').replace('$$', '$')
+tool = re.search(r'^CMAKE_MAKE_PROGRAM:FILEPATH=(.*)$', (CACHE / 'CMakeCache.txt').read_text(encoding='utf8'), re.M).group(1)
+ninja = (CACHE / 'build.ninja').read_text(encoding='utf8'); inputs = {}; sources = {}; commands = []; start = time.monotonic()
+def protect(p):
+ p = Path(p); p = p if p.is_absolute() else CACHE / p; assert p.is_file(), p
+ if str(p) not in inputs: inputs[str(p)] = sha(p)
+ return p
+def rule(name):
+ lines = re.search(r'^build ' + re.escape(name) + r': .*?(?=\n\n)', ninja, re.M | re.S).group().splitlines()
+ var = dict(re.match(r' ([A-Z_]+) = (.*)', l).groups() for l in lines[1:] if re.match(r' ([A-Z_]+) = (.*)', l))
+ objects = [unescape(n).replace('\\', '/') for n in lines[0].split('Release ', 1)[1].split(' | ', 1)[0].split(' || ', 1)[0].split(' ')]
+ for value in args(unescape(var.get('LINK_LIBRARIES', ''))):
+ if value.lower().endswith('.lib') and (Path(value).is_file() or (CACHE / value).is_file()): protect(value)
+ return objects, var
+def compiler(name):
+ command = args(subprocess.check_output([tool, '-t', 'commands', name], cwd=CACHE, text=True, encoding='utf8').splitlines()[-1])
+ return ['-DVEYRA_DISPLAY_VERSION="' + LABEL + '"' if v.startswith(('-DVEYRA_DISPLAY_VERSION=', '/DVEYRA_DISPLAY_VERSION=')) else v for v in command]
+env = dict(os.environ); env.update(TEMP=str(TMP), TMP=str(TMP), VSLANG='1033')
+setup = subprocess.run(['cmd.exe', '/u', '/d', '/c', r'call C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Auxiliary\Build\vcvars64.bat >nul && set'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True, encoding='utf-16-le', errors='replace', env=env, check=True)
+for line in setup.stdout.splitlines():
+ if '=' in line:
+ k, v = line.split('=', 1)
+ if k and not k.startswith('='): env[k] = v
+env.update(TEMP=str(TMP), TMP=str(TMP))
+def run(command, name, cwd=TMP):
+ commands.append(command); remaining = 890 - (time.monotonic() - start); assert remaining > 0
+ with (LOG / (name + '.log')).open('wb') as stream: r = subprocess.run(command, cwd=cwd, env=env, stdout=stream, stderr=subprocess.STDOUT, timeout=min(300, remaining))
+ print(name, 'exit', r.returncode, flush=True)
+ if r.returncode: print((LOG / (name + '.log')).read_text(encoding='utf8', errors='replace')[-6000:]); raise RuntimeError(name)
+
+# Files changed on this branch (committed or not) relative to main.
+def git(*a): return subprocess.check_output(['git', *a], cwd=ROOT, text=True, encoding='utf8')
+changed = set(git('diff', '--name-only', BASE_COMMIT).split()) | set(git('ls-files', '--others', '--exclude-standard').split())
+changed = {p.replace('\\', '/') for p in changed}
+changed_headers = sorted(p for p in changed if p.endswith(('.h', '.hpp', '.inl')))
+# Transitive includers of changed headers (by include-path suffix), independent of the old ninja deps.
+include_re = re.compile(r'^\s*#\s*include\s*[<"]([^>"]+)[>"]', re.M)
+files = [p for folder in ('include', 'src', 'apps', 'tests') for p in (ROOT / folder).rglob('*') if p.suffix in ('.h', '.hpp', '.inl', '.cpp', '.cc')]
+includes = {p.relative_to(ROOT).as_posix(): include_re.findall(p.read_text(encoding='utf8', errors='replace')) for p in files}
+affected = set(changed_headers); grew = True
+while grew:
+ grew = False
+ for path, incs in includes.items():
+ if path in affected: continue
+ if any(any(h.endswith('/' + i.lstrip('./')) or h == i for h in affected) for i in incs):
+ affected.add(path); grew = True
+print('changed', sorted(changed), flush=True)
+headerKey = hashlib.sha256(''.join(str(p) + sha(p) for folder in ('include', 'tests') for p in sorted((ROOT / folder).rglob('*.h'))).encode()).hexdigest()
+def compile(source, name, a, extra=(), dependencyKey=''):
+ sources[str(source)] = sha(source); target = OUT / (name + '.obj')
+ command = a[:1] + ['/utf-8', '/I' + str(OUT), '/I' + str(ROOT / 'include'), '/I' + str(ROOT / 'src')] + [v.replace(str(CACHE).replace('\\', '/'), str(OUT).replace('\\', '/')) if v.startswith(('/DVEYRA_SHADER_DIR', '-DVEYRA_SHADER_DIR')) else v for v in a[1:-1] if not v.startswith(('/Fo', '/Fd')) and v != '/showIncludes']
+ command += list(extra) + ['/Fo' + str(target), '/Fd' + str(OUT / (name + '.pdb')), str(source)]
+ key = hashlib.sha256((json.dumps(command) + sources[str(source)] + headerKey + dependencyKey).encode()).hexdigest(); stamp = target.with_suffix('.build.json')
+ if target.is_file() and stamp.is_file():
+ old = json.loads(stamp.read_text())
+ if old['key'] == key and old['object'] == sha(target): print('reuse', name, flush=True); return target
+ run(command, 'compile-' + name); stamp.write_text(json.dumps({'key': key, 'object': sha(target)}), encoding='utf8'); return target
+previous = json.loads(PREVIOUS.read_text(encoding='utf8'))
+overrides = {name: protect(row['path']) for name, row in previous['overrides'].items()}
+for name, row in previous['overrides'].items(): assert sha(row['path']) == row['sha256'], name
+# The accepted build compiled these per run from the source tree; they are rebuilt below.
+for generated in ('CMakeFiles/veyra_qml_ui.dir/.qt/rcc/qrc_veyra_i18n.cpp.obj', 'CMakeFiles/veyra_qml_ui.dir/veyra-qml-version.rc.res'):
+ overrides.pop(generated, None)
+targets = {n: rule(n + '.exe') for n in ('veyra_qml_ui', 'veyra_capture_tests', 'veyra_capture_color_tests', 'veyra_capture_format_selection_tests', 'veyra_hdr_color_tests', 'veyra_capture_audio_tests', 'veyra_qml_quick_tests', 'veyra_present_sink_lifecycle_tests', 'veyra_live_presentation_tests', 'veyra_nr_video_quality_probe', 'veyra_effect_chain_tests', 'veyra_repair_contract_tests', 'veyra_live_timing_tests', 'veyra_audio_timeline_tests', 'veyra_audio_track_output_tests', 'veyra_audio_playback_rate_tests') + ('veyra_vfg_gpu_tests',)}
+objects = set(p for obj, var in targets.values() for p in obj)
+def libraries(var): return {Path(v).stem for v in args(unescape(var.get('LINK_LIBRARIES', ''))) if v.endswith('.lib') and Path(v).stem.startswith('veyra_')}
+groups = set().union(*(libraries(var) for objs, var in targets.values()))
+for group in groups:
+ if re.search(r'^build ' + re.escape(group + '.lib') + r': (?:CXX|C)_STATIC_', ninja, re.M): objects.update(rule(group + '.lib')[0])
+dependencies = {}; current = None
+for line in subprocess.check_output([tool, '-t', 'deps'], cwd=CACHE, text=True, encoding='utf8').splitlines():
+ if line and not line[0].isspace(): current = line.split(': #deps ', 1)[0].replace('\\', '/'); dependencies[current] = []
+ elif current and line.strip(): dependencies[current].append(line.strip().replace('\\', '/'))
+rebuild = []
+for obj in objects:
+ relative = obj.split('.dir/', 1)[-1][:-4]
+ if not relative.startswith(('src/', 'apps/', 'tests/')) or not (ROOT / relative).is_file(): continue
+ dep_changed = any(any(d.endswith('/' + h) for d in dependencies.get(obj, ())) for h in changed_headers)
+ # Test objects not linked by the accepted build may predate main: always rebuild them.
+ forced = obj.startswith('CMakeFiles/veyra_vfg_gpu_tests.dir/tests/')
+ if forced or relative in changed or relative in affected or dep_changed or (obj not in overrides and not (CACHE / obj).is_file()):
+ rebuild.append((obj, ROOT / relative, compiler(obj)))
+print('rebuild', sorted(o for o, _, _ in rebuild), flush=True)
+moc = protect(Path('C:/veyra-deps/qt-veyra/6.8.3/msvc2022_64/bin/moc.exe'))
+run([str(moc), str(ROOT / 'tests/qml/QuickSmokeTests.cpp'), '-o', str(OUT / 'QuickSmokeTests.moc')], 'generate-quick-test-moc')
+def job(row):
+ obj, source, a = row; return obj, compile(source, obj.replace('/', '-').replace('.', '-'), a)
+# Sources added on this branch (not in the cached CMake graph): same flags as a
+# neighbour in the same static library, linked wherever that library is.
+added = {'CMakeFiles/veyra_engine.dir/src/engine/EngineWatchdog.cpp.obj': ('src/engine/EngineWatchdog.cpp', 'CMakeFiles/veyra_engine.dir/src/engine/EngineController.cpp.obj')}
+rebuild += [(obj, ROOT / source, compiler(neighbour)) for obj, (source, neighbour) in added.items()]
+with ThreadPoolExecutor(max_workers=8) as pool:
+ for obj, p in pool.map(job, rebuild): overrides[obj] = p
+quickAutogen = 'CMakeFiles/veyra_qml_quick_tests.dir/veyra_qml_quick_tests_autogen/mocs_compilation.cpp.obj'
+emptyMoc = OUT / 'quick-mocs.cpp'; emptyMoc.write_text('// Setup moc is included explicitly by QuickSmokeTests.cpp.\n', encoding='utf8')
+overrides[quickAutogen] = compile(emptyMoc, 'quick-mocs', compiler(quickAutogen))
+# Bridge meta-object group (QmlPlayerBridge.h is a Q_OBJECT header).
+if 'include/veyra/ui/QmlPlayerBridge.h' in changed:
+ autogen = json.loads(protect(CACHE / 'CMakeFiles/veyra_qml_bridge_autogen.dir/AutogenInfo.json').read_text(encoding='utf8'))
+ mocArgs = [autogen['QT_MOC_EXECUTABLE']] + ['-D' + d for d in autogen['MOC_DEFINITIONS']] + ['-I' + str(ROOT / 'include')] + ['-I' + d for d in autogen['MOC_INCLUDES']]
+ run(mocArgs + ['-o', str(OUT / 'moc_QmlPlayerBridge.cpp'), str(ROOT / 'include/veyra/ui/QmlPlayerBridge.h')], 'moc-QmlPlayerBridge')
+ mocs = OUT / 'bridge_mocs_compilation.cpp'
+ retained = [protect(CACHE / f'veyra_qml_bridge_autogen/EC3QK4C7QJ/moc_{n}.cpp') for n in ('MoonlightInputCapture', 'QmlExportQueueModel')]
+ mocs.write_text(''.join('#include "' + p.as_posix() + '"\n' for p in retained) + '#include "moc_QmlPlayerBridge.cpp"\n', encoding='utf8')
+ overrides['CMakeFiles/veyra_qml_bridge.dir/veyra_qml_bridge_autogen/mocs_compilation.cpp.obj'] = compile(mocs, 'bridge-mocs', compiler('CMakeFiles/veyra_qml_bridge.dir/src/ui/QmlPlayerBridge.cpp.obj'), dependencyKey=sha(OUT / 'moc_QmlPlayerBridge.cpp'))
+for obj in objects:
+ if obj not in overrides: protect(obj)
+# Unchanged objects added by PR31, not present in the older cached CMake graph.
+assert not ({'include/veyra/ui/PlaylistModel.h', 'src/ui/PlaylistModel.cpp'} & changed)
+playlist = [protect(BASE / 'build/pr31-playlist-20261009' / n) for n in ('PlaylistModel.obj', 'playlist-moc.obj')]
+sourceCompiler = compiler('CMakeFiles/veyra_sources.dir/src/source/CaptureCardSource.cpp.obj')
+generatedSdk = OUT / 'decklink-generated'; generatedSdk.mkdir(exist_ok=True)
+for file in SDK.rglob('*'):
+ if file.is_file(): protect(file)
+midl = protect(Path(r'C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/midl.exe'))
+run([str(midl), '/nologo', '/env', 'x64', '/I', str(SDK), '/out', str(generatedSdk), '/h', 'DeckLinkAPI_h.h',
+ '/iid', 'DeckLinkAPI_i.c', '/tlb', 'DeckLinkAPI.tlb', '/client', 'none', '/server', 'none', str(SDK / 'DeckLinkAPI.idl')], 'generate-decklink-abi')
+nativeCore = compile(ROOT / 'src/source/DeckLinkCapture.cpp', 'DeckLinkCapture', sourceCompiler)
+nativeDriver = compile(ROOT / 'src/source/DeckLinkDriver.cpp', 'DeckLinkDriver', sourceCompiler, ['/DVEYRA_HAS_DECKLINK=1', '/I' + str(generatedSdk)], sha(generatedSdk / 'DeckLinkAPI_h.h'))
+stubDriver = compile(ROOT / 'src/source/DeckLinkDriver.cpp', 'DeckLinkDriver-stub', sourceCompiler, ['/DVEYRA_HAS_DECKLINK=0'])
+native = [nativeCore, nativeDriver]
+uiOnly = sys.argv[1:] == ['ui-only']
+shaderOut = OUT / 'shaders'; shaderOut.mkdir(exist_ok=True)
+compiledShaders = {'PackedCaptureToLinear'} | {Path(p).stem for p in changed if p.startswith('shaders/') and p.endswith('.hlsl')}
+for source in (CACHE / 'shaders').rglob('*'):
+ if not source.is_file() or (source.suffix == '.dxil' and source.stem in compiledShaders): continue
+ protect(source); target = shaderOut / source.relative_to(CACHE / 'shaders'); target.parent.mkdir(parents=True, exist_ok=True)
+ if not target.exists(): os.link(source, target)
+assert not [p for p in changed if p.startswith('shaders/') and not p.endswith('.hlsl')], 'shared shader include changes need every includer rebuilt'
+dxc = protect(Path(r'C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/dxc.exe'))
+for stem in sorted(compiledShaders):
+ target = shaderOut / (stem + '.dxil')
+ if target.exists(): target.unlink()
+ run([str(dxc), '-T', 'cs_6_0', '-E', 'main', '-O3', '-Qstrip_debug', '-Qstrip_reflect', '-Fo', str(target), str(ROOT / 'shaders' / (stem + '.hlsl'))], 'shader-' + stem)
+resource = 'CMakeFiles/veyra_qml_ui.dir/.qt/rcc/qrc_veyra_i18n.cpp.obj'
+rcc = protect(Path('C:/veyra-deps/qt-veyra/6.8.3/msvc2022_64/bin/rcc.exe'))
+qrc = OUT / 'i18n.qrc'; qrc.write_text('<RCC><qresource prefix="/i18n"><file alias="catalog.json">' + (ROOT / 'i18n/catalog.json').as_posix() + '</file></qresource></RCC>', encoding='utf8')
+generated = OUT / 'qrc_veyra_i18n.cpp'; run([str(rcc), '--name', 'veyra_i18n', '--no-zstd', '-o', str(generated), str(qrc)], 'generate-i18n')
+overrides[resource] = compile(generated, 'qrc_veyra_i18n', compiler(resource), dependencyKey=sha(ROOT / 'i18n/catalog.json')); sources[str(ROOT / 'i18n/catalog.json')] = sha(ROOT / 'i18n/catalog.json')
+versionSource = ROOT / 'apps/veyra/version.rc.in'
+version = versionSource.read_text(encoding='utf8')
+for key, value in {'PROJECT_VERSION_MAJOR': '2', 'PROJECT_VERSION_MINOR': '0', 'PROJECT_VERSION_PATCH': '6',
+ 'VEYRA_DISPLAY_VERSION': LABEL, 'VEYRA_RESOURCE_FILENAME': 'veyra_qml_ui.exe'}.items():
+ version = version.replace('@' + key + '@', value)
+assert '@' not in version
+versionRc = OUT / 'veyra-qml-version.rc'; versionRc.write_text(version, encoding='utf8')
+(OUT / 'veyra-resource.h').write_bytes((ROOT / 'apps/veyra/resource.h').read_bytes())
+if not (OUT / 'veyra.ico').exists(): os.link(protect(ROOT / 'assets/veyra.ico'), OUT / 'veyra.ico')
+rc = protect(Path(r'C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe'))
+versionRes = OUT / 'veyra-qml-version.rc.res'
+run([str(rc), '/nologo', '/c65001', '/fo', str(versionRes), str(versionRc)], 'compile-version-resource', OUT)
+overrides['CMakeFiles/veyra_qml_ui.dir/veyra-qml-version.rc.res'] = versionRes
+cmake = r'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe'
+link = r'C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\link.exe'; executables = []
+def linkTarget(name, objs, var):
+ rsp = OUT / (name + '.rsp'); rsp.write_text('\n'.join(subprocess.list2cmdline([str(p)]) for p in objs) + '\n' + unescape(var.get('LINK_PATH', '')) + '\n' + unescape(var['LINK_LIBRARIES']), encoding='utf8')
+ directory = OUT / ('manifest-' + name); directory.mkdir(exist_ok=True)
+ flags = [('/MANIFESTINPUT:' + str(CACHE / 'veyra-qml.manifest')) if a.startswith('/MANIFESTINPUT:') else a for a in args(unescape(var.get('LINK_FLAGS', '')))]
+ # Test builds only: public-symbol PDB for the app so [engine-hang] frames resolve
+ # (symbolize.py). Release defaults /OPT:REF,ICF are kept explicitly.
+ if name == 'veyra_qml_ui': flags += ['/DEBUG:FULL', '/OPT:REF', '/OPT:ICF']
+ # wmain of the replay test holds many PlayerSnapshot locals (CMakeLists: same option).
+ if name == 'veyra_live_presentation_tests': flags += ['/STACK:8388608']
+ command = [cmake, '-E', 'vs_link_exe', '--msvc-ver=1944', '--intdir=' + str(directory), r'--rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe', r'--mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe', '--manifests', '--', link, '/nologo', '@' + str(rsp), '/out:' + str(OUT / (name + '.exe')), '/implib:' + str(OUT / (name + '.lib')), '/pdb:' + str(OUT / (name + '.pdb')), '/version:0.0'] + flags
+ run(command, 'link-' + name, CACHE); executables.append(OUT / (name + '.exe'))
+# Test targets linked from the static sink library only need the changed sink object;
+# the other recompiled sink objects (encoders) reference the GPU graph.
+selective = {'veyra_capture_audio_tests': '/src/sink/CaptureAudioSession.cpp.obj'}
+selective.update({n: '/src/sink/WasapiAudioSink.cpp.obj' for n in ('veyra_audio_timeline_tests', 'veyra_audio_track_output_tests', 'veyra_audio_playback_rate_tests')})
+for name, (objs, var) in targets.items():
+ if uiOnly and name != 'veyra_qml_ui': continue
+ selected = [overrides.get(obj, CACHE / obj) for obj in objs]
+ linked = libraries(var)
+ selected += [p for obj, p in overrides.items() if obj not in objs and any(obj.startswith('CMakeFiles/' + group + '.dir/') for group in linked) and
+ (name not in selective or obj.endswith(selective[name]))]
+ if name == 'veyra_qml_ui': selected += playlist
+ if 'veyra_sources' in linked: selected += native
+ linkTarget(name, selected, var)
+if not uiOnly:
+ objects, var = targets['veyra_live_presentation_tests']
+ linked = libraries(var)
+ modules = [p for obj, p in overrides.items() if any(obj.startswith('CMakeFiles/' + group + '.dir/') for group in linked)]
+ for name, source in (('veyra_settings_transaction_tests', 'tests/integration/SettingsTransactionTests.cpp'), ('veyra_sr_quality_tests', 'tests/integration/SrQualityTests.cpp')):
+ test = compile(ROOT / source, name, compiler(objects[0]))
+ linkTarget(name, [test] + modules + native, var)
+for p, d in inputs.items(): assert sha(p) == d, p
+for folder in ('include', 'src', 'shaders', 'qml', 'tests'):
+ for file in (ROOT / folder).rglob('*'):
+ if file.is_file() and file.suffix in ('.h', '.hlsl', '.hlsli', '.qml', '.cpp'): sources[str(file)] = sha(file)
+head = git('rev-parse', 'HEAD').strip(); dirty = git('status', '--porcelain').strip()
+receipt = {'task': TASK, 'head': head, 'dirty': dirty.splitlines(), 'changed': sorted(changed), 'commands': commands, 'displayVersion': LABEL, 'sources': sources,
+ 'overrides': {n: {'path': str(p), 'sha256': sha(p)} for n, p in overrides.items()}, 'inputsUnchanged': inputs, 'seconds': time.monotonic() - start,
+ 'executables': {p.name: sha(p) for p in executables}, 'recompiledDependencyClosure': len(rebuild)}
+(LOG / 'receipt.json').write_text(json.dumps(receipt, ensure_ascii=False, indent=2), encoding='utf8')
+print('built', TASK, 'head', head[:8], 'dirty', len(receipt['dirty']), 'rebuilt', len(rebuild), 'seconds', round(receipt['seconds'], 1), LOG, flush=True)
+
+(BASE / 'reports' / TASK / 'build.json').write_text(json.dumps({'receipt':str(LOG / 'receipt.json')}), encoding='utf8')
diff --git a/scripts/acceptance/merge-claude-fixes-configure.py b/scripts/acceptance/merge-claude-fixes-configure.py
new file mode 100644
index 00000000..cdb5be54
--- /dev/null
+++ b/scripts/acceptance/merge-claude-fixes-configure.py
@@ -0,0 +1,109 @@
+"""Check the full merged CMake graph and build a private UI damage probe.
+
+Reuses the just-tested product link inputs, never the pre-merge GUI objects.
+No runtime/SDK is written and no user application or profile is touched.
+"""
+from pathlib import Path
+import ctypes, hashlib, json, os, re, subprocess, time
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra'); TASK = 'merge-claude-fixes-20261011'
+OUT = BASE / 'build' / TASK; CACHE = BASE / 'build/vfg-next-20261007'
+TMP = BASE / 'tmp' / TASK / 'configure'; TMP.mkdir(parents=True, exist_ok=True)
+LOG = BASE / 'logs' / TASK / ('configure-' + time.strftime('%Y%m%d-%H%M%S'))
+LOG.mkdir(parents=True, exist_ok=False)
+pointer = json.loads((BASE / 'reports' / TASK / 'build.json').read_text('utf8'))
+prior = json.loads(Path(pointer['receipt']).read_text('utf8'))
+commands = []; inputs = {}; began = time.monotonic()
+
+def sha(p):
+ with Path(p).open('rb') as f: return hashlib.file_digest(f, 'sha256').hexdigest()
+
+def protect(p):
+ p = Path(p); assert p.is_file(), p
+ inputs[str(p)] = sha(p); return p
+
+shell = ctypes.WinDLL('shell32')
+shell.CommandLineToArgvW.argtypes = [ctypes.c_wchar_p, ctypes.POINTER(ctypes.c_int)]
+shell.CommandLineToArgvW.restype = ctypes.POINTER(ctypes.c_wchar_p)
+ctypes.windll.kernel32.LocalFree.argtypes = [ctypes.c_void_p]
+def args(s):
+ n = ctypes.c_int(); p = shell.CommandLineToArgvW(s, ctypes.byref(n))
+ a = [p[i] for i in range(n.value)]; ctypes.windll.kernel32.LocalFree(p); return a
+
+env = dict(os.environ); env.update(TEMP=str(TMP), TMP=str(TMP), VSLANG='1033', PYTHONDONTWRITEBYTECODE='1')
+setup = subprocess.run(['cmd.exe', '/u', '/d', '/c', r'call C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Auxiliary\Build\vcvars64.bat >nul && set'],
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True, encoding='utf-16-le', errors='replace', env=env, check=True)
+for line in setup.stdout.splitlines():
+ if '=' in line:
+ k, v = line.split('=', 1)
+ if k and not k.startswith('='): env[k] = v
+env.update(TEMP=str(TMP), TMP=str(TMP), PYTHONDONTWRITEBYTECODE='1')
+
+def run(command, label, cwd=TMP):
+ commands.append(command)
+ with (LOG / (label + '.log')).open('wb') as stream:
+ result = subprocess.run(command, cwd=cwd, env=env, stdout=stream, stderr=subprocess.STDOUT, timeout=290)
+ print(label, result.returncode, flush=True)
+ if result.returncode:
+ print((LOG / (label + '.log')).read_text('utf8', errors='replace')[-7000:]); raise SystemExit(result.returncode)
+
+link = next(c for c in prior['commands'] if 'vs_link_exe' in c and any(v.endswith('veyra_qml_ui.exe') for v in c))
+cmake = str(protect(link[0]))
+cache = (CACHE / 'CMakeCache.txt').read_text('utf8')
+options = dict((key, value) for key, typ, value in re.findall(r'^(VEYRA_[^:]+|CMAKE_MAKE_PROGRAM|CMAKE_PREFIX_PATH):([^=]+)=(.*)$', cache, re.M) if typ != 'INTERNAL')
+# These pinned tools are explicit in the accepted cache, outside the VEYRA prefix.
+for key in ('PROTOC', 'PKG_CONFIG_EXECUTABLE', 'SDL3_DIR', 'LibDataChannel_DIR', 'Opus_DIR', 'nlohmann_json_DIR'):
+ options[key] = re.search(r'^' + key + r':[^=]+=(.*)$', cache, re.M).group(1)
+options.update(VEYRA_DECKLINK_SDK_DIR=str(BASE / 'deps/decklink-sdk-obs31-20261009'),
+ VEYRA_AMD_NR_TEST_GRAPH_SOURCE=str(ROOT / 'src/pipeline/EnhanceGraph.cpp'), VEYRA_DISPLAY_VERSION=prior['displayVersion'])
+for key in ('REMOTEPLAY', 'MOONLIGHT', 'XBOX'): assert options['VEYRA_ENABLE_' + key] == 'ON'
+conf = OUT / 'cmake'
+run([cmake, '-S', str(ROOT), '-B', str(conf), '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=Release'] +
+ ['-D' + key + '=' + value for key, value in options.items()], 'configure-full-product')
+ninja = str(protect(options['CMAKE_MAKE_PROGRAM']))
+graph = (conf / 'build.ninja').read_text('utf8')
+assert 'src/engine/EngineWatchdog.cpp.obj' in graph.replace('\\', '/')
+live = subprocess.check_output([ninja, '-t', 'commands', 'veyra_live_presentation_tests.exe'], cwd=conf, text=True, encoding='utf8')
+assert '/STACK:8388608' in live
+mainTarget = re.search(r'^build (CMakeFiles[\\/]veyra_qml_ui\.dir[\\/]apps[\\/]veyra-qml[\\/]main.cpp.obj):', graph, re.M).group(1)
+main = subprocess.check_output([ninja, '-t', 'commands', mainTarget], cwd=conf, text=True, encoding='utf8').splitlines()[-1]
+assert 'QtQuick/6.8.3' not in main.replace('\\', '/') # No withdrawn QuickPrivate/full-redraw hook.
+for feature in ('REMOTEPLAY', 'MOONLIGHT', 'XBOX'): assert '-DVEYRA_ENABLE_' + feature + '=1' in main
+assert str(ROOT / 'apps/veyra-qml/main.cpp').replace('\\', '/') in main.replace('\\', '/')
+(LOG / 'main-command.txt').write_text(main, 'utf8')
+(LOG / 'live-commands.txt').write_text(live, 'utf8')
+
+source = protect(ROOT / 'apps/veyra-qml/main.cpp'); probe = protect(ROOT / 'tests/qml/SoftwareUiDamageProbe.h')
+text = source.read_text('utf8').replace('#include "../veyra/resource.h"', '#include "' + (ROOT / 'apps/veyra/resource.h').as_posix() + '"')
+needle = ' if (testSize.isValid()) window->resize(testSize);'
+assert text.count(needle) == 1
+text = '#include "' + probe.as_posix() + '"\n' + text.replace(needle, needle + '\n installSoftwareUiDamageProbe(window, &bridge);')
+source = OUT / 'damage-probe-main.cpp'; source.write_text(text, 'utf8')
+name = 'veyra_ui_damage_probe'; obj = OUT / (name + '.obj')
+oldCompile = next(c for c in prior['commands'] if c[-1].replace('\\', '/').endswith('/apps/veyra-qml/main.cpp'))
+compile = [v for v in oldCompile[:-1] if not v.startswith(('/Fo', '/Fd'))] + ['/Fo' + str(obj), '/Fd' + str(OUT / (name + '.compile.pdb')), str(source)]
+run(compile, 'compile-private-main')
+oldRsp = protect(next(v[1:] for v in link if v.startswith('@')))
+text = oldRsp.read_text('utf8'); oldMain = prior['overrides']['CMakeFiles/veyra_qml_ui.dir/apps/veyra-qml/main.cpp.obj']['path']
+assert text.count(oldMain) == 1
+for p in args('link ' + text)[1:]:
+ if Path(p).suffix.lower() in ('.obj', '.res', '.lib') and Path(p).is_file(): protect(p)
+protect(OUT / 'veyra_qml_ui.exe')
+rsp = OUT / (name + '.rsp'); rsp.write_text(text.replace(oldMain, str(obj)), 'utf8')
+manifest = OUT / ('manifest-' + name); manifest.mkdir(exist_ok=True)
+command = []
+for v in link:
+ if v.startswith('--intdir='): v = '--intdir=' + str(manifest)
+ elif v.startswith('@'): v = '@' + str(rsp)
+ elif v.startswith(('/out:', '/implib:', '/pdb:')):
+ prefix, path = v.split(':', 1); v = prefix + ':' + str(OUT / (name + Path(path).suffix))
+ command.append(v)
+run(command, 'link-private-probe', CACHE)
+for p, digest in inputs.items(): assert sha(p) == digest, p
+receipt = {'head':subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT,text=True).strip(), 'commands':commands,
+ 'configuredFeatures':options, 'quickPrivate':False, 'testStackBytes':8388608, 'inputsUnchanged':inputs,
+ 'productExeSha256':sha(OUT / 'veyra_qml_ui.exe'), 'probeExeSha256':sha(OUT / (name + '.exe')), 'seconds':time.monotonic()-began}
+(LOG / 'receipt.json').write_text(json.dumps(receipt, ensure_ascii=False, indent=2), 'utf8')
+(BASE / 'reports' / TASK / 'configure.json').write_text(json.dumps({'receipt':str(LOG / 'receipt.json')}), 'utf8')
+print('PASS full CMake + private probe', flush=True)
diff --git a/scripts/acceptance/merge-claude-fixes-gui.py b/scripts/acceptance/merge-claude-fixes-gui.py
new file mode 100644
index 00000000..f2ed3178
--- /dev/null
+++ b/scripts/acceptance/merge-claude-fixes-gui.py
@@ -0,0 +1,70 @@
+"""Reuse the accepted UI pixel/performance harness against the merged product.
+
+Run with Python 3.11 -B (user-site psutil, numpy and Pillow). GPU cases are serial.
+"""
+from pathlib import Path
+import importlib.util, json, os, re, subprocess, sys, time
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra'); TASK = 'merge-claude-fixes-20261011'
+spec = importlib.util.spec_from_file_location('damage_harness', ROOT / 'scripts/acceptance/ui-software-damage-test.py')
+h = importlib.util.module_from_spec(spec); spec.loader.exec_module(h)
+h.TASK = TASK; h.TEST = BASE / 'tests' / TASK; h.APP = h.TEST / 'regress-merged'
+h.BUILD = BASE / 'build' / TASK; h.LOG = BASE / 'logs' / TASK
+
+def watchdog():
+ original = h.APP / 'qml/Veyra/Main.qml'; saved = original.read_bytes()
+ driver = BASE / 'tests/claude-freeze-20261010/harness/ProbeAB.qml'
+ target = h.APP / 'qml/Veyra/MergeWatchdogProbe.qml'; h.replace(driver, target)
+ rows = []
+ try:
+ for name, stall, seconds in [('watchdog-recover',12000,22), ('watchdog-shutdown',-1,16)]:
+ h.no_player(); out = h.LOG / name; out.mkdir(parents=True, exist_ok=False)
+ prefs = h.profile(name, 'gpu', True)
+ config = {'media':h.MEDIA.as_posix(), 'seconds':seconds, 'warmup':0, 'display':2, 'nr':0}
+ text = saved.decode('utf8'); at = text.rfind('}')
+ h.write(original, (text[:at] + '\n Loader { source:"MergeWatchdogProbe.qml"; onLoaded:item.config=' + json.dumps(config,ensure_ascii=True) + ' }\n' + text[at:]).encode('utf8'))
+ env = h.environment(name); env.update(VEYRA_LOG_FILE=str(out / 'player.log'), VEYRA_TEST_ENGINE_HANG_MS=str(stall))
+ command = [str(h.APP / 'veyra_qml_ui.exe'),'--data-dir',str(prefs),'--page','pro','--size','1280x800','--exit-after','45000']
+ began = time.monotonic()
+ with (out / 'console.log').open('wb') as stream:
+ result = subprocess.run(command,cwd=h.APP,env=env,stdout=stream,stderr=subprocess.STDOUT,timeout=55)
+ elapsed = time.monotonic()-began
+ text = (out / 'player.log').read_text('utf8',errors='replace')
+ bad = [line for line in h.errors(text) if 'engine-hang' not in line]
+ dumps = list(out.glob('veyra-hang-*.dmp'))
+ assert result.returncode == 0 and not bad and 'PROBE_AB_PASS' in text, text[-6000:]
+ assert len(dumps) == 1 and 'minidump written=true' in text, text[-6000:]
+ stalls = re.findall(r'owner=\d+ stalledMs=(\d+) .*stackFrames=(\d+)', text)
+ assert len(stalls) == 1 and int(stalls[0][0]) >= 8000 and int(stalls[0][1]) > 0, stalls
+ recovered = 'moved again' in text
+ bounded = 'shutdown: owner thread still blocked' in text
+ assert recovered and not bounded if stall > 0 else bounded and not recovered
+ assert elapsed < (40 if stall > 0 else 30), elapsed
+ row = {'case':name,'exit':result.returncode,'seconds':elapsed,'command':command,'stallMs':stall,
+ 'reportedAtMs':int(stalls[0][0]),'stackFrames':int(stalls[0][1]),'recovered':recovered,'boundedShutdown':bounded,
+ 'dump':str(dumps[0]),'dumpBytes':dumps[0].stat().st_size,'dumpSha256':h.sha(dumps[0]),
+ 'exeSha256':h.sha(h.APP / 'veyra_qml_ui.exe'),'driverSha256':h.sha(driver)}
+ (out / 'result.json').write_text(json.dumps(row,ensure_ascii=False,indent=2),'utf8')
+ rows.append(row); print(json.dumps(row,ensure_ascii=False),flush=True)
+ finally:
+ h.write(original,saved)
+ target.unlink(missing_ok=True)
+ (BASE / 'reports' / TASK / 'watchdog.json').write_text(json.dumps(rows,ensure_ascii=False,indent=2),'utf8')
+
+assert sys.argv[1:] in (['pixels'], ['performance'], ['performance-reverse'], ['watchdog'])
+h.no_player(); count = h.verify_donor(); h.stage()
+if sys.argv[1] == 'pixels':
+ h.pixels(True); h.clipping()
+ h.qml_variant(False)
+elif sys.argv[1] == 'performance':
+ # Exercise the merged overlay-restart signal signature in the candidate.
+ h.performance(True, ROOT / 'qml/Veyra/Main.qml')
+elif sys.argv[1] == 'performance-reverse':
+ h.performance(True, ROOT / 'qml/Veyra/Main.qml',
+ [('perf-reverse-obs-fixed','obs',False,False), ('perf-reverse-obs-old','obs',True,False)],
+ 'performance-reverse.json')
+else:
+ watchdog()
+assert h.verify_donor() == count
+print('PASS merged GUI',sys.argv[1],'; donor unchanged',count,flush=True)
diff --git a/scripts/acceptance/merge-claude-fixes-test.py b/scripts/acceptance/merge-claude-fixes-test.py
new file mode 100644
index 00000000..06b7151b
--- /dev/null
+++ b/scripts/acceptance/merge-claude-fixes-test.py
@@ -0,0 +1,133 @@
+"""Serial integration regressions for the merged Claude fixes; private runtime and profile.
+Usage: py -3.11 -I merge-claude-fixes-test.py case ...
+"""
+from pathlib import Path
+import hashlib, json, os, re, shutil, subprocess, sys, time
+
+BASE = Path('E:/项目/Veyra'); TASK = 'merge-claude-fixes-20261011'
+NAME = 'merged'
+ROOT = BASE / 'worktrees' / TASK
+DONOR = BASE / 'test-packages/fixes-20261010/Veyra-2.0.6-fixes-20261010-NVIDIA-win64-portable'
+BUILD = BASE / 'build' / TASK; APP = BASE / 'tests' / TASK / ('regress-' + NAME)
+QT = Path('C:/veyra-deps/qt-veyra/6.8.3/msvc2022_64')
+FFMPEG = BASE / 'deps/ffmpeg-subtitle-formats-20261009/installed/bin'
+GTA4K = 'E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4'
+cases = sys.argv[1:]; assert cases
+manifest = json.loads((DONOR / 'package-manifest.json').read_text(encoding='utf8'))
+
+
+def sha(p):
+ with open(p, 'rb') as f:
+ return hashlib.file_digest(f, 'sha256').hexdigest()
+
+
+def verify():
+ for row in manifest['files']:
+ assert sha(DONOR / row['path']) == row['sha256'], row['path']
+
+
+def replace(source, target):
+ target.parent.mkdir(parents=True, exist_ok=True)
+ swap = target.with_name(target.name + '.swap'); shutil.copy2(source, swap); os.replace(swap, target)
+
+
+verify()
+running = [l for l in subprocess.check_output(['tasklist', '/fo', 'csv', '/nh'], text=True, errors='replace').splitlines() if 'veyra' in l.lower()]
+assert not running, running
+if not APP.exists():
+ APP.mkdir(parents=True)
+ for row in manifest['files']:
+ rel = Path(row['path'])
+ if rel.parts[0] in ('runtime_local', 'logs') or rel.name == 'veyra_qml_ui.exe':
+ continue
+ target = APP / rel; target.parent.mkdir(parents=True, exist_ok=True); os.link(DONOR / rel, target)
+ (APP / 'runtime_local').mkdir(exist_ok=True)
+for source in BUILD.glob('*.exe'):
+ replace(source, APP / source.name)
+for source in (ROOT / 'qml').rglob('*'):
+ if source.is_file() and (source.suffix in ('.qml', '.js') or source.name == 'qmldir'):
+ replace(source, APP / 'qml' / source.relative_to(ROOT / 'qml'))
+for source in (BUILD / 'shaders').glob('*.dxil'):
+ replace(source, APP / 'shaders' / source.name)
+for source in FFMPEG.glob('*.dll'):
+ target = APP / source.name; swap = target.with_name(target.name + '.swap'); os.link(source, swap); os.replace(swap, target)
+for source in (DONOR / 'runtime_local/amd/fidelityfx').glob('*.dll'):
+ target = APP / 'runtime_local/amd/fidelityfx' / source.name
+ if not target.exists():
+ target.parent.mkdir(parents=True, exist_ok=True); os.link(source, target)
+for source in (ROOT / 'tests/qml/quick').glob('*.qml'):
+ replace(source, APP / 'qml-tests' / source.name)
+log = BASE / 'logs' / TASK / NAME / ('tests-' + time.strftime('%Y%m%d-%H%M%S')); log.mkdir(parents=True, exist_ok=False)
+results = []
+for case in cases:
+ output = log / case; output.mkdir(); temporary = BASE / 'tmp' / TASK / NAME / log.name / case; temporary.mkdir(parents=True)
+ env = {k: v for k, v in os.environ.items() if not k.upper().startswith(('VEYRA_', 'QT_', 'QSG_'))}
+ env.update(TEMP=str(temporary), TMP=str(temporary), CUDA_CACHE_PATH=str(temporary / 'cuda'), QML_DISK_CACHE_PATH=str(temporary / 'qml'),
+ PATH=str(APP) + os.pathsep + str(QT / 'bin') + os.pathsep + env['PATH'], QML_IMPORT_PATH=str(QT / 'qml'),
+ QT_FORCE_STDERR_LOGGING='1', VEYRA_EXPORT_TEST_ARTIFACTS=str(output))
+ if case in ('slider', 'menu', 'components'):
+ file = {'slider': 'tst_slider_value.qml', 'menu': 'tst_menu_layout.qml', 'components': 'tst_components.qml'}[case]
+ env['QSG_RHI_BACKEND'] = 'd3d12'
+ command = [str(APP / 'veyra_qml_quick_tests.exe'), '-input', str(APP / 'qml-tests' / file), '-o', '-,txt']
+ elif case == 'sr':
+ command = [str(APP / 'veyra_sr_quality_tests.exe'), str(output)]
+ elif case == 'inactive':
+ command = [str(APP / 'veyra_live_presentation_tests.exe'), GTA4K, str(output), '--inactive-effects']
+ elif case == 'inactive-node':
+ command = [str(APP / 'veyra_live_presentation_tests.exe'), GTA4K, str(output), '--inactive-effects-node']
+ elif case == 'chain':
+ command = [str(APP / 'veyra_effect_chain_tests.exe')]
+ elif case == 'contracts':
+ command = [str(APP / 'veyra_repair_contract_tests.exe')]
+ elif case == 'video':
+ command = [str(APP / 'veyra_live_presentation_tests.exe'), GTA4K, str(output), '--settings-rebuild']
+ elif case == 'rollback':
+ command = [str(APP / 'veyra_live_presentation_tests.exe'), GTA4K, str(output), '--reset-rollback']
+ elif case == 'presenter':
+ command = [str(APP / 'veyra_settings_transaction_tests.exe'), str(output)]
+ elif case == 'lifecycle':
+ command = [str(APP / 'veyra_present_sink_lifecycle_tests.exe'), str(output)]
+ elif case == 'hdr':
+ command = [str(APP / 'veyra_hdr_color_tests.exe')]
+ elif case == 'timing':
+ command = [str(APP / 'veyra_live_timing_tests.exe')]
+ elif case == 'half-rate':
+ command = [str(APP / 'veyra_live_presentation_tests.exe'), str(BASE / 'tests/claude-dedup-20261011/media/gta6-true60.mp4'), str(output), '--half-rate']
+ elif case == 'vfg-gpu':
+ command = [str(APP / 'veyra_vfg_gpu_tests.exe'), str(APP / 'runtime/nvidia-vfg'), '1280', '720', 'async']
+ elif case == 'capture-color':
+ command = [str(APP / 'veyra_capture_color_tests.exe')]
+ elif case.startswith('audio') and case != 'audio-rate':
+ flag = {'audio':None,'audio-jitter':'--jitter','audio-underrate':'--underrate',
+ 'audio-startup-seek':'--startup-seek','audio-stall':'--read-stall','audio-stall-direct':'--read-stall-direct'}[case]
+ command = [str(APP / 'veyra_audio_timeline_tests.exe'), str(output)] + ([flag] if flag else [])
+ elif case == 'audio-rate':
+ import wave, math, struct
+ fixture = output / '440hz.wav'
+ with wave.open(str(fixture), 'wb') as w:
+ w.setnchannels(1); w.setsampwidth(2); w.setframerate(48000)
+ w.writeframes(b''.join(struct.pack('<h',int(12000*math.sin(2*math.pi*440*i/48000))) for i in range(240000)))
+ command = [str(APP / 'veyra_audio_playback_rate_tests.exe'), str(fixture)]
+ elif case in ('seek-stress','file-endpoint'):
+ command = [str(APP / 'veyra_live_presentation_tests.exe'), GTA4K, str(output), '--'+case]
+ else:
+ raise AssertionError(case)
+ start = time.monotonic()
+ with (output / 'console.log').open('wb') as stream:
+ try:
+ run = subprocess.run(command, cwd=APP, env=env, stdout=stream, stderr=subprocess.STDOUT, timeout=290); code = run.returncode
+ except subprocess.TimeoutExpired:
+ code = -1
+ text = (output / 'console.log').read_text(encoding='utf8', errors='replace')
+ errors = [line for line in text.splitlines() if re.search(r'^FAIL |FAIL!|passed=0|ReferenceError:|TypeError:|Binding loop|Cannot assign|D3D12 ERROR|D3D12 CORRUPTION', line)]
+ passed = code == 0 and not errors
+ row = {'case': case, 'exit': code, 'seconds': round(time.monotonic() - start, 1), 'passed': passed, 'errors': errors[:10]}
+ results.append(row); print(json.dumps(row, ensure_ascii=False), flush=True)
+verify()
+receipt = {'task': NAME, 'head': subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=ROOT, text=True).strip(), 'results': results,
+ 'passed': all(r['passed'] for r in results), 'donorUnchanged': len(manifest['files']),
+ 'executables': {p.name: sha(p) for p in APP.glob('*.exe')}}
+(log / 'receipt.json').write_text(json.dumps(receipt, ensure_ascii=False, indent=2), encoding='utf8')
+(BASE / 'reports' / TASK / ('tests-' + log.name + '.json')).write_text(json.dumps({'receipt':str(log / 'receipt.json')}), encoding='utf8')
+print('passed' if receipt['passed'] else 'FAILED', log)
+raise SystemExit(not receipt['passed'])
diff --git a/scripts/acceptance/ui-software-damage-test.py b/scripts/acceptance/ui-software-damage-test.py
index b98fc71b..06a5d564 100644
--- a/scripts/acceptance/ui-software-damage-test.py
+++ b/scripts/acceptance/ui-software-damage-test.py
@@ -147,7 +147,7 @@ def focus(proc):
user.SetForegroundWindow.argtypes = [wintypes.HWND]
if windows: user.SetForegroundWindow(windows[0])
-def performance(final=False):
+def performance(final=False, candidate_main=None, cases_override=None, report_name=None):
results = []; main = APP / 'qml/Veyra/Main.qml'; saved = main.read_bytes()
perfQml = APP / 'qml/Veyra/RegressionPerf.qml'
replace(ROOT / 'scripts/acceptance/stability-export-priority-perf.qml', perfQml)
@@ -156,11 +156,12 @@ def performance(final=False):
('perf-obs-old', 'obs', True, False), ('perf-obs-fixed', 'obs', False, False)]
if final: cases = [('perf-final-gpu-old', 'gpu', False, True), ('perf-final-gpu-fixed', 'gpu', False, False),
('perf-final-obs-old', 'obs', True, False), ('perf-final-obs-fixed', 'obs', False, False)]
+ if cases_override is not None: cases = cases_override
for name, mode, partial, old in cases:
no_player(); out = LOG / name; out.mkdir(parents=True, exist_ok=False)
replace(DONOR / 'veyra_qml_ui.exe' if old else BUILD / 'veyra_qml_ui.exe', APP / 'veyra_qml_ui.exe')
qml_variant(partial or old)
- saved = (DONOR / 'qml/Veyra/Main.qml').read_bytes()
+ saved = (DONOR / 'qml/Veyra/Main.qml' if old or candidate_main is None else candidate_main).read_bytes()
config = {'modern':True, 'seconds':40, 'media':MEDIA.as_posix(), 'display':2, 'reducedMotion':False, 'page':'pro', 'oldUi':False}
text = saved.decode('utf8'); at = text.rfind('}')
write(main, (text[:at] + '\n Loader { source:"RegressionPerf.qml"; onLoaded:item.config=' + json.dumps(config, ensure_ascii=True) + ' }\n' + text[at:]).encode('utf8'))
@@ -207,7 +208,7 @@ def performance(final=False):
results.append(row); print(json.dumps({k:v for k,v in row.items() if k != 'priorityReadings'}, ensure_ascii=False), flush=True)
finally:
write(main, saved); replace(BUILD / 'veyra_qml_ui.exe', APP / 'veyra_qml_ui.exe'); qml_variant(False)
- (BASE / 'reports' / TASK / ('performance-final.json' if final else 'performance.json')).write_text(json.dumps(results, ensure_ascii=False, indent=2), encoding='utf8')
+ (BASE / 'reports' / TASK / (report_name or ('performance-final.json' if final else 'performance.json'))).write_text(json.dumps(results, ensure_ascii=False, indent=2), encoding='utf8')
if __name__ == '__main__':
assert sys.argv[1:] in (['pixels'], ['pixels-expanded'], ['clipping'], ['performance'], ['performance-final'])
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index eca38074..929fc458 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -80,7 +80,7 @@ EngineController::EngineController(){
}
EngineController::~EngineController(){
{std::lock_guard lock(mutex_);shutdown_=true;pending_={};stop_=true;}wake_.notify_one();
- if(!worker_.joinable())return;
+ if(!worker_.joinable()){watchdog_.reset();return;}
// Field logs(15): an owner thread blocked inside a driver call never returns,
// and closing the app waited for it forever (the process had to be killed).
// Wait a bounded time, then end the process instead of hanging on exit.
@@ -95,6 +95,10 @@ EngineController::~EngineController(){
}
}
worker_.join();
+ // The watchdog callback reads snapshot_ and hangPreviousStatus_. Detach it
+ // while all controller members are still alive, before reverse destruction
+ // reaches hangPreviousStatus_ (declared after watchdog_).
+ watchdog_.reset();
}
void EngineController::dispatch(){
for(;;){std::function<void()> task;{std::unique_lock lock(mutex_);wake_.wait(lock,[&]{return shutdown_||bool(pending_);});if(shutdown_)break;task=std::move(pending_);pending_={};busy_=true;stop_=false;}