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 professional video viewport overlapping playback controls

Veyra Goal Agentc125caddeae7
diff --git a/AGENTS.md b/AGENTS.md
index dc321019..7ecc24c8 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Veyra 项目 Agent 执行规则
+> **2026-10-12 专业模式画面遮挡播放条**:用户反馈原生视频位置错误并要求追溯来源。按docs/PRO_VIDEO_GEOMETRY_PLAN_2026-10-12.md从已验34f479e隔离codex/pro-video-geometry-20261012,仅统一Main/ProPage响应式尺寸、加入实际HWND回归;不改引擎、33ms/250ms节奏、GPU优先级、运行库或真实配置,不派Agent。65旧树/509脏文件由本轮start/bundle保护;产物全E盘,每测试≤300秒。无main合并/push/打包/Release/关机。
+
> **2026-10-12 日志50补帧修复授权**:用户在完成 RTX5070Ti/Elgato 日志诊断后明确“尝试修复”。按 docs/FG_CAPTURE_RECOVERY_PLAN_2026-10-12.md 从 main a167831 在 codex/fg-capture-recovery-20261012 隔离修复异常短 PTS 污染节奏基线及有证据的必要接点,覆盖这些具体范围旧冻结。独立 start/bundle 保护64旧树/515脏文件;已有交换链复用先验证,不重复改写。保持真实 PTS、VRR、真正断点重置、容量上限、UI33ms/250ms、GPU默认优先级与用户配置,不派Agent、不改驱动/运行库/模型。全产物E盘,测试每进程≤300秒/构建≤900秒;无main合并/push/打包/Release/关机。本机回放不能冒充Elgato实卡或物理屏幕性能验收。
> **2026-10-12 PR34 合并与采集设置授权**:用户明确合并 PR34、补齐当前卡全部设备格式及采集页自动保存/继续上次/启动自动恢复。按 docs/PR34_CAPTURE_SETTINGS_PLAN_2026-10-12.md 从 main76f41b3 在 codex/pr34-capture-settings-20261012 隔离适配必要 source/bridge/QML/preferences/测试接点,覆盖这些范围旧冻结。构建及定向验收后允许 main 合并与普通推送以完成 GitHub PR 合并。62 旧树/509 脏文件保持,main仅按授权更新;其它尚未合并分支不混入。保持 UI33ms/250ms、默认优先级与正常采集缓冲,不派Agent、不改驱动/运行库/真实配置。全产物E盘,测试≤300秒/构建≤900秒,无打包/Release/关机。
diff --git a/docs/PRO_VIDEO_GEOMETRY_PLAN_2026-10-12.md b/docs/PRO_VIDEO_GEOMETRY_PLAN_2026-10-12.md
new file mode 100644
index 00000000..20b63c76
--- /dev/null
+++ b/docs/PRO_VIDEO_GEOMETRY_PLAN_2026-10-12.md
@@ -0,0 +1,11 @@
+# 专业模式原生视频遮挡播放条修复
+
+用户反馈专业模式画面向下盖住播放条,要求追溯是哪项修复导致。基线34f479e(含已验采集节奏修复),隔离codex/pro-video-geometry-20261012;不改变main、其它工作树或用户正在使用的程序。开工start/bundle位于E:/项目/Veyra/archives/pro-video-geometry-20261012,保护65旧树/509脏文件。
+
+已查到4557ab6将专业页统计区由固定172改为按状态说明动态增高,但Main.videoRect仍减固定172;同时旧公式长期固定32像素标题、36像素播放条和多减14像素宽度,与实际响应式布局不同。先用原生产EXE/原QML记录实际videoArea、transport与原生HWND边界,保留失败负对照,不能只用不含原生子窗口的Qt截图证明修复。
+
+只统一ProPage持有的布局尺寸,Main原生视频几何使用同一份尺寸并在几何变更时同步。保留打开源前可计算的非零尺寸,覆盖普通/窄窗口、检查器调整、状态选项/语言变化、页面切换及全屏恢复。不添加生产Timer/update/requestUpdate,不修改33ms统计、250ms状态发布、GPU优先级、引擎/算法/驱动/运行库或真实用户配置。
+
+独立运行目录和data-dir,原子替换QML,运行时保持原字节;所有产物写入E:/项目/Veyra/{tests,logs,tmp,reports,archives}/pro-video-geometry-20261012。每个测试进程≤300秒;必要构建≤900秒。定向检查实际HWND与QML区域一致、播放条不重叠、图标软件/GPU模式、无QML错误,以及UI绘制节奏未被改变;性能数字只按实测口径报告。
+
+本次没有合并main、push、打包、Release或关机授权。完成后记录WORKLOG与报告,提供原因、修正、验证和未测边界。
diff --git a/docs/PRO_VIDEO_GEOMETRY_REPORT_2026-10-12.md b/docs/PRO_VIDEO_GEOMETRY_REPORT_2026-10-12.md
new file mode 100644
index 00000000..a0c21e6d
--- /dev/null
+++ b/docs/PRO_VIDEO_GEOMETRY_REPORT_2026-10-12.md
@@ -0,0 +1,42 @@
+# 专业模式视频位置与播放条遮挡
+
+基线34f479e,分支codex/pro-video-geometry-20261012。产品只改Main.qml、ProPage.qml,共享布局尺寸;EXE与引擎、SDK、运行库、模型保持原字节,没有合并main、推送、打包或发布。
+
+## 原因
+
+4557ab6(2026-10-11“正常内容节奏/限速状态”修复)给状态区增加开启选项和原因,ProPage将原172像素统计区改成随文字动态增高,但Main.videoRect仍扣固定172。这是本次普通窗口遮挡的直接引入点,属于上轮验收遗漏:当时只检查Qt文字和卡片边界,Qt截图不含原生视频子窗口,未比较真实HWND与videoArea/transport。
+
+还存在更早的尺寸重复维护:Main固定32像素标题、36像素播放条,ProPage实际标题可变成72、播放条34或68;Main视频宽度额外少14像素。因此窄窗口还会出现纵向位置差40像素和更严重的底部遮挡。
+
+真实生产EXE、GTA视频、相同私有环境的对照:
+
+| 界面源码 | 普通窗口播放条遮挡 | 窄窗口播放条遮挡 |
+| --- | --- | --- |
+| 4557ab6之前(e8300d9) | 0(旧宽度仍少14、高度少2) | 本次只取普通窗口作引入点对照 |
+| 本轮基线34f479e | 开启状态选项后56逻辑像素 | 900宽时90逻辑像素 |
+| 本次修复 | 0 | 0 |
+
+## 修正
+
+ProPage持有videoColumnWidth、metersHeight、videoCardHeight和videoViewport,视频卡片与Main原生窗口使用同一份尺寸。videoViewport变化时事件同步,不轮询,不增加生产Timer、update或requestUpdate。标题换行、窄播放条、状态说明、语言变化和检查器宽度变化均使用实际响应式值。打开源前仍可计算非零尺寸,保留原本避免1×1交换链的要求;极简、节点、导出和全屏既有几何策略保持。
+
+## 验证
+
+路径以下均以E:/项目/Veyra/为前缀。脚本使用Python311的`-X utf8 -B -I`;GTA媒体为用户指定的4K Native.mp4,运行在私有data-dir,全程顺序测试。
+
+- `scripts/acceptance/pro-video-geometry-test.py after --renderer d3d12|software --scale 1|1.5 --donor-app E:/项目/Veyra/tests/fg-capture-recovery-20261012/app --media E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4`。四种组合各13场景(52组合),实际Win32原生子窗口矩形与QML videoArea一致,播放条不重叠;包含选项开关、简中/英文/日文/繁中、720宽、检查器650宽、极简返回、全屏及返回。GPU1.5组使用永久脚本,其余首次使用相同临时夹具;收尾再用永久脚本完整复跑软件100%组。回执见reports/pro-video-geometry-20261012/after-*.json所指日志。
+- 引入点对照:同脚本`before --baseline-ref 4557ab6^ --case normal-active-policy`,日志`logs/pro-video-geometry-20261012/before-d3d12-1-20261012-160403/receipt.json`。进程正常完成,普通窗口遮挡0;总几何判定仍失败是旧14/2像素间隙,不能称旧版所有几何都正确。当前基线负对照13场景记录于155358批次,普通56、窄90像素遮挡真实复现。
+- Qt6.8.3 `qmlcachegen --only-bytecode -o E:/项目/Veyra/build/pro-video-geometry-20261012/Main.qmlc qml/Veyra/Main.qml`,ProPage同命令,均通过。本次是外置QML变更,复用34f479e已测EXE,无需重编C++,没有冒称全量clean构建。所有真实GUI正常播放、正常退出,无QML绑定/类型或D3D12错误。
+- `tmp/pro-video-geometry-20261012/perf.py before|after d3d12|software`:4K视频、单层原版NR、内部1080p、强度1、自动调控关闭、无SR/FG、普通优先级。四组产品日志均确认requested=2 actual=2;夹具外部class采样因句柄权限不足未成功,不作为确认依据。各组约45秒,NR实际运行后取18个一秒GPU统计样本。GPU界面NR中位数5.852→5.839ms、UI提交中位数36→34次/秒;软件界面5.751→5.901ms、38→40次/秒,视频提交均30fps。仅后台窗口短测(activeSamples=0),不当作前台完整性能A/B或普遍提速证据。
+- 同四组早期15–30秒进程CPU读数为GPU0.2476→0.2756 CPU秒/秒、软件0.2594→0.2271;原始全部采样保留。GPU25–42秒为0.2460→0.2566。短样本有波动,不能宣称CPU下降;没有增加持续全窗重绘路径。33ms插值、250ms状态和GPU优先级代码SHA保持,见validation.json。
+- `git diff --check`通过;控制脚本verify保护65旧树:64完全不变,claude/xess-flow-tune-20261012有外部并行修改,原样记录且未触碰/合入;原分支tip和main不变。源码/QML及所有EXE/DLL/模型/着色器的原件对照见reports/pro-video-geometry-20261012/validation.json。没有新增proprietary文件入Git。
+
+实际矩形通过Win32 EnumChildWindows/GetWindowRect读取,与QML mapToItem结果及Qt DPR比较,允许原生物理像素舍入≤1像素。屏幕截取曾被其它窗口遮住,已删除该副本,不作为通过证据。150%使用Qt缩放参数,不冒充双屏真实DPI热切换验收;未连接反馈者采集卡,但本次视频几何与源类型无关,实卡仍待反馈者确认。
+
+## 失败和边界
+
+首次引入前对照只换Main/Pro,遗漏NodePage对StatusSummary的依赖,导致加载失败(160222批次)。已改为完整替换历史QML树并在结束恢复当前源码;该失败没有计入通过。夹具补独立VEYRA_LOG_FILE,避免默认追加日志混入前一轮,并让GUI加载失败返回失败;发生异常只结束夹具自己启动的进程。性能四组外部GPU class读取均失败,后两组增加query权限仍返回ACCESS_DENIED,原错误保留;实际普通优先级由每组独立产品日志中的requested=2 actual=2 state=1 ntstatus=0确认,没有将外部失败当成通过。
+
+可用程序在tests/pro-video-geometry-20261012/app/veyra_qml_ui.exe,测试驱动已从Main移除,所有QML恢复当前源码。显示版本继承2.0.6-capture-fg-fix-20261012,EXE SHA256 c815906da37f79a0aa36446ab47563cd4ca6c57a9451217ce0452b40de0d9d35。最终commit/tag/bundle与完整验证路径见reports/pro-video-geometry-20261012/final.json。
+
+收尾缓存清理两次被自动审批以“blocked by policy”拒绝,未返回更具体理由;第二次已经先独立核验12个明确路径均在本轮tmp内、无reparse point,并使用固定LiteralPath,仍被拦截。没有绕过审查继续删除,40,063,628字节缓存和8个空目录保留,记录cleanup-plan.json/cleanup.json。源码和验证证据不受影响。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 1f2c548d..1a361f1f 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -9180,3 +9180,19 @@ harness/final-ui.py最终9组通过:四语言布局、跨列表/节点全局
工具夹具PATH/环境键、路径转义、旧Ninja缺目标、负对照输出目录断言和GUI日志路径失败已修,未以失败批次冒称通过;详细失败记录见REPORT。严格旧树核对失败于并行claude/xess-flow-tune树的新增修改:63原树完全保持,差异原样记录worktree-audit.json,没有写入/回滚/合入该树。main及原分支tip保持。validation.json核对源码/输入/10EXE/原包1626文件和原日志SHA;runtime/SDK/模型无新增入Git。
全产物E:/项目/Veyra本轮archives/build/tests/logs/tmp/reports;实际命令、原回执与边界见docs/FG_CAPTURE_RECOVERY_REPORT_2026-10-12.md。可用程序tests/fg-capture-recovery-20261012/app/veyra_qml_ui.exe,未合并main/push/打包/Release/关机。最后源码commit/tag/bundle、保护及存储核对见reports/fg-capture-recovery-20261012/final.json。反馈者Elgato/5070Ti/120Hz仍需同设置复测;不强改设备时钟或延长deadline掩盖剩余问题。
+
+## 2026-10-12 专业模式原生视频遮挡播放条
+
+用户要求追溯画面盖住播放条;从34f479e隔离codex/pro-video-geometry-20261012。start/bundle保护65旧树/509脏文件。确认4557ab6新增限速状态选项后统计区动态增高,但Main仍固定减172;常见窗口遮挡56、900宽遮挡90逻辑像素。git历史和真实旧e8300d9 QML普通窗口0遮挡共同定位引入点;旧宽度少14、窄标题差40和播放条固定36的问题一并消除。
+
+生产仅Main/ProPage两QML改动,统一videoViewport及依赖尺寸、按变化事件同步,不加生产Timer/update/requestUpdate,不改33ms/250ms、优先级、引擎、算法或真实配置。保留打开源前非零尺寸。使用原已验EXE c815906d…,Qt6.8.3 qmlcachegen --only-bytecode编译两QML通过,输出build/pro-video-geometry-20261012;不是C++全量clean构建。
+
+命令Python311 -X utf8 -B -I scripts/acceptance/pro-video-geometry-test.py after --renderer d3d12|software --scale 1|1.5 --donor-app E:/项目/Veyra/tests/fg-capture-recovery-20261012/app --media E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4:四模式各13布局(52组合)实际HWND/QML一致、遮挡0,另永久夹具完整复跑软件100%通过。覆盖选项、四语言、720宽、检查器650宽、极简/全屏返回,单进程约26秒,GUI无绑定/D3D错误。before --baseline-ref 4557ab6^ --case normal-active-policy正常完成、遮挡0而旧14/2间隙仍在;160222首次遗漏NodePage同版依赖加载失败,修夹具后160403通过目的对照,未把失败当通过。夹具改独立日志防追加混入,历史QML树完整替换/恢复,异常只结束自有进程;初次屏幕截取被其它窗口遮住,删除副本、不作证据。
+
+tmp/pro-video-geometry-20261012/perf.py before|after d3d12|software顺序各约45秒:同用户4K GTA、原版单层1080p NR、强度1/调控关、普通优先级,实际视频30fps。GPU界面NR5.852→5.839ms/UI36→34提交每秒,软件5.751→5.901/UI38→40;均后台窗口,不宣称前台完整性能通过或提速。四组外部class采样ACCESS_DENIED(增加query权限仍失败)原记录保留;独立产品日志actual=2/state=1/status0确认普通优先级。CPU早期窗口有波动,全部采样及限制见REPORT,不用单次读数宣传下降。没有持续resize循环,修复后每组仅开源和状态初始化共3次SetWindowPos。
+
+git diff --check、Python夹具语法通过。audit.py核对59个QML与356个原件文件;33ms插值/bridge/宿主/presenter源码SHA不变,runtime/SDK/模型无新增进Git。control.py verify:64原树不变,Claude xess-flow-tune树外部并行修改原样记录、未碰/合入,全部旧tip/main保持。详细命令、回执、失败及边界见docs/PRO_VIDEO_GEOMETRY_REPORT_2026-10-12.md、reports/pro-video-geometry-20261012/validation.json。
+
+全产物在E:/项目/Veyra本轮archives/build/tests/logs/tmp/reports;可用程序tests/pro-video-geometry-20261012/app/veyra_qml_ui.exe,驱动已移除、QML恢复源码。未合并main/push/打包/Release/关机;收尾commit/tag/bundle/清理见reports/pro-video-geometry-20261012/final.json。
+
+收尾tmp缓存清理两次遭自动审批“blocked by policy”拒绝。第二次先只读核验12个路径在本任务内、无链接,固定LiteralPath仍被拦截;没有继续绕过,约40MB缓存保留,cleanup.json如实标记未删。该清理不影响本轮修复完成。
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 346945e2..6db286c2 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -216,14 +216,9 @@ Window {
// .min .stage: full width, height = the picture height.
return { x: 0, y: 0, width: width, height: Math.round(pictureHeight) }
case "pro":
- // .pro grid: 1fr 376px, gap 10, padding 14. The video wrap is column
- // 1 row 2; .meters below it is a fixed 172px; .pro-head is 32; and the
- // card's own .vbar is 36px at its foot, which the picture must not cover.
- // The inspector column can be widened by its splitter (inspectorWidth).
- return { x: 14,
- y: 14 + 32 + 10,
- width: Math.max(1, width - proPage.inspectorWidth - 14 * 2 - 10 - 14),
- height: Math.max(1, height - 14 * 2 - 32 - 10 - 172 - 10 - 36) }
+ // Share the page's responsive header, transport and status dimensions.
+ // A second fixed-height formula let the HWND cover the playback bar.
+ return proPage.videoViewport
case "node":
// .nodeview padding 14; .nv-top (330px by default, the splitter under
// it resizes it) minus its 40px bar.
@@ -259,8 +254,8 @@ Window {
ProPage {
id: proPage
pageId: "pro"
- // The splitter moves the picture's right edge with it.
- onInspectorWidthChanged: if (root.page === "pro" && !root.fullscreen) videoHost.syncRect()
+ // Also follows wrapping status text and the compact header/transport.
+ onVideoViewportChanged: if (root.page === "pro" && !root.fullscreen) videoHost.syncRect()
home: pages
overlay: root.quickPanelShown
onRequestFullscreen: root.toggleFullscreen()
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index 7a342dce..b83c270f 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -478,6 +478,15 @@ VPage {
}
}
+ // One geometry contract for this layout and Main's native video HWND.
+ // These are available before the first layout pass when a source is opened.
+ readonly property real videoColumnWidth: Math.max(1, root.width - root.inspectorWidth - 14 * 2 - 10)
+ readonly property real metersHeight: Math.max(172, meter3Content.implicitHeight + 28)
+ readonly property real videoCardHeight: Math.max(transport.height + 1,
+ root.height - 14 * 2 - head.height - 10 - root.metersHeight - 10)
+ readonly property rect videoViewport: Qt.rect(14, 14 + head.height + 10,
+ root.videoColumnWidth, root.videoCardHeight - transport.height)
+
// --- video + transport bar -------------------------------------------
Rectangle {
id: vwrap
@@ -486,8 +495,8 @@ VPage {
anchors.leftMargin: 14
anchors.top: head.bottom
anchors.topMargin: 10
- width: root.width - insp.width - 14 * 2 - 10
- height: root.height - 14 - head.height - 10 - Math.max(172, meter3Content.implicitHeight + 28) - 10 - 14
+ width: root.videoColumnWidth
+ height: root.videoCardHeight
radius: Theme.rCard
color: Theme.card
border.width: 1
diff --git a/scripts/acceptance/pro-video-geometry-probe.qml b/scripts/acceptance/pro-video-geometry-probe.qml
new file mode 100644
index 00000000..bf4e3352
--- /dev/null
+++ b/scripts/acceptance/pro-video-geometry-probe.qml
@@ -0,0 +1,91 @@
+// Test-only driver loaded into a private copy of Main.qml by the companion script.
+import QtQuick
+Item {
+ id: probe
+ property var appWindow: Window.window
+ property var cases: []
+ property int index: -1
+ property int ticks: 0
+ property bool recorded: false
+ property string media: ""
+ function find(item, name) {
+ if (!item) return null
+ if (item.objectName === name) return item
+ for (const child of (item.children || [])) {
+ const hit = find(child, name)
+ if (hit) return hit
+ }
+ return null
+ }
+ function rect(item) {
+ const p = item.mapToItem(appWindow.contentItem, 0, 0)
+ return { x: p.x, y: p.y, w: item.width, h: item.height }
+ }
+ function apply(c) {
+ if (appWindow.fullscreen) appWindow.toggleFullscreen()
+ appWindow.page = "pro"
+ appWindow.width = c.width
+ appWindow.height = c.height
+ veyra.setPreference("language", c.language || "zh-CN")
+ veyra.setPreference("listInspectorWidth", c.inspector || 376)
+ veyra.contentRate = c.options ? 1 : 0
+ veyra.displaySync = c.options ? 1 : 0
+ veyra.outputCustomFps = 30
+ veyra.outputRateMode = c.options ? 2 : 0
+ veyra.playbackRate = c.options ? 0.5 : 1
+ if (c.page === "min") appWindow.page = "min"
+ if (c.fullscreen) appWindow.toggleFullscreen()
+ }
+ function record(c) {
+ const content = appWindow.contentItem
+ const host = find(content, "videoHost")
+ const area = find(content, "videoArea")
+ const bar = find(content, "pro-transport")
+ const head = find(content, "pro-header")
+ const options = find(content, "run-active-options")
+ if (!host || !veyra.hasSource || veyra.failed) throw new Error("source/host unavailable")
+ const row = { name: c.name, index: index, page: appWindow.page, qtDpr: Screen.devicePixelRatio,
+ fullscreen: appWindow.fullscreen, window: {w: appWindow.width,h: appWindow.height},
+ host: rect(host), options: veyra.runOptions, status: veyra.runStatus,
+ submitFps: veyra.submitFps, applying: veyra.applying }
+ if (appWindow.page === "pro" && !appWindow.fullscreen) {
+ if (!area || !bar || !head) throw new Error("professional layout missing")
+ row.area = rect(area); row.bar = rect(bar); row.header = rect(head)
+ if (options) row.optionText = {rect: rect(options),text: options.text}
+ }
+ console.log("PRO_GEOMETRY " + JSON.stringify(row))
+ }
+ Timer {
+ interval: 100; running: true; repeat: true
+ onTriggered: {
+ try {
+ ++probe.ticks
+ if (probe.index < 0) {
+ if (probe.ticks < 3) return
+ veyra.setPreference("reducedMotion", true)
+ veyra.nodeMode = 0; veyra.muted = true
+ veyra.nrEnabled = false; veyra.srEnabled = false
+ veyra.fgEnabled = false; veyra.videoHdr = false; veyra.colorEnabled = false
+ probe.index = 0; probe.apply(probe.cases[0])
+ // Open on the same callback as the page/size change, before a render.
+ veyra.openPath(probe.media)
+ probe.ticks = 0; return
+ }
+ if (probe.ticks > 180) throw new Error("timeout at " + probe.index)
+ if (!probe.recorded) {
+ if (probe.ticks < 12 || !veyra.running || veyra.applying) return
+ probe.record(probe.cases[probe.index]); probe.recorded = true; probe.ticks = 0
+ } else if (probe.ticks >= 5) {
+ ++probe.index
+ if (probe.index >= probe.cases.length) {
+ console.log("PRO_GEOMETRY_DONE")
+ veyra.stopPlayback(); Qt.quit(); return
+ }
+ probe.apply(probe.cases[probe.index]); probe.recorded = false; probe.ticks = 0
+ }
+ } catch(e) {
+ console.error("PRO_GEOMETRY_FAIL " + e.message); Qt.exit(3)
+ }
+ }
+ }
+}
diff --git a/scripts/acceptance/pro-video-geometry-test.py b/scripts/acceptance/pro-video-geometry-test.py
new file mode 100644
index 00000000..c6798529
--- /dev/null
+++ b/scripts/acceptance/pro-video-geometry-test.py
@@ -0,0 +1,134 @@
+"""Drive the real GUI in a private stage; compare QML video/transport to its HWND.
+
+No pixel readback in the player, no changes to the donor/user profile. Runtime
+files are hardlinked unchanged; changed QML is replaced atomically in this stage.
+Use --baseline-ref with 'before' to retain a failing historical negative control.
+"""
+from pathlib import Path
+import argparse, ctypes, hashlib, json, math, os, re, shutil, subprocess, sys, time
+from ctypes import wintypes as W
+p=argparse.ArgumentParser(description=__doc__)
+p.add_argument('variant',choices=('before','after'))
+p.add_argument('--renderer',choices=('d3d12','software'),default='d3d12')
+p.add_argument('--scale',choices=('1','1.5'),default='1')
+p.add_argument('--artifacts-root',type=Path,default=Path('E:/项目/Veyra'))
+p.add_argument('--task',default='pro-video-geometry-20261012')
+p.add_argument('--source-root',type=Path,default=Path(__file__).resolve().parents[2])
+p.add_argument('--donor-app',type=Path,required=True)
+p.add_argument('--media',required=True)
+p.add_argument('--baseline-ref')
+p.add_argument('--case',action='append',dest='selected_cases',help='Run only these named layout cases')
+opts=p.parse_args()
+assert re.fullmatch(r'[a-z0-9-]+',opts.task),'unsafe artifact directory name'
+assert opts.variant!='before' or opts.baseline_ref,'negative control requires an explicit Git reference'
+B=opts.artifacts_root.resolve();T=opts.task;R=opts.source_root.resolve()
+DONOR=opts.donor_app.resolve();APP=B/'tests'/T/'app'
+assert DONOR!=APP and not APP.is_relative_to(R),'private stage must be separate from source and donor'
+for category in ('reports','tests','logs','tmp'):(B/category/T).mkdir(parents=True,exist_ok=True)
+VARIANT=opts.variant;MODE=opts.renderer;SCALE=opts.scale
+O=B/'logs'/T/(VARIANT+'-'+MODE+'-'+SCALE+'-'+time.strftime('%Y%m%d-%H%M%S'));O.mkdir(parents=True)
+TMP=B/'tmp'/T/O.name;TMP.mkdir(parents=True)
+PROFILE=B/'tests'/T/('profile-'+VARIANT+'-'+MODE+'-'+SCALE);PROFILE.mkdir(parents=True,exist_ok=True)
+def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
+def write(p,data):
+ p.parent.mkdir(parents=True,exist_ok=True);tmp=p.with_name(p.name+'.swap');tmp.write_bytes(data);os.replace(tmp,p)
+def no_player():
+ found=subprocess.check_output(['powershell','-NoProfile','-Command',"Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'veyra_qml_ui.exe' } | Select-Object -ExpandProperty ProcessId"],text=True).split()
+ assert not found,('player already running',found)
+no_player()
+if not APP.exists():
+ for base,dirs,files in os.walk(DONOR):
+ dirs[:]=[n for n in dirs if n not in ('logs','cache','data')]
+ target=APP/Path(base).relative_to(DONOR);target.mkdir(parents=True,exist_ok=True)
+ for name in files:os.link(Path(base)/name,target/name)
+restore={}
+for p in (R/'qml').rglob('*'):
+ if p.is_file():
+ target=APP/'qml'/p.relative_to(R/'qml');restore[target]=p.read_bytes();write(target,restore[target])
+if VARIANT=='before':
+ files=subprocess.check_output(['git','-C',str(R),'ls-tree','-r','--name-only',opts.baseline_ref,'qml'],text=True,encoding='utf8').splitlines()
+ for relative in files:
+ write(APP/relative,subprocess.check_output(['git','-C',str(R),'show',opts.baseline_ref+':'+relative]))
+assert sha(APP/'veyra_qml_ui.exe')==sha(DONOR/'veyra_qml_ui.exe')
+cases=[dict(name='wide-no-policy',width=1900,height=900),dict(name='wide-active-policy',width=1900,height=900,options=True),
+ dict(name='normal-active-policy',width=1400,height=900,options=True),dict(name='normal-english',width=1400,height=900,options=True,language='en'),
+ dict(name='compact-header',width=960,height=800,options=True,language='en'),dict(name='compact-transport',width=900,height=800,options=True),
+ dict(name='minimum-width',width=720,height=800,options=True,language='ja'),dict(name='wide-inspector',width=1400,height=900,inspector=650,options=True),
+ dict(name='traditional',width=1400,height=900,options=True,language='zh-TW'),dict(name='cinema-switch',width=1280,height=800,page='min'),
+ dict(name='professional-return',width=1400,height=900,options=True),dict(name='fullscreen',width=1400,height=900,options=True,fullscreen=True),
+ dict(name='fullscreen-return',width=1400,height=900,options=True)]
+if opts.selected_cases:
+ selected=set(opts.selected_cases)
+ assert selected.issubset({c['name'] for c in cases}),selected
+ cases=[c for c in cases if c['name'] in selected]
+MAIN=APP/'qml/Veyra/Main.qml';original=MAIN.read_bytes();driver=APP/'qml/Veyra/ProGeometryProbe.qml'
+write(driver,(R/'scripts/acceptance/pro-video-geometry-probe.qml').read_bytes())
+text=original.decode('utf8');at=text.rfind('}')
+loader='\n Loader { source:"ProGeometryProbe.qml"; onLoaded: { item.cases='+json.dumps(cases)+'; item.media='+json.dumps(opts.media,ensure_ascii=False)+' } }\n'
+write(MAIN,(text[:at]+loader+text[at:]).encode('utf8'))
+env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_'))}
+env.update(TEMP=str(TMP),TMP=str(TMP),CUDA_CACHE_PATH=str(TMP/'cuda'),QML_DISK_CACHE_PATH=str(TMP/'qml'),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1',QT_SCALE_FACTOR=SCALE,VEYRA_LOG_FILE=str(O/'engine.log'))
+if MODE=='software':env['QT_QUICK_BACKEND']='software'
+else:env['VEYRA_UI_RHI']='d3d12'
+U=ctypes.WinDLL('user32',use_last_error=True);U.SetProcessDpiAwarenessContext.argtypes=[ctypes.c_void_p];U.SetProcessDpiAwarenessContext(ctypes.c_void_p(-4))
+CALLBACK=ctypes.WINFUNCTYPE(W.BOOL,W.HWND,W.LPARAM)
+U.EnumWindows.argtypes=[CALLBACK,W.LPARAM];U.EnumChildWindows.argtypes=[W.HWND,CALLBACK,W.LPARAM]
+U.GetWindowThreadProcessId.argtypes=[W.HWND,ctypes.POINTER(W.DWORD)];U.GetClassNameW.argtypes=[W.HWND,W.LPWSTR,ctypes.c_int]
+U.GetParent.argtypes=[W.HWND];U.GetParent.restype=W.HWND
+U.GetWindowRect.argtypes=[W.HWND,ctypes.POINTER(W.RECT)];U.ClientToScreen.argtypes=[W.HWND,ctypes.POINTER(W.POINT)]
+U.GetDpiForWindow.argtypes=[W.HWND];U.GetDpiForWindow.restype=W.UINT
+def native(pid):
+ hits=[]
+ @CALLBACK
+ def visit(hwnd,_):
+ p=W.DWORD();U.GetWindowThreadProcessId(hwnd,ctypes.byref(p))
+ if p.value!=pid:return True
+ cls=ctypes.create_unicode_buffer(256);U.GetClassNameW(hwnd,cls,256)
+ if cls.value=='VeyraQmlVideoHost':hits.append(hwnd)
+ return True
+ @CALLBACK
+ def top(hwnd,_):
+ visit(hwnd,0);U.EnumChildWindows(hwnd,visit,0);return True
+ U.EnumWindows(top,0);assert len(set(hits))==1,hits
+ hwnd=hits[0];parent=U.GetParent(hwnd);r=W.RECT();U.GetWindowRect(hwnd,ctypes.byref(r));origin=W.POINT();U.ClientToScreen(parent,ctypes.byref(origin))
+ pr=W.RECT();U.GetWindowRect(parent,ctypes.byref(pr))
+ return dict(x=r.left-origin.x,y=r.top-origin.y,w=r.right-r.left,h=r.bottom-r.top,dpr=U.GetDpiForWindow(hwnd)/96,screen=[pr.left,pr.top,pr.right,pr.bottom])
+rows=[];seen=set();console=O/'console.log';start=time.monotonic();rc=None;proc=None
+try:
+ with console.open('wb') as stream:
+ command=[str(APP/'veyra_qml_ui.exe'),'--data-dir',str(PROFILE),'--page','home','--size','1400x900','--exit-after','70000']
+ if MODE=='software':command.append('--obs-game-capture')
+ proc=subprocess.Popen(command,cwd=APP,env=env,stdout=stream,stderr=subprocess.STDOUT)
+ while proc.poll() is None:
+ if time.monotonic()-start>80:proc.kill();raise TimeoutError('GUI timeout')
+ data=console.read_text('utf8',errors='replace')
+ for raw in re.findall(r'PRO_GEOMETRY (\{[^\r\n]+\})',data):
+ row=json.loads(raw)
+ if row['index'] in seen:continue
+ seen.add(row['index']);n=native(proc.pid);row['native']=n
+ expected=row.get('area') or dict(x=0,y=0,w=row['window']['w'],h=row['window']['h'])
+ row['hostDifference']={k:round(row['host'][k]-expected[k],4) for k in ('x','y','w','h')}
+ dpr=row.get('qtDpr',n['dpr'])
+ row['nativeDifference']={k:round(n[k]-math.floor(expected[k]*dpr),4) for k in ('x','y','w','h')}
+ row['overlapDip']=round(max(0,row['host']['y']+row['host']['h']-row['bar']['y']),4) if 'bar' in row else 0
+ row['passed']=all(abs(v)<=1 for v in row['nativeDifference'].values()) and all(abs(v)<.1 for v in row['hostDifference'].values())
+ rows.append(row);print(row['name'],'hostDelta',row['hostDifference'],'overlapDip',row['overlapDip'],'pass',row['passed'],flush=True)
+ time.sleep(.08)
+ rc=proc.returncode
+finally:
+ if proc is not None and proc.poll() is None:
+ proc.terminate()
+ try:proc.wait(timeout=10)
+ except subprocess.TimeoutExpired:proc.kill();proc.wait(timeout=10)
+ for path,data in restore.items():write(path,data)
+ driver.unlink(missing_ok=True)
+logs=console.read_text('utf8',errors='replace')+'\n'+(O/'engine.log').read_text('utf8',errors='replace')
+errors=[l for l in logs.splitlines() if re.search(r'PRO_GEOMETRY_FAIL|TypeError:|ReferenceError:|Binding loop|Cannot assign|D3D12 ERROR|D3D12 CORRUPTION|failed to load component|no root object',l)]
+completed=rc==0 and not errors and 'PRO_GEOMETRY_DONE' in logs and len(rows)==len(cases)
+result=dict(variant=VARIANT,mode=MODE,scale=SCALE,exit=rc,seconds=round(time.monotonic()-start,2),errors=errors,rows=rows,
+ passed=completed and all(r['passed'] for r in rows),completed=completed,
+ mainRestored=MAIN.read_bytes()==restore[MAIN],exeSha256=sha(APP/'veyra_qml_ui.exe'),command=command,baselineRef=opts.baseline_ref)
+(O/'receipt.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),'utf8')
+(B/'reports'/T/(VARIANT+'-'+MODE+'-'+SCALE+'.json')).write_text(json.dumps(dict(receipt=str(O/'receipt.json')),ensure_ascii=False),'utf8')
+print('RESULT',json.dumps(dict(passed=result['passed'],errors=errors,exit=rc,seconds=result['seconds'],receipt=str(O/'receipt.json')),ensure_ascii=False),flush=True)
+raise SystemExit(not completed or (VARIANT!='before' and not result['passed']))