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++
Fix settings recovery, native video SR and multilingual UI layout
Veyra Goal Agent108cbaabce11
diff --git a/AGENTS.md b/AGENTS.mdindex a37c9891..441706ef 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,5 +1,7 @@# Veyra 项目 Agent 执行规则+> **2026-10-10 四项现场修复授权**:用户提供日志46及手动数字输入后快捷键失效截图,要求修复设置切换致软件错误、数字输入焦点、优化超分和多语言/中文布局溢出,完成后汇报并关机。在 codex/settings-sr-ui-20261010 从 af2edf4 隔离实施必要 engine/presenter/SR/共享QML组件/翻译与构建定向验收接点,覆盖这些必要接点的旧冻结。独立不可变start保护43既有工作树/495脏文件与main;产物全E盘,保留已验DeckLink/字幕/播放列表改动。不派Agent,不改驱动、运行库/模型原件或用户配置,不打测试包、不merge/push/Release。测试每进程≤300秒,构建≤900秒;实测与现场未复现的边界分别报告。源码/报告/证据保存后按本次用户授权安排关机,不强制丢弃未保存内容。+> **2026-10-09 BMD 原生修复授权**:用户在原生信号核查后明确“修”,随后要求“做成和美乐威一样的开关”。按 docs/DECKLINK_NATIVE_PLAN_2026-10-09.md,在codex/decklink-native-20261009实现DeckLink COM输入、共享采集/模式恢复、必要10位GPU解包/颜色合同及采集设置开关(美乐威旁、默认关闭、保存选择、重连生效),覆盖这些必要接点的旧冻结。42旧工作树/495脏文件及main0e7018ad按独立start保护。SDK原件/生成头文件留E盘,正式构建须明确传VEYRA_DECKLINK_SDK_DIR,不进Git,不改驱动/运行库/模型/用户配置;无子Agent/测试包/合并/push/Release/关机。没有BMD实卡不得宣称现场已经恢复或延迟收益。实施证据见同轮REPORT。> **2026-10-09 BMD 信号核查**:用户提供 veyra-qml(45).log,要求具体核对 madVR/Blackmagic 官方软件并解释持续黑屏。本轮按 docs/BLACKMAGIC_SIGNAL_RESEARCH_PLAN_2026-10-09.md,在 codex/blackmagic-signal-research-20261009 基于973fc9b隔离记录,只读核对日志、产品源码、固定上游与官方文档;没有新的产品修复/实卡通过声明。独立start保护41既有工作树/495脏文件,产物全E盘;保留“不用打测试包”,不改用户配置/驱动/运行库,不派Agent,不合并/推送/发布/关机。原生DeckLink能力缺口与本例尚未确认的物理原因必须分开。结论见同轮REPORT。diff --git a/CMakeLists.txt b/CMakeLists.txtindex 00ef3aca..ea9fe18b 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -811,6 +811,12 @@ if(VEYRA_FFMPEG_ROOT AND EXISTS "${VEYRA_FFMPEG_ROOT}/include/libavformat/avformtarget_compile_features(veyra_present_sink_lifecycle_tests PRIVATE cxx_std_20)target_compile_definitions(veyra_present_sink_lifecycle_tests PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN)target_link_libraries(veyra_present_sink_lifecycle_tests PRIVATE veyra_gfx user32)+ add_executable(veyra_settings_transaction_tests tests/integration/SettingsTransactionTests.cpp)+ target_compile_features(veyra_settings_transaction_tests PRIVATE cxx_std_20)+ target_link_libraries(veyra_settings_transaction_tests PRIVATE veyra_engine)+ add_executable(veyra_sr_quality_tests tests/integration/SrQualityTests.cpp)+ target_compile_features(veyra_sr_quality_tests PRIVATE cxx_std_20)+ target_link_libraries(veyra_sr_quality_tests PRIVATE veyra_engine)add_executable(veyra_experimental_backend_tests tests/integration/ExperimentalBackendTests.cpp)target_compile_features(veyra_experimental_backend_tests PRIVATE cxx_std_20)target_include_directories(veyra_experimental_backend_tests PRIVATE ${FFMPEG_INCLUDE_DIRS})diff --git a/docs/SETTINGS_SR_UI_PLAN_2026-10-10.md b/docs/SETTINGS_SR_UI_PLAN_2026-10-10.mdnew file mode 100644index 00000000..57a4a468--- /dev/null+++ b/docs/SETTINGS_SR_UI_PLAN_2026-10-10.md@@ -0,0 +1,18 @@+# 设置切换、数字输入、超分及布局修复(2026-10-10)++## 范围和保护++用户提供日志46与截图并要求四项修复、汇报及关机。基点 af2edf4052857c7db99d7c33f92827f02ab34319;分支 codex/settings-sr-ui-20261010,工作树 E:/项目/Veyra/worktrees/settings-sr-ui-20261010。沿用已验DeckLink/字幕/播放列表。不可变 archives/settings-sr-ui-20261010/start.json 保护43旧工作树、495脏文件及main。只改本次必要接点,不派Agent,不修改第三方运行库、驱动、模型或真实用户配置,不打测试包,不发布或合并。++## 已知证据及实施顺序++1. 日志46在15:12:34/36 UTC重建显示时重复 CreateSwapChainForHwnd E_ACCESSDENIED,设置回退亦失败。核对资源/窗口/队列所有权,在同一显示合同下保留原生交换链并重新绑定已排空的新图资源;不靠延长sleep掩盖。不兼容合同必须保留正确关闭/重建路径。针对拒绝访问、前后设置切换及恢复做真实呈现回归;叠加层持有对象等未证实的原因如实区分。+2. VSliderValue 隐藏输入框但未明确释放其focus;检查快捷键的输入判断。修复提交/取消/点击外部路径,不能抢走另一个正在编辑的输入框的焦点。用真实键盘事件验证快捷键和数值绑定。+3. 检查各SR后端的实际执行、尺寸、NR交接、颜色及降级路径;以真实GPU输出对照开启/关闭、不同档位,修复明确失效接点,采用适合视频的现有超分能力。拒绝把仅增加锐化或插值当作模型细节重建收益。源尺寸已达目标等情况明确提示;不编造画质百分比。+4. 从共享VMenu/VSelect/VRow等组件修复长文本测量、边界限宽、换行/完整信息查看及滚动;核查节点右键与采集格式,验证简中/繁中/英语/日语和小窗口/DPI情形。不得改引擎数据以适配UI。++## 验证与收尾++实施补充:SR 已确认原尺寸 VSR 和 FSR 无运动首帧两处旁路;普通调色被绕过的假设已被像素对照否定,未改正常输入描述符。共享视频导出文案以图的enableSr为准,避免原尺寸修复启用却提示关闭。呈现保留HDR元数据已发送状态、重绑定时释放兼容复制旧纹理;失败注入推动修复回退记录被暖机覆盖。截图复核扩展到节点窄窗口统计栏和长操作提示,并等待页面过渡完成后截图。具体已执行证据与现场边界见同轮REPORT。++新任务control检查旧工作树/脏文件/main不变,所有新构建、私有运行目录、日志、截图、缓存和报告在E:/项目/Veyra对应任务目录。复用已验对象须核对源/头依赖闭包与输入哈希,保留patched FFmpeg、外部DeckLink SDK及运行组件身份。每测试≤300秒、构建≤900秒,不造竞争压力。定向QML键盘/几何、真实呈现/设置恢复、超分实际输出和相关旧回归;没有AMD/BMD实卡不得外推验收。记录失败与修复、必要日志、源码commit/checkpoint/incremental bundle及新增磁盘占用,审查后交付报告,再按用户要求安排非强制关机。diff --git a/docs/SETTINGS_SR_UI_REPORT_2026-10-10.md b/docs/SETTINGS_SR_UI_REPORT_2026-10-10.mdnew file mode 100644index 00000000..5b37fa21--- /dev/null+++ b/docs/SETTINGS_SR_UI_REPORT_2026-10-10.md@@ -0,0 +1,72 @@+# 设置切换、数字输入、超分和多语言布局修复++2026-10-10。本轮在 `codex/settings-sr-ui-20261010` 实施,基点 `af2edf4052857c7db99d7c33f92827f02ab34319`。代码、构建和本机定向回归完成;不打测试包、不更新版本、不合并 main、不推送或发布。收尾凭据见 `E:/项目/Veyra/reports/settings-sr-ui-20261010/final.json`。++## 1. 改设置后软件错误、重启才能恢复++日志46的直接故障在呈现初始化,不是 NR 参数验证失败。2026-10-09 15:12:34.051 UTC 关闭 NR 时,HDR10 输出和 DLSS 2X 仍启用;旧实现连同原生交换链一起销毁、重建。`CreateSwapChainForHwnd` 返回 `0x80070005 / E_ACCESSDENIED`,8 次有界重试仍失败,随后恢复旧设置再次遇到相同错误,最终停止播放。++DXGI 对同一 HWND 的 flip-model 交换链有生命周期约束,外部仍持有旧对象时重新创建可能失败。微软的 [D3D12 交换链说明](https://learn.microsoft.com/en-us/windows/win32/direct3d12/swap-chains) 和 [flip-model 建议](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/for-best-performance--use-dxgi-flip-model) 支持这一机制。日志同时有 GamePP `GPP64.dll` 和 NVIDIA overlay,但不能据此断言是哪一个钩子或驱动保留了对象;原引用数也包括程序自己的接口引用,不能当作泄漏证明。++修复是在相同窗口、设备、输出格式及 OBS 兼容合同下保留原生交换链与呈现队列,排空后只重建效果图和它的描述符。初始化降级、设置重建、恢复旧设置、输入尺寸变化和运行时后端恢复共用这个边界。XeSS 自有呈现,以及窗口、设备、HDR/SDR 格式、兼容模式真正改变时,仍正确关闭重建。++原生呈现队列现在具有稳定生命周期;关闭补帧也不需要换掉同一 HWND 的链。排空仅在切换边界执行,未加入逐帧 CPU 等待、像素回读或新的无界队列。兼容复制的旧合成纹理在重绑定时释放,避免关闭兼容后留下一块无用纹理。HDR 元数据已发送状态保留,以便新设置关闭时清除交换链上的旧提示。++另外修复了回退诊断:恢复旧图后的首帧暖机曾把“已回退”覆盖成“成功”;现在保留失败设置 revision 和实际回退耗时,后续显式 seek/resize 等新 reset 仍正常记录。++本机使用 RTX 5070 12GB、驱动 616.56(Windows 32.0.16.1656)。日志反馈者是 RTX 5070 Ti 16GB,不能混为同一台机器。测试主动保留外部 COM 引用:8 次 SDR 图替换、8 次 P010/PQ HDR10+原版 NR 开关+DLSS 2X 替换均通过,HDR 还交替开启/关闭兼容复制。实际呈现中心像素与当前图输出比对,HDR RGB 三通道最大误差 1/1023,D3D12 错误 0。用户 GTA6 4K 视频、1080p 原版 NR 连续 8 次 NR/SR/补帧切换及放大视窗均继续呈现,无需重启。++这证明本机生命周期与恢复路径通过,尚未取得反馈者叠加层环境复测,不宣称所有概率性错误已被现场证实根治。++## 2. 手动输入数字后快捷键失效++`VSliderValue` 提交或取消时隐藏输入框,却没有清除它的焦点。快捷键过滤仍将隐藏的 `QQuickTextInput` 视为正在输入,所以重置按钮夺走焦点后才恢复,拖动滑杆则不会触发。++现在提交、Esc 和失焦关闭均清除编辑器焦点。仅当它仍持有活动焦点时才返回窗口内容焦点;用户点击另一个输入框时不会把新输入框的焦点抢走。真实键盘测试覆盖 Return/Esc 后方向快捷键、点击外部、继续编辑下一项、数值限幅/百分比/无效输入,13 条 Qt 测试记录通过。++## 3. 超分“几乎没效果”++已确认并修复两处真正没有执行模型的路径:++- RTX Video SR 1–4 档:原尺寸达到目标时,被“无需放大”判定跳过。4K 片源选择 4K 就会出现开关无区别。现在视频在原尺寸也执行 RTX Video SR 的压缩伪影修复;DLSS SR、FSR 及静态图片仍保留原尺寸不放大的规则。+- FSR:首次或光流尚未可用的帧直接落到普通缩放。现在使用明确的零运动输入执行 FSR;请求光流却缺失时重置累积,避免使用旧运动历史。未把估算运动宣称为引擎原生数据。++UI 已说明 RTX Video SR 的原尺寸修复与 DLSS/FSR 放大的区别。视频导出提示也读取共享图的实际 `enableSr`,不会在原尺寸 VSR 正在执行时错误提示“导出关闭超分”。12 组预览/导出/图片、三种后端合同检查覆盖这一差异。++对照旧判定:原尺寸 VSR 的执行数为 0,开关输出差异为 0;修复后 3 帧执行 3 次。GTA6 第 12 秒实际解码画面在原生 3840×2160 输出下有 16,268,204 个 RGB 通道值变化,8 位平均绝对差 1.1377;合成纹理样本变化 9,220,022 个通道,平均差 1.89597。FSR 的 3 帧测试从首次执行 0 次、总计 2 次,变为首次 1 次、总计 3 次。质量 1/4 档、DLSS/FSR 放大与调色输入检查通过,PNG 对照保留。++这些数字证明执行和输出变化,**不是画质提升百分比**。普通调色原先已生效;排查中关于它被 SR 绕过的假设被实际像素对照否定,没有把正常链路改坏或包装成修复。也未增加假锐化、替换模型或宣称高质量 4K 源必然明显改善。原先被跳过的 1:1 VSR 现在确实工作,因此会增加 GPU 工作量;仍可关闭 SR 或降低原有质量档。本轮没有受控吞吐率/屏幕延迟对照,也未重新验收全部编码器与导出封装。++## 4. 多语言和中文长选项裁切++共享菜单按文字、图标和标签测量宽度,限制在窗口内;长标题、正文及说明换行,长列表有界滚动,窗口或锚点移动时重新定位。采集格式无需靠固定 220px 宽度硬裁,已选值被截断时可悬停看全文。参数行根据控件和标签宽度上下排布,行高随文字增长;按钮按实际可用宽度排版并提供全文提示。++截图复核另发现节点页统计被按钮挤没、英文操作提示越界:窄窗口将统计单独排第二行,统计可横向滚动/悬停查看,画布提示按宽度换行。右键菜单在右下角也保持完整并限制在窗口内。++真实生产界面验证使用本机 KUHAIMI 27P 的实际格式枚举、真实节点编辑 API 和真实专业页,而不是复制一套样式。简中/英语 1280×900、繁中/日语 900×800、英语 900×800+150% 缩放共 5 组通过;逐项验证菜单完整文字、窗口边界、节点操作栏及专业页参数行。截图在页面动画完成后保存并人工检查。另有 8 条菜单/布局、22 条现有组件 Qt 测试记录通过。++本次新增 5 个来源键均有繁中/英文/日文,placeholder 错误 0。基线的 29 个历史缺译保持 29,没有新增缺译;这不是全项目翻译已经完整的声明。++## 验证记录和输出++命令均从 `E:/项目/Veyra/worktrees/settings-sr-ui-20261010` 执行;以下目录前缀为 `E:/项目/Veyra/logs/settings-sr-ui-20261010/`:++| 检查 | 命令/回执 | 结果 |+|---|---|---|+| 当前产品、测试和依赖闭包构建 | `py -3.11 -B scripts/acceptance/settings-sr-ui-build.py`;`build-20261010-015445/receipt.json` | 成功;旧对象/SDK 原件哈希不变 |+| CMake 原生/no-SDK 配置及实际对象编译 | 同脚本 `cmake-check`;`build-20261010-015524/receipt.json` | 两种驱动对象和新集成测试对象成功 |+| 定向完整回归 | `settings-sr-ui-test.py sr presenter slider menu components lifecycle video rollback`;`tests-20261010-014713/receipt.json` | 8 组成功;回退/暂停/恢复/停止/4X/来源新鲜度覆盖 |+| 最终呈现及实际视频 | 同脚本 `presenter video`;`tests-20261010-015303/receipt.json` | 成功,兼容复制开/关、HDR/SDR 中心像素和 8 次真实视频切换 |+| GTA6 实际画面超分 | 同脚本 `sr-gta`;`tests-20261010-013544/receipt.json` | 原生4K及2K→4K、三后端输出检查通过 |+| 旧 HDR/采集颜色/格式回归 | 同脚本 `hdr color formats`;`tests-20261010-014401/receipt.json` | 全部 exit 0,无颜色/格式失败 |+| 真实多语言界面 | `settings-sr-ui-gui-test.py`;`gui-20261010-014928/receipt.json` | 5 组通过,无 QML 错误 |+| 最终 SR 合同与输出 | 同脚本 `sr`;`tests-20261010-015539/receipt.json` | 12 组合同及实际 GPU 输出通过 |+| 范围/原件保全 | `settings-sr-ui-control.py final-audit`;`E:/项目/Veyra/reports/settings-sr-ui-20261010/final-audit.json` | 43 旧工作树、495 脏文件和 main 核对 |++构建使用 MSVC 14.44、Windows SDK 10.0.26100、Qt 6.8.3,重编受影响源码和头依赖闭包,复用经哈希校验的旧对象;不是宣称重新编译了整个工程及全部第三方库。CMake 额外验证可正常配置新增目标。运行时使用私有硬链接目录,替换 EXE/QML 时原子换文件,前后校验原便携包 1614 个文件。保留带 PS5 slices256 补丁的 FFmpeg;未修改第三方 DLL、驱动、模型或真实用户配置。++排查中的初次失败均保留日志:PNG 导出缺 COM 初始化、FSR 私有目录漏放已有加载器、Popup 属性名与 Qt FINAL 属性冲突、尺寸变化后菜单定位、UI 截图落在过渡动画中,以及一次测试脚本缺少 `hdr` 分支。修正后重验;旧失败未计为产品通过。失败注入测试还真实发现并推动修复了回退诊断覆盖。++所有新增构建、私有 app、PNG、日志、缓存和增量源码存档均在 `E:/项目/Veyra/{build,tests,logs,tmp,reports,archives}/settings-sr-ui-20261010`。保留单份当前构建/私有运行目录、必要证据和增量 bundle;新增磁盘占用及源码 commit/checkpoint 记录在 `final.json`。测试每进程少于 300 秒,构建少于 900 秒。本机无反馈者 AMD 9070/5070Ti 环境,不把通用 QML 或 RTX5070 回归冒充那些设备现场通过。按用户要求在源码与报告保存后安排非强制关机,关机动作回执与最终审计分开保存。++临时缓存清理未执行:已核对绝对目标 `E:/项目/Veyra/tmp/settings-sr-ui-20261010` 后的 PowerShell 删除请求被自动审批拒绝,返回信息仅为 `blocked by policy`。没有换工具绕过;保留 2773 个临时文件、284748097 逻辑字节(约271.6MiB),未声称释放磁盘空间。保全记录见 reports 同名目录的 `cleanup.json`。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 897f1674..f2678744 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -8961,3 +8961,28 @@ media, SDK files or runtime binaries.- 初次构建依赖闭包/SDK枚举名/相对链接库路径/音频无关对象问题与CMake误用DLL-only FFmpeg前缀均修复后重验,失败日志仍在logs任务目录;不是产品通过证明。最终审查另修正EnableVideoInput早期制式回调丢失、10位RGB极白粗亮度样本溢出、未知HDR EOTF误作SDR、原生重连后名义帧率刷新等边界,均在上述最终构建/相应回归中。产物全在E:/项目/Veyra/{build,tests,logs,tmp,reports,archives}/decklink-native-20261009,SDK另在deps/decklink-sdk-obs31-20261009;无运行库/模型修改或SDK/二进制入Git。本机无BMD卡。以上证明本机产品状态机/GPU/UI及旧USB/音频回归,不是反馈者出画、BMD全型号/多声道/去隔行或实测延迟证明。原日志已定位到上游样本抽样黑,具体信号/驱动原因仍需新原生日志,不能以原生接入自动宣称根治。最终范围守卫、源码提交/checkpoint和增量bundle见reports/decklink-native-20261009/final.json。++## 2026-10-10 设置错误、数字输入快捷键、超分和多语言布局++用户提供日志46及手动输入后快捷键失效截图,要求四项修复、汇报并关机;沿用“不用打测试包”。从af2edf4052857c7db99d7c33f92827f02ab34319隔离到`E:/项目/Veyra/worktrees/settings-sr-ui-20261010`、`codex/settings-sr-ui-20261010`。独立archives同名/start.json和source-before.bundle保护43既有工作树、495脏文件、main0e7018ad;无Agent、无main合并、push/Release/版本更新。PLAN/REPORT在docs同名2026-10-10文件。++- 日志46(259854字节,SHA256 f4361990c74a6f384d5d1d6625f6ae117409d5863e0cd315b104ea26f6376443)15:12:34.051 UTC关闭NR、HDR10+DLSS2X仍开,CreateSwapChainForHwnd E_ACCESSDENIED,8次重试及恢复旧设置再失败。原生同窗口/设备/格式/OBS合同保留交换链与稳定呈现队列,排空后重绑图资源;初始化降级、设置恢复、源尺寸和运行时故障恢复接同一边界。XeSS/真实合同变化仍关闭重建。保留HDR元数据已发送状态;释放旧兼容合成纹理。微软one-flip-chain-per-HWND合同支持保留旧对象的故障机制,但日志中的GamePP/NVIDIA overlay不足以确认具体持有方,refcount3也不是泄漏证明。反馈者5070Ti16GB与本机5070 12GB/616.56明确区分。+- 隐藏数字TextInput保留焦点导致快捷键仍判typing,提交/Esc/失焦关闭显式清除,仅自身仍活动时返回窗口焦点,继续输入下一项不抢焦点。定向真实键盘13通过,菜单布局8、现有组件22通过。+- SR原尺寸VSR被“未放大”门控跳过、FSR首帧无flow走普通resize两处修复;原尺寸仅视频VSR1–4可恢复,DLSS/FSR/图片仍按放大条件。FSR零motion+必要reset,不吃旧历史;导出提示改读共享gd.enableSr,不再把正在执行的原尺寸VSR说成关闭。预览/导出/图片三后端12组合同通过。普通调色被SR绕过是假设,实际像素证明原先已生效,未改正常描述符或冒称修复。+- 菜单按字宽/图标/tag测量、限制窗口边界、长项换行和有界滚动;选择/按钮截断可看全文;参数行随宽度上下排、行高增长。截图又发现节点窄窗口统计栏被挤没和英文画布提示越界,改两行、统计滚动/全文提示和操作提示换行;截图等页面动画结束再检查。5新增键补全繁中/英文/日文,placeholder0,基线遗留缺译29→29。++命令均在本轮工作树,输出前缀`E:/项目/Veyra/logs/settings-sr-ui-20261010/`:++- `py -3.11 -B scripts/acceptance/settings-sr-ui-build.py`最终build-20261010-015445/receipt.json成功,21.203秒;18受影响依赖闭包对象核对/重编,MSVC14.44/SDK10.0.26100/Qt6.8.3,旧缓存/SDK输入哈希不变。GUI SHA256 587761373e1f064c13dc6f56d3ad31b6a8e755ae417e58c0ab7750dcd0867d9b。不宣称clean全工程重编;脚本按不可变开工基点识别头改动,提交后再执行也不会漏依赖。+- `...build.py cmake-check`:build-20261010-015524/receipt.json,7.047秒,原生/no-SDK配置和驱动对象实际编译,以及新增两个集成测试的CMake对象编译成功。+- `...test.py sr presenter slider menu components lifecycle video rollback`:tests-20261010-014713/receipt.json八组成功。GTA6原4K、原版NR1080p热切8次并放大视窗无需重启;失败注入、匹配revision/GPU完成、音频改动不重置图、暂停/恢复/4X/停止取消/来源新鲜度均通过。回退测试发现旧图恢复暖机把RolledBack覆盖为Completed,修复后实际恢复播放并保留失败revision/计时。+- 审查旧兼容纹理释放后`...test.py presenter video`:tests-20261010-015303/receipt.json,18.218/41.875秒通过。保留外部COM引用、SDR8次+HDR P010/PQ/真实原版NR+DLSS2X8次切换,HDR兼容复制也交替开/关;实际呈现中心RGB最大10位差1,D3D12错误0。日志复用8次;不是反馈者overlay实机复现或全帧图像一致证明。+- `...test.py sr-gta`:tests-20261010-013544/receipt.json,实际第12秒画面原生4K,VSR开/关变化16268204个RGB通道、MAE8=1.1377;2K→4K的VSR质量1/4、DLSS、FSR及调色回归通过。旧门控对照tests-20261010-012819为原尺寸0执行/0差异、FSR3帧首帧0/总2;最终`...test.py sr` tests-20261010-015539/receipt.json首帧1/总3,原尺寸合成样本9220022通道变化、MAE8=1.89597,12合同通过。数字只证明实际执行/改变,不是画质百分比;原尺寸恢复会新增GPU工作量,未做受控吞吐率或屏幕延迟对照。+- `...test.py hdr color formats`:tests-20261010-014401/receipt.json全部exit0,无颜色/格式失败;`...gui-test.py` gui-20261010-014928/receipt.json五组真实生产界面通过,简中/英语1280×900、繁中/日语900×800、英语900×800×150%,本机KUHAIMI格式枚举/真实节点/专业页,不是复制样式。PNG和几何/完整文字断言保留,人工复核英文格式/节点与日文专业页。+- `py -3.11 -B scripts/i18n/extract.py --check`:2162来源键,placeholder0,新缺译0。reports/settings-sr-ui-20261010/i18n-audit.json记录与基线的29条对照。++早期失败日志保留:PNG保存缺COM初始化、私有app漏已有FSR加载器、Popup误用Qt FINAL属性名、窗口改变后菜单位置、截图处于过渡、测试脚本缺hdr分支;均修正后重验,未计为产品成功。所有测试每进程<300秒、构建<900秒,正常链路未新增GPU像素回读/逐帧CPU等待/无界队列。1614文件母包每次前后SHA不变,patched FFmpeg保留PS5 slices256,DLL/SDK/模型原件与真实用户配置不变,不入Git。++产物统一`E:/项目/Veyra/{build,tests,logs,tmp,reports,archives}/settings-sr-ui-20261010`,仅单份私有运行目录和当前构建,不打包或复制整工程。最后control.py final-audit核对旧树/main/范围,源码commit/checkpoint/source-after.bundle、构建和各回执哈希、磁盘占用与清理记录存reports同名/final.json。现场5070Ti+overlay/AMD9070未复测,未重验全部编码器/封装,不宣称所有用户已根治;保存证据后按本次用户请求安排非强制关机,动作另存shutdown回执。++收尾缓存删除被自动审批拒绝:PowerShell已解析并检查`E:/项目/Veyra/tmp/settings-sr-ui-20261010`绝对范围,Remove-Item请求仍返回`blocked by policy`,命令未执行;未更换工具绕过。2773文件/284748097逻辑字节保留,非磁盘已释放。cleanup.json与disk-before-cleanup.json如实记录,修复/构建/源码收尾继续。diff --git a/i18n/catalog.json b/i18n/catalog.jsonindex 9c630449..d0a43788 100644--- a/i18n/catalog.json+++ b/i18n/catalog.json@@ -15030,6 +15030,41 @@"zh-TW": "交錯","en": "Interlaced","ja": "インターレース"+ },+ {+ "zh": "放大时重建细节;原尺寸时修复压缩伪影。效果取决于片源。",+ "src": "qml/Veyra/ProPage.qml",+ "zh-TW": "放大時重建細節;原尺寸時修復壓縮瑕疵。效果取決於片源。",+ "en": "Reconstructs detail when upscaling and reduces compression artifacts at native size. Results depend on the source.",+ "ja": "拡大時は細部を再構成し、元の解像度では圧縮ノイズを低減します。効果は映像により異なります。"+ },+ {+ "zh": "目标须大于片源尺寸;已达到目标时不执行超分。",+ "src": "qml/Veyra/ProPage.qml",+ "zh-TW": "目標須大於片源尺寸;已達到目標時不執行超解析度。",+ "en": "The target must exceed the source size. Upscaling is skipped when the source already meets the target.",+ "ja": "入力より大きい目標解像度が必要です。入力が目標以上の場合は超解像処理を行いません。"+ },+ {+ "zh": "设置切换呈现排空失败,已停止",+ "src": "src/engine/EngineController.cpp",+ "zh-TW": "設定切換呈現排空失敗,已停止",+ "en": "Could not drain presentation for the settings change. Playback stopped.",+ "ja": "設定変更時に描画処理を完了できなかったため、再生を停止しました。"+ },+ {+ "zh": "设置恢复呈现排空失败,已停止",+ "src": "src/engine/EngineController.cpp",+ "zh-TW": "設定還原呈現排空失敗,已停止",+ "en": "Could not drain presentation to restore settings. Playback stopped.",+ "ja": "設定復元時に描画処理を完了できなかったため、再生を停止しました。"+ },+ {+ "zh": "输入尺寸切换呈现排空失败",+ "src": "src/engine/EngineController.cpp",+ "zh-TW": "輸入尺寸切換呈現排空失敗",+ "en": "Could not drain presentation for the input size change.",+ "ja": "入力サイズ変更時に描画処理を完了できませんでした。"}]}diff --git a/include/veyra/engine/GraphDescription.h b/include/veyra/engine/GraphDescription.hindex 28403849..de9c83bc 100644--- a/include/veyra/engine/GraphDescription.h+++ b/include/veyra/engine/GraphDescription.h@@ -93,7 +93,11 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,constdesc.workWidth=plan.base.width;desc.workHeight=plan.base.height;desc.nrWidth=plan.nr.width;desc.nrHeight=plan.nr.height;desc.flowWidth=plan.flow.width;desc.flowHeight=plan.flow.height;- desc.enableSr=plan.srApplied&&(request.nvidiaAdapter||settings.videoSrQuality==kVideoSrFsr);+ // RTX Video SR can restore compressed video at its original resolution.+ // ResolutionPlan::srApplied describes enlargement, not SDK execution.+ const bool nativeVideoRestore=request.sr&&!request.stillImage&&request.nvidiaAdapter&&+ settings.videoSrQuality>=1&&settings.videoSrQuality<=4;+ desc.enableSr=(plan.srApplied||nativeVideoRestore)&&(request.nvidiaAdapter||settings.videoSrQuality==kVideoSrFsr);desc.enableNr=request.nr&&(request.nvidiaAdapter||request.amdNr)&&(!settings.nrLayerCount||settings.activeNrLayerCount()>0);desc.nrBeforeSr=!request.stillImage&&!request.exportJob&&lowLatency&&desc.enableNr&&desc.enableSr;desc.enableNvofStandalone=desc.enableNr;diff --git a/include/veyra/engine/VideoPresenter.h b/include/veyra/engine/VideoPresenter.hindex 215ffa50..00c7d836 100644--- a/include/veyra/engine/VideoPresenter.h+++ b/include/veyra/engine/VideoPresenter.h@@ -24,6 +24,11 @@ public:bool open(gfx::D3D12DeviceContext&, HWND, pipeline::EnhanceGraph&, bool captureCompatible=false, bool mediaClockPaced=false);bool present(gfx::D3D12DeviceContext&,gfx::CommandSlotRing&,pipeline::EnhanceGraph&,unsigned slot,bool generated,bool referencesValid=true,int comparison=0,bool baseReference=false,float split=.5f,pipeline::FrameIdentity identity={},PreviewView view={},int64_t sourcePts100ns=-1,bool retainUnchanged=false);void close();+ // Owner-thread graph replacement boundary. Native DXGI remains attached to+ // its HWND; provider-owned presentation must be shut down before its graph.+ bool prepareGraphChange();+ // Explicit lifecycle regression: simulate an overlay retaining the chain.+ Microsoft::WRL::ComPtr<IDXGISwapChain3> swapChainForTest()const{return sink_.swapChain();}// Present-sink providers (XeSS) block inside Present while pacing// their generated frames. A helper-thread Present was tried on// 2026-09-22 (X3): the provider then estimated its period from the@@ -116,6 +121,9 @@ private:};std::optional<RetainedFrame> retainedFrame_;HWND window_=nullptr;+ ID3D12Device* presentationDevice_=nullptr;+ DXGI_FORMAT presentationFormat_=DXGI_FORMAT_UNKNOWN;+ bool captureCompatible_=false;std::chrono::steady_clock::time_point lastResize_{};unsigned viewWidth_=0,viewHeight_=0;HMONITOR bufferMonitor_=nullptr;diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qmlindex 473244ba..1ccb02ea 100644--- a/qml/Veyra/NodePage.qml+++ b/qml/Veyra/NodePage.qml@@ -368,21 +368,30 @@ VPage {// .nv-bar: transport, then the stats strip.Rectangle {id: statsBar+ readonly property bool compact: width < nodeSourceBtn.implicitWidth + nodePresetBtn.implicitWidth+ + nodeModeSwitch.implicitWidth + nodeOrbs.implicitWidth + 3 * 32 + 32 + 8 * 8 + 360anchors.left: parent.leftanchors.right: parent.rightanchors.bottom: parent.bottom- height: 40+ height: compact ? 72 : 40color: Theme.card- RowLayout {+ GridLayout {+ objectName: "node-transport-layout"anchors.fill: parentanchors.leftMargin: 8anchors.rightMargin: 8- spacing: 8+ columns: statsBar.compact ? 8 : 9+ columnSpacing: 8+ rowSpacing: 0// pages-node.js .nv-bar: the source first, as on the list page.VButton {id: nodeSourceBtn+ Layout.row: 0; Layout.column: 0+ Layout.minimumWidth: 100+ Layout.maximumWidth: implicitWidth+ Layout.fillWidth: statsBar.compactobjectName: "node-source-button"iconName: veyra.sourceKind === "ps5" ? "gamepad" : veyra.sourceKind === "moonlight" ? "cast" : veyra.sourceKind === "xbox" ? "gamepad" : veyra.sourceKind === "screen" ? "monitor": veyra.sourceKind === "image" ? "image" : veyra.sourceKind === "file" ? "film" : "video"@@ -392,20 +401,39 @@ VPage {onClicked: nodeSourceMenu.openAt(this, "down")}VButton {+ Layout.row: 0; Layout.column: 1icon: trueiconName: (veyra.running && !veyra.paused) ? "pause" : "play"onClicked: veyra.togglePlayPause()}- VButton { icon: true; iconName: "back10"; onClicked: veyra.seekBy(-10) }- VButton { icon: true; iconName: "fwd10"; onClicked: veyra.seekBy(10) }+ VButton { Layout.row: 0; Layout.column: 2; icon: true; iconName: "back10"; onClicked: veyra.seekBy(-10) }+ VButton { Layout.row: 0; Layout.column: 3; icon: true; iconName: "fwd10"; onClicked: veyra.seekBy(10) }// .nv-stats: each entry separated by a hairline, mono numbers.- RowLayout {+ Flickable {+ objectName: "node-stats-scroll"+ Layout.row: statsBar.compact ? 1 : 0+ Layout.column: statsBar.compact ? 0 : 4+ Layout.columnSpan: statsBar.compact ? 8 : 1Layout.fillWidth: trueLayout.minimumWidth: 0+ Layout.preferredHeight: 30clip: true+ contentWidth: statItems.implicitWidth+ contentHeight: height+ flickableDirection: Flickable.HorizontalFlick+ boundsBehavior: Flickable.StopAtBounds+ ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AsNeeded }+ HoverHandler { id: statsHover }+ ToolTip.visible: statsHover.hovered && contentWidth > width+ ToolTip.delay: 400+ ToolTip.text: statRepeater.model.map(x => x.k + ": " + (x.v.length ? x.v : "—")).join("\n")+ RowLayout {+ id: statItems+ height: parent.heightspacing: 0Repeater {+ id: statRepeatermodel: [{ k: qsTr("输入"), v: veyra.sourceSummary, hi: false },{ k: qsTr("输出"), v: veyra.outputSummary.length > 0 ? veyra.outputSummary : qsTr("未测"), hi: false },@@ -437,11 +465,13 @@ VPage {}}}+ }}// Total time / GPU / output-vs-target orbs (replace "已测增强 P95").- ProPage.PerfOrbs { objectName: "node-perf-orbs"; size: 32; showLabels: false; spacing: 6 }+ ProPage.PerfOrbs { id: nodeOrbs; Layout.row: 0; Layout.column: statsBar.compact ? 4 : 5; objectName: "node-perf-orbs"; size: 32; showLabels: false; spacing: 6 }VButton {+ Layout.row: 0; Layout.column: statsBar.compact ? 5 : 6objectName: "node-fullscreen"icon: true; iconName: "max"tip: qsTr("全屏画面(双击画面 / F11)")@@ -449,6 +479,8 @@ VPage {}// .viewtog: 列表 asks first (the list configuration comes back).VSeg {+ id: nodeModeSwitch+ Layout.row: 0; Layout.column: statsBar.compact ? 6 : 7objectName: "node-mode-switch"options: [{ id: "list", label: qsTr("列表"), icon: "list" }, { id: "node", label: qsTr("节点"), icon: "nodes" }]current: "node"@@ -457,6 +489,10 @@ VPage {VButton { objectName: "node-return-list"; visible: false; text: qsTr("返回列表"); onClicked: returnDialog.open() }VButton {id: nodePresetBtn+ Layout.row: 0; Layout.column: statsBar.compact ? 7 : 8+ Layout.minimumWidth: 120+ Layout.maximumWidth: implicitWidth+ Layout.fillWidth: statsBar.compactobjectName: "node-preset-button"iconName: "nodes"trailingIcon: "down"@@ -530,8 +566,10 @@ VPage {Text {objectName: "node-canvas-tip"anchors.left: parent.left+ anchors.right: parent.rightanchors.top: parent.topanchors.leftMargin: 12+ anchors.rightMargin: 12anchors.topMargin: 10z: 4text: root.wireFrom >= 0 ? qsTr("请选择输入端口完成连接 · Esc 取消") :@@ -539,6 +577,7 @@ VPage {color: Theme.t3font.family: Theme.fontUifont.pixelSize: 11+ wrapMode: Text.Wrap}Canvas {@@ -1378,7 +1417,9 @@ VPage {}VRow {label: qsTr("目标尺寸")- hint: qsTr("决定输出分辨率")+ hint: veyra.videoSrQuality >= 1 && veyra.videoSrQuality <= 4+ ? qsTr("放大时重建细节;原尺寸时修复压缩伪影。效果取决于片源。")+ : qsTr("目标须大于片源尺寸;已达到目标时不执行超分。")VSeg {options: [{ id: "1", label: "2K" }, { id: "2", label: "4K" }, { id: "4", label: "5K" }, { id: "5", label: "6K" }, { id: "6", label: "7K" }, { id: "3", label: "8K" }]current: String(veyra.srTargetIndex)diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qmlindex 783d1866..8eaf1008 100644--- a/qml/Veyra/ProPage.qml+++ b/qml/Veyra/ProPage.qml@@ -1272,7 +1272,9 @@ VPage {}VRow {label: qsTr("目标尺寸")- hint: qsTr("决定输出分辨率")+ hint: veyra.videoSrQuality >= 1 && veyra.videoSrQuality <= 4+ ? qsTr("放大时重建细节;原尺寸时修复压缩伪影。效果取决于片源。")+ : qsTr("目标须大于片源尺寸;已达到目标时不执行超分。")VSeg {options: [{ id: "1", label: "2K" },diff --git a/qml/Veyra/VButton.qml b/qml/Veyra/VButton.qmlindex 7500d58c..79190730 100644--- a/qml/Veyra/VButton.qml+++ b/qml/Veyra/VButton.qml@@ -18,7 +18,8 @@ Rectangle {property int maxTextWidth: 0signal clicked()- implicitWidth: icon ? Theme.ctlHeight : (content.implicitWidth + 24)+ implicitWidth: icon ? Theme.ctlHeight : (Math.min(label.implicitWidth, maxTextWidth > 0 ? maxTextWidth : label.implicitWidth)+ + (iconName.length ? 25 : 0) + (trailingIcon.length ? 19 : 0) + 24)implicitHeight: Theme.ctlHeightradius: Theme.rCtlcolor: primary ? Theme.accent@@ -46,7 +47,8 @@ Rectangle {Text {id: labelvisible: text.length > 0- width: btn.maxTextWidth > 0 ? Math.min(implicitWidth, btn.maxTextWidth) : implicitWidth+ width: Math.max(0, Math.min(implicitWidth, btn.maxTextWidth > 0 ? btn.maxTextWidth : implicitWidth,+ btn.width - 24 - (btn.iconName.length ? 25 : 0) - (btn.trailingIcon.length ? 19 : 0)))elide: Text.ElideMiddleanchors.verticalCenter: parent.verticalCentertext: btn.glyph.length > 0 ? btn.glyph + (btn.text.length > 0 ? " " + btn.text : "") : btn.text@@ -64,9 +66,9 @@ Rectangle {color: Theme.t3}}- ToolTip.visible: tip.length > 0 && hover.hovered+ ToolTip.visible: (tip.length > 0 || label.truncated) && hover.hoveredToolTip.delay: 500- ToolTip.text: tip+ ToolTip.text: tip.length > 0 ? tip : label.textHoverHandler { id: hover; cursorShape: Qt.PointingHandCursor }TapHandler { id: tap; gesturePolicy: TapHandler.WithinBounds; onTapped: btn.clicked() }}diff --git a/qml/Veyra/VMenu.qml b/qml/Veyra/VMenu.qmlindex 9e066639..d4cac1a4 100644--- a/qml/Veyra/VMenu.qml+++ b/qml/Veyra/VMenu.qml@@ -21,6 +21,18 @@ Popup {// Optional local-window bottom boundary for upward menus. The fullscreen// cinema bar uses this to keep a popover clear of the 92px playback pill.property real aboveLimit: -1+ readonly property real menuAvailableWidth: Math.max(1, (parent ? parent.width : 640) - 16)+ readonly property real measuredWidth: {+ let widest = titleMetrics.advanceWidth(title) + 44+ for (const o of items) {+ const extra = 52 + (o.icon ? 28 : 0) + (o.tag ? labelMetrics.advanceWidth(o.tag) + 30 : 0)+ widest = Math.max(widest, labelMetrics.advanceWidth(o.label || o.head || "") + extra)+ }+ return widest+ }+ width: Math.min(menuAvailableWidth, Math.max(220, anchorItem ? anchorItem.width : 0, Math.min(720, measuredWidth)))+ FontMetrics { id: labelMetrics; font.family: Theme.fontUi; font.pixelSize: Theme.fsBody; font.weight: Font.Medium }+ FontMetrics { id: titleMetrics; font.family: Theme.fontUi; font.pixelSize: 11; font.weight: Font.Medium }signal picked(int index, var item)// The design's local copy of the checked flags, so the tick moves on click@@ -64,12 +76,22 @@ Popup {anchorItem = anchorplacement = placechecks = items.map(o => o.checked === true)- width = place === "at" ? 220 : Math.max(220, anchor.width)positionAtAnchor()open()Qt.callLater(positionAtAnchor)}onHeightChanged: if (visible && anchorItem) positionAtAnchor()+ onWidthChanged: if (visible && anchorItem) positionAtAnchor()+ Connections {+ target: pop.parent+ function onWidthChanged() { if (pop.visible) Qt.callLater(pop.positionAtAnchor) }+ function onHeightChanged() { if (pop.visible) Qt.callLater(pop.positionAtAnchor) }+ }+ Connections {+ target: pop.anchorItem+ function onXChanged() { if (pop.visible) Qt.callLater(pop.positionAtAnchor) }+ function onYChanged() { if (pop.visible) Qt.callLater(pop.positionAtAnchor) }+ }property real originX: width / 2// For the motion probe.readonly property real motionScale: motion.s@@ -80,7 +102,7 @@ Popup {// Takes focus so Esc closes it (CloseOnEscape needs the popup focused).focus: trueclosePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside- implicitHeight: Math.min(420, col.implicitHeight + 12)+ implicitHeight: Math.min(420, Math.max(1, (parent ? parent.height : 640) - 16), col.implicitHeight + 12)background: nullenter: Transition {@@ -156,6 +178,9 @@ Popup {// .pop h6Text {visible: pop.title.length > 0+ Layout.fillWidth: true+ Layout.minimumWidth: 0+ wrapMode: Text.WrapLayout.margins: 6Layout.leftMargin: 10text: pop.title@@ -189,6 +214,7 @@ Popup {font.family: Theme.fontUifont.pixelSize: 11font.weight: Font.Medium+ wrapMode: Text.Wrap}}Component {@@ -208,15 +234,18 @@ Popup {VIcon { visible: !!row.modelData.icon; name: row.modelData.icon || ""; color: Theme.t1 }ColumnLayout {Layout.fillWidth: true+ Layout.minimumWidth: 0spacing: 3Text {+ objectName: "vmenu-option-label"Layout.fillWidth: true+ Layout.minimumWidth: 0text: row.modelData.labelcolor: Theme.t1font.family: Theme.fontUifont.pixelSize: Theme.fsBodyfont.weight: Font.Medium- elide: Text.ElideRight+ wrapMode: Text.Wrap}Text {visible: !!row.modelData.note@@ -225,7 +254,7 @@ Popup {color: Theme.t3font.family: Theme.fontUifont.pixelSize: 11- wrapMode: Text.WordWrap+ wrapMode: Text.Wrap}}VTag { visible: !!row.modelData.tag; text: row.modelData.tag || ""; kind: row.modelData.tagKind || "" }diff --git a/qml/Veyra/VRow.qml b/qml/Veyra/VRow.qmlindex 8310524f..8e15b8d3 100644--- a/qml/Veyra/VRow.qml+++ b/qml/Veyra/VRow.qml@@ -9,6 +9,9 @@ Item {// Narrow panels with a wide control (导出 输出设置): the hint runs under the// whole row instead of being squeezed beside the control.property bool hintBelow: false+ readonly property bool stacked: width > 0 && width - slot.childrenRect.width - (value.length ? 52 : 0) - 12+ < Math.min(170, labelMetrics.advanceWidth(label))+ FontMetrics { id: labelMetrics; font.family: Theme.fontUi; font.pixelSize: Theme.fsBody }default property alias control: slot.data// The row's slider, when its control is one (typed values beside the number).readonly property Item valueSlider: {@@ -24,35 +27,36 @@ Item {// row is only ever placed inside a layout.// A hint that wraps (narrow panels) grows the row instead of running into// the next one.- implicitHeight: hintBelow- ? mainRow.height + (hint.length > 0 ? belowHint.implicitHeight + 6 : 0)- : Math.max(hint.length > 0 ? Theme.rowMinHeight + 12 : Theme.rowMinHeight,- textColumn.implicitHeight + 12, slot.implicitHeight + 8)+ implicitHeight: Math.max(Theme.rowMinHeight, mainRow.implicitHeight + 8)+ + (hintBelow && hint.length > 0 ? belowHint.implicitHeight + 6 : 0)Layout.preferredHeight: implicitHeightLayout.fillWidth: true- RowLayout {+ GridLayout {id: mainRowanchors.left: parent.leftanchors.right: parent.rightanchors.top: parent.top- height: row.hintBelow ? Math.max(Theme.rowMinHeight, slot.implicitHeight + 8) : parent.height- spacing: 12+ columns: row.stacked ? 2 : 3+ columnSpacing: 12+ rowSpacing: 6ColumnLayout {id: textColumnLayout.fillWidth: true+ Layout.minimumWidth: 0+ Layout.columnSpan: row.stacked ? 2 : 1spacing: 2// fillWidth here too: without a hint the label is the column's only child,// and a layout with no filling child cannot grow, which left the control// beside the label instead of at the row's right edge.- // Two lines before eliding: English and Japanese labels run longer than Chinese.- Text { Layout.fillWidth: true; text: row.label; color: Theme.t2; font.family: Theme.fontUi; font.pixelSize: Theme.fsBody; wrapMode: Text.WordWrap; maximumLineCount: 2; elide: Text.ElideRight }+ // Grow the row for long labels instead of hiding translated text.+ Text { Layout.fillWidth: true; Layout.minimumWidth: 0; text: row.label; color: Theme.t2; font.family: Theme.fontUi; font.pixelSize: Theme.fsBody; wrapMode: Text.Wrap }Text {visible: row.hint.length > 0 && !row.hintBelowtext: row.hintcolor: Theme.t3font.family: Theme.fontUifont.pixelSize: 11- wrapMode: Text.WordWrap+ wrapMode: Text.WrapLayout.fillWidth: true}}@@ -76,7 +80,7 @@ Item {anchors.left: parent.leftanchors.right: parent.rightanchors.top: mainRow.bottom- anchors.topMargin: -4+ anchors.topMargin: 6text: row.hintcolor: Theme.t3font.family: Theme.fontUidiff --git a/qml/Veyra/VSelect.qml b/qml/Veyra/VSelect.qmlindex fe137769..e2d915e9 100644--- a/qml/Veyra/VSelect.qml+++ b/qml/Veyra/VSelect.qml@@ -23,7 +23,9 @@ Rectangle {anchors.leftMargin: 12anchors.rightMargin: 10Text {+ id: valueLabelLayout.fillWidth: true+ Layout.minimumWidth: 0text: sel.valuecolor: Theme.t1font.family: Theme.fontUi@@ -34,6 +36,10 @@ Rectangle {VIcon { name: "down"; size: 14; color: Theme.t3 }}+ ToolTip.visible: hover.hovered && valueLabel.truncated+ ToolTip.delay: 500+ ToolTip.text: sel.value+VMenu {id: menu// Default to the enclosing VRow's label, as the design's sel(label, ...) does.diff --git a/qml/Veyra/VSliderValue.qml b/qml/Veyra/VSliderValue.qmlindex da64b09f..f285b19a 100644--- a/qml/Veyra/VSliderValue.qml+++ b/qml/Veyra/VSliderValue.qml@@ -26,7 +26,14 @@ Item {}function closeEditor(apply) {if (!editor.visible) return+ const heldFocus = input.activeFocuseditor.visible = false+ // Hiding a TextInput does not clear its focus. The window's shortcut+ // filter still treats that hidden item as typing after Enter/Escape.+ // A focus-loss commit must not steal focus from the next input.+ input.focus = false+ if (heldFocus && valueText.Window.window)+ valueText.Window.window.contentItem.forceActiveFocus()if (apply) {const raw = input.text.trim().replace(",", ".")const typed = Number(raw)diff --git a/scripts/acceptance/settings-sr-ui-build.py b/scripts/acceptance/settings-sr-ui-build.pynew file mode 100644index 00000000..1958f318--- /dev/null+++ b/scripts/acceptance/settings-sr-ui-build.py@@ -0,0 +1,188 @@+"""Scoped settings/SR/UI build; immutable accepted cache, current dependency closure."""+from pathlib import Path+import ctypes, hashlib, json, os, re, subprocess, sys, time+from concurrent.futures import ThreadPoolExecutor++ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='settings-sr-ui-20261010'+CACHE=BASE/'build/vfg-next-20261007';OUT=BASE/'build'/TASK+SDK=BASE/'deps/decklink-sdk-obs31-20261009'+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):return args(subprocess.check_output([tool,'-t','commands',name],cwd=CACHE,text=True,encoding='utf8').splitlines()[-1])+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'],capture_output=True,text=True,encoding='utf-16-le',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)++if sys.argv[1:]==['cmake-check']:+ cache=dict(re.findall(r'^([^#/:=]+):[^=]+=(.*)$',(CACHE/'CMakeCache.txt').read_text(encoding='utf8'),re.M))+ cmake=r'C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe'+ names=('VEYRA_DLSS_SDK_ROOT','VEYRA_NVOF_SDK_ROOT','VEYRA_NVENC_HEADERS_ROOT','VEYRA_XESS_ROOT',+ 'VEYRA_FIDELITYFX_ROOT','VEYRA_FIDELITYFX2_ROOT','VEYRA_MAGEWELL_SDK_DIR','VEYRA_LIBASS_ROOT','CMAKE_PREFIX_PATH')+ for native in (True,False):+ name='cmake-sdk' if native else 'cmake-no-sdk';directory=OUT/name+ flags=['-D'+key+'='+cache[key] for key in names]+ # The accepted vcpkg prefix supplies MSVC import libraries. The patched+ # runtime prefix used in tests contains DLLs/DEFs, not MSVC libraries.+ flags+=['-DVEYRA_FFMPEG_ROOT='+cache['VEYRA_FFMPEG_ROOT'],+ '-DVEYRA_ENABLE_EXPERIMENTAL_DLSSNR=ON','-DVEYRA_ENABLE_D3D12_DEBUG=OFF','-DVEYRA_BUILD_QML_UI=ON',+ '-DVEYRA_ENABLE_REMOTEPLAY=OFF','-DVEYRA_ENABLE_MOONLIGHT=OFF','-DVEYRA_ENABLE_XBOX=OFF',+ '-DVEYRA_DECKLINK_SDK_DIR='+(str(SDK) if native else ''),'-DCMAKE_BUILD_TYPE=Release','-DCMAKE_MAKE_PROGRAM='+tool]+ run([cmake,'-S',str(ROOT),'-B',str(directory),'-G','Ninja',*flags],name+'-configure')+ run([cmake,'--build',str(directory),'--target','CMakeFiles/veyra_sources.dir/src/source/DeckLinkDriver.cpp.obj','-j','2'],name+'-compile')+ if native:+ run([cmake,'--build',str(directory),'--target',+ 'CMakeFiles/veyra_settings_transaction_tests.dir/tests/integration/SettingsTransactionTests.cpp.obj',+ 'CMakeFiles/veyra_sr_quality_tests.dir/tests/integration/SrQualityTests.cpp.obj','-j','2'],name+'-test-objects')+ (LOG/'receipt.json').write_text(json.dumps({'commands':commands,'passed':True,'seconds':time.monotonic()-start},ensure_ascii=False,indent=2),encoding='utf8')+ (BASE/'reports'/TASK/'cmake-current.json').write_text(json.dumps({'receipt':str(LOG/'receipt.json')},indent=2),encoding='utf8')+ print('CMake native/no-SDK configurations, driver objects and current test objects passed;',LOG,flush=True)+ raise SystemExit(0)+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((BASE/'logs/decklink-native-20261009/build-20261009-205406/receipt.json').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+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')}+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])+baseline=json.loads((BASE/'archives'/TASK/'start.json').read_text(encoding='utf8'))['base']+changed_headers=[p.replace('\\','/') for p in subprocess.check_output(['git','diff','--name-only',baseline],cwd=ROOT,text=True,encoding='utf8').splitlines() if p.startswith('include/')]+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+ original=next((p for p in previous['sources'] if p.replace('\\','/').endswith('/'+relative)),None)+ source_changed=original is not None and Path(original).read_bytes().replace(b'\r\n',b'\n')!=(ROOT/relative).read_bytes().replace(b'\r\n',b'\n')+ directly=relative in ('src/source/CaptureCardSource.cpp','src/engine/EngineController.cpp','src/pipeline/EnhanceGraph.cpp','src/ui/QmlPlayerBridge.cpp','tests/integration/HdrColorTests.cpp','src/engine/VideoPresenter.cpp','src/gfx/PresentSink.cpp')+ dep_changed=any(any(d.endswith('/'+h) for d in dependencies.get(obj,())) for h in changed_headers)+ if source_changed or directly or dep_changed or not (CACHE/obj).is_file():rebuild.append((obj,ROOT/relative,compiler(obj)))+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)+with ThreadPoolExecutor(max_workers=4) 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))+for obj in objects:+ if obj not in overrides:protect(obj)+# Unchanged objects added by PR31, not present in the older cached CMake graph.+playlist=[protect(BASE/'build/pr31-playlist-20261009'/n) for n in ('PlaylistModel.obj','playlist-moc.obj')]+for relative in ('include/veyra/ui/QmlPlayerBridge.h','include/veyra/ui/PlaylistModel.h','src/ui/PlaylistModel.cpp'):+ original=next(p for p in previous['sources'] if p.replace('\\','/').endswith('/'+relative));assert sha(original)==previous['sources'][original]+ assert Path(original).read_bytes().replace(b'\r\n',b'\n')==(ROOT/relative).read_bytes().replace(b'\r\n',b'\n');sources[str(ROOT/relative)]=sha(ROOT/relative)+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']+if uiOnly:+ for name in ('veyra_capture_tests','veyra_capture_color_tests','veyra_capture_format_selection_tests',+ 'veyra_hdr_color_tests','veyra_capture_audio_tests','decklink-tests','decklink-stub-tests'):+ protect(OUT/(name+'.exe'))+for file in SDK.rglob('*'):+ if file.is_file():protect(file)++shaderOut=OUT/'shaders';shaderOut.mkdir(exist_ok=True)+for source in (CACHE/'shaders').rglob('*'):+ if not source.is_file() or source.name=='PackedCaptureToLinear.dxil':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)+dxc=protect(Path(r'C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/dxc.exe'))+run([str(dxc),'-T','cs_6_0','-E','main','-O3','-Qstrip_debug','-Qstrip_reflect','-Fo',str(shaderOut/'PackedCaptureToLinear.dxil'),str(ROOT/'shaders/PackedCaptureToLinear.hlsl')],'shader-packed')+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));sources[str(ROOT/'i18n/catalog.json')]=sha(ROOT/'i18n/catalog.json')++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','')))]+ 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'))+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!='veyra_capture_audio_tests' or obj.endswith('/src/sink/CaptureAudioSession.cpp.obj'))]+ if name=='veyra_qml_ui':selected+=playlist+ # Static-library closure flattened by CMake into the immutable GUI graph.+ 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)+if not uiOnly:+ test=compile(ROOT/'tests/unit/DeckLinkCaptureTests.cpp','DeckLinkCaptureTests',sourceCompiler)+ var=targets['veyra_capture_tests'][1]+ baseObj=protect(CACHE/'CMakeFiles/veyra_base.dir/src/base/Log.cpp.obj')+ linkTarget('decklink-tests',[test,nativeCore,nativeDriver,baseObj],var)+ linkTarget('decklink-stub-tests',[test,nativeCore,stubDriver,baseObj],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)+receipt={'commands':commands,'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')+(BASE/'reports'/TASK/'build-current.json').write_text(json.dumps({'receipt':str(LOG/'receipt.json')},indent=2),encoding='utf8')+print('Built current product and native/legacy tests; immutable inputs unchanged;',LOG,flush=True)diff --git a/scripts/acceptance/settings-sr-ui-control.py b/scripts/acceptance/settings-sr-ui-control.pynew file mode 100644index 00000000..1ad94037--- /dev/null+++ b/scripts/acceptance/settings-sr-ui-control.py@@ -0,0 +1,44 @@+"""Audit immutable pre-task worktrees and this task's narrow source scope."""+from pathlib import Path+import hashlib+import json+import re+import subprocess+import sys++ROOT = Path(__file__).resolve().parents[2]+BASE = Path('E:/项目/Veyra')+TASK = 'settings-sr-ui-20261010'+start = json.loads((BASE/'archives'/TASK/'start.json').read_text(encoding='utf8'))++def git(*args, cwd=ROOT):+ return subprocess.check_output(['git', *args], cwd=cwd)++def sha(path):+ with path.open('rb') as stream:+ return hashlib.file_digest(stream, 'sha256').hexdigest()++for name, row in start['worktrees'].items():+ path = Path(name)+ assert git('rev-parse', 'HEAD', cwd=path).decode().strip() == row['head'], name+ assert hashlib.sha256(git('status', '--porcelain=v1', '-z', cwd=path)).hexdigest() == row['statusSha256'], name+ for relative, digest in row['dirtyFiles'].items():+ file = path/relative+ assert (sha(file) if file.is_file() else None) == digest, str(file)+assert git('rev-parse', 'main').decode().strip() == start['main']+assert git('branch', '--show-current').decode().strip() == 'codex/'+TASK+allowed = {'docs/SETTINGS_SR_UI_REPORT_2026-10-10.md', 'qml/Veyra/VSegment.qml', 'src/gfx/FsrSrBackend.cpp', 'include/veyra/ui/QmlPlayerBridge.h', 'qml/Veyra/VButton.qml', 'include/veyra/gfx/PresentSink.h', 'qml/Veyra/VMenu.qml', 'scripts/acceptance/settings-sr-ui-control.py', 'tests/integration/LivePresentationTests.cpp', 'CMakeLists.txt', 'src/gfx/PresentSink.cpp', 'src/engine/EngineController.cpp', 'tests/integration/SrQualityTests.cpp', 'docs/SETTINGS_SR_UI_PLAN_2026-10-10.md', 'src/engine/EnhancementSettings.cpp', 'qml/Veyra/DialogHost.qml', 'tests/qml/quick/tst_slider_value.qml', 'qml/Veyra/Main.qml', 'qml/Veyra/NodePage.qml', 'include/veyra/engine/GraphDescription.h', 'tests/perf/PresentSinkLifecycleTests.cpp', 'tests/unit/GraphDescriptionTests.cpp', 'i18n/catalog.json', 'src/pipeline/EnhanceGraph.cpp', 'tests/qml/quick/tst_components.qml', 'include/veyra/gfx/FsrSrBackend.h', 'qml/Veyra/VRow.qml', 'qml/Veyra/ColorPage.qml', 'tests/integration/SettingsTransactionTests.cpp', 'include/veyra/engine/VideoPresenter.h', 'qml/Veyra/SettingsPage.qml', 'include/veyra/engine/EnhancementSettings.h', 'AGENTS.md', 'src/engine/VideoPresenter.cpp', 'tests/qml/quick/tst_menu_layout.qml', 'scripts/acceptance/settings-sr-ui-build.py', 'qml/Veyra/ChainControls.qml', 'docs/WORKLOG.md', 'qml/Veyra/EnhancePage.qml', 'qml/Veyra/VSliderValue.qml', 'include/veyra/pipeline/EnhanceGraph.h', 'src/ui/QmlPlayerBridge.cpp', 'scripts/acceptance/settings-sr-ui-gui-test.py', 'qml/Veyra/VSelect.qml', 'scripts/acceptance/settings-sr-ui.qml', 'scripts/acceptance/settings-sr-ui-test.py'}+dirty = {p.decode('utf8') for p in git('ls-files', '-m', '-d', '--others', '--exclude-standard', '-z').split(b'\0') if p}+allowed.add('qml/Veyra/ProPage.qml')+allowed.add('src/engine/VideoExportJob.cpp')+changed = {p.decode('utf8') for p in git('diff', '--name-only', start['base']).splitlines() if p}+assert (changed | dirty) <= allowed, (changed | dirty) - allowed+git('diff', '--check')+git('diff', '--cached', '--check')+label = sys.argv[1] if len(sys.argv) > 1 else 'audit'+assert re.fullmatch('[a-z0-9-]+', label)+report = {'baselineWorktreesUnchanged': len(start['worktrees']),+ 'dirtyFilesUnchanged': sum(len(v['dirtyFiles']) for v in start['worktrees'].values()),+ 'scopePass': True, 'changed': sorted(changed | dirty), 'mainHead': start['main'], 'base': start['base']}+(BASE/'reports'/TASK/(label+'.json')).write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding='utf8')+print(json.dumps(report, ensure_ascii=False), flush=True)diff --git a/scripts/acceptance/settings-sr-ui-gui-test.py b/scripts/acceptance/settings-sr-ui-gui-test.pynew file mode 100644index 00000000..3c4c84fb--- /dev/null+++ b/scripts/acceptance/settings-sr-ui-gui-test.py@@ -0,0 +1,58 @@+"""Actual production capture/node/inspector layouts, private profiles and runtime."""+from pathlib import Path+import hashlib,json,os,re,shutil,subprocess,sys,time+import psutil+ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='settings-sr-ui-20261010'+DONOR=BASE/'test-packages/vfg-next-20261007/Veyra-2.0.6-VFG-next-NVIDIA-win64-portable'+BUILD=BASE/'build'/TASK;APP=BASE/'tests'/TASK/'app'+FFMPEG=BASE/'deps/ffmpeg-subtitle-formats-20261009/installed/bin'+LOG=BASE/'logs'/TASK/('gui-'+time.strftime('%Y%m%d-%H%M%S'));LOG.mkdir(parents=True)+manifest=json.loads((DONOR/'package-manifest.json').read_text(encoding='utf8'))+def sha(p):return hashlib.file_digest(p.open('rb'),'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)+def write(target,content):+ swap=target.with_name(target.name+'.swap');swap.write_bytes(content);os.replace(swap,target)+verify()+for proc in psutil.process_iter(['name']):assert not (proc.info['name'] or '').lower().startswith(('veyra','fg-presentation','flash-pixel')),proc.info+assert APP.is_dir(),'Run settings-sr-ui-test.py first to stage the private app'+replace(BUILD/'veyra_qml_ui.exe',APP/'veyra_qml_ui.exe')+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'):replace(source,APP/source.name)+main=APP/'qml/Veyra/Main.qml';saved=main.read_bytes();results=[]+try:+ cases=[('zh-CN',1280,900,'1'),('en',1280,900,'1'),('zh-TW',900,800,'1'),('ja',900,800,'1'),('en',900,800,'1.5')]+ if sys.argv[1:]==['one']:cases=cases[:1]+ for language,width,height,scale in cases:+ name=f'{language}-{width}-{scale}';evidence=LOG/name;evidence.mkdir()+ tmp=BASE/'tmp'/TASK/LOG.name/name;tmp.mkdir(parents=True)+ profile=BASE/'tests'/TASK/'profiles'/LOG.name/name;profile.mkdir(parents=True)+ preferences=profile/'qml-preferences.v1.json'+ preferences.write_text(json.dumps({'language':language,'autoResume':False,'rememberPosition':False,+ 'prewarmEnhancement':False,'gpuPriority':'normal','subtitleEnabled':False,+ 'screenshotDir':str(evidence/'screenshots'),'sentinel':'preserved'}),encoding='utf8')+ env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_'))}+ env.update(PATH=str(APP)+os.pathsep+env['PATH'],TEMP=str(tmp),TMP=str(tmp),CUDA_CACHE_PATH=str(tmp/'cuda'),+ QML_DISK_CACHE_PATH=str(tmp/'qml-cache'),QT_FORCE_STDERR_LOGGING='1',QT_SCALE_FACTOR=scale,VEYRA_LOG_FILE=str(evidence/'engine.log'))+ loader='\nLoader { source: '+json.dumps((ROOT/'scripts/acceptance/settings-sr-ui.qml').as_uri())+'; onLoaded: { item.appRoot=root; item.dialogHost=dialogs; item.nodePage=nodePage; item.proPage=proPage; item.evidence='+json.dumps(evidence.as_posix(),ensure_ascii=False)+' } }\n'+ text=saved.decode('utf8');at=text.rfind('}');assert at>0;write(main,(text[:at]+loader+text[at:]).encode('utf8'))+ command=[str(APP/'veyra_qml_ui.exe'),'--data-dir',str(profile),'--page','home','--size',f'{width}x{height}','--exit-after','41000']+ began=time.monotonic()+ with (evidence/'console.log').open('wb') as stream:run=subprocess.run(command,cwd=APP,env=env,stdout=stream,stderr=subprocess.STDOUT,timeout=50)+ console=(evidence/'console.log').read_text(encoding='utf8',errors='replace')+ errors=[line for line in console.splitlines() if re.search(r'LAYOUT_UI_FAIL|ReferenceError:|TypeError:|\[ERROR\s*\]|\[FATAL\s*\]|D3D12 ERROR|D3D12 CORRUPTION|Cannot assign|Binding loop',line)]+ assert json.loads(preferences.read_text(encoding='utf8')).get('sentinel')=='preserved'+ passed=run.returncode==0 and not errors and 'LAYOUT_UI_PASS' in console+ row={'case':name,'command':command,'exit':run.returncode,'seconds':time.monotonic()-began,'passed':passed,'errors':errors,+ 'events':[l for l in console.splitlines() if 'LAYOUT_UI_' in l],'profile':str(profile)}+ results.append(row);print(json.dumps({k:v for k,v in row.items() if k != "events"},ensure_ascii=False),flush=True)+ if not passed:break+finally:write(main,saved)+verify();receipt={'results':results,'passed':len(results)==len(cases) and all(r['passed'] for r in results),'exeSha256':sha(APP/'veyra_qml_ui.exe'),'donorUnchanged':len(manifest['files'])}+(LOG/'receipt.json').write_text(json.dumps(receipt,ensure_ascii=False,indent=2),encoding='utf8')+(BASE/'reports'/TASK/'gui-current.json').write_text(json.dumps({'receipt':str(LOG/'receipt.json')},indent=2),encoding='utf8')+raise SystemExit(not receipt['passed'])diff --git a/scripts/acceptance/settings-sr-ui-test.py b/scripts/acceptance/settings-sr-ui-test.pynew file mode 100644index 00000000..2b402b91--- /dev/null+++ b/scripts/acceptance/settings-sr-ui-test.py@@ -0,0 +1,71 @@+"""Bounded actual GPU/QML regressions; shared private runtime, immutable donor."""+from pathlib import Path+import hashlib,json,os,re,shutil,subprocess,sys,time+import psutil+ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='settings-sr-ui-20261010'+DONOR=BASE/'test-packages/vfg-next-20261007/Veyra-2.0.6-VFG-next-NVIDIA-win64-portable'+BUILD=BASE/'build'/TASK;APP=BASE/'tests'/TASK/'app'+QT=Path('C:/veyra-deps/qt-veyra/6.8.3/msvc2022_64')+FFMPEG=BASE/'deps/ffmpeg-subtitle-formats-20261009/installed/bin'+cases=sys.argv[1:];assert cases+manifest=json.loads((DONOR/'package-manifest.json').read_text(encoding='utf8'))+def sha(p):return hashlib.file_digest(p.open('rb'),'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()+for proc in psutil.process_iter(['name']):assert not (proc.info['name'] or '').lower().startswith(('veyra','fg-presentation','flash-pixel')),proc.info+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'):replace(source,APP/source.name)+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)+ assert sha(source)==sha(target)+for source in (ROOT/'tests/qml/quick').glob('*.qml'):replace(source,APP/'qml-tests'/source.name)+log=BASE/'logs'/TASK/('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/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 in ('sr-baseline','sr','sr-gta'):+ command=[str(APP/'veyra_sr_quality_tests.exe'),str(output)]+(['baseline'] if case=='sr-baseline' else ['natural','E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4'] if case=='sr-gta' else [])+ elif case=='video':command=[str(APP/'veyra_live_presentation_tests.exe'),'E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4',str(output),'--settings-rebuild']+ elif case=='rollback':command=[str(APP/'veyra_live_presentation_tests.exe'),'E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4',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=='color':command=[str(APP/'veyra_capture_color_tests.exe')]+ elif case=='formats':command=[str(APP/'veyra_capture_format_selection_tests.exe')]+ 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,'command':command,'exit':code,'seconds':time.monotonic()-start,'passed':passed,'errors':errors,'events':[l for l in text.splitlines() if re.search('PASS|SR_CASE|SR_POLICY|SR_NATIVE|SR_PRECOLOR|SR_QUALITY|RESULT|SETTINGS_REUSE|SETTINGS_HDR|Totals:',l)]}+ results.append(row);print(json.dumps(row,ensure_ascii=False),flush=True)+ if not passed:break+verify();receipt={'results':results,'passed':len(results)==len(cases) and 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-current.json').write_text(json.dumps({'receipt':str(log/'receipt.json')},indent=2),encoding='utf8')+raise SystemExit(not receipt['passed'])diff --git a/scripts/acceptance/settings-sr-ui.qml b/scripts/acceptance/settings-sr-ui.qmlnew file mode 100644index 00000000..e4565b60--- /dev/null+++ b/scripts/acceptance/settings-sr-ui.qml@@ -0,0 +1,98 @@+import QtQuick+Item {+ id: test+ property var appRoot+ property var dialogHost+ property var nodePage+ property var proPage+ property string evidence+ property int step: 0+ property int ticks: 0+ property var menu+ property bool saved: false+ property int settleTick: 0+ Item { id: popupAnchor; parent: test.appRoot ? test.appRoot.contentItem : null; x: parent ? parent.width - 12 : 0; y: parent ? parent.height - 12 : 0; width: 1; height: 1 }+ function require(ok, why) {+ if (!ok) throw new Error(why)+ console.log("LAYOUT_UI_CHECK", why)+ }+ function walk(item, output, seen) {+ if (!item || seen.indexOf(item) >= 0) return output+ seen.push(item); output.push(item)+ for (const child of item.children || []) walk(child, output, seen)+ for (const child of item.data || []) walk(child, output, seen)+ return output+ }+ function find(root, name) { return walk(root, [], []).find(x => x.objectName === name) }+ function checkMenu() {+ require(menu && menu.opened, "production menu opened")+ require(menu.width <= appRoot.width - 16 && menu.x >= 7 && menu.x + menu.width <= appRoot.width - 7, "menu stays inside window width")+ require(menu.height <= appRoot.height - 16 && menu.y >= 7 && menu.y + menu.height <= appRoot.height - 7, "menu stays inside window height")+ const labels = walk(menu.contentItem, [], []).filter(x => x.objectName === "vmenu-option-label")+ require(labels.length > 0, "production choices contain text")+ require(labels.every(x => !x.truncated && x.contentWidth <= x.width + 1 && x.contentHeight <= x.height + 1), "complete choice labels fit and wrap")+ console.log("LAYOUT_UI_GEOMETRY", JSON.stringify({width:menu.width,height:menu.height,x:menu.x,y:menu.y,labels:labels.map(x => x.text)}))+ }+ function grab(name) {+ saved = false+ appRoot.contentItem.grabToImage(result => { saved = result.saveToFile(evidence + "/" + name + ".png") })+ }+ Timer {+ interval: 250; running: true; repeat: true+ onTriggered: { try {+ ++test.ticks+ if (test.ticks > 150) throw new Error("deadline step=" + test.step)+ if (test.step === 0) {+ if (test.ticks < 6 || !test.dialogHost) return+ test.require(!veyra.running, "layout check uses a private idle profile")+ test.dialogHost.open("capture"); test.step = 1; return+ }+ if (test.step === 1) {+ if (veyra.captureQueryBusy) return+ const device = veyra.captureDevices.find(x => x.label === "KUHAIMI 27P")+ if (device && veyra.captureDeviceId !== device.id) { veyra.captureDeviceId = device.id; return }+ const select = test.find(test.appRoot.contentItem, "capture-format")+ test.require(select && select.options.length > 0, "real capture format list available")+ test.menu = test.walk(select, [], []).find(x => typeof x.openAt === "function")+ test.menu.openAt(select, "down"); test.step = 2; return+ }+ if (test.step === 2) { if (!test.menu.opened) return; test.checkMenu(); test.grab("capture-format"); test.step = 3; return }+ if (test.step === 3) {+ if (!test.saved) return+ test.menu.close(); test.dialogHost.close(); test.appRoot.page = "node"; test.step = 4; return+ }+ if (test.step === 4) {+ if (veyra.nodeMode !== 1) return+ if (!veyra.chain.length) { test.require(veyra.addEffect("nr") >= 0, "add a node through the real editor API"); return }+ test.menu = test.find(test.nodePage, "node-context-menu")+ const node = veyra.chain.find(x => x.type === "nr") || veyra.chain[0]+ test.require(test.menu && node, "real node context menu and node available")+ test.menu.targetId = node.id+ test.menu.openAt(popupAnchor, "at"); test.step = 5; return+ }+ if (test.step === 5) {+ if (!test.menu.opened) return+ test.checkMenu()+ const transport = test.find(test.nodePage, "node-transport-layout")+ test.require(transport && transport.childrenRect.width <= transport.width + 1, "node transport controls stay within the bar")+ const tip = test.find(test.nodePage, "node-canvas-tip")+ test.require(tip && !tip.truncated && tip.contentWidth <= tip.width + 1, "complete node instructions wrap within the canvas")+ test.grab("node-context"); test.step = 6; return+ }+ if (test.step === 6) {+ if (!test.saved) return+ test.menu.close(); veyra.nodeMode = 0; test.appRoot.page = "pro"; test.settleTick = test.ticks; test.step = 7; return+ }+ if (test.step === 7) {+ if (test.ticks < test.settleTick + 6 || test.appRoot.shownPage !== "pro" || test.appRoot.leavingPage !== "") return+ test.require(test.proPage.current && test.proPage.visible && test.proPage.opacity === 1, "production inspector transition has completed")+ const rows = test.walk(test.proPage, [], []).filter(x => x.stacked !== undefined && x.implicitHeight !== undefined && x.width > 0)+ test.require(rows.length > 10, "production inspector rows present")+ console.log("LAYOUT_UI_ROWS", JSON.stringify(rows.filter(x => x.childrenRect.width > x.width + 1).map(x => ({label:x.label,width:x.width,children:x.childrenRect.width}))))+ test.require(rows.every(x => x.childrenRect.width <= x.width + 1), "inspector rows stay within their panels")+ test.grab("inspector"); test.step = 8; return+ }+ if (test.step === 8 && test.saved) { console.log("LAYOUT_UI_PASS"); Qt.quit() }+ } catch(e) { console.log("LAYOUT_UI_FAIL", String(e)); Qt.quit() } }+ }+}diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cppindex c98d6e8a..93687e3c 100644--- a/src/engine/EngineController.cpp+++ b/src/engine/EngineController.cpp@@ -698,7 +698,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sif(failure==FailedBackend::Fg&&(ngx::AmpereMfgUnlock::applied()||(ngx::DlssgTransfusion::applied()&&ngx::DlssgTransfusion::snapshot().target==ngx::DlssgTransfusion::Target::Ampere)))backendRecoveryWarning+=L";RTX 30 系补帧解锁已应用,但当前驱动/运行库组合下运行时不开放补帧,可改用 AMD FSR 补帧";if(!ring.drainQueue()||!ring.discardRecording())return false;- presenter.close();graph->shutdown();selected=PlayerOptions::from(reduced,selected.nodeOrder);+ if(!presenter.prepareGraphChange())return false;+ graph->shutdown();selected=PlayerOptions::from(reduced,selected.nodeOrder);describeStages(stageRequest(selected),selected.snapshot(),desc);}return false;@@ -948,6 +949,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s};std::optional<diagnostics::FrameFlowMetrics::ResetRecord> resetRecord;std::optional<diagnostics::FrameFlowMetrics::ResetRecord> lastResetRecord;+ bool rollbackWarmupPending=false;Clock::time_point resetStart{},resetStageStart{};auto markResetStage=[&](diagnostics::ResetStage stage){if(!resetRecord)return;@@ -960,6 +962,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sif(!resetRecord)return;resetRecord->outcome=outcome;resetRecord->totalMs=elapsedMs(resetStart);lastResetRecord=resetRecord;+ if(outcome==diagnostics::ResetOutcome::RolledBack)rollbackWarmupPending=true;if(frameFlow)frameFlow->resetLifecycle(*resetRecord);const auto& r=*resetRecord;const auto ms=[&](diagnostics::ResetStage s){return r.stageMs[size_t(s)].value_or(-1.0);};traceFrame(diagnostics::TraceKind::Reset,{r.epoch,r.settingsRevision,r.sourceFrameId},0,0,0,r.reason,unsigned(outcome),*r.totalMs);@@ -1314,7 +1317,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s(previous.frameGenerationBackend!=requested.frameGenerationBackend||previous.multiplier!=requested.multiplier||previous.vfgQuality!=requested.vfgQuality);const bool preserveWorkingNr=previous.nr&&requested.nr&&previous.nrRuntime!=requested.nrRuntime;if(accepted&&rebuild){- presenter.close();bool reused=false;+ if(!presenter.prepareGraphChange()){finishReset(diagnostics::ResetOutcome::Failed);status(L"设置切换呈现排空失败,已停止",true);break;}+ bool reused=false;const bool mayRetain=recentCacheAllowed&&!isCapture&&!isImage&&RecentGraphCache::eligible(gd)&&RecentGraphCache::effectsOff(nextDesc);if(mayRetain&&recentGraphCache.retain(graph,RecentGraphCache::key(previous,previousOrder,gd),graphBytes)){@@ -1337,7 +1341,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,smarkResetStage(diagnostics::ResetStage::Create);if(stop_){veyra::log::info("engine","settings rebuild cancelled; skipping rollback on exit");break;}if(!accepted){- presenter.close();graph->shutdown();recentGraphCache.evict("build-rollback");+ if(!presenter.prepareGraphChange()){status(L"设置恢复呈现排空失败,已停止",true);break;}+ graph->shutdown();recentGraphCache.evict("build-rollback");graph=std::make_unique<pipeline::EnhanceGraph>(ctx,ring,&coreCache);graphBytes=0;if(!gpu->configureQueue(gd,!isCapture&&!isImage)||!graph->initialize(gd)||!openPreparedPresenter(options)){if(!stop_)status(L"设置失败且旧资源恢复失败,已停止",true);break;}}@@ -1600,7 +1605,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sgd.yuy2Input=false;gd.packedInput=pipeline::packedInputCode(captureGraphColor.pixelFormat);gd.captureBitDepth=ingressBitDepth(captureGraphColor.pixelFormat);std::lock_guard lock(mutex_);snapshot_.sourceWidth=width;snapshot_.sourceHeight=height;snapshot_.sourceHdr=gd.hdrInput;snapshot_.sourceDisplayAspect=activeSource->info().displayAspect;}- presenter.close();graph->shutdown();recentGraphCache.evict("source-resize");+ if(!presenter.prepareGraphChange()){status(L"输入尺寸切换呈现排空失败",true);break;}+ graph->shutdown();recentGraphCache.evict("source-resize");graph=std::make_unique<pipeline::EnhanceGraph>(ctx,ring,&coreCache);graphBytes=0;out={};hasOutput=false;if(!graph->initialize(gd)||!openPreparedPresenter(options)){if(!stop_)status(L"串流尺寸切换失败",true);break;}reset=true;pendingResetCause=pipeline::ResetReason::Resize;@@ -1926,7 +1932,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sconst auto attempted=options.snapshot();drainLivePresentation();if(!ring.drainQueue()||!ring.discardRecording()){status(L"增强故障恢复排空失败",true);break;}- out={};hasOutput=false;presenter.close();graph->shutdown();+ if(!presenter.prepareGraphChange()){status(L"增强故障恢复排空失败",true);break;}+ out={};hasOutput=false;graph->shutdown();{std::lock_guard lock(mutex_);reduced.revision=++nextRevision_;}options=PlayerOptions::from(reduced,options.nodeOrder);describeStages(stageRequest(options),options.snapshot(),gd);@@ -1941,7 +1948,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s}}if(transaction){- ring.drainQueue();out={};presenter.close();graph->shutdown();recentGraphCache.evict("process-rollback");+ if(!ring.drainQueue()||!presenter.prepareGraphChange()){status(L"设置恢复呈现排空失败,已停止",true);break;}+ out={};graph->shutdown();recentGraphCache.evict("process-rollback");graph=std::make_unique<pipeline::EnhanceGraph>(ctx,ring,&coreCache);graphBytes=0;options=PlayerOptions::from(previous,previousOrder);gd=previousDesc;if(graph->initialize(gd)&&openPreparedPresenter(options)&&graph->process(frame,pts,true,out,pkt.sequence,&pkt.colorInfo,&pkt.hardwareSurface,comparisonMode_!=0)){@@ -1958,7 +1966,13 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sreset=false;hasOutput=true;const auto processDone=Clock::now();if(physicalCapture&&veyra::log::verboseFrameLogs())veyra::log::info("capture-graph-sample",std::format("source={} epoch={} revision={} arrival={} start={} submitted={} slotWaitMs={:.6f}",pkt.sequence,out.batch.identity.epoch,out.batch.identity.settingsRevision,captureArrival,std::chrono::duration_cast<std::chrono::nanoseconds>(processStart.time_since_epoch()).count()/100,std::chrono::duration_cast<std::chrono::nanoseconds>(processDone.time_since_epoch()).count()/100,processSlotWaitMs));- if(!resetRecord&&out.historyReset&&!previewOnlyReset){+ // The restored graph's first frame has empty temporal history.+ // It is the failed transaction's rollback warmup, not another+ // successful user reset that may overwrite the failure record.+ const bool restoredWarmup=rollbackWarmupPending&&+ (pendingResetCause==pipeline::ResetReason::None||pendingResetCause==pipeline::ResetReason::Settings);+ rollbackWarmupPending=false;+ if(!resetRecord&&out.historyReset&&!previewOnlyReset&&!restoredWarmup){resetStart=processStart;resetStageStart=processStart;resetRecord=diagnostics::FrameFlowMetrics::ResetRecord{};resetRecord->sessionId=runSessionId;resetRecord->settingsRevision=out.batch.identity.settingsRevision;resetRecord->epoch=out.batch.identity.epoch;resetRecord->sourceFrameId=out.batch.identity.sourceFrameId;resetRecord->reason=static_cast<uint8_t>(diagnostics::resetCause(pkt.flags,pendingResetCause,out.detectedReset));resetRecord->stageMs[size_t(diagnostics::ResetStage::Drain)]=0.0;resetRecord->stageMs[size_t(diagnostics::ResetStage::Destroy)]=0.0;resetRecord->stageMs[size_t(diagnostics::ResetStage::Create)]=0.0;diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cppindex 3944a0c8..0dccc307 100644--- a/src/engine/VideoExportJob.cpp+++ b/src/engine/VideoExportJob.cpp@@ -109,7 +109,9 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOpticonst auto plan=describeStages(stages,options.snapshot(),gd);if(!nvidiaFeatures&&gd.opticalFlowBackend==OpticalFlowBackend::Nvidia)gd.opticalFlowBackend=OpticalFlowBackend::AmdFidelityFx;const auto resolution=plan;- const bool srAvailable=plan.srApplied&&(nvidiaFeatures||options.settings.videoSrQuality==kVideoSrFsr);+ // Availability comes from the shared stage contract: native-size RTX+ // Video SR restores video even though ResolutionPlan has no enlargement.+ const bool srAvailable=gd.enableSr;if(options.nr&&amdNrExport){fgNote=L"AMD NR 使用内部最高 1080p 处理,保留原尺寸合成与导出";veyra::log::info("export-nr",std::format("runtime=lmxxf source={}x{} output={}x{} internal={}x{} layers={}",info.width,info.height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.nrLayersExtent.size()));diff --git a/src/engine/VideoPresenter.cpp b/src/engine/VideoPresenter.cppindex a4da46bd..25bf511b 100644--- a/src/engine/VideoPresenter.cpp+++ b/src/engine/VideoPresenter.cpp@@ -21,7 +21,11 @@ void VideoPresenter::sourceProcessed(pipeline::FrameIdentity identity){xessWorkPosition_=(xessWorkPosition_+1)%xessWork_.size();xessInputId_=0;}bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::EnhanceGraph& graph,bool captureCompatible,bool mediaClockPaced) {- close();+ const bool reuse=sink_.swapChain()&&!sink_.xess()&&!graph.xessEnabled()&&window_==window&&+ presentationDevice_==ctx.device()&&presentationFormat_==graph.outputFormat()&&+ captureCompatible_==captureCompatible&&presentationQueue_;+ if(reuse){if(!prepareGraphChange())return false;}+ else close();RECT rc{};if(!IsWindow(window)||!GetClientRect(window,&rc)){veyra::log::warn("present","presentation creation cancelled: target window is no longer available");@@ -30,7 +34,9 @@ bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::EnhviewWidth_=viewHeight_=0;bufferMonitor_=nullptr;monitorWidth_=monitorHeight_=0;++generation_;Status st=Status::Ok;- if((graph.fgEnabled()||graph.usesComputeQueue())&&!graph.xessEnabled()){+ // Keep one presentation queue for the native chain's lifetime. A later+ // FG/compute switch can reuse it instead of replacing the HWND's chain.+ if(!reuse&&!graph.xessEnabled()){D3D12_COMMAND_QUEUE_DESC desc{};desc.Type=D3D12_COMMAND_LIST_TYPE_DIRECT;wchar_t requestedPriority[16]{};if(GetEnvironmentVariableW(L"VEYRA_TEST_PRESENT_QUEUE_PRIORITY",requestedPriority,16)&&std::wstring_view(requestedPriority)==L"high"){@@ -47,10 +53,11 @@ bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::Enhif(FAILED(hr)){veyra::log::error("present",std::format("application frame-generation presentation queue/fence hr=0x{:X}",unsigned(hr)));close();return false;}presentationEvent_=CreateEventW(nullptr,FALSE,FALSE,nullptr);if(!presentationEvent_||!presentationRing_.initialize(ctx.device(),presentationQueue_.Get(),presentationFence_.Get(),presentationEvent_,3,st)){close();return false;}- veyra::log::info("present","application frame-generation presentation uses independent queue/fence, 3 command slots; shared textures use producer/consumer GPU fences");+ veyra::log::info("present","native presentation uses persistent independent queue/fence, 3 command slots; shared textures use producer/consumer GPU fences");}auto* queue=presentationQueue_?presentationQueue_.Get():ctx.directQueue();gpuTimer_.initialize(ctx.device(),queue);window_=window;+ presentationDevice_=ctx.device();presentationFormat_=graph.outputFormat();captureCompatible_=captureCompatible;gfx::PresentSink::Desc d;d.targetWindow=window;d.width=std::max(1L,rc.right);d.height=std::max(1L,rc.bottom);d.vsync=false;d.tearing=false;d.waitable=!GetEnvironmentVariableW(L"VEYRA_TEST_LEGACY_SWAPCHAIN",nullptr,0);d.hdr=graph.hdrOutput();d.hdr10=graph.hdr10Output();d.xess=graph.xessEnabled();d.captureCompatible=captureCompatible;d.fgMultiplier=graph.fgMultiplier();@@ -71,7 +78,9 @@ bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::Enh}veyra::log::info("present",std::format("XeSS retained buffers {}x{} client={}x{}; window scaling avoids provider rebuild",d.width,d.height,rc.right,rc.bottom));}- if(!sink_.initialize(ctx.device(),queue,d,st))return false;+ if(!reuse&&!sink_.initialize(ctx.device(),queue,d,st))return false;+ if(reuse)veyra::log::info("present-reuse",std::format("retained native swapchain generation={} format={} fg={} output={}x{}; rebinding drained graph descriptors",generation_,unsigned(graph.outputFormat()),graph.fgEnabled(),graph.workWidth(),graph.workHeight()));+ pass_={};rtvs_.Reset();compositeTarget_.Reset();std::vector<uint8_t> vs,ps;// The output pool contains both parities of every generated subframe.// Comparison references follow it; derive offsets to cover VFG through 8X.@@ -104,6 +113,16 @@ bool VideoPresenter::open(gfx::D3D12DeviceContext& ctx,HWND window,pipeline::Enhfor(unsigned i=0;i<4;++i)pipeline::makeSrv(ctx.device(),i<2?graph.sourceReference(i):graph.baseReference(i-2),DXGI_FORMAT_R16G16B16A16_FLOAT,{pass_.heap->GetCPUDescriptorHandleForHeapStart().ptr+size_t(i+pipeline::kOutputPoolSlots)*pass_.increment});return true;}+bool VideoPresenter::prepareGraphChange(){+ if(sink_.xess()){close();return true;}+ if(presentationRing_.initialized()&&!presentationRing_.drainQueue())return false;+ hasPresented_=false;retainedFrame_.reset();gpuTimer_.close();+ // Retain metadataSent_: a new graph disabling metadata must clear the+ // hint that is still attached to the retained DXGI chain.+ metadataDirty_=true;metadataAttempt_={};sourceMetadata_={};+ reflex_.close();reflexFrame_=0;+ return true;+}bool VideoPresenter::refresh(ID3D12Device* device){// ResizeBuffers keeps the swapchain object and may retain its metadata.// Request a resend without forgetting an active hint that must be cleared@@ -400,6 +419,7 @@ void VideoPresenter::close(){presentMotionPass_={};presentMotion_={};previousXessWidth_=previousXessHeight_=0;presentationRing_.shutdown();presentationFence_.Reset();presentationQueue_.Reset();if(presentationEvent_){CloseHandle(presentationEvent_);presentationEvent_=nullptr;}+ presentationDevice_=nullptr;presentationFormat_=DXGI_FORMAT_UNKNOWN;window_=nullptr;}PresentationSettings VideoPresenter::configurePresentation(gfx::D3D12DeviceContext& ctx,PresentationSettings requested,bool fg,std::wstring& status){bool wanted=requested.hdrFgCompatibility&©Eligible_;diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex 4597de1d..93dee64b 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -444,7 +444,8 @@ bool EnhanceGraph::initialize(const EnhanceGraphDesc& desc)veyra::log::info("resolution",std::format("source={}x{} base={}x{} nr={}x{} flow={}x{} fg={}x{} output={}x{}",srcW_,srcH_,workW_,workH_,nrW_,nrH_,nvofW_,nvofH_,workW_,workH_,workW_,workH_));veyra::log::info("pipeline-order",desc.splitNrAcrossSr()?"NR(source) -> SR -> NR(work) -> FG (node preview)":desc.nrBeforeSr?"NR -> residual(source) -> SR -> FG (experimental preview)":"SR -> NR -> residual -> FG");if(!desc.videoHdr.valid()||(desc.hdrOutput&&!desc.hdrInput&&!desc.convertVideoHdr())){veyra::log::error("hdr","HDR output requires native HDR input or explicit Video HDR conversion");return false;}- srEnabled_ = desc.enableSr && (srcW_ != workW_ || srcH_ != workH_);+ const bool videoRestore=!desc.stillImage&&desc.videoSrQuality>=1&&desc.videoSrQuality<=4;+ srEnabled_ = desc.enableSr && (srcW_ != workW_ || srcH_ != workH_ || videoRestore);lmxxfNr_ = context_.adapter().vendorId == 0x1002 || desc.nrRuntime == engine::NrRuntime::LmxxfAmd;if(context_.adapter().vendorId==0x1002 && desc_.opticalFlowBackend==engine::OpticalFlowBackend::Nvidia)desc_.opticalFlowBackend=engine::OpticalFlowBackend::AmdFidelityFx;@@ -2390,23 +2391,25 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frameout.batch.b100ns=static_cast<int64_t>(std::llround(ptsMs*10000));gpuTimer_.identity(out.batch.identity);auto runSr=[&]()->bool{if(desc_.splitNrAcrossSr())tracker_.transition(list,srStageInput(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);- if(srEnabled_&&fsrSrEnabled()&&(haveFlow||!desc_.srUsesFlow())){+ if(srEnabled_&&fsrSrEnabled()){// AMD FSR upscaling: FidelityFX effect, render-extent color + guidance// motion (previous = current + motion, same convention as the frame- // generator) straight into the working texture. A frame without valid- // motion falls through to the plain blit below instead of guessing.+ // generator) straight into the working texture. With no valid motion,+ // reset temporal accumulation and reconstruct this frame using zero+ // guidance; never silently replace the effect with an ordinary resize.gpuTimer_.mark(list,GpuStage::Sr);const double deltaMs = (prevPtsMs_>=0.0&&ptsMs>prevPtsMs_)?(ptsMs-prevPtsMs_):16.6;// The shared boundary includes ordinary NR-first output as well as// split-node/color output. Reading srcRgba_ here discards completed NR.auto* srInput=srStageInput();tracker_.transition(list,srInput,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);- auto* srMotion=desc_.srUsesFlow()?flowTex_.Get():fsrSrZeroMotion_.Get();+ const bool validMotion=desc_.srUsesFlow()&&haveFlow;+ auto* srMotion=validMotion?flowTex_.Get():fsrSrZeroMotion_.Get();tracker_.transition(list,srMotion,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);tracker_.transition(list,fsrSrDepth_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);tracker_.transition(list,workRgba_.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);if(!fsrSrBackend_->evaluate(list,srInput,srMotion,fsrSrDepth_.Get(),workRgba_.Get(),- srcW_,srcH_,workW_,workH_,reset,float(deltaMs))){+ srcW_,srcH_,workW_,workH_,reset||(desc_.srUsesFlow()&&!haveFlow),float(deltaMs))){failedBackend_=engine::FailedBackend::Sr;return false;}diff --git a/tests/integration/LivePresentationTests.cpp b/tests/integration/LivePresentationTests.cppindex c11de343..1094bdbf 100644--- a/tests/integration/LivePresentationTests.cpp+++ b/tests/integration/LivePresentationTests.cpp@@ -98,11 +98,19 @@ int wmain(int argc,wchar_t**argv){}#endifSetEnvironmentVariableW(L"VEYRA_VERBOSE_FRAME_LOGS",L"1");- if(argc!=3&&!(argc==4&&(wcscmp(argv[3],L"--backend-recovery")==0||wcscmp(argv[3],L"--nr-first")==0||wcscmp(argv[3],L"--seek-stress")==0||wcscmp(argv[3],L"--half-rate")==0||wcscmp(argv[3],L"--overload")==0||wcscmp(argv[3],L"--file-overload")==0||wcscmp(argv[3],L"--source-gap")==0||wcscmp(argv[3],L"--file-endpoint")==0||wcscmp(argv[3],L"--file-continuity")==0||wcscmp(argv[3],L"--file-fg-recovery")==0||wcscmp(argv[3],L"--reset-rollback")==0)))return 2;SetProcessDPIAware();CoInitializeEx(nullptr,COINIT_MULTITHREADED);+ const bool settingsRebuild=argc==4&&wcscmp(argv[3],L"--settings-rebuild")==0;+ if(!settingsRebuild&&argc!=3&&!(argc==4&&(wcscmp(argv[3],L"--backend-recovery")==0||wcscmp(argv[3],L"--nr-first")==0||wcscmp(argv[3],L"--seek-stress")==0||wcscmp(argv[3],L"--half-rate")==0||wcscmp(argv[3],L"--overload")==0||wcscmp(argv[3],L"--file-overload")==0||wcscmp(argv[3],L"--source-gap")==0||wcscmp(argv[3],L"--file-endpoint")==0||wcscmp(argv[3],L"--file-continuity")==0||wcscmp(argv[3],L"--file-fg-recovery")==0||wcscmp(argv[3],L"--reset-rollback")==0)))return 2;SetProcessDPIAware();CoInitializeEx(nullptr,COINIT_MULTITHREADED);std::filesystem::create_directories(argv[2]);Logger::instance().openFile((std::filesystem::path(argv[2])/"engine.log").wstring());Logger::instance().setConsoleEnabled(false);HWND window=CreateWindowExW(0,L"STATIC",L"Live scheduler replay",WS_POPUP,0,0,960,540,nullptr,nullptr,GetModuleHandleW(nullptr),nullptr);if(!window)return 3;engine::EngineController engine;engine::PlayerOptions options;options.nr=false;options.fg=false;options.captureReplayForTest=true;const bool nrFirst=argc==4&&wcscmp(argv[3],L"--nr-first")==0;+ if(settingsRebuild){+ options.captureReplayForTest=false;options.nr=options.fg=true;options.fgMultiplier=2;+ options.settings.nrPolicy=pipeline::NrSizePolicy::Realtime;+ options.settings.nrRuntime=engine::NrRuntime::NvidiaOriginal;+ options.settings.frameGenerationBackend=engine::FrameGenerationBackend::Dlss;+ engine.setVolume(0,true);ShowWindow(window,SW_SHOWNOACTIVATE);+ }if(nrFirst){options.captureReplayForTest=false;options.nr=options.sr=options.fg=true;options.realtime=false;options.fgMultiplier=2;options.settings.lowLatency=true;options.settings.videoSrQuality=2;engine.setVolume(0,true);}const bool seekStress=argc==4&&wcscmp(argv[3],L"--seek-stress")==0;const bool backendRecovery=argc==4&&wcscmp(argv[3],L"--backend-recovery")==0;@@ -125,6 +133,25 @@ int wmain(int argc,wchar_t**argv){int failures=0;auto check=[&](bool pass,const char* s){std::cout<<(pass?"PASS ":"FAIL ")<<s<<std::endl;if(!pass)++failures;};auto until=[&](auto predicate,int seconds=8){auto deadline=std::chrono::steady_clock::now()+std::chrono::seconds(seconds);while(std::chrono::steady_clock::now()<deadline){MSG msg;while(PeekMessageW(&msg,nullptr,0,0,PM_REMOVE)){TranslateMessage(&msg);DispatchMessageW(&msg);}auto s=engine.snapshot();if(s.failed){std::wcerr<<s.status<<'\n';return false;}if(predicate(s))return true;std::this_thread::sleep_for(5ms);}return false;};engine.open(window,argv[1],options);+ if(settingsRebuild){+ check(until([](const auto& s){return s.frames>20&&s.nrActive&&s.fgActive;},30),"original NR 1080p and DLSS 2X start on the actual video");+ for(unsigned round=0;round<8&&!failures;++round){+ const auto before=engine.snapshot();auto changed=before.applied;+ changed.nr=round%2!=0;changed.multiplier=round==4?1:2;+ changed.sr=round==2||round==3;changed.videoSrQuality=4;+ check(engine.requestSettings(changed),"hot settings accepted");+ const auto revision=engine.snapshot().desired.revision;+ check(until([&](const auto& s){return !s.applying&&s.applied.revision==revision&&s.nrActive==changed.nr&&s.fgActive==(changed.multiplier>1)&&s.srActive==changed.sr&&s.metrics.flow.counters.realPresented>before.metrics.flow.counters.realPresented+12;},30),"new graph presents after NR/FG/SR transaction without restarting");+ const auto after=engine.snapshot();+ std::cout<<"SETTINGS_VIDEO round="<<round<<" revision="<<revision<<" nr="<<after.nrActive<<" sr="<<after.srActive<<" fg="<<after.fgActive<<" frames="<<after.frames<<" presents="<<after.metrics.flow.counters.realPresented<<" generated="<<after.metrics.flow.counters.generatedPresented<<" processingMs="<<after.metrics.flow.enhancementProcessing.mean.value_or(-1)<<std::endl;+ if(round==3){+ MONITORINFO monitor{sizeof(monitor)};GetMonitorInfoW(MonitorFromWindow(window,MONITOR_DEFAULTTONEAREST),&monitor);+ SetWindowPos(window,nullptr,monitor.rcMonitor.left,monitor.rcMonitor.top,monitor.rcMonitor.right-monitor.rcMonitor.left,monitor.rcMonitor.bottom-monitor.rcMonitor.top,SWP_NOZORDER|SWP_NOACTIVATE);+ }+ }+ engine.stop();check(until([&](const auto&){return engine.idle();},8),"settings session drains");+ DestroyWindow(window);CoUninitialize();return failures?1:0;+ }if(backendRecovery){check(until([](const auto& s){return s.frames>20&&!s.applied.nr&&!s.backendWarning.empty();},25),"injected NR init failure retains real basic playback");SetEnvironmentVariableW(L"VEYRA_TEST_NR_INIT_FAILURE",nullptr);@@ -298,7 +325,7 @@ int wmain(int argc,wchar_t**argv){check(colorSamples>=20&&colorSamples<=35,"one-second stage window receives completed source-frame timings");}auto state=engine.snapshot();auto settings=state.desired;settings.nr=true;settings.multiplier=2;engine.requestSettings(settings);- check(until([](const auto& s){return s.applied.nr&&s.applied.multiplier==2&&!s.applying&&s.nrEvaluated>2&&s.generated>0;}),"NR and 2x transaction while two batches are in flight");+ check(until([](const auto& s){return s.applied.nr&&s.applied.multiplier==2&&!s.applying&&s.nrEvaluated>2&&s.generated>0;},30),"NR and 2x transaction while two batches are in flight");check(until([](const auto& s){const auto& r=s.metrics.flow.reset;return r.settingsRevision==s.applied.revision&&r.outcome==diagnostics::ResetOutcome::Completed&&r.totalMs.has_value();}),"settings reset completes only after matching GPU-ready output");{const auto s=engine.snapshot();const auto& r=s.metrics.flow.reset;double stages=0;bool measured=true;diff --git a/tests/integration/SettingsTransactionTests.cpp b/tests/integration/SettingsTransactionTests.cppnew file mode 100644index 00000000..794104ea--- /dev/null+++ b/tests/integration/SettingsTransactionTests.cpp@@ -0,0 +1,93 @@+#include "veyra/engine/VideoPresenter.h"+#include "veyra/pipeline/EnhanceGraph.h"+#include "veyra/gfx/D3D12DeviceContext.h"+#include "veyra/gfx/CommandSlotRing.h"+#include "veyra/Log.h"+#include "veyra/sink/ImageExportSink.h"+#include "veyra/RuntimePaths.h"+#include <d3d12sdklayers.h>+#include <filesystem>+#include <iostream>+#include <vector>+extern "C" {+#include <libavutil/frame.h>+#include <libavutil/pixfmt.h>+}+#include "HdrCopyPresentationFixture.h"++// A real external COM reference reproduces the one-chain-per-HWND ownership+// hazard without injecting anything or changing a third-party overlay.+int wmain(int argc,wchar_t** argv){+ using namespace veyra;if(argc!=2)return 2;+ const std::filesystem::path dir=argv[1];std::filesystem::create_directories(dir);Logger::instance().openFile((dir/L"engine.log").wstring());+ gfx::D3D12DeviceContext ctx;gfx::CommandSlotRing ring;Status status;gfx::DeviceContextDesc device;device.enableDebugLayer=true;+ if(!ctx.initialize(device,status)||!ring.initialize(ctx.device(),ctx.directQueue(),ctx.fence(),ctx.fenceEvent(),4,status))return 2;+ gfx::ComPtr<ID3D12InfoQueue> messages;ctx.device()->QueryInterface(IID_PPV_ARGS(&messages));if(!messages)return 2;messages->ClearStoredMessages();+ HWND window=CreateWindowExW(WS_EX_NOACTIVATE,L"STATIC",L"Veyra retained swapchain",WS_POPUP,30,30,320,180,nullptr,nullptr,GetModuleHandleW(nullptr),nullptr);if(!window)return 2;+ engine::VideoPresenter presenter;gfx::ComPtr<IDXGISwapChain3> held;bool ok=true;+ AVFrame* frame=av_frame_alloc();frame->format=AV_PIX_FMT_RGBA;frame->width=320;frame->height=180;if(av_frame_get_buffer(frame,32)<0)return 2;+ for(unsigned round=0;round<8&&ok;++round){+ if(!presenter.prepareGraphChange()){ok=false;break;}+ pipeline::EnhanceGraph graph(ctx,ring);pipeline::EnhanceGraphDesc desc;+ desc.sourceWidth=320;desc.sourceHeight=180;desc.workWidth=round%2?640:320;desc.workHeight=round%2?360:180;+ desc.nrWidth=desc.workWidth;desc.nrHeight=desc.workHeight;desc.rgbInput=true;desc.enableNr=desc.enableFg=desc.enableSr=false;desc.noFeatures=desc.noNgx=true;+ ok=graph.initialize(desc)&&graph.createViews()&&presenter.open(ctx,window,graph);+ if(!held)held=presenter.swapChainForTest();+ const bool same=held&&held.Get()==presenter.swapChainForTest().Get();ok=ok&&same;+ for(int y=0;y<frame->height;++y)for(int x=0;x<frame->width;++x){auto* p=frame->data[0]+size_t(y)*frame->linesize[0]+x*4;p[0]=uint8_t(25+round*20);p[1]=70;p[2]=120;p[3]=255;}+ pipeline::EnhanceGraph::FrameOutputs out;+ ok=ok&&graph.process(frame,round*33.333333,true,out,round+1)&&presenter.present(ctx,ring,graph,out.videoSlot,false,true,0,false,.5f,out.batch.identity);+ sink::RgbaImage image;+ ok=ok&&presenter.readPresentedFrameForTest(ctx,ring,image);+ if(ok){const size_t at=(size_t(image.height/2)*image.width+image.width/2)*4;ok=std::abs(int(image.pixels[at])-int(25+round*20))<=2;}+ std::cout<<"SETTINGS_REUSE round="<<round<<" retainedExternalReference="<<same<<" generation="<<presenter.generation()<<" passed="<<ok<<std::endl;+ ok=presenter.prepareGraphChange()&&ring.drainQueue()&&ok;out={};graph.shutdown();+ }+ held.Reset();presenter.close();av_frame_free(&frame);+ // The field failure was NR on/off while HDR10 and DLSS 2X remained on.+ // Keep an external chain reference during that exact graph transition,+ // then compare the actually presented 10-bit pixels with the graph output.+ frame=av_frame_alloc();frame->format=AV_PIX_FMT_P010LE;frame->width=640;frame->height=360;+ frame->color_range=AVCOL_RANGE_MPEG;frame->colorspace=AVCOL_SPC_BT2020_NCL;+ frame->color_primaries=AVCOL_PRI_BT2020;frame->color_trc=AVCOL_TRC_SMPTE2084;+ ok=av_frame_get_buffer(frame,32)>=0&&ok;+ unsigned hdrChecks=0;int maxError=0;+ for(unsigned round=0;round<8&&ok;++round){+ ok=presenter.prepareGraphChange();+ pipeline::EnhanceGraph graph(ctx,ring);pipeline::EnhanceGraphDesc desc;+ desc.sourceWidth=desc.workWidth=desc.nrWidth=640;desc.sourceHeight=desc.workHeight=desc.nrHeight=360;+ desc.hdrInput=desc.hdrOutput=true;desc.captureBitDepth=10;+ desc.enableNr=round%2!=0;desc.enableFg=true;desc.enableSr=false;desc.fgMultiplier=2;+ desc.enableNvofStandalone=desc.enableNr;desc.nrRuntime=engine::NrRuntime::NvidiaOriginal;+ desc.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();+ ok=ok&&graph.initialize(desc)&&graph.createViews()&&presenter.open(ctx,window,graph);+ engine::PresentationSettings presentation;+ presentation.display=engine::DisplaySync::Tearing;+ presentation.hdrFgCompatibility=round%4>=2;+ std::wstring notice;+ const auto effective=presenter.configurePresentation(ctx,presentation,true,notice);+ ok=ok&&effective.hdrFgCompatibility==presentation.hdrFgCompatibility;+ if(!held)held=presenter.swapChainForTest();+ const bool same=held&&held.Get()==presenter.swapChainForTest().Get();ok=ok&&same;+ for(int y=0;y<360;++y)for(int x=0;x<640;++x)reinterpret_cast<uint16_t*>(frame->data[0]+size_t(y)*frame->linesize[0])[x]=uint16_t((240+round*32)<<6);+ for(int y=0;y<180;++y)for(int x=0;x<640;++x)reinterpret_cast<uint16_t*>(frame->data[1]+size_t(y)*frame->linesize[1])[x]=512<<6;+ pipeline::EnhanceGraph::FrameOutputs out;+ for(unsigned i=0;i<3&&ok;++i){+ out={};ok=graph.process(frame,(round*3+i)*33.333333,i==0,out,round*3+i+1)&&ring.waitIdle();+ ok=ok&&presenter.present(ctx,ring,graph,out.videoSlot,false,false,0,false,.5f,out.batch.identity);+ }+ auto shown=presenter.presentedResourceForTest();std::vector<uint32_t> actual,expected;unsigned w=0,h=0,ew=0,eh=0;+ ok=ok&&readHdrWords(ctx,ring,shown.Get(),actual,w,h)&&readHdrWords(ctx,ring,graph.videoFrameResource(out.videoSlot),expected,ew,eh);+ if(ok){+ const auto a=actual[size_t(h/2)*w+w/2],b=expected[size_t(eh/2)*ew+ew/2];+ for(unsigned c=0;c<3;++c)maxError=std::max(maxError,std::abs(int((a>>(10*c))&1023)-int((b>>(10*c))&1023)));+ ok=maxError<=1;++hdrChecks;+ }+ shown.Reset();std::cout<<"SETTINGS_HDR round="<<round<<" nr="<<desc.enableNr<<" copyCompatibility="<<effective.hdrFgCompatibility<<" retainedExternalReference="<<same<<" checks="<<hdrChecks<<" max10BitError="<<maxError<<" passed="<<ok<<std::endl;+ ok=presenter.prepareGraphChange()&&ring.drainQueue()&&ok;out={};graph.shutdown();+ }+ held.Reset();presenter.close();av_frame_free(&frame);+ unsigned errors=0;for(UINT64 i=0;i<messages->GetNumStoredMessagesAllowedByRetrievalFilter();++i){SIZE_T size=0;messages->GetMessage(i,nullptr,&size);std::vector<char> buffer(size);auto* m=reinterpret_cast<D3D12_MESSAGE*>(buffer.data());messages->GetMessage(i,m,&size);if(m->Severity<=D3D12_MESSAGE_SEVERITY_ERROR){++errors;std::cerr<<m->pDescription<<std::endl;}}+ ok=ok&&errors==0&&SUCCEEDED(ctx.device()->GetDeviceRemovedReason());messages.Reset();ring.shutdown();ctx.shutdown();DestroyWindow(window);+ std::cout<<"SETTINGS_RESULT passed="<<ok<<" debugErrors="<<errors<<std::endl;return ok?0:1;+}diff --git a/tests/integration/SrQualityTests.cpp b/tests/integration/SrQualityTests.cppnew file mode 100644index 00000000..042672ff--- /dev/null+++ b/tests/integration/SrQualityTests.cpp@@ -0,0 +1,111 @@+#include "veyra/pipeline/EnhanceGraph.h"+#include "veyra/engine/GraphDescription.h"+#include "veyra/gfx/D3D12DeviceContext.h"+#include "veyra/gfx/CommandSlotRing.h"+#include "veyra/sink/ImageExportSink.h"+#include "veyra/source/MediaFileSource.h"+#include "veyra/RuntimePaths.h"+#include "veyra/Log.h"+#include <filesystem>+#include <iostream>+#include <array>+extern "C" {+#include <libavutil/frame.h>+#include <libavutil/pixfmt.h>+#include <libswscale/swscale.h>+}++// Matched deterministic frames, actual SDK evaluation and output pixels.+// Readbacks are restricted to this test; these are not playback timings.+int wmain(int argc,wchar_t** argv){+ using namespace veyra;+ if(argc<2)return 2;+ const HRESULT com=CoInitializeEx(nullptr,COINIT_MULTITHREADED);+ if(FAILED(com))return 2;+ const bool baseline=argc>2&&std::wstring_view(argv[2])==L"baseline";+ source::MediaFileSource media;const AVFrame* natural=nullptr;+ if(argc>3){+ source::SourceOpenDesc open;open.path=argv[3];open.preferHardwareDecode=false;+ if(!media.open(open)||!media.seek({12,1}))return 2;+ pipeline::FramePacket packet;+ if(media.read(packet,&natural)!=source::SourceReadStatus::Frame||!natural)return 2;+ }+ const std::filesystem::path directory=argv[1];std::filesystem::create_directories(directory);+ Logger::instance().openFile((directory/L"engine.log").wstring());+ gfx::D3D12DeviceContext ctx;gfx::CommandSlotRing ring;Status status;+ gfx::DeviceContextDesc device;+ if(!ctx.initialize(device,status)||!ring.initialize(ctx.device(),ctx.directQueue(),ctx.fence(),ctx.fenceEvent(),4,status))return 2;+ bool ok=true;+ for(unsigned quality:{0u,4u,5u})for(bool still:{false,true})for(bool exportJob:{false,true}){+ engine::EnhancementSettings settings;settings.nr=false;settings.sr=true;settings.multiplier=1;+ settings.videoSrQuality=quality;settings.srTarget=pipeline::SrTarget::Qhd;+ engine::StageRequest request;request.width=2560;request.height=1440;request.sr=true;request.stillImage=still;request.exportJob=exportJob;+ pipeline::EnhanceGraphDesc desc;engine::describeStages(request,settings,desc);+ const bool expected=!baseline&&quality==4&&!still;+ const bool passed=desc.enableSr==expected;ok=passed&&ok;+ std::cout<<"SR_POLICY quality="<<quality<<" stillImage="<<still<<" exportJob="<<exportJob<<" nativeActive="<<desc.enableSr<<" passed="<<passed<<std::endl;+ }+ auto render=[&](unsigned quality,bool native,bool color,bool enabled,sink::RgbaImage& image){+ engine::EnhancementSettings settings;settings.nr=false;settings.sr=enabled;settings.multiplier=1;+ settings.videoSrQuality=quality;settings.srTarget=natural?pipeline::SrTarget::Uhd4K:pipeline::SrTarget::Qhd;+ settings.color.enabled=color;settings.color.exposure=color?1.0f:0.0f;+ settings.srMotion=quality==engine::kVideoSrFsr?engine::MotionSource::OpticalFlow:engine::MotionSource::Zero;+ engine::StageRequest request;request.sr=enabled;+ request.width=natural?(native?unsigned(natural->width):unsigned(natural->width)/2):(native?2560:1280);+ request.height=natural?(native?unsigned(natural->height):unsigned(natural->height)/2):(native?1440:720);+ pipeline::EnhanceGraphDesc desc;engine::describeStages(request,settings,desc);+ desc.rgbInput=true;desc.runtimeAbsPath=runtime::localRuntimeDirectory().wstring();+ pipeline::EnhanceGraph graph(ctx,ring);+ if(!graph.initialize(desc)||!graph.createViews())return false;+ AVFrame* frame=av_frame_alloc();frame->format=AV_PIX_FMT_RGBA;frame->width=request.width;frame->height=request.height;+ if(av_frame_get_buffer(frame,32)<0){av_frame_free(&frame);return false;}+ if(natural){+ auto* scaler=sws_getContext(natural->width,natural->height,AVPixelFormat(natural->format),frame->width,frame->height,AV_PIX_FMT_RGBA,SWS_LANCZOS,nullptr,nullptr,nullptr);+ if(!scaler){av_frame_free(&frame);return false;}+ const int rows=sws_scale(scaler,natural->data,natural->linesize,0,natural->height,frame->data,frame->linesize);sws_freeContext(scaler);+ if(rows!=frame->height){av_frame_free(&frame);return false;}+ frame->color_range=AVCOL_RANGE_JPEG;frame->color_primaries=natural->color_primaries;frame->color_trc=natural->color_trc;frame->colorspace=AVCOL_SPC_RGB;+ }else for(unsigned y=0;y<request.height;++y)for(unsigned x=0;x<request.width;++x){+ auto* p=frame->data[0]+size_t(y)*frame->linesize[0]+x*4;+ const auto texture=((x/3+y/3)%2)*18;+ p[0]=uint8_t(25+(x*105/request.width)+texture);p[1]=uint8_t(25+(y*105/request.height)+texture);+ p[2]=uint8_t(45+((x/32+y/32)%3)*20+texture);p[3]=255;+ }+ pipeline::EnhanceGraph::FrameOutputs out;bool passed=true;uint64_t first=0;+ for(unsigned i=0;i<3&&passed;++i){+ out={};passed=graph.process(frame,i*33.333333,i==0,out,i+1)&&ring.waitIdle();+ if(i==0)first=graph.metrics().srEvaluateCount;+ }+ if(passed)passed=sink::readRgba8(ctx,ring,graph.videoFrameResource(out.videoSlot),image);+ const bool expectedActive=enabled&&(!native||(!baseline&&quality>=1&&quality<=4));+ const uint64_t expectedEvaluations=expectedActive?(quality==engine::kVideoSrFsr&&baseline?2:3):0;+ passed=passed&&graph.srEnabled()==expectedActive&&graph.metrics().srEvaluateCount==expectedEvaluations;+ if(enabled&&quality==engine::kVideoSrFsr)passed=passed&&first==(baseline?0u:1u);+ const auto name=std::to_string(quality)+(native?"-native":"-upscale")+(color?"-color":"")+(enabled?"-on":"-off");+ if(passed)passed=sink::saveImage((directory/(name+".png")).wstring(),image,false);+ std::cout<<"SR_CASE name="<<name<<" active="<<graph.srEnabled()<<" firstEvaluations="<<first<<" evaluations="<<graph.metrics().srEvaluateCount<<" width="<<image.width<<" height="<<image.height<<" passed="<<passed<<std::endl;+ out={};ring.drainQueue();graph.shutdown();av_frame_free(&frame);return passed;+ };+ auto difference=[](const sink::RgbaImage& a,const sink::RgbaImage& b){+ uint64_t changed=0,error=0;+ if(!a.width||!a.height||a.width!=b.width||a.height!=b.height||a.pixels.size()!=b.pixels.size())return std::pair<uint64_t,double>{0,-1};+ for(size_t i=0;i<a.pixels.size();++i)if(i%4!=3){const auto d=std::abs(int(a.pixels[i])-int(b.pixels[i]));changed+=d!=0;error+=d;}+ return std::pair<uint64_t,double>{changed,double(error)/(a.width*a.height*3)};+ };+ auto mean=[](const sink::RgbaImage& a){if(!a.width||!a.height)return -1.0;double v=0;for(size_t i=0;i<a.pixels.size();++i)if(i%4!=3)v+=a.pixels[i];return v/(a.width*a.height*3);};+ sink::RgbaImage nativeOff,nativeOn;+ ok=render(4,true,false,false,nativeOff)&&ok;ok=render(4,true,false,true,nativeOn)&&ok;+ auto [changed,mae]=difference(nativeOff,nativeOn);+ const bool nativePass=baseline?changed==0:changed>1000;+ std::cout<<"SR_NATIVE_CHANGED channels="<<changed<<" mae8="<<mae<<" passed="<<nativePass<<std::endl;ok=ok&&nativePass;+ sink::RgbaImage low,high,colored;+ ok=render(1,false,false,true,low)&&ok;ok=render(4,false,false,true,high)&&ok;ok=render(4,false,true,true,colored)&&ok;+ const bool colorPass=mean(colored)>mean(high)+10;+ auto [qualityChanged,qualityMae]=difference(low,high);+ std::cout<<"SR_PRECOLOR baseMean="<<mean(high)<<" coloredMean="<<mean(colored)<<" passed="<<colorPass<<std::endl;+ std::cout<<"SR_QUALITY_CHANGED channels="<<qualityChanged<<" mae8="<<qualityMae<<" passed="<<(qualityChanged>100)<<std::endl;+ ok=ok&&colorPass&&qualityChanged>100;+ sink::RgbaImage dlss,fsr;+ ok=render(0,false,false,true,dlss)&&ok;ok=render(5,false,false,true,fsr)&&ok;+ media.close();ring.shutdown();ctx.shutdown();CoUninitialize();std::cout<<"SR_RESULT baseline="<<baseline<<" natural="<<(natural!=nullptr)<<" passed="<<ok<<std::endl;return ok?0:1;+}diff --git a/tests/qml/quick/tst_menu_layout.qml b/tests/qml/quick/tst_menu_layout.qmlnew file mode 100644index 00000000..52411bb0--- /dev/null+++ b/tests/qml/quick/tst_menu_layout.qml@@ -0,0 +1,64 @@+import QtQuick+import QtQuick.Controls+import QtQuick.Layouts+import QtTest+import Veyra++Item {+ id: root+ width: 900; height: 600+ Item { id: anchor; x: root.width - 24; y: root.height - 24; width: 1; height: 1 }+ VMenu { id: menu; title: "Long context menu" }+ VRow {+ id: row; x: 12; y: 12; width: 285+ label: "The capture device's actual supported pixel format"+ hint: "This information must stay readable even in a narrow panel."+ VSelect { implicitWidth: 220; value: "3840 × 2160 @ 59.94 fps · P010 · HDR · Native · Low latency" }+ }+ function labels(item, output) {+ if (item.objectName === "vmenu-option-label") output.push(item)+ for (const child of item.children || []) labels(child, output)+ return output+ }+ TestCase {+ name: "MenuAndRowLayout"+ when: windowShown+ function cleanup() { menu.close() }+ function test_text_data() {+ return [{tag:"English",label:"Duplicate the selected enhancement node and reconnect its downstream output",width:900},+ {tag:"Chinese",label:"3840 × 2160 @ 59.94 fps · P010 · 原生格式 · HDR · 低延迟 · 驱动默认输入",width:900},+ {tag:"Japanese",label:"選択した画像補正ノードを複製して出力に再接続する",width:420},+ {tag:"Narrow",label:"C:/A_very_long_folder_name/"+"unbroken".repeat(60),width:300}]+ }+ function test_text(data) {+ root.Window.window.width=data.width; root.Window.window.height=500+ root.width=data.width; root.height=500+ menu.items=[{label:data.label},{label:"Second choice"}]+ menu.openAt(anchor,"at")+ tryCompare(menu,"opened",true)+ wait(500)+ verify(menu.width<=data.width-16)+ verify(menu.x>=8 && menu.x+menu.width<=data.width-7, "x="+menu.x+" width="+menu.width+" window="+data.width)+ verify(menu.y>=8 && menu.y+menu.height<=500-7)+ const items=labels(menu.contentItem,[])+ compare(items.length,2)+ verify(!items[0].truncated)+ verify(items[0].contentWidth<=items[0].width+1)+ verify(items[0].contentHeight<=items[0].height+1)+ if(data.width===900) verify(menu.width>220)+ }+ function test_tall_menu_scrolls() {+ root.Window.window.width=600;root.Window.window.height=400;root.width=600;root.height=400+ let entries=[];for(let i=0;i<60;i++)entries.push({label:"Capture format "+i+" · 3840 × 2160 @ 59.94 fps · P010"})+ menu.items=entries;menu.openAt(anchor,"at");tryCompare(menu,"opened",true);wait(500)+ verify(menu.height<=384)+ const items=labels(menu.contentItem,[]);compare(items.length,60)+ verify(!items[59].truncated)+ }+ function test_narrow_row_reflows() {+ tryCompare(row,"stacked",true)+ verify(row.implicitHeight>60)+ verify(row.childrenRect.width<=row.width+1)+ }+ }+}diff --git a/tests/qml/quick/tst_slider_value.qml b/tests/qml/quick/tst_slider_value.qmlindex eba6e462..ea9247ba 100644--- a/tests/qml/quick/tst_slider_value.qml+++ b/tests/qml/quick/tst_slider_value.qml@@ -6,6 +6,8 @@ Item {id: rootwidth: 420; height: 180property real amount: 1.25+ property int shortcuts: 0+ Shortcut { sequence: "Right"; onActivated: root.shortcuts++ }VSlider {id: sliderx: 20; y: 30; width: 220@@ -20,6 +22,7 @@ Item {text: root.amount.toFixed(2)}VButton { id: outside; x: 20; y: 90; width: 120; height: 30; text: "Other control"; onClicked: forceActiveFocus() }+ TextInput { id: nextInput; x: 160; y: 90; width: 140; height: 30; text: "Next input"; selectByMouse: true }TestCase {name: "SliderNumberInput"when: windowShown@@ -28,6 +31,7 @@ Item {root.amount = 1.25slider.from = 0; slider.to = 5; slider.inputScale = 1; slider.inputDecimals = 2slider.enabledControl = true+ root.shortcuts = 0}function type(text) {mouseClick(number, 35, 12)@@ -67,5 +71,29 @@ Item {mouseClick(number, 35, 12)compare(number.editing, false); compare(root.amount, 1.25)}+ function test_shortcuts_after_commit_data() {+ return [{tag:"return",key:Qt.Key_Return},{tag:"escape",key:Qt.Key_Escape}]+ }+ function test_shortcuts_after_commit(data) {+ type("2.75")+ keyClick(Qt.Key_Right)+ compare(root.shortcuts, 0)+ keyClick(data.key)+ compare(number.editing, false)+ const input = findChild(number, "vslider-value-input")+ verify(!input.activeFocus && !input.focus)+ keyClick(Qt.Key_Right)+ tryCompare(root, "shortcuts", 1)+ }+ function test_focus_loss_keeps_next_editor() {+ type("3.25")+ mouseClick(nextInput, 25, 12)+ tryCompare(number, "editing", false)+ verify(nextInput.activeFocus)+ keyClick(Qt.Key_A, Qt.ControlModifier)+ keyClick("7")+ compare(nextInput.text, "7")+ compare(root.amount, 3.25)+ }}}