Skip to content

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

C++

fix: avoid orphan RTSS prompts and preserve compatibility restart intent

Veyra Goal Agentc9d946e612f7
diff --git a/apps/veyra-qml/main.cpp b/apps/veyra-qml/main.cpp
index c0a4309e..e3444f6e 100644
--- a/apps/veyra-qml/main.cpp
+++ b/apps/veyra-qml/main.cpp
@@ -449,6 +449,7 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
int uiScale = 0;
bool obsGameCapture = false;
bool overlayCompatAuto = true; // 设置 → 监控软件兼容: "auto" (default) or "off"
+ bool overlayCompatRestart = false;
{
int count = 0;
LPWSTR* args = CommandLineToArgvW(GetCommandLineW(), &count);
@@ -457,6 +458,7 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
for (int i = 1; args && i < count; ++i) {
if (std::wstring(args[i]) == L"--data-dir" && i + 1 < count) dir = args[++i];
else if (std::wstring(args[i]) == L"--obs-game-capture") obsGameCaptureArg = true;
+ else if (std::wstring(args[i]) == L"--overlay-compat-restart") overlayCompatRestart = true;
}
if (args) LocalFree(args);
QFile prefs(QString::fromStdWString((dir / L"qml-preferences.v1.json").wstring()));
@@ -490,16 +492,22 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
wchar_t forcedRenderer[16]{};
GetEnvironmentVariableW(L"VEYRA_UI_RHI", forcedRenderer, 16);
// VEYRA_TEST_IGNORE_RTSS=1 starts as if RivaTuner were not running (its late-start path).
+ // An orphan hooks loader can inject the DLL after RTSS itself has exited.
+ // Module presence does not prove an active OSD server. A user-accepted
+ // compatibility restart carries its intent for this launch only, so timing
+ // changes in server detection cannot turn that restart into another prompt.
const bool rivaTuner = !GetEnvironmentVariableW(L"VEYRA_TEST_IGNORE_RTSS", nullptr, 0)
- && (veyra::gfx::rivaTunerRunning() || GetModuleHandleW(L"RTSSHooks64.dll"));
- const bool overlayCompat = !obsGameCapture && overlayCompatAuto && rivaTuner && !forcedRenderer[0];
+ && veyra::gfx::rivaTunerRunning();
+ const bool overlayCompat = !obsGameCapture && overlayCompatAuto
+ && (rivaTuner || overlayCompatRestart) && !forcedRenderer[0];
const bool softwareUi = obsGameCapture || overlayCompat;
if (obsGameCapture) {
QQuickWindow::setSceneGraphBackend(QStringLiteral("software"));
veyra::log::info("app", "OBS game capture compatibility: software UI; native D3D12 video unchanged");
} else if (overlayCompat) {
QQuickWindow::setSceneGraphBackend(QStringLiteral("software"));
- veyra::log::info("app", "RivaTuner Statistics Server is running: software UI so its OSD draws on the video only; native D3D12 video unchanged");
+ veyra::log::info("app", std::format("RTSS compatibility: software UI; activeServer={} acceptedRestart={}; native D3D12 video unchanged",
+ rivaTuner, overlayCompatRestart));
}
{
// A GPU interface keeps RTSS from drawing in this process at all, so a RivaTuner
@@ -950,6 +958,8 @@ static int runApplication(int argc, char** argv, QString& restartProgram, QStrin
++i;
}
}
+ if (app.property("veyraOverlayCompatRestart").toBool())
+ restartArgs << QStringLiteral("--overlay-compat-restart");
restartArgs << QStringLiteral("--page") << QStringLiteral("set");
}
if (g_video) { DestroyWindow(g_video); g_video = nullptr; }
diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.md
index 0fd8c141..312f47f0 100644
--- a/docs/CURRENT_STATUS.md
+++ b/docs/CURRENT_STATUS.md
@@ -1,5 +1,11 @@
# 当前项目状态 / Current Status
+## 2026-10-04 RTSS 现场误提示与重启循环已修复(本地)
+
+隔离分支 codex/rtss-restart-loop-20261004:查明并停止Agent旧测试遗漏的RTSS加载器;软件判活增加RTSS.exe存活条件,过滤孤立hook/残留映射。接受兼容重启携带本次启动意图,避免重复弹窗;用户关闭/强制渲染器/OBS选择保持。
+最终构建成功,真实用户安装RTSS7.3.5.28314,11启动/重启+33参数组合通过,OSD/NR/4K超分/四类补帧/暂停seek/全屏退窗实际验证。RTSS原配置逐字节恢复,测试进程及子加载器零遗留。此前RTSS7.3.7记录已纠正。
+RTX5070/616.56短测;VFG8High实时播放有调度降档,不能保证240fps。未新增AMD/OBS捕获/Xbox长稳验收。完整本地NVIDIA候选正在封存,未合main/推送/改远端2.0.3。证据和失败修正见WORKLOG与RTSS_RESTART_LOOP_PLAN_2026-10-04.md。
+
## 2026-10-04 2.0.3 已正式发布
已将本轮Xbox/码率/RTSS背景/误判/极简边缘、AMD NR、VFG全档位及分包能力合入main并发布 [v2.0.3](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v2.0.3)。
diff --git a/docs/FIELD_UPGRADE_ACCEPTANCE_2026-10-03.md b/docs/FIELD_UPGRADE_ACCEPTANCE_2026-10-03.md
index 29f808fe..8f7e6c17 100644
--- a/docs/FIELD_UPGRADE_ACCEPTANCE_2026-10-03.md
+++ b/docs/FIELD_UPGRADE_ACCEPTANCE_2026-10-03.md
@@ -1,5 +1,7 @@
# 五项修复本地验收(2026-10-03)
+> 2026-10-04 纠正:按实际 RTSS.exe 的 FileVersion/ProductVersion 与 SHA256 核验,本文原先的 7.3.7 版本记录不准确;当前用户安装与此前测试副本均为 7.3.5.28314(84E6E439…6736)。本轮另外发现旧测试只退出主 RTSS 而漏收子加载器,导致用户误提示;详见 RTSS_RESTART_LOOP_PLAN_2026-10-04.md。本条纠正版本和清理记录,不宣称重新完成本文全部旧测试。
+
分支 `codex/field-upgrade-20261003`,起点 main `66cd3e5`。先建立
`checkpoint/pre-field-upgrade-20261003`、Git bundle/桌面修改存档及施工方案,
再修改产品。未合并、推送或公开发布。
@@ -12,7 +14,7 @@
| Xbox 断开 | 日志 16 持续约 17 分钟后收到 KickForServerShutdown。保留具体 reason,网络丢失/服务器关闭/过期最多 3 次重连,1/2/3 秒退避,可取消;30 秒连续解码才恢复额度,重连原子 reset 图历史。 | 本地 ICE/DTLS/SCTP/RTP peer 90 checks 通过;无 Xbox 长稳测试,不能阻止服务端关闭或保证 Wi-Fi 永不丢包。 |
| AMD NR | MIT 独立 runtime、共享 NR 图及按 GPU 的 UI 接入;用户 0.39 包校验通过,186 权重/2 映射/62 HIP 核补齐,真实 DLL API 和模块布局验证通过。 | RTX5070 无 RX9000 HIP 推理/画质/性能/长稳实测;仅 1080p 像素预算,HDR/原生 4K AMD NR 导出未支持。 |
| 导出码率 | 有效键入即时提交,草稿不受其他 exportChanged 覆盖,统一 1–300 Mbps,具体 validate 错误和冻结参数入日志。真实 bridge/worker/NVENC 的两种复现均通过。 | 本机驱动 616.56;用户 616.92 未直接测试。 |
-| RTSS 透明背景 | 软件绘制用 Rectangle/Image,Window 不透明;真实 RTSS 7.3.7 自动兼容,RTSSHooks64 已注入,截图深色 alpha=255。 | 未枚举全部 RTSS/OBS 版本、注入组合与显示配置。 |
+| RTSS 透明背景 | 软件绘制用 Rectangle/Image,Window 不透明;真实 RTSS 7.3.5.28314 自动兼容,RTSSHooks64 已注入,截图深色 alpha=255。 | 未枚举全部 RTSS/OBS 版本、注入组合与显示配置。 |
| NVIDIA 插件误判 | 删除 nvppex/NvPresent 风险分类、检测与崩溃归因;旧 device/nvppex marker 不再触发 NVIDIA App 提示,真实 GPU 错误仍记录。 | 不宣称所有第三方插件安全;不再只凭模块存在判断崩溃。 |
## 自动测试与真实导出
diff --git a/docs/RELEASE_2.0.3_ACCEPTANCE_2026-10-04.md b/docs/RELEASE_2.0.3_ACCEPTANCE_2026-10-04.md
index 4a64cfba..8318509a 100644
--- a/docs/RELEASE_2.0.3_ACCEPTANCE_2026-10-04.md
+++ b/docs/RELEASE_2.0.3_ACCEPTANCE_2026-10-04.md
@@ -1,5 +1,7 @@
# 2.0.3 显卡分包与现场修复验收
+> 2026-10-04 纠正:按实际 RTSS.exe 的 FileVersion/ProductVersion 与 SHA256 核验,本文原先的 7.3.7 版本记录不准确;当前用户安装与此前测试副本均为 7.3.5.28314(84E6E439…6736)。本轮另外发现旧测试只退出主 RTSS 而漏收子加载器,导致用户误提示;详见 RTSS_RESTART_LOOP_PLAN_2026-10-04.md。本条纠正版本和清理记录,不宣称重新完成本文全部旧测试。
+
用户授权分别发布 NVIDIA/AMD 包、保留不可用功能的灰色入口、写入 AGENTS.md、合并当前已完成修复到 main 并发布 GitHub 2.0.3。追加决定保留现有 FSR3.1/4 共用组件;旧 SDK 分离试改已撤下。HDR/Dolby Vision PR #13/#14 不在本版施工范围。本轮不重复此前已经执行的关机。
## 源码与分包
@@ -22,7 +24,7 @@ NR 保留四个版本入口,SR 保留三个算法入口,FG 保留五个后
| 原 FSR2.3 组件 | 独立 FSR 39 samples/39 中间帧,meanError=0、GPU debug errors=0;18 次 DLSS/XeSS/FSR 热切换、774 生成帧、0 debug error,见 `shared-native-v1`。这些是保留原组件后的结果,旧 SDK 试验不算本版证据。 |
| VFG | 本轮原生 720p 463 checks/0 failures;真实包内 GUI 所有 2–8X/三质量、DLSS6↔VFG8、seek/pause/resize、列表/节点预设与重启恢复通过;独立 worker 冻结 High 8X,输出 64 帧 HEVC/240fps,见 `shared-native-v1`、`vfg-ui-v1`。上一已存档瘦身阶段还验证过原生 4K,不能将本轮 720p 记作重复 4K 验收。 |
| 灰色入口与兼容 | `policy-nv-v3`、`policy-amd-v2`:真实两份包、同一 RTX5070;四 NR/三 SR/五 FG 可见且状态正确,拒绝 FSR4 请求。AMD 包加载原 VFG 列表8X Medium/节点8X High配置,禁用 FG 并保留参数;两包实际 FSR SR 播放成功,0 provider failure。 |
-| 导出码率与 RTSS | `production-rtss-v1`:真实 RTSS7.3.7/RTSSHooks64 注入;2K30 MPEG-4 AVI→NR+最高 RTX SR→4K HEVC;18 Mbps VBR 后改其他选项、24 Mbps CBR 直接开始,两份均 24/24 帧。worker 使用冻结码率;输入值不是保证短片平均码率逐位相同。背景取样 alpha255,旧 NVIDIA marker 不触发误判。只关闭本轮启动的 RTSS,未改其配置。 |
+| 导出码率与 RTSS | `production-rtss-v1`:真实 RTSS7.3.5.28314/RTSSHooks64 注入;2K30 MPEG-4 AVI→NR+最高 RTX SR→4K HEVC;18 Mbps VBR 后改其他选项、24 Mbps CBR 直接开始,两份均 24/24 帧。worker 使用冻结码率;输入值不是保证短片平均码率逐位相同。背景取样 alpha255,旧 NVIDIA marker 不触发误判。只关闭本轮启动的 RTSS,未改其配置。 |
| 极简右边缺口 | `edge-v1`:六个整数/分数 DPI 与软件绘制实际窗口测量,rightGap=0、bottomGap=0;没有用容器比例黑边冒充缺口。 |
| AMD NR | `amd-runtime-audit.json`:528 份实际分发文件逐 SHA,186 权重/62 HIP 模块,真实 ABI1/144 bytes 与模块布局通过;caps.hip=0。没有运行 HIP 推理。 |
| 对应源码可重建 | 源码包保留 byte-identical 2.0.0 依赖包,新增 lmxxf 源码和实际 recipe;排除权重/编译模块/截图/CSV/对话。从独立解压源码和 manifest 重建真实 AMD 宿主 DLL 成功,`amd-source-rebuild.log`;发布仍携带原已核验 DLL,不替换为重建件。 |
diff --git a/docs/RTSS_COMPAT_2026-10-03.md b/docs/RTSS_COMPAT_2026-10-03.md
index c4768556..0d16b362 100644
--- a/docs/RTSS_COMPAT_2026-10-03.md
+++ b/docs/RTSS_COMPAT_2026-10-03.md
@@ -1,8 +1,10 @@
# 小飞机(RTSS / MSI Afterburner OSD)适配(2026-10-03)
+> 2026-10-04 纠正:按实际 RTSS.exe 的 FileVersion/ProductVersion 与 SHA256 核验,本文原先的 7.3.7 版本记录不准确;当前用户安装与此前测试副本均为 7.3.5.28314(84E6E439…6736)。本轮另外发现旧测试只退出主 RTSS 而漏收子加载器,导致用户误提示;详见 RTSS_RESTART_LOOP_PLAN_2026-10-04.md。本条纠正版本和清理记录,不宣称重新完成本文全部旧测试。
+
用户要求:微星小飞机的 RTSS 监控叠加在 Veyra 上时必定闪退或显示异常;改界面为 D3D11 / D3D12 不解决问题(界面一个数值、播放窗口一个数值,界面不需要数值);同时保证 OBS 采集与 OBS 兼容模式采集正常。
-分支 `claude/rtss-compat-20261003`(基于 Codex 的 2.0.1 候选 `15a0e39`),工作区 `E:/项目/Veyra/worktrees/rtss-compat-20261003`,构建 `build/rtss-compat-20261003`,测试证据 `tests/rtss-20261003`。本机 RTSS 7.3.7 + MSI Afterburner、OBS 32.1.2 便携副本(`tmp/obs-test/obs`,不碰用户 OBS 配置)、RTX 5070。
+分支 `claude/rtss-compat-20261003`(基于 Codex 的 2.0.1 候选 `15a0e39`),工作区 `E:/项目/Veyra/worktrees/rtss-compat-20261003`,构建 `build/rtss-compat-20261003`,测试证据 `tests/rtss-20261003`。本机 RTSS 7.3.5.28314 + MSI Afterburner、OBS 32.1.2 便携副本(`tmp/obs-test/obs`,不碰用户 OBS 配置)、RTX 5070。
## 复现与根因
@@ -40,7 +42,7 @@
| 继承 `EnableOSD,0` 重启到软件绘制 | 变量被清,OSD 正常出现在视频上 |
| OBS 窗口采集(WGC)+ 小飞机 | 6/6 帧有画面,含视频上的 OSD |
| OBS 游戏采集,不受 RTSS 影响(`AppDetectionLevel,0`):GPU 界面 / OBS 兼容模式 | 6/6、6/6 帧为视频画面 |
-| OBS 游戏采集 + 小飞机(默认挂钩) | 0/6;**最小 D3D12 窗口程序同样 0/4**,是 RTSS 7.3.7 与 OBS 32.1.2 在 D3D12 上的通用冲突,改动前的 2.0.1 候选也 0/6 |
+| OBS 游戏采集 + 小飞机(默认挂钩) | 0/6;**最小 D3D12 窗口程序同样 0/4**,是 RTSS 7.3.5.28314 与 OBS 32.1.2 在 D3D12 上的通用冲突,改动前的 2.0.1 候选也 0/6 |
| 同上,RTSS 进程配置 `UseDetours=1`(临时文件,测后删除) | 最小程序 4/4;Veyra 6/6 帧为视频、无设备移除 |
| 单测 | i18n、qml-data、ui-contract 通过;Qt Quick 29/29 |
| CPU(播放 1080p30) | GPU 界面约 6–16%,软件界面约 6–13%;首页软件界面约 4–25%(首页动画由 CPU 重绘) |
diff --git a/docs/RTSS_RESTART_LOOP_PLAN_2026-10-04.md b/docs/RTSS_RESTART_LOOP_PLAN_2026-10-04.md
new file mode 100644
index 00000000..8cc3d224
--- /dev/null
+++ b/docs/RTSS_RESTART_LOOP_PLAN_2026-10-04.md
@@ -0,0 +1,55 @@
+# RTSS 未启动误提示与兼容重启循环修复
+
+## 现场证据与开工存档
+
+用户在已发布 NVIDIA 2.0.3 本地包反馈:没有开启小飞机,弹出要求兼容重启的对话框;重启后仍反复弹出。三份用户日志均显示启动时 `running=false injected=false compat=auto`,约两秒后 RTSSHooks64.dll 注入并建议重启。用户最后手动把 overlayCompat 改为 off,不能修改或重置这份配置来制造通过。
+
+本机发现 `E:/项目/Veyra/deps/rtss-overlay-20261002/RTSSHooksLoader64.exe /i`,PID 13316、父 PID 11020、启动时间 2026-10-04 11:31:40 +08:00。父 PID 与上一轮 `logs/release-2.0.3-20261004/rtss-test-pid.txt` 完全一致,主 RTSS 已退出,子加载器仍在注入。这是 Agent 上轮测试收尾遗漏,不是用户开了小飞机。
+
+独立 profile 运行已发布原 EXE 的 `baseline-orphan` 实际复现同样日志,exit 0。开工主线/源码基线 354b1c6e39ba0f62b2e6aac4c161f682dea9c2ff,分支 `codex/rtss-restart-loop-20261004`,标签 `checkpoint/pre-rtss-restart-loop-20261004`。全引用 bundle 已 verify,SHA256 `08679242174753dbf6f367f3dfe2cd85b0a8981180d6597767e0b2ea9a491dd2`。原现场日志和状态在 `E:/项目/Veyra/archives/rtss-restart-loop-20261004/`。
+
+## 最小修复范围
+
+1. 记录并停止本轮查明的 Agent 自有残留加载器,只按已核验 PID/绝对路径/父 PID/创建时间处理,不停用户的监控程序。验证没有 RTSS 后原发布 EXE 正常运行且不再触发此提示。
+2. 区分 RTSS 活跃服务器和仅加载钩子。启动与晚到检测统一以活跃服务器为自动兼容/弹窗依据;只有模块存在不推断“小飞机已启动”。保留实际模块路径和状态日志,GPU UI 保持已有的进程内 OSD 关闭策略。
+ - 原用户安装测试 installed-matrix-v1 暴露 force terminate 后共享内存仍为有效 signature、但无 RTSS/加载器进程的真实反例。仅共享内存签名不足以证明运行;补充 RTSS.exe 存活检查,并在该残留 mapping 下回测。原配置已在失败后逐字节恢复。
+3. 兼容重启携带一次性、专用途径的 software UI 参数,避免服务器检测时序或启动退出造成反复重启。普通设置重启不强制 RTSS 模式,off/显式 RHI/OBS 的用户选择仍适用,不永久改用户设置。
+4. 修正提示措辞,不断言小飞机主程序刚刚启动;独立 profile 验证未启动、孤立钩子、真实 RTSS 启动/晚到、off、设置重启、接受兼容重启及第二进程渲染方式。真实视频/软件背景做针对性回归。测试清理包括 owned RTSS 的子加载器,验证无遗留。
+
+必要改动限 `apps/veyra-qml/main.cpp`、RTSS 检测/重启桥接与 QML 对话框、翻译和定向验收脚本/文档。增强/音频/串流/颜色/运行库均保持。最新现场问题授权覆盖对应历史 UI 冻结,未授权新 merge/push/Release/关机;HDR PR 仍暂缓。桌面旧工作树、用户配置、已发布压缩包及其 manifest 不改。
+
+所有新构建/测试/日志/临时/本地修复交付产物在 `E:/项目/Veyra/{build,tests,logs,tmp,test-packages,archives}/rtss-restart-loop-20261004`,单测试进程最多 300 秒、构建最多 900 秒,TEMP/TMP 仅子进程。仅提供本地可验证修复,远端发布另按当前用户指令。
+
+## 验收要求
+
+- 原发布包现场复现留证;停自有残留后原包不再误提示;孤立钩子在修复版中不要求重启。
+- 真实 RTSS 自动兼容仍生效、透明背景不回归;晚到情况下仅一次建议,接受后实际第二进程为软件 UI 且不再弹窗。
+- 无 RTSS / off / 显式渲染器 / OBS / 普通重启保持各自行为;导出期间不能重启。
+- 构建成功;记录实际命令、退出码、原生日志、用户目录/源码/Runtime 隔离与本轮自启进程零遗留。
+- 测试过程不篡改 proprietary DLL 或永久关闭系统 RTSS、不把“未弹窗”冒充全部监控软件兼容。
+
+## 用户追加真实安装测试
+
+用户提供 `E:/App/RivaTuner Statistics Server/` 并要求“真实启动,并且多设置几个参数”。直接运行该目录的 RTSS.exe/加载器,按官方随附 SDK 的 Profile API 设置 Veyra 专属测试 profile,包含检测级别、OSD 开关/缩放/位置/颜色/阴影与帧率限制;不改变全局检测和启动设置。写入前存档现有 Profiles 文件,收尾恢复逐字节并清除本轮创建的 Veyra profile,只停止本轮启动的已核验进程及其加载器。
+
+同时在本地修复候选/独立用户目录里实际播放测试视频,切换 NR 参数、RTX 4K 超分、DLSS/XeSS/FSR/VFG 的倍率与质量、暂停/seek、窗口/全屏/页面,使用官方共享内存的独立 OSD 槽投放真实屏显文字,并保留帧进展、实际后端、原生截图和故障日志。每个 GUI 测试 ≤300 秒。
+
+版本记录纠正:本轮读出用户安装和之前测试目录 RTSS.exe 的 FileVersion/ProductVersion 都为 `7.3.5.28314`、SHA256 `84E6E439D313DCEE0BA9549D8248D3923D9DE6805D0380BE5EAB337446856736`。此前文档写 RTSS 7.3.7 没有对应二进制证据,应改为 7.3.5.28314;不能因为目录/下载说明便宣称另一版本通过。RTSSHooks64.dll 为 `68C496DEA7DED5B8766092F0159F4E9BA3947DF0829F594EB6981D2B06352AD5`。
+
+## 最终真实验收(2026-10-04)
+
+最终 build-v3.log 成功,EXE SHA256 d4ab803562641ef16d7b917b4b27db51b7b379ebb7ea975d47d6b472598bf994,17,342,976 bytes。实际用户安装版 7.3.5.28314;installed-matrix-v3 11启动/重启项通过,installed-stress-v4三套RTSS Profile API配置×11效果/操作=33项通过,installed-transport-v1先验证异步seek/全屏恢复。
+
+| RTSS配置 | 实际参数 | 结果 |
+|---|---|---|
+| low-osd | 检测1,OSD开,2倍,(16,16),橙,背景开,统计开,不限帧 | 11/11;真实视频截图+RTSS计数/颜色/坐标/缩放一致 |
+| high-large-osd | 检测3,OSD开,3倍,(24,24),绿,背景关,统计开,不限帧 | 11/11;实际大OSD截图与原生统计一致 |
+| medium-osd-off-cap60 | 检测2,OSD关,1倍,(48,32),背景开,统计关,限60 | 11/11;视频截图无测试OSD,限制属性读回60 |
+
+每套含基础、NR四参数、NR+最高RTX4K、NR+RTX+DLSS2、DLSS6、XeSS4、FSR3.1 2、VFG2Low/4Medium/8High、NR resize/暂停/seek2s/全屏/退窗。33视频与33UI截图,软件背景alpha255,进度和实际active后端核验;最终3个GUI约80秒,日志无ERROR/FATAL,无第二次重启提示或设备移除。
+
+失败记录保留:matrix-v1 Win740普通用户启动修正;installed-matrix-v1共享内存残留反例;stress-v1 seek调用名/手算字段偏移、v2 PNG写入读取竞争、v3 NR冷初始化期间固定时间断言,分别修正测试脚本而非放宽实际状态断言。v4使用真实SDK编译offsetof,异步操作等待已呈现2秒目标帧/真正全屏/窗口恢复。不能把失败轮内的QML PASS计作通过。
+
+本机RTX5070/616.56:VFG8High 2K30有实时调度降档,瞬时提交约30–31fps;VFG4在限60时也降档。软件稳定短测不代表稳定240fps、实屏刷新率/延迟、全部驱动或画质。未新增OBS捕获、AMD或Xbox实机测试。
+
+RTSS Config/Global逐字节恢复,SHA256 46e3258195f5784f99f152dfe7e1405f614d7b42f6609d95993cc19396b1ac83 / 1e44c57669402f4c49e519c8322613170b72f3ddd519f8f1a495d9cc828ee7ca,测试profile删除,主RTSS和加载器零遗留。原用户包overlayCompat=off及现场日志保持。最终包/源码/manifest将由rtss-restart-deliver.py生成并再次独立审计;不公开发布。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index f3c3caf2..b0ff895a 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,20 @@
# Veyra 工作记录
+## 2026-10-04 RTSS 误提示、重启循环与真实安装参数验收
+
+- 用户反馈已发布 NVIDIA2.0.3 未开小飞机仍反复要求重启,并提供 E:/App/RivaTuner Statistics Server 要求真实启动/多参数测试。先从 main354b1c6 开 codex/rtss-restart-loop-20261004,checkpoint/pre-rtss-restart-loop-20261004,外部 source-before.bundle verify/SHA08679242…dd2;不改桌面旧工作树、原正式包、main 或用户 profile。方案 RTSS_RESTART_LOOP_PLAN_2026-10-04.md。
+- 现场三日志 startup running=false/injected=false,之后 RTSSHooks64 注入。查明 Agent 旧测试留下 PID13316/PPID11020 的 deps/rtss-overlay-20261002/RTSSHooksLoader64.exe;父 PID 与 release 的 rtss-test-pid.txt 一致。这是 Agent 清理遗漏,已明确告知用户并按身份停止。原正式 EXE 在独立 profile 复现;停此加载器后原 EXE 正常退出且无误提示。
+- 软件修复:启动/晚到检测要求 RTSS.exe 存活且共享内存有效,模块存在或孤立加载器不代表活动服务;晚到还需实际 hook。接受兼容重启用一次性 --overlay-compat-restart,普通设置重启不携带;off/显式RHI/OBS优先,导出重启阻止沿用。新增实际 hook 路径/活动状态日志,提示区分 RTSS 屏显服务与 Afterburner,软件背景不透明。没有改算法、串流、音频、导出、shader 或 proprietary DLL。
+- 真实反例:installed-matrix-v1 退出 RTSS/加载器后映射仍有 RTSS signature,导致共享内存单独判活无效;加入进程检查。matrix-v1 私有 loader 最初 Win740,改为普通完整性级别 RunAsInvoker,仅自身测试窗口,不提权。各首次失败原始记录保留。
+- 版本纠正:用户安装与旧测试副本 RTSS.exe 实际均7.3.5.28314,SHA84E6E439D313DCEE0BA9549D8248D3923D9DE6805D0380BE5EAB337446856736;RTSSHooks64 SHA68C496DE…2AD5。此前7.3.7记录不准确,本轮修正相关源码注释/验收文档并保留纠正说明,不将旧版本名称当作验证。未重做旧OBS捕获矩阵。
+- `py -3.11 -B scripts/acceptance/rtss-restart-build.py build-v1.log` fresh472步;build-v2.log加入服务器进程检查;build-v3.log版本注释纠正后的最终10步,均exit0。最终EXE17,342,976 bytes / SHAd4ab803562641ef16d7b917b4b27db51b7b379ebb7ea975d47d6b472598bf994;build-i18n-v1.log/i18n-test.log成功,i18n0failures。C4244既有警告保留。
+- `py -3.11 -B scripts/acceptance/rtss-restart-tests.py installed-matrix-v3 "E:/App/RivaTuner Statistics Server"` 最终EXE 11/11 pass:clean/orphan/liveAuto/off/forcedRHI/OBS/acceptedWithoutServer/acceptedOff/normalRestart/normalAfterAccepted/lateRealRestart。真实Qt按钮接受,观察实际第二进程和CLI,软件/GPU后端及不透明截图断言,不模拟DLL/服务。matrix-v2和私有matrix-v2早期成功保留。
+- `py -3.11 -B scripts/acceptance/rtss-restart-real.py installed-stress-v4` 使用用户真实RTSS.exe、官方Profile API、独立OSD槽,3×11=33/33 pass。三配置为低检测+橙OSD2倍+背景/统计;高检测+绿OSD3倍+无背景/统计;中检测+OSD关闭+60帧限制。各9项属性写入/读回,SDK offsetof验证本机布局,真实OSD计数/位置/缩放/颜色核对、33张原生视频+33张QtUI截图。11效果/操作:基础、NR四参数0.45/0.2/0.3/0.25、NR+最高RTX4K、NR+RTX+DLSS2、DLSS6、XeSS4、FSR3.1 2、VFG2Low/4Medium/8High、NR resize/暂停/seek2s/全屏/退窗。每个GUI约80秒、无ERROR/FATAL/循环弹窗/设备移除,背景alpha255;实际后端/进度而非请求值验收。
+- stress-v1不算通过:seek函数名错误与手算OSD字段偏移错4bytes;改用seekTo与实际SDKoffsetof(316/268/36)。stress-v2截图路径刚创建但PNG未写完,改加载完整后再记录。stress-v3固定1.4s断言碰上NR冷初始化/异步seek,改为等待实际参数/暂停/seek/窗口状态;installed-transport-v1单项先确认paused seek实际PTS2000ms/fullscreen/restore,再完整v4。失败原始目录均保留,不能引用其QML PASS当最终验收。
+- 性能边界:本机RTX5070/616.56、2K30测试视频。VFG8High明确有实时调度降档,截图瞬时提交约30–31fps;VFG4在RTSS60限制下也降档。兼容稳定通过不代表稳定240fps、物理刷新率、端到端延迟或画质验收。没有新增AMD实卡/OBS捕获/Xbox长稳测试。
+- installed-stress-v4最终恢复原Config/Global逐字节,SHA46e32581…c83/1e44c576…7ca;删除的只是本轮创建的Veyra测试profile。最终matrix-v3也恢复原配置,主RTSS和全部子加载器已退出、remainingOwnedHelpers=0,不停用户其它应用。测试TEMP/TMP仅子进程;全部新产物E:/项目/Veyra/{archives,build,deps,tests,logs,tmp,test-packages}/rtss-restart-loop-20261004。
+- 正在封存本地完整NVIDIA候选、独立逐文件manifest、对应Veyra源码ZIP/patch与交付索引,运行组件全部沿用发布原字节。无merge/push/Release/关机;本轮保存后另记包审计回执。
+
## 2026-10-04 2.0.3 正式发布完成
- 当前用户授权的几项修复、AMD NR、VFG全档位与厂商分包已合入main,发布代码commit `f82f6499ff0db9c36953bcafb752b9be2d7fca4d` / tag `v2.0.3`,普通快进push至nrvideo。桌面64项status与258615-byte working patch逐字节保持;HDR/Dolby PR13/14仍OPEN、未合并。仅本条之后发布记录改变文档,不改变已测产品源树和tag。
diff --git a/i18n/catalog.json b/i18n/catalog.json
index cfe857db..90aa0736 100644
--- a/i18n/catalog.json
+++ b/i18n/catalog.json
@@ -5126,11 +5126,11 @@
"ja": "小"
},
{
- "zh": "小飞机在 Veyra 之后启动。为避免画面卡住,它的 OSD 暂不在 Veyra 里显示。重启后界面改用兼容绘制,OSD 只显示在视频上。现在重启吗?当前播放或串流将停止。",
+ "zh": "检测到 RTSS 屏显服务正在运行。开启兼容绘制需重启 Veyra,重启后 OSD 仅显示在视频上。现在重启吗?当前播放或串流将停止。",
"src": "qml/Main.qml",
- "zh-TW": "小飛機在 Veyra 之後啟動。為避免畫面卡住,它的 OSD 暫不在 Veyra 中顯示。重新啟動後介面改用相容繪製,OSD 只顯示在影片上。現在重新啟動嗎?目前的播放或串流將停止。",
- "en": "RivaTuner started after Veyra. To keep the picture from freezing, its OSD is not shown in Veyra for now. After a restart the interface uses compatible drawing and the OSD shows on the video only. Restart now? Current playback or streaming will stop.",
- "ja": "RivaTuner が Veyra の後に起動しました。映像が止まらないよう、今は Veyra に OSD を表示しません。再起動するとインターフェースが互換描画になり、OSD は映像にだけ表示されます。今すぐ再起動しますか?再生中の映像やストリーミングは停止します。"
+ "zh-TW": "偵測到 RTSS 螢幕顯示服務正在執行。啟用相容繪製需重新啟動 Veyra,重新啟動後 OSD 僅顯示在影片上。現在重新啟動嗎?目前的播放或串流將停止。",
+ "en": "The RTSS on-screen display service is running. Restart Veyra to enable compatible rendering and show the OSD on the video only. Restart now? Current playback or streaming will stop.",
+ "ja": "RTSS オンスクリーン表示サービスが動作しています。互換描画を有効にするには Veyra を再起動してください。再起動後、OSD は映像にだけ表示されます。今すぐ再起動しますか?再生中の映像やストリーミングは停止します。"
},
{
"zh": "尚无导出任务",
@@ -5567,11 +5567,11 @@
"ja": "同じ名前のプリセットがあります。別の名前にすると保存できます"
},
{
- "zh": "已检测到小飞机(RTSS):界面软件绘制,OSD 只显示在视频上;部分阴影与模糊简化",
+ "zh": "监控兼容绘制已启用:OSD 只显示在视频上;部分阴影与模糊简化",
"src": "qml/SettingsPage.qml",
- "zh-TW": "已偵測到小飛機(RTSS):介面軟體繪製,OSD 只顯示在影片上;部分陰影與模糊簡化",
- "en": "RivaTuner (RTSS) detected: the interface is drawn in software and the OSD shows on the video only; some shadows and blur are simplified",
- "ja": "RivaTuner(RTSS)を検出:インターフェースはソフトウェア描画、OSD は映像にだけ表示。一部の影とぼかしは簡略化されます"
+ "zh-TW": "監控相容繪製已啟用:OSD 只顯示在影片上;部分陰影與模糊簡化",
+ "en": "Monitoring compatibility rendering is enabled: the OSD shows on the video only; some shadows and blur are simplified",
+ "ja": "監視ソフト互換描画が有効です。OSD は映像にだけ表示されます。一部の影やぼかしは簡略化されます"
},
{
"zh": "已登录",
@@ -7920,11 +7920,11 @@
"ja": "RivaTuner(RTSS OSD)が Veyra に挿入されています。設定 → モニタリングソフト互換 を「自動」にし、RTSS の実行中に Veyra を再起動してください。インターフェースが互換描画になり、OSD は映像にだけ表示されます"
},
{
- "zh": "检测到小飞机(RTSS)",
+ "zh": "检测到 RTSS 屏显服务",
"src": "qml/Main.qml",
- "zh-TW": "偵測到小飛機(RTSS)",
- "en": "RivaTuner (RTSS) detected",
- "ja": "RivaTuner(RTSS)を検出"
+ "zh-TW": "偵測到 RTSS 螢幕顯示服務",
+ "en": "RTSS on-screen display service detected",
+ "ja": "RTSS オンスクリーン表示サービスを検出"
},
{
"zh": "检测异常增长时自动退出全屏;默认关闭",
diff --git a/include/veyra/gfx/PresentationHooks.h b/include/veyra/gfx/PresentationHooks.h
index 9446d09a..abf6162f 100644
--- a/include/veyra/gfx/PresentationHooks.h
+++ b/include/veyra/gfx/PresentationHooks.h
@@ -9,6 +9,7 @@
// DXGI swapchain and with DLSS frame generation.
#include <windows.h>
#include <psapi.h>
+#include <tlhelp32.h>
#include <algorithm>
#include <iterator>
#include <string>
@@ -44,14 +45,30 @@ inline std::wstring riskyInjections() {
// RivaTuner Statistics Server (MSI Afterburner's OSD, also used by HWiNFO, CapFrameX and
// others) is running: its shared memory exists and is live. True before it has injected
// RTSSHooks64.dll here, which it does to every process that creates windows.
+// An orphan RTSSHooksLoader64 or an already-injected DLL can outlive the server;
+// neither module presence nor the loader process alone means the OSD is active.
+// A force-terminated server can also leave a valid shared-memory signature in
+// clients that kept the mapping open. Require the server process as well.
//
-// Why it matters (reproduced 2026-10-03, RTSS 7.3.7, RTX 5070): RTSS draws on a single
+// Why it matters (reproduced 2026-10-03, RTSS 7.3.5.28314, RTX 5070; version
+// corrected against the executable on 2026-10-04): RTSS draws on a single
// Direct3D 12 swapchain at a time and rebuilds its renderer whenever a different one
// presents. With the interface on D3D12 next to the video's own swapchain, the GPU device
// was removed (DXGI_ERROR_ACCESS_DENIED) about half a second after a video started once its
// OSD had something to draw. With the interface drawn without a swapchain, RTSS only sees
// the video and draws its OSD there.
inline bool rivaTunerRunning() {
+ const HANDLE raw = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (raw == INVALID_HANDLE_VALUE) return false;
+ struct Snapshot { HANDLE handle; ~Snapshot() { CloseHandle(handle); } } snapshot{raw};
+ PROCESSENTRY32W process{};
+ process.dwSize = sizeof(process);
+ bool server = false;
+ for (BOOL found = Process32FirstW(snapshot.handle, &process); found;
+ found = Process32NextW(snapshot.handle, &process)) {
+ if (_wcsicmp(process.szExeFile, L"RTSS.exe") == 0) { server = true; break; }
+ }
+ if (!server) return false;
HANDLE map = OpenFileMappingW(FILE_MAP_READ, FALSE, L"RTSSSharedMemoryV2");
if (!map) return false;
bool live = false;
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index c867f884..4116e40f 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -977,6 +977,7 @@ public:
Q_INVOKABLE void pauseExport(bool paused);
Q_INVOKABLE void quit();
Q_INVOKABLE void restartApplication();
+ Q_INVOKABLE void restartForOverlayCompatibility();
// Returns this page's controls to the engine defaults (the design's
// "重置本页"); it does not touch presets or other pages.
Q_INVOKABLE void resetCurrentPage();
@@ -1064,6 +1065,7 @@ private:
// they can never disagree with each other.
engine::EnhancementSettings settings() const;
void startGpuSampler();
+ void requestApplicationRestart(bool overlayCompatibility);
void updateRunStatus();
void applyPresentation();
void applyAspect(bool force);
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 249ca2bd..eb4c0006 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -640,11 +640,11 @@ Window {
VConfirm {
id: overlayRestart
objectName: "overlay-restart-confirm"
- title: qsTr("检测到小飞机(RTSS)")
- text: qsTr("小飞机在 Veyra 之后启动。为避免画面卡住,它的 OSD 暂不在 Veyra 里显示。重启后界面改用兼容绘制,OSD 只显示在视频上。现在重启吗?当前播放或串流将停止。")
+ title: qsTr("检测到 RTSS 屏显服务")
+ text: qsTr("检测到 RTSS 屏显服务正在运行。开启兼容绘制需重启 Veyra,重启后 OSD 仅显示在视频上。现在重启吗?当前播放或串流将停止。")
acceptText: qsTr("重启")
rejectText: qsTr("稍后")
- onAccepted: veyra.restartApplication()
+ onAccepted: veyra.restartForOverlayCompatibility()
}
Connections {
diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qml
index b1b29831..2fd3fa51 100644
--- a/qml/Veyra/SettingsPage.qml
+++ b/qml/Veyra/SettingsPage.qml
@@ -252,7 +252,7 @@ VPage {
: (automatic !== veyra.overlayCompatActive && (veyra.overlayCompatActive || veyra.rivaTunerRunning()))
? qsTr("重启后生效")
: veyra.overlayCompatActive
- ? qsTr("已检测到小飞机(RTSS):界面软件绘制,OSD 只显示在视频上;部分阴影与模糊简化")
+ ? qsTr("监控兼容绘制已启用:OSD 只显示在视频上;部分阴影与模糊简化")
: automatic
? qsTr("启动时检测到小飞机(RTSS)就改用软件绘制界面,OSD 只显示在视频上")
: qsTr("界面始终用显卡绘制;为避免冲突,小飞机 OSD 不在 Veyra 里显示")
diff --git a/scripts/acceptance/rtss-restart-build.py b/scripts/acceptance/rtss-restart-build.py
new file mode 100644
index 00000000..036554da
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-build.py
@@ -0,0 +1,45 @@
+"""Fresh isolated RTSS repair build with the published dependency configuration."""
+import os
+import subprocess
+import sys
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra')
+TASK = 'rtss-restart-loop-20261004'
+BUILD, TMP, LOGS = (BASE / part / TASK for part in ('build', 'tmp', 'logs'))
+CONTROL = ROOT / 'scripts/acceptance/rtss-restart-control.py'
+subprocess.run([sys.executable, '-B', str(CONTROL)], check=True)
+for p in (BUILD, TMP, LOGS):
+ p.mkdir(parents=True, exist_ok=True)
+settings = []
+for line in (BASE / 'build/release-2.0.3-20261004/CMakeCache.txt').read_text(encoding='utf8').splitlines():
+ if ':' not in line or '=' not in line or line.startswith(('#', '//')):
+ continue
+ keytype, value = line.split('=', 1)
+ key, kind = keytype.split(':', 1)
+ if kind in ('INTERNAL', 'STATIC') or key == 'VEYRA_DISPLAY_VERSION':
+ continue
+ if key.startswith('VEYRA_') or key in ('CMAKE_PREFIX_PATH', 'CMAKE_MAKE_PROGRAM', 'PROTOC', 'PKG_CONFIG_EXECUTABLE'):
+ settings.append(f'set({key} [[{value}]] CACHE {kind} "Published dependency" FORCE)')
+settings.append('set(VEYRA_DISPLAY_VERSION [[2.0.3-rtssfix]] CACHE STRING "Local RTSS repair candidate" FORCE)')
+(TMP / 'dependencies.cmake').write_text('\n'.join(settings), encoding='utf8')
+targets = sys.argv[2:] or ['veyra_qml_ui']
+assert all(t.replace('_', '').isalnum() for t in targets)
+cmd = TMP / 'build.cmd'
+cmd.write_text('@echo off\nchcp 65001 >nul\ncall "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat" >nul 2>&1\nif errorlevel 1 exit /b 4\n"%TASK_CMAKE%" --preset x64-release -S "%TASK_ROOT%" -B "%TASK_BUILD%" -C "%TASK_TMP%\\dependencies.cmake"\nif errorlevel 1 exit /b 5\n"%TASK_CMAKE%" --build "%TASK_BUILD%" --parallel 6 --target ' + ' '.join(targets) + '\nexit /b %errorlevel%\n', encoding='ascii')
+env = os.environ.copy()
+env.update(VSLANG='1033', TASK_ROOT=str(ROOT), TASK_BUILD=str(BUILD), TASK_TMP=str(TMP),
+ TEMP=str(TMP), TMP=str(TMP),
+ TASK_CMAKE='C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe')
+log = LOGS / sys.argv[1]
+with log.open('x', encoding='utf8') as output:
+ try:
+ code = subprocess.run(['cmd.exe', '/d', '/c', str(cmd)], cwd=ROOT, env=env,
+ stdout=output, stderr=subprocess.STDOUT, timeout=890).returncode
+ except subprocess.TimeoutExpired:
+ code = 124
+print('BUILD', code, log)
+print('\n'.join(log.read_text(encoding='utf8', errors='replace').splitlines()[-20:]))
+subprocess.run([sys.executable, '-B', str(CONTROL)], check=True)
+raise SystemExit(code)
diff --git a/scripts/acceptance/rtss-restart-control.py b/scripts/acceptance/rtss-restart-control.py
new file mode 100644
index 00000000..46f854a3
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-control.py
@@ -0,0 +1,21 @@
+"""Scope check for the local RTSS restart-loop repair; no binary/SDK additions."""
+import subprocess
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = '354b1c6e39ba0f62b2e6aac4c161f682dea9c2ff'
+allowed = {'apps/veyra-qml/main.cpp', 'src/ui/QmlPlayerBridge.cpp',
+ 'include/veyra/ui/QmlPlayerBridge.h', 'include/veyra/gfx/PresentationHooks.h',
+ 'qml/Veyra/Main.qml', 'qml/Veyra/SettingsPage.qml', 'i18n/catalog.json',
+ 'docs/WORKLOG.md', 'docs/CURRENT_STATUS.md',
+ 'docs/RTSS_COMPAT_2026-10-03.md',
+ 'docs/FIELD_UPGRADE_ACCEPTANCE_2026-10-03.md',
+ 'docs/RELEASE_2.0.3_ACCEPTANCE_2026-10-04.md',
+ 'docs/RTSS_RESTART_LOOP_PLAN_2026-10-04.md'}
+paths = set(subprocess.check_output(['git', 'diff', '--name-only', BASE], cwd=ROOT).decode().splitlines())
+paths.update(subprocess.check_output(['git', 'ls-files', '--others', '--exclude-standard'], cwd=ROOT).decode().splitlines())
+assert not [p for p in paths if p not in allowed and not p.startswith('scripts/acceptance/rtss-restart-')], paths
+assert not [p for p in paths if Path(p).suffix.lower() in {'.exe', '.dll', '.lib', '.pdb', '.ptx', '.hsaco', '.onnx', '.f16', '.bin'}], paths
+assert subprocess.check_output(['git', 'rev-parse', 'main'], cwd=ROOT).decode().strip() == BASE
+subprocess.run(['git', 'diff', '--check'], cwd=ROOT, check=True)
+print('RTSS repair scope PASS', len(paths), 'source paths; main unchanged')
diff --git a/scripts/acceptance/rtss-restart-deliver.py b/scripts/acceptance/rtss-restart-deliver.py
new file mode 100644
index 00000000..e959d8f1
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-deliver.py
@@ -0,0 +1,99 @@
+"""Finalize the locally tested NVIDIA repair; never alter the published package."""
+import hashlib
+import importlib.util
+import json
+import os
+from pathlib import Path
+import shutil
+import subprocess
+import sys
+
+ROOT=Path(__file__).resolve().parents[2]
+BASE=Path('E:/项目/Veyra');TASK='rtss-restart-loop-20261004'
+OUT=BASE/'test-packages'/TASK; LOGS=BASE/'logs'/TASK; TMP=BASE/'tmp'/TASK
+APP=OUT/'Veyra-2.0.3-rtssfix-NVIDIA-win64-portable'
+PUBLISHED=BASE/'releases/release-2.0.3-20261004/Veyra-2.0.3-NVIDIA-win64-portable'
+def digest(path):
+ with path.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
+def write(path,value):path.write_text(json.dumps(value,ensure_ascii=False,indent=2)+'\n',encoding='utf8')
+def module(name,path):
+ spec=importlib.util.spec_from_file_location(name,path);result=importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(result);return result
+
+subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/rtss-restart-control.py')],check=True)
+assert not subprocess.check_output(['git','status','--porcelain'],cwd=ROOT).strip(),'Commit the reviewed local changes first'
+commit=subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT).decode().strip()
+matrix=json.loads((LOGS/'installed-matrix-v3/summary.json').read_text(encoding='utf8'))
+stress=json.loads((LOGS/'installed-stress-v4/summary.json').read_text(encoding='utf8'))
+assert len(matrix['results'])==11 and len(stress['results'])==3
+assert sum(len(r['cases']) for r in stress['results'])==33
+assert json.loads((LOGS/'installed-stress-v4/cleanup.json').read_text(encoding='utf8'))['profilesRestored']
+assert not json.loads((LOGS/'installed-matrix-v3/cleanup.json').read_text(encoding='utf8'))['remainingOwnedHelpers']
+pkg=module('rtss_qml_package',ROOT/'scripts/package-qml-release.py')
+vendor=module('rtss_vendor_package',ROOT/'scripts/package-vendor-release.py')
+old=json.loads((PUBLISHED/'package-manifest.json').read_text(encoding='utf8'))
+product_changes={'veyra_qml_ui.exe','qml/Veyra/Main.qml','qml/Veyra/SettingsPage.qml'}
+doc_changes={'docs/'+n for n in ('RTSS_COMPAT_2026-10-03.md','FIELD_UPGRADE_ACCEPTANCE_2026-10-03.md','RELEASE_2.0.3_ACCEPTANCE_2026-10-04.md')}
+assert digest(APP/'veyra_qml_ui.exe')==digest(BASE/'build'/TASK/'veyra_qml_ui.exe')
+for name in ('Main.qml','SettingsPage.qml'):
+ assert (APP/'qml/Veyra'/name).read_bytes()==(ROOT/'qml/Veyra'/name).read_bytes(),'Acceptance loader remains'
+for name in doc_changes:
+ if (APP/name).exists():shutil.copy2(ROOT/name,APP/name)
+shutil.copy2(ROOT/'docs/RTSS_RESTART_LOOP_PLAN_2026-10-04.md',APP/'docs/RTSS_RESTART_LOOP_PLAN_2026-10-04.md')
+(APP/'RTSS-修复说明.md').write_text('''# Veyra 2.0.3 RTSS 本地修复版(NVIDIA)
+
+在本目录运行 veyra_qml_ui.exe 即可,组件已齐全。默认监控软件兼容为自动。
+
+修复:孤立 RTSS 加载器或残留共享内存不再被当作 RTSS 屏显服务运行;
+点击兼容重启携带本次启动意图,避免重启后再次弹同一提示。
+提示区分 RTSS 与 MSI Afterburner,软件绘制背景保持不透明。
+
+RTX 5070 / 616.56、用户实际安装的 RTSS 7.3.5.28314:
+11 项启动/重启及 3 套 RTSS 配置 × 11 项真实播放/效果/窗口组合通过。
+包括 NR 参数、最高 RTX 4K 超分、DLSS 2X/6X、XeSS 4X、FSR3.1 2X、
+VFG 2X Low/4X Medium/8X High、暂停/seek/全屏/窗口恢复。
+OSD 2/3 倍、位置、颜色、背景、检测级别、OSD 开关与 60 帧限制实际设置并读回。
+这属于短测;VFG 8X High 在 2K30 实时播放会调度降档,不保证 240 fps。
+
+RTSS 测试配置已恢复,测试主进程与加载器已退出。
+本包没有带入用户配置、测试脚本、媒体或日志;运行组件字节与正式 NVIDIA 2.0.3 包相同。
+本地修复尚未合入 main 或上传 GitHub,原正式包保持原样。
+对应 Veyra 源码 ZIP 在本目录的上级;未变的依赖源码沿用正式 2.0.3 资产。
+''',encoding='utf8')
+changed=[]
+for row in old['files']:
+ assert (PUBLISHED/row['path']).stat().st_size==row['size'] and digest(PUBLISHED/row['path'])==row['sha256'],('Published payload changed',row['path'])
+ if digest(APP/row['path'])!=row['sha256']:changed.append(row['path'])
+assert set(changed)<=product_changes|doc_changes,changed
+assert product_changes<=set(changed),changed
+names=vendor.check_vendor(APP,'NVIDIA')
+for name in names:
+ pkg.validate_payload(name)
+ if name.endswith('.qml'):
+ assert 'scripts/acceptance/rtss-restart-' not in (APP/name).read_text(encoding='utf8',errors='ignore')
+rows=[dict(path=f.relative_to(APP).as_posix(),size=f.stat().st_size,sha256=digest(f))
+ for f in sorted(APP.rglob('*')) if f.is_file() and f.name!='package-manifest.json']
+source_name='Veyra-2.0.3-rtssfix-veyra-source.zip'
+manifest={k:v for k,v in old.items() if k!='files'}
+manifest.update(candidate='2.0.3-rtssfix',displayVersion='2.0.3-rtssfix',baseCommit=commit,sourceArchiveCommit=commit,
+ worktreeDirty=False,releaseReady=False,localOnly=True,
+ publishedBase='f82f6499ff0db9c36953bcafb752b9be2d7fca4d',
+ correspondingSource=dict(application='../'+source_name,dependencies=old['correspondingSource']['dependencies'],
+ instructions='docs/BUILD_2.0.3.md',displayVersionOverride='-DVEYRA_DISPLAY_VERSION=2.0.3-rtssfix'),files=rows)
+write(APP/'package-manifest.json',manifest)
+audit=TMP/'package-audit.py'
+original=(ROOT/'scripts/acceptance/release-2.0.3-package-audit.py').read_text(encoding='utf8')
+assert original.count("TASK='release-2.0.3-20261004'")==1
+audit.write_text(original.replace("TASK='release-2.0.3-20261004'","TASK='"+TASK+"'"),encoding='utf8')
+env=os.environ.copy();env.update(TEMP=str(TMP),TMP=str(TMP))
+subprocess.run([sys.executable,'-B',str(audit),str(APP),'NVIDIA','local-package-audit'],env=env,check=True,timeout=150)
+pkg.source_snapshot(OUT,'2.0.3-rtssfix',digest(APP/'veyra_qml_ui.exe'))
+source=OUT/source_name
+patch=subprocess.check_output(['git','diff','--binary','354b1c6e39ba0f62b2e6aac4c161f682dea9c2ff',commit],cwd=ROOT)
+(BASE/'archives'/TASK/'repair-source.patch').write_bytes(patch)
+write(OUT/'DELIVERY.json',dict(candidate='2.0.3-rtssfix',app=str(APP/'veyra_qml_ui.exe'),appSHA256=digest(APP/'veyra_qml_ui.exe'),
+ sourceCommit=commit,source=str(source),sourceSHA256=digest(source),packageManifestSHA256=digest(APP/'package-manifest.json'),
+ payloadFiles=len(rows),changedPublishedPayload=changed,localOnly=True,releaseReady=False,
+ startupRestartCases=11,rtssParameterCases=33,logs=str(LOGS),
+ limitation='Short RTX5070/616.56 + RTSS7.3.5.28314 test; VFG8 High realtime scheduling reduction observed; no new AMD/OBS/Xbox/long-run validation'))
+print('RTSS LOCAL DELIVERY PASS',commit,len(rows),digest(APP/'veyra_qml_ui.exe'),OUT,flush=True)
diff --git a/scripts/acceptance/rtss-restart-real.py b/scripts/acceptance/rtss-restart-real.py
new file mode 100644
index 00000000..dac47ade
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-real.py
@@ -0,0 +1,245 @@
+"""Installed RTSS Profile API/real OSD/native video parameter test. Profiles restored."""
+import ctypes
+from ctypes import wintypes
+import hashlib
+import json
+import os
+from pathlib import Path
+import shutil
+import subprocess
+import sys
+import time
+
+import psutil
+from PIL import Image, ImageGrab
+
+ROOT=Path(__file__).resolve().parents[2]
+BASE=Path('E:/项目/Veyra'); TASK='rtss-restart-loop-20261004'
+RUN=BASE/'tests'/TASK/sys.argv[1]; LOGS=BASE/'logs'/TASK/sys.argv[1]; TMP=BASE/'tmp'/TASK/sys.argv[1]
+for path in (RUN,LOGS,TMP):path.mkdir(parents=True,exist_ok=False)
+APP=BASE/'test-packages'/TASK/'Veyra-2.0.3-rtssfix-NVIDIA-win64-portable'
+RTSS=Path('E:/App/RivaTuner Statistics Server')
+PROFILE=b'veyra_qml_ui.exe'
+transport_only=len(sys.argv)>2 and sys.argv[2]=='--transport-only'
+expected_cases=1 if transport_only else 11
+started=time.time(); owned=[]; seen={}; cleanup=[]; results=[]
+before={p.name:p.read_bytes() for p in (RTSS/'Profiles').iterdir() if p.is_file()}
+(RUN/'profiles-before').mkdir()
+for name,data in before.items():(RUN/'profiles-before'/name).write_bytes(data)
+
+def helpers():
+ roots={p.pid for p in owned};hits=[]
+ for p in psutil.process_iter(['pid','ppid','name','exe','create_time']):
+ x=p.info
+ if (x['exe'] and Path(x['exe']).parent==RTSS and x['name'].lower().startswith('rtss')
+ and x['create_time']>=started-1 and (x['pid'] in roots or x['ppid'] in roots or seen.get(x['pid'])==x['create_time'])):
+ hits.append(p);seen[x['pid']]=x['create_time']
+ return hits
+def stop():
+ for _ in range(3):
+ found=helpers()
+ if not found:break
+ for p in sorted(found,key=lambda p:p.name().lower()!='rtss.exe'):
+ try:cleanup.append({'pid':p.pid,'name':p.name(),'path':p.exe()});p.terminate()
+ except psutil.NoSuchProcess:pass
+ psutil.wait_procs(found,timeout=3)
+ assert not helpers()
+
+assert not any(p.info['name'].lower()=='rtss.exe' for p in psutil.process_iter(['name'])),'RTSS was already active'
+dll=ctypes.WinDLL(str(RTSS/'RTSSHooks64.dll'),winmode=0x1100)
+for name in ('LoadProfile','SaveProfile','DeleteProfile'):
+ getattr(dll,name).argtypes=[ctypes.c_char_p];getattr(dll,name).restype=None
+for name in ('GetProfileProperty','SetProfileProperty'):
+ getattr(dll,name).argtypes=[ctypes.c_char_p,ctypes.c_void_p,ctypes.c_uint32];getattr(dll,name).restype=ctypes.c_int
+dll.UpdateProfiles.argtypes=[];dll.UpdateProfiles.restype=None
+def set_profile(values):
+ dll.LoadProfile(PROFILE)
+ actual={}
+ for key,value in values.items():
+ number=ctypes.c_uint32(value)
+ assert dll.SetProfileProperty(key.encode(),ctypes.byref(number),4),(key,'SetProfileProperty rejected')
+ dll.SaveProfile(PROFILE);dll.LoadProfile(PROFILE)
+ for key,value in values.items():
+ number=ctypes.c_uint32()
+ assert dll.GetProfileProperty(key.encode(),ctypes.byref(number),4) and number.value==value,(key,value,number.value)
+ actual[key]=number.value
+ dll.UpdateProfiles();return actual
+
+k=ctypes.WinDLL('kernel32');u=ctypes.WinDLL('user32')
+k.OpenFileMappingW.argtypes=[ctypes.c_uint32,ctypes.c_int,ctypes.c_wchar_p];k.OpenFileMappingW.restype=ctypes.c_void_p
+k.MapViewOfFile.argtypes=[ctypes.c_void_p,ctypes.c_uint32,ctypes.c_uint32,ctypes.c_uint32,ctypes.c_size_t];k.MapViewOfFile.restype=ctypes.c_void_p
+k.UnmapViewOfFile.argtypes=[ctypes.c_void_p];k.CloseHandle.argtypes=[ctypes.c_void_p]
+CALLBACK=ctypes.WINFUNCTYPE(ctypes.c_bool,ctypes.c_void_p,ctypes.c_void_p)
+u.EnumWindows.argtypes=[CALLBACK,ctypes.c_void_p];u.EnumChildWindows.argtypes=[ctypes.c_void_p,CALLBACK,ctypes.c_void_p]
+u.GetWindowThreadProcessId.argtypes=[ctypes.c_void_p,ctypes.POINTER(wintypes.DWORD)]
+u.GetClassNameW.argtypes=[ctypes.c_void_p,ctypes.c_wchar_p,ctypes.c_int]
+u.GetClientRect.argtypes=[ctypes.c_void_p,ctypes.POINTER(wintypes.RECT)]
+u.ClientToScreen.argtypes=[ctypes.c_void_p,ctypes.POINTER(wintypes.POINT)]
+u.WindowFromPoint.argtypes=[wintypes.POINT];u.WindowFromPoint.restype=ctypes.c_void_p
+u.SetWindowPos.argtypes=[ctypes.c_void_p,ctypes.c_void_p,ctypes.c_int,ctypes.c_int,ctypes.c_int,ctypes.c_int,ctypes.c_uint]
+def windows(pid,parent=None):
+ found=[]
+ @CALLBACK
+ def callback(hwnd,_):
+ owner=wintypes.DWORD();u.GetWindowThreadProcessId(hwnd,ctypes.byref(owner));name=ctypes.create_unicode_buffer(256)
+ u.GetClassNameW(hwnd,name,256)
+ if owner.value==pid:found.append((hwnd,name.value))
+ return True
+ if parent:u.EnumChildWindows(parent,callback,None)
+ else:u.EnumWindows(callback,None)
+ return found
+def native_capture(pid,path):
+ for root,cls in windows(pid):
+ if not cls.startswith('Qt'):continue
+ video=next((h for h,c in windows(pid,root) if c=='VeyraQmlVideoHost'),None)
+ if not video:continue
+ u.SetWindowPos(root,ctypes.c_void_p(-1),0,0,0,0,0x13)
+ rect=wintypes.RECT();point=wintypes.POINT(0,0)
+ assert u.GetClientRect(video,ctypes.byref(rect)) and u.ClientToScreen(video,ctypes.byref(point))
+ w,h=rect.right,rect.bottom
+ for x,y in ((8,8),(w-9,8),(8,h-9),(w-9,h-9),(w//2,h//2)):
+ owner=wintypes.DWORD();u.GetWindowThreadProcessId(u.WindowFromPoint(wintypes.POINT(point.x+x,point.y+y)),ctypes.byref(owner))
+ assert owner.value==pid,'Owned native client is occluded; no unrelated window captured'
+ image=ImageGrab.grab(bbox=(point.x,point.y,point.x+w,point.y+h),all_screens=True).convert('RGB');image.save(path)
+ assert max(image.resize((32,32)).getextrema()[0])>30,'Black native video capture'
+ return {'rect':[point.x,point.y,w,h],'file':str(path)}
+ raise AssertionError('No native video HWND')
+
+# Use Windows atomics and SDK-derived offsets, not hand-computed struct layouts.
+atomic=TMP/'atomic.cpp'
+atomic.write_text('''#include <windows.h>
+#include <intrin.h>
+#include <cstddef>
+#include "RTSSSharedMemory.h"
+extern "C" __declspec(dllexport) long try_lock(volatile long* p){return _InterlockedCompareExchange(p,1,0);}
+extern "C" __declspec(dllexport) void unlock(volatile long* p){_InterlockedExchange(p,0);}
+extern "C" __declspec(dllexport) unsigned long app_osd_offset(){return offsetof(RTSS_SHARED_MEMORY::RTSS_SHARED_MEMORY_APP_ENTRY,dwOSDX);}
+extern "C" __declspec(dllexport) unsigned long app_frames_offset(){return offsetof(RTSS_SHARED_MEMORY::RTSS_SHARED_MEMORY_APP_ENTRY,dwTime0);}
+extern "C" __declspec(dllexport) unsigned long busy_offset(){return offsetof(RTSS_SHARED_MEMORY,dwBusy);}
+''',encoding='ascii')
+cmd=TMP/'atomic.cmd'
+cmd.write_text('@echo off\ncall "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat" >nul 2>&1\ncl /nologo /LD /O2 /MD /I"%TASK_RTSS%\\SDK\\Include" /Fe:"%TASK_TMP%\\atomic.dll" /Fo:"%TASK_TMP%\\atomic.obj" "%TASK_TMP%\\atomic.cpp"\n',encoding='ascii')
+env=os.environ.copy();env.update(TASK_TMP=str(TMP),TASK_RTSS=str(RTSS),TEMP=str(TMP),TMP=str(TMP))
+with (LOGS/'atomic-build.log').open('xb') as log:subprocess.run(['cmd.exe','/d','/c',str(cmd)],cwd=TMP,env=env,stdout=log,stderr=subprocess.STDOUT,timeout=60,check=True)
+atom=ctypes.WinDLL(str(TMP/'atomic.dll'));atom.try_lock.argtypes=[ctypes.POINTER(ctypes.c_long)];atom.try_lock.restype=ctypes.c_long;atom.unlock.argtypes=[ctypes.POINTER(ctypes.c_long)]
+for name in ('app_osd_offset','app_frames_offset','busy_offset'):
+ getattr(atom,name).argtypes=[];getattr(atom,name).restype=ctypes.c_uint32
+offsets={name:getattr(atom,name)() for name in ('app_osd_offset','app_frames_offset','busy_offset')}
+(LOGS/'sdk-offsets.json').write_text(json.dumps(offsets,indent=2),encoding='utf8')
+def osd(view,text,pid,release=False):
+ head=(ctypes.c_uint32*9).from_address(view)
+ assert head[0]==0x52545353 and head[1]>=0x2000e and 4608<=head[5]<=400000 and 2<=head[7]<=128
+ busy=ctypes.cast(view+offsets['busy_offset'],ctypes.POINTER(ctypes.c_long))
+ if atom.try_lock(busy)!=0:return None
+ owner=b'VeyraRtssAcceptance20261004';entry=None
+ try:
+ for n in range(1,head[7]):
+ at=view+head[6]+n*head[5];name=ctypes.string_at(at+256,256).split(b'\0',1)[0]
+ if name==owner or (not name and not release):entry=at;break
+ if entry:
+ if release:ctypes.memset(entry,0,head[5])
+ else:
+ ctypes.memmove(entry+256,owner+b'\0',len(owner)+1)
+ encoded=text.encode('ascii');ctypes.memset(entry+512,0,4096);ctypes.memmove(entry+512,encoded,len(encoded))
+ head[8]+=1
+ entries=[]
+ for n in range(head[4]):
+ at=view+head[3]+n*head[2]
+ if ctypes.c_uint32.from_address(at).value==pid:
+ fields=(ctypes.c_uint32*5).from_address(at+offsets['app_osd_offset'])
+ counters=(ctypes.c_uint32*3).from_address(at+offsets['app_frames_offset'])
+ entries.append({'pid':pid,'osdX':fields[0],'osdY':fields[1],'zoom':fields[2],'color':fields[3],'osdFrame':fields[4],
+ 'frames':counters[2],'rtssPresentFps':1000*counters[2]/(counters[1]-counters[0]) if counters[1]>counters[0]>0 else None,'globalOsdFrame':head[8]})
+ return entries
+ finally:atom.unlock(busy)
+
+media=BASE/'tests'/TASK/'rtss-stress-2k30.mp4'
+if not media.exists():
+ with (LOGS/'fixture.log').open('xb') as log:
+ subprocess.run(['ffmpeg','-v','warning','-n','-f','lavfi','-i','testsrc2=size=2560x1440:rate=30','-t','150','-c:v','libx264','-preset','ultrafast','-crf','28','-pix_fmt','yuv420p','-threads','4',str(media)],env=env,stdout=log,stderr=subprocess.STDOUT,timeout=120,check=True)
+main=APP/'qml/Veyra/Main.qml';original=main.read_bytes();view=None;handle=None
+profiles=[
+ ('low-osd',{'AppDetectionLevel':1,'EnableOSD':1,'ZoomRatio':2,'PositionX':16,'PositionY':16,'EnableBgnd':1,'EnableStat':1,'BaseColor':0x00ff8000,'FramerateLimit':0}),
+ ('high-large-osd',{'AppDetectionLevel':3,'EnableOSD':1,'ZoomRatio':3,'PositionX':24,'PositionY':24,'EnableBgnd':0,'EnableStat':1,'BaseColor':0x0000ff00,'FramerateLimit':0}),
+ ('medium-osd-off-cap60',{'AppDetectionLevel':2,'EnableOSD':0,'ZoomRatio':1,'PositionX':48,'PositionY':32,'EnableBgnd':1,'EnableStat':0,'BaseColor':0x00ff8000,'FramerateLimit':60}),
+]
+if transport_only:profiles=profiles[:1]
+try:
+ shutil.copy2(BASE/'build'/TASK/'veyra_qml_ui.exe',APP/'veyra_qml_ui.exe')
+ for name,values in profiles:
+ stop();actual=set_profile(values)
+ out=RUN/name;logs=LOGS/name;tmp=TMP/name
+ for p in (out,logs,tmp):p.mkdir()
+ (logs/'rtss-profile.json').write_text(json.dumps(actual,indent=2),encoding='utf8')
+ si=subprocess.STARTUPINFO();si.dwFlags|=subprocess.STARTF_USESHOWWINDOW;si.wShowWindow=0
+ server_env=os.environ.copy();server_env.update(__COMPAT_LAYER='RunAsInvoker',TEMP=str(tmp),TMP=str(tmp))
+ server=subprocess.Popen([str(RTSS/'RTSS.exe')],cwd=RTSS,env=server_env,startupinfo=si,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL);owned.append(server)
+ deadline=time.monotonic()+15
+ while time.monotonic()<deadline:
+ handle=k.OpenFileMappingW(0xf001f,False,'RTSSSharedMemoryV2')
+ if handle:
+ view=k.MapViewOfFile(handle,0xf001f,0,0,0)
+ if view and ctypes.c_uint32.from_address(view).value==0x52545353:break
+ if view:k.UnmapViewOfFile(view);view=None
+ k.CloseHandle(handle);handle=None
+ time.sleep(.1)
+ assert view,'Installed RTSS did not create shared memory'
+ time.sleep(1.5)
+ source=original.decode('utf8');at=source.rfind('}')
+ loader='\nLoader { source: '+json.dumps((ROOT/'scripts/acceptance/rtss-restart-stress.qml').as_uri())+'; onLoaded: { item.media='+json.dumps(str(media))+';item.evidence='+json.dumps(str(out))+' } }\n'
+ if transport_only:loader=loader.replace('item.media=','item.cases=[item.cases[10]];item.media=',1)
+ main.write_text(source[:at]+loader+source[at:],encoding='utf8')
+ profile=out/'profile';profile.mkdir();(profile/'qml-preferences.v1.json').write_text('{"language":"zh-CN","overlayCompat":"auto"}',encoding='utf8')
+ app_env={key:value for key,value in os.environ.items() if key.upper() not in ('QT_QUICK_BACKEND','QT_QPA_PLATFORM','VEYRA_UI_RHI','VEYRA_TEST_IGNORE_RTSS','RTSSHOOKSPROFILEOVERRIDE')}
+ app_env.update(TEMP=str(tmp),TMP=str(tmp),VEYRA_LOG_FILE=str(logs/'app.log'),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1')
+ snapshots=[];captured=set();deadline=time.monotonic()+255
+ with (logs/'console.log').open('xb') as console:
+ process=subprocess.Popen([str(APP/'veyra_qml_ui.exe'),'--data-dir',str(profile),'--page','pro','--exit-after','240000','--reduced-motion'],cwd=APP,env=app_env,stdout=console,stderr=subprocess.STDOUT);owned.append(process)
+ while process.poll() is None and time.monotonic()<deadline:
+ data=osd(view,'VEYRA RTSS '+name+'\nREAL OSD / NR SR FG TEST',process.pid)
+ if data:snapshots.append(data[-1])
+ for shot in out.glob('*-ui.png'):
+ if shot.name in captured:continue
+ # The PNG path appears before Qt finishes writing its IDAT.
+ # Retry the same shot on the next tick; don't skip evidence.
+ try:
+ with Image.open(shot) as source:ui=source.convert('RGBA')
+ except OSError:
+ continue
+ assert ui.getpixel((12,80))[3]==255
+ info=native_capture(process.pid,out/(shot.stem.replace('-ui','-native')+'.png'))
+ captured.add(shot.name)
+ info['case']=shot.stem; (logs/(shot.stem+'.json')).write_text(json.dumps(info,indent=2),encoding='utf8')
+ time.sleep(.15)
+ code=process.wait(timeout=5)
+ text=(logs/'app.log').read_text(encoding='utf8',errors='replace')
+ (logs/'native-stats.json').write_text(json.dumps(snapshots,indent=2),encoding='utf8')
+ assert code==0 and f'RTSS_STRESS_PASS {expected_cases}' in text and 'RTSS_STRESS_FAIL' not in text,(name,code,text[-6000:])
+ assert '[ERROR]' not in text and '[FATAL]' not in text,'Product/QML error; inspect app.log'
+ assert str(RTSS/'RTSSHooks64.dll').replace('/','\\') in text,'Hook module did not come from the installed directory'
+ assert len(captured)==expected_cases,(name,captured)
+ if values['EnableOSD']:
+ assert any(x['osdFrame']>0 for x in snapshots),'OSD was not consumed by the native renderer'
+ assert any(x['zoom']==values['ZoomRatio'] for x in snapshots),'Actual OSD zoom does not match profile'
+ assert any(x['osdX']==values['PositionX'] and x['osdY']==values['PositionY'] and x['color']==values['BaseColor'] for x in snapshots),'Native OSD position/color do not match profile'
+ cases=[json.loads(line.split('RTSS_STRESS_CASE ',1)[1]) for line in text.splitlines() if 'RTSS_STRESS_CASE ' in line]
+ assert len(cases)==expected_cases
+ results.append({'rtssProfile':actual,'cases':cases,'screenshots':len(captured),'rtssNativeSnapshots':snapshots[::20],'exit':code})
+ (logs/'native-stats.json').write_text(json.dumps(snapshots,indent=2),encoding='utf8')
+ osd(view,'',process.pid,True);k.UnmapViewOfFile(view);view=None;k.CloseHandle(handle);handle=None
+ stop();print('INSTALLED RTSS PARAMETER PASS',name,len(cases),flush=True)
+finally:
+ main.write_bytes(original)
+ if view:
+ osd(view,'',0,True);k.UnmapViewOfFile(view)
+ if handle:k.CloseHandle(handle)
+ for p in owned:
+ if p.poll() is None and p.args[0]==str(APP/'veyra_qml_ui.exe'):p.terminate();p.wait(timeout=5)
+ stop()
+ dll.DeleteProfile(PROFILE)
+ for name,data in before.items():(RTSS/'Profiles'/name).write_bytes(data)
+ restored={p.name:p.read_bytes() for p in (RTSS/'Profiles').iterdir() if p.is_file()}
+ assert restored==before,'Installed RTSS profiles were not restored byte for byte'
+ (LOGS/'cleanup.json').write_text(json.dumps({'helpersStopped':cleanup,'remainingOwnedHelpers':len(helpers()),'profilesRestored':True,'profileSHA256':{n:hashlib.sha256(v).hexdigest() for n,v in restored.items()}},indent=2),encoding='utf8')
+(LOGS/'summary.json').write_text(json.dumps({'rtssExecutable':str(RTSS/'RTSS.exe'),'rtssSHA256':hashlib.sha256((RTSS/'RTSS.exe').read_bytes()).hexdigest(),'results':results},indent=2),encoding='utf8')
+print('INSTALLED RTSS REAL OSD PASS',len(results),LOGS)
diff --git a/scripts/acceptance/rtss-restart-stress.qml b/scripts/acceptance/rtss-restart-stress.qml
new file mode 100644
index 00000000..0edcb3f7
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-stress.qml
@@ -0,0 +1,131 @@
+import QtQuick
+Item {
+ id: test
+ property var appWindow: Window.window
+ property string media: ""
+ property string evidence: ""
+ property int index: -1
+ property int ticks: 0
+ property int waited: 0
+ property int settling: 0
+ property double before: 0
+ property bool captured: false
+ property int transportPhase: 0
+ property int transportTicks: 0
+ property var cases: [
+ {name:"plain",nr:false,sr:false,fg:"",m:2,q:1},
+ {name:"nr-parameters",nr:true,sr:false,fg:"",m:2,q:1},
+ {name:"nr-rtx-highest-4k",nr:true,sr:true,fg:"",m:2,q:1},
+ {name:"nr-rtx-dlss2",nr:true,sr:true,fg:"dlss",m:2,q:1},
+ {name:"dlss6",nr:false,sr:false,fg:"dlss",m:6,q:1},
+ {name:"xess4",nr:false,sr:false,fg:"xess",m:4,q:1},
+ {name:"fsr3-2",nr:false,sr:false,fg:"fsr3",m:2,q:1},
+ {name:"vfg2-low",nr:false,sr:false,fg:"vfg",m:2,q:0},
+ {name:"vfg4-medium",nr:false,sr:false,fg:"vfg",m:4,q:1},
+ {name:"vfg8-high",nr:false,sr:false,fg:"vfg",m:8,q:2},
+ {name:"nr-resize-pause-seek",nr:true,sr:false,fg:"",m:2,q:1}
+ ]
+ function require(ok, message) {
+ if (ok) return
+ timer.stop()
+ console.error("RTSS_STRESS_FAIL", index, message, veyra.statusText, veyra.backendWarning)
+ Qt.quit()
+ throw new Error(message)
+ }
+ function next() {
+ ++index; waited=0; settling=0; captured=false; transportPhase=0; transportTicks=0
+ if (index === cases.length) {
+ console.log("RTSS_STRESS_PASS", cases.length, "version="+veyra.version)
+ Qt.quit(); return
+ }
+ const c=cases[index]
+ veyra.fgEnabled=false
+ veyra.nrEnabled=c.nr; veyra.srEnabled=c.sr
+ veyra.nrIntensity=0.45; veyra.nrTone=0.2; veyra.nrStructure=0.3; veyra.nrSkin=0.25
+ veyra.videoSrQuality=4; veyra.srTargetIndex=2
+ if (c.fg.length) {
+ veyra.fgBackendName=c.fg; veyra.fgMultiplier=c.m; veyra.vfgQuality=c.q
+ veyra.fgEnabled=true
+ }
+ before=veyra.position
+ console.log("RTSS_STRESS_REQUEST", c.name)
+ }
+ Connections {
+ target: veyra
+ function onOverlayRestartSuggested() { test.require(false,"live server was detected before launch; another restart is invalid") }
+ function onNotice(message,error) { console.log("RTSS_STRESS_NOTICE",message,error) }
+ }
+ Timer {
+ id: timer
+ interval: 200; repeat: true; running: true
+ onTriggered: {
+ if (++test.ticks > 1150) { test.require(false,"230-second deadline"); return }
+ if (!test.media.length) return
+ test.require(vySoftwareUi && veyra.overlayCompatActive && veyra.rivaTunerRunning(),"real RTSS compatibility missing")
+ test.require(test.appWindow.color.a === 1,"transparent software background")
+ test.require(!veyra.failed,"source/GPU failure")
+ if (test.index === -1) {
+ if (test.ticks === 5) {
+ test.appWindow.page="pro"; test.appWindow.requestActivate()
+ veyra.muted=true; veyra.nrEnabled=false; veyra.srEnabled=false; veyra.fgEnabled=false
+ veyra.openPath(test.media)
+ }
+ if (veyra.running && veyra.hasSource && !veyra.applying) test.next()
+ return
+ }
+ const c=test.cases[test.index]
+ ++test.waited
+ if (test.waited > 140) { test.require(false,"backend transition deadline"); return }
+ if (veyra.applying || test.waited < 22 || !veyra.running) return
+ if (veyra.nrActive !== c.nr || veyra.srActive !== c.sr || veyra.fgActive !== !!c.fg.length) return
+ if (c.fg.length && (veyra.fgBackendName !== c.fg || veyra.fgMultiplier !== c.m)) return
+ if (c.name === "nr-resize-pause-seek") {
+ // Wait for real state acknowledgements, including a cold NR
+ // initialization; transport/window changes are asynchronous.
+ if (test.transportPhase === 0) {
+ test.appWindow.width=1100; test.appWindow.height=680
+ veyra.togglePlayPause(); test.transportPhase=1; return
+ }
+ if (test.transportPhase === 1) {
+ if (!veyra.paused) return
+ veyra.seekTo(2); test.transportPhase=2; return
+ }
+ if (test.transportPhase === 2) {
+ test.require(veyra.paused,"pause was lost while seeking")
+ if (Math.abs(veyra.position-2)>=0.6) return
+ console.log("RTSS_STRESS_SEEK",veyra.position)
+ veyra.togglePlayPause(); test.before=2
+ test.appWindow.page="min"; test.appWindow.toggleFullscreen()
+ test.transportPhase=3; return
+ }
+ if (test.transportPhase === 3) {
+ if (!test.appWindow.fullscreen) return
+ if (++test.transportTicks<10) return
+ console.log("RTSS_STRESS_FULLSCREEN",test.appWindow.fullscreen)
+ test.appWindow.toggleFullscreen(); test.appWindow.page="pro"
+ test.transportPhase=4; return
+ }
+ if (test.transportPhase === 4) {
+ if (test.appWindow.fullscreen) return
+ console.log("RTSS_STRESS_WINDOW_RESTORED",!test.appWindow.fullscreen)
+ test.transportPhase=5
+ }
+ }
+ if (veyra.paused) return
+ if (veyra.position < test.before+0.5) return
+ if (!test.captured) {
+ test.captured=true
+ const state={name:c.name,position:veyra.position,detail:veyra.runStatusDetail,
+ nr:veyra.nrActive,sr:veyra.srActive,fg:veyra.fgActive,backend:veyra.fgBackendName,
+ multiplier:veyra.fgMultiplier,quality:veyra.vfgQuality,submitFps:veyra.submitFps,
+ intensity:veyra.nrIntensity,tone:veyra.nrTone,structure:veyra.nrStructure,skin:veyra.nrSkin}
+ console.log("RTSS_STRESS_CASE",JSON.stringify(state))
+ test.appWindow.contentItem.grabToImage(result=>{
+ test.require(result.saveToFile(test.evidence+"/"+c.name+"-ui.png"),"UI screenshot failed")
+ })
+ return
+ }
+ if (++test.settling>8) test.next()
+ }
+ }
+}
diff --git a/scripts/acceptance/rtss-restart-tests.py b/scripts/acceptance/rtss-restart-tests.py
new file mode 100644
index 00000000..3f198531
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-tests.py
@@ -0,0 +1,242 @@
+"""Real orphan hook/server, Qt dialog, detached replacement, and owned-child cleanup."""
+import ctypes
+import hashlib
+import json
+import os
+import shutil
+import subprocess
+import sys
+import time
+from pathlib import Path
+
+import psutil
+from PIL import Image
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra')
+TASK = 'rtss-restart-loop-20261004'
+RUN = BASE / 'tests' / TASK / sys.argv[1]
+LOGS = BASE / 'logs' / TASK / sys.argv[1]
+TMP = BASE / 'tmp' / TASK / sys.argv[1]
+APP = BASE / 'test-packages' / TASK / 'Veyra-2.0.3-rtssfix-NVIDIA-win64-portable'
+PUBLISHED = BASE / 'releases/release-2.0.3-20261004/Veyra-2.0.3-NVIDIA-win64-portable'
+RTSS = Path(sys.argv[2]) if len(sys.argv) > 2 else BASE / 'deps' / TASK / 'rtss'
+installed_profiles = {}
+for path in (RUN, LOGS, TMP):
+ path.mkdir(parents=True, exist_ok=False)
+
+subprocess.run([sys.executable, '-B', str(ROOT / 'scripts/acceptance/rtss-restart-control.py')], check=True)
+manifest = json.loads((PUBLISHED / 'package-manifest.json').read_text(encoding='utf8'))
+if not APP.exists():
+ APP.mkdir(parents=True)
+ for entry in manifest['files']:
+ source = PUBLISHED / entry['path']
+ assert hashlib.sha256(source.read_bytes()).hexdigest() == entry['sha256'], source
+ dest = APP / entry['path']
+ dest.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copy2(source, dest)
+ shutil.copy2(BASE / 'build' / TASK / 'veyra_qml_ui.exe', APP / 'veyra_qml_ui.exe')
+ for name in ('Main.qml', 'SettingsPage.qml'):
+ shutil.copy2(ROOT / 'qml/Veyra' / name, APP / 'qml/Veyra' / name)
+if not RTSS.exists():
+ RTSS.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copytree(BASE / 'deps/rtss-overlay-20261002', RTSS)
+if len(sys.argv) > 2:
+ backup = RUN / 'installed-profiles-before'
+ backup.mkdir()
+ for profile in (RTSS / 'Profiles').iterdir():
+ if profile.is_file():
+ installed_profiles[profile.name] = profile.read_bytes()
+ (backup / profile.name).write_bytes(profile.read_bytes())
+shutil.copy2(BASE / 'build' / TASK / 'veyra_qml_ui.exe', APP / 'veyra_qml_ui.exe')
+for name in ('Main.qml', 'SettingsPage.qml'):
+ shutil.copy2(ROOT / 'qml/Veyra' / name, APP / 'qml/Veyra' / name)
+
+kernel = ctypes.WinDLL('kernel32', use_last_error=True)
+kernel.OpenFileMappingW.argtypes = [ctypes.c_ulong, ctypes.c_int, ctypes.c_wchar_p]
+kernel.OpenFileMappingW.restype = ctypes.c_void_p
+kernel.MapViewOfFile.argtypes = [ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_size_t]
+kernel.MapViewOfFile.restype = ctypes.c_void_p
+kernel.UnmapViewOfFile.argtypes = [ctypes.c_void_p]
+kernel.CloseHandle.argtypes = [ctypes.c_void_p]
+
+def server_live():
+ if not any(p.info['name'] and p.info['name'].lower() == 'rtss.exe'
+ for p in psutil.process_iter(['name'])):
+ return False
+ handle = kernel.OpenFileMappingW(4, False, 'RTSSSharedMemoryV2')
+ if not handle:
+ return False
+ view = kernel.MapViewOfFile(handle, 4, 0, 0, 4)
+ try:
+ return bool(view and ctypes.c_uint32.from_address(view).value == 0x52545353)
+ finally:
+ if view:
+ kernel.UnmapViewOfFile(view)
+ kernel.CloseHandle(handle)
+
+started = time.time()
+owned = []
+seen_helpers = {}
+cleanup = []
+assert not server_live(), 'A live external RTSS server would invalidate this isolated test'
+
+def owned_helpers():
+ hits = []
+ roots = {p.pid for p in owned}
+ for process in psutil.process_iter(['pid', 'ppid', 'name', 'exe', 'create_time']):
+ value = process.info
+ if (value['exe'] and Path(value['exe']).parent == RTSS
+ and value['create_time'] >= started - 1 and value['name'].lower().startswith('rtss')
+ and (value['pid'] in roots or value['ppid'] in roots
+ or seen_helpers.get(value['pid']) == value['create_time'])):
+ hits.append(process)
+ seen_helpers[value['pid']] = value['create_time']
+ return hits
+
+def stop_helpers():
+ # Terminate only helpers from this task's private RTSS copy. Closing just
+ # RTSS.exe previously left RTSSHooksLoader64.exe installed as a global hook.
+ for _ in range(3):
+ hits = owned_helpers()
+ if not hits:
+ break
+ for process in sorted(hits, key=lambda p: p.name().lower() != 'rtss.exe'):
+ try:
+ cleanup.append({'pid': process.pid, 'name': process.name(), 'path': process.exe()})
+ process.terminate()
+ except psutil.NoSuchProcess:
+ pass
+ psutil.wait_procs(hits, timeout=3)
+ assert not owned_helpers(), 'Owned RTSS helpers remain'
+ assert not server_live(), 'RTSS server process still active'
+
+def start_helper(name):
+ si = subprocess.STARTUPINFO()
+ si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+ si.wShowWindow = 0
+ args = [str(RTSS / name)] + (['/i'] if 'Loader' in name else [])
+ # The loader requests administrator privileges for hooking elevated apps.
+ # Our own test window does not need them: keep this private helper at the
+ # caller's normal integrity level, with no UAC prompt or privilege gain.
+ helper_env = os.environ.copy()
+ helper_env.update(__COMPAT_LAYER='RunAsInvoker', TEMP=str(TMP), TMP=str(TMP))
+ process = subprocess.Popen(args, cwd=RTSS, env=helper_env, startupinfo=si,
+ stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ owned.append(process)
+ deadline = time.monotonic() + 10
+ while name == 'RTSS.exe' and not server_live() and time.monotonic() < deadline:
+ time.sleep(.1)
+ if name == 'RTSS.exe':
+ assert server_live(), 'Real RTSS did not publish its live server state'
+ else:
+ time.sleep(.7)
+ assert not server_live(), 'Orphan loader unexpectedly has a live server'
+
+main = APP / 'qml/Veyra/Main.qml'
+original = main.read_bytes()
+results = []
+cases = [
+ ('clean', False, False, False, False, False, False, 'check'),
+ ('orphan', False, True, False, False, False, False, 'check'),
+ ('automatic-live', True, False, True, True, False, False, 'check'),
+ ('off-live', True, False, False, False, True, False, 'check'),
+ ('forced-live', True, False, False, False, False, True, 'check'),
+ ('obs-live', True, False, True, False, False, False, 'check'),
+ ('accepted-without-server', False, False, True, True, False, False, 'check'),
+ ('accepted-off', True, False, False, False, True, False, 'check'),
+ ('normal-restart', False, False, False, False, False, False, 'normal'),
+ ('normal-after-accepted', False, False, True, True, False, False, 'normal'),
+ ('late-real-restart', False, False, False, False, False, False, 'late'),
+]
+
+try:
+ for name, live, orphan, software, compatibility, off, forced, mode in cases:
+ stop_helpers()
+ out, logs, tmp = RUN / name, LOGS / name, TMP / name
+ for path in (out, logs, tmp):
+ path.mkdir()
+ profile = out / 'profile'
+ profile.mkdir()
+ (profile / 'qml-preferences.v1.json').write_text(json.dumps({'language': 'zh-CN', 'overlayCompat': 'off' if off else 'auto', 'uiScale': 0}), encoding='utf8')
+ source = original.decode('utf8')
+ loader = '\nLoader { source: ' + json.dumps((ROOT / 'scripts/acceptance/rtss-restart-ui.qml').as_uri()) + '; onLoaded: { '
+ loader += 'item.mode=' + json.dumps(mode) + ';item.evidence=' + json.dumps(str(out)) + ';'
+ loader += f'item.expectedSoftware={str(software).lower()};item.expectedCompatibility={str(compatibility).lower()};item.expectedServer={str(live).lower()};' + ' } }\n'
+ at = source.rfind('}')
+ main.write_text(source[:at] + loader + source[at:], encoding='utf8')
+ if live:
+ start_helper('RTSS.exe')
+ elif orphan:
+ start_helper('RTSSHooksLoader64.exe')
+ env = {k: v for k, v in os.environ.items() if k.upper() not in ('QT_QPA_PLATFORM', 'QT_QUICK_BACKEND', 'VEYRA_UI_RHI', 'VEYRA_TEST_IGNORE_RTSS', 'VEYRA_LOG_FILE')}
+ env.update(TEMP=str(tmp), TMP=str(tmp), VEYRA_LOG_FILE=str(logs / 'app.log'), QML_DISABLE_DISK_CACHE='1', QT_FORCE_STDERR_LOGGING='1')
+ if forced:
+ env['VEYRA_UI_RHI'] = 'd3d12'
+ args = [str(APP / 'veyra_qml_ui.exe'), '--data-dir', str(profile), '--page', 'home', '--exit-after', '25000', '--reduced-motion']
+ if name == 'obs-live':
+ args.append('--obs-game-capture')
+ if name in ('accepted-without-server', 'accepted-off', 'normal-after-accepted'):
+ args.append('--overlay-compat-restart')
+ with (logs / 'console.log').open('xb') as console:
+ process = subprocess.Popen(args, cwd=APP, env=env, stdout=console, stderr=subprocess.STDOUT)
+ owned.append(process)
+ if mode == 'late':
+ time.sleep(3.5)
+ start_helper('RTSS.exe')
+ code = process.wait(timeout=32)
+ assert code == 0, (name, code)
+ children = []
+ if mode in ('late', 'normal'):
+ deadline = time.monotonic() + 20
+ while time.monotonic() < deadline:
+ running = []
+ for child in psutil.process_iter(['pid', 'exe', 'cmdline', 'create_time']):
+ value = child.info
+ if value['exe'] and Path(value['exe']) == APP / 'veyra_qml_ui.exe' and str(profile) in (value['cmdline'] or []):
+ running.append(child)
+ if value['pid'] not in [x['pid'] for x in children]:
+ children.append({'pid': value['pid'], 'args': value['cmdline']})
+ if not running:
+ break
+ time.sleep(.2)
+ assert children and not running, (name, 'replacement not observed or did not close')
+ app_logs = [logs / 'app.log'] + sorted(logs.glob('veyra-qml-*.log'))
+ text = '\n'.join(p.read_text(encoding='utf8', errors='replace') for p in app_logs if p.exists())
+ assert 'RTSS_RESTART_FAIL' not in text and 'RTSS_RESTART_PASS' in text, (name, text[-4000:])
+ if orphan:
+ assert 'RTSS hook module: activeServer=false path=' in text, 'Real orphan DLL was not injected'
+ assert 'compatibility restart suggested' not in text
+ if mode == 'late':
+ assert text.count('RTSS_RESTART_ACCEPT') == 1
+ assert 'acceptedRestart=true' in text
+ assert '--overlay-compat-restart' in children[0]['args']
+ if mode == 'normal':
+ assert '--overlay-compat-restart' not in children[0]['args']
+ image = Image.open(next(out.glob('*.png'))).convert('RGBA')
+ pixel = image.getpixel((12, 80))
+ if software and mode != 'normal':
+ assert pixel[3] == 255 and max(pixel[:3]) < 160, pixel
+ results.append({'case': name, 'exit': code, 'replacement': children, 'pixel': pixel,
+ 'logFiles': [str(p) for p in app_logs if p.exists()]})
+ print('RTSS CASE PASS', name, flush=True)
+finally:
+ main.write_bytes(original)
+ stop_helpers()
+ for process in owned:
+ if process.poll() is None:
+ process.terminate()
+ process.wait(timeout=5)
+ # Also collect replacement apps after a failed restart test, scoped to this
+ # candidate executable and profiles created under this task's test root.
+ for process in psutil.process_iter(['exe', 'cmdline']):
+ value = process.info
+ if value['exe'] and Path(value['exe']) == APP / 'veyra_qml_ui.exe' and any(str(RUN) in arg for arg in (value['cmdline'] or [])):
+ process.terminate()
+ process.wait(timeout=5)
+ for name, data in installed_profiles.items():
+ (RTSS / 'Profiles' / name).write_bytes(data)
+ assert (RTSS / 'Profiles' / name).read_bytes() == data
+ (LOGS / 'cleanup.json').write_text(json.dumps({'ownedHelpersStopped': cleanup, 'remainingOwnedHelpers': len(owned_helpers()), 'liveServer': server_live()}, indent=2), encoding='utf8')
+(LOGS / 'summary.json').write_text(json.dumps({'results': results, 'ownedHelperCleanup': cleanup}, indent=2), encoding='utf8')
+print('RTSS PRODUCT ACCEPTANCE PASS', len(results), LOGS)
diff --git a/scripts/acceptance/rtss-restart-ui.qml b/scripts/acceptance/rtss-restart-ui.qml
new file mode 100644
index 00000000..fe5b596a
--- /dev/null
+++ b/scripts/acceptance/rtss-restart-ui.qml
@@ -0,0 +1,91 @@
+// Injected only into the local candidate during acceptance, using its real bridge.
+import QtQuick
+Item {
+ id: test
+ property var appWindow: Window.window
+ property string mode: "check"
+ property string evidence: ""
+ property bool expectedSoftware: false
+ property bool expectedCompatibility: false
+ property bool expectedServer: false
+ property int ticks: 0
+ property int suggestions: 0
+ property bool accepting: false
+ property bool finishing: false
+ function find(item, name) {
+ if (item.objectName === name) return item
+ for (const child of item.children || []) {
+ const hit = find(child, name)
+ if (hit) return hit
+ }
+ return null
+ }
+ function require(ok, message) {
+ if (ok) return
+ timer.stop()
+ console.error("RTSS_RESTART_FAIL", mode, message)
+ Qt.quit()
+ throw new Error(message)
+ }
+ function finish(label) {
+ if (finishing) return
+ finishing = true
+ require(suggestions === 0, "replacement/check run suggested another restart")
+ const dialog = find(appWindow.contentItem, "overlay-restart-confirm")
+ require(dialog && !dialog.shown, "unexpected restart dialog")
+ if (vySoftwareUi) require(appWindow.color.a === 1, "software window must be opaque")
+ appWindow.contentItem.grabToImage(result => {
+ require(result.saveToFile(evidence + "/" + label + ".png"), "screenshot not saved")
+ console.log("RTSS_RESTART_PASS", label, "software=" + vySoftwareUi,
+ "compatibility=" + veyra.overlayCompatActive,
+ "server=" + veyra.rivaTunerRunning(), "version=" + veyra.version)
+ Qt.quit()
+ })
+ }
+ Connections {
+ target: veyra
+ function onOverlayRestartSuggested() { test.suggestions++ }
+ }
+ Timer {
+ id: timer
+ interval: 100; repeat: true; running: true
+ onTriggered: {
+ if (++test.ticks > 230) { test.require(false, "23-second deadline"); return }
+ if (!test.evidence.length || test.finishing) return
+ if (test.mode === "late") {
+ if (veyra.overlayCompatActive) {
+ test.require(vySoftwareUi, "compatibility restart did not switch renderer")
+ if (test.ticks > 55) test.finish("late-child")
+ return
+ }
+ if (test.accepting) return
+ const dialog = test.find(test.appWindow.contentItem, "overlay-restart-confirm")
+ if (!dialog || !dialog.shown) return
+ test.require(test.suggestions === 1 && veyra.rivaTunerRunning(), "late prompt needs one suggestion and a live server")
+ const accept = test.find(dialog, "overlay-restart-confirm-accept")
+ test.require(accept !== null, "restart button missing")
+ test.accepting = true
+ console.log("RTSS_RESTART_ACCEPT", "software=" + vySoftwareUi)
+ accept.clicked() // Executes the actual button's QML onClicked/onAccepted path.
+ return
+ }
+ if (test.mode === "normal") {
+ if (veyra.uiScaleActive !== 125) {
+ if (test.ticks < 15 || test.accepting) return
+ test.require(veyra.setPreference("uiScale", 125), "scale setting not saved")
+ test.accepting = true
+ console.log("RTSS_NORMAL_RESTART_ACCEPT")
+ veyra.restartApplication()
+ return
+ }
+ test.require(!vySoftwareUi && !veyra.overlayCompatActive, "normal restart retained a compatibility latch")
+ if (test.ticks > 55) test.finish("normal-child")
+ return
+ }
+ test.require(vySoftwareUi === test.expectedSoftware, "wrong UI renderer")
+ test.require(veyra.overlayCompatActive === test.expectedCompatibility, "wrong compatibility state")
+ test.require(veyra.rivaTunerRunning() === test.expectedServer, "wrong server state")
+ if (test.ticks > 55) test.finish("check")
+ }
+ }
+}
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index f3151bbe..db825fbf 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -1216,6 +1216,12 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
handled = true;
veyra::log::warn("overlay-hooks", std::format("{} is injected into this process ({})",
hook->product, QString::fromWCharArray(hook->module).toStdString()));
+ if (GetModuleHandleW(L"RTSSHooks64.dll")) {
+ wchar_t path[32768]{};
+ GetModuleFileNameW(GetModuleHandleW(L"RTSSHooks64.dll"), path, DWORD(std::size(path)));
+ veyra::log::info("overlay-hooks", std::format("RTSS hook module: activeServer={} path={}",
+ gfx::rivaTunerRunning(), QString::fromWCharArray(path).toStdString()));
+ }
}
// RivaTuner arrived after a start with the interface on the GPU (it was not running
// then, see main.cpp). Its OSD stays out of this process (RTSSHooksProfileOverride),
@@ -1223,15 +1229,16 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
// OSD on the video.
static bool rivaTunerLate = false;
if (!rivaTunerLate && !qApp->property("veyraSoftwareUi").toBool() && !qApp->property("veyraUiRendererForced").toBool()
- && GetModuleHandleW(L"RTSSHooks64.dll")) {
+ && GetModuleHandleW(L"RTSSHooks64.dll") && gfx::rivaTunerRunning()) {
rivaTunerLate = true;
const bool automatic = impl_->prefString("overlayCompat") != QLatin1String("off");
veyra::log::warn("overlay-hooks", std::format("RivaTuner injected into a run with a GPU interface; its OSD is off in this process ({})",
- automatic ? "started after Veyra: restart suggested" : "monitoring compatibility off"));
+ automatic ? "active OSD server: compatibility restart suggested" : "monitoring compatibility off"));
if (automatic) emit overlayRestartSuggested();
}
// RivaTuner's default hooking keeps OBS game capture from hooking any Direct3D 12
- // program (2026-10-03, RTSS 7.3.7 + OBS 32.1.2, a bare D3D12 window included); its
+ // program (2026-10-03, RTSS 7.3.5.28314 + OBS 32.1.2, a bare D3D12 window included;
+ // RTSS version corrected against the executable on 2026-10-04); its
// "Use Microsoft Detours API hooking" option lets both work. Said once, ever.
static bool obsWithRivaTuner = false;
if (!obsWithRivaTuner && GetModuleHandleW(L"graphics-hook64.dll") && GetModuleHandleW(L"RTSSHooks64.dll")) {
@@ -4935,11 +4942,18 @@ void QmlPlayerBridge::cancelExport() {
}
void QmlPlayerBridge::restartApplication() {
+ requestApplicationRestart(false);
+}
+void QmlPlayerBridge::restartForOverlayCompatibility() {
+ requestApplicationRestart(true);
+}
+void QmlPlayerBridge::requestApplicationRestart(bool overlayCompatibility) {
if (exportRunning()) {
emit notice(tr("设置已保存,请等待导出结束后重启软件"), true);
return;
}
rememberPosition(true);
+ qApp->setProperty("veyraOverlayCompatRestart", overlayCompatibility);
// main launches the replacement only after UI/engine owners unwind.
QCoreApplication::exit(42);
}