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(qml): cover fractional-DPI cinema client edges

Veyra Goal Agentfc2ca7163e98
diff --git a/AGENTS.md b/AGENTS.md
index 9406baa8..40d8d026 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Veyra 项目 Agent 执行规则
+> **2026-10-04 当前授权**:立即修复极简窗口右侧像素缺口;HDR/Dolby Vision PR #13/#14 只做研究、静态审查和适配/UI方案,待用户审批才修复并入。在 `codex/minimal-edge-hdr-review-20261004` / 当前E盘隔离工作树按 `docs/MINIMAL_EDGE_HDR_REVIEW_PLAN_2026-10-04.md` 执行。黑边所需QML原生宿主窗口几何/裁切、默认极简窗口取整的最小显示几何接点及定向验收获本轮授权,覆盖对应历史冻结;HDR算法/UI/PR合并未授权。复现证据与新增PresentationGeometry/VideoPresenter范围先记录在方案,不改增强/颜色链。保留已验VFG/现场修复、main、桌面、候选和用户配置;不派Agent、不merge/push/Release,所有产物在E盘,测试≤300秒、构建≤900秒。
+
> **2026-10-03 VFG 接入授权**:用户“接入看看,8x也支持上”“所有档位都加上”。在当前 E 盘隔离工作树的 `codex/vfg-integration-20261003`,以 `1802f43565e07f3c3040d3fe745ca2e939aab00f` 为基线,按 `docs/VFG_INTEGRATION_EXECUTION_2026-10-03.md` 接入 NVIDIA VFG、全部 2X–8X 与 Low/Medium/High。必要的 native backend、D3D12/CUDA bridge、共享 graph/pools/leases、settings/preset/session/worker、preview/export、QML/bridge、shader/CMake 与针对性验收获本轮授权,覆盖对应历史冻结;不扩改无关链路,不派子 Agent,不 merge/push/Release。存档 `checkpoint/pre-vfg-integration-20261003` 与 `E:/项目/Veyra/archives/vfg-integration-20261003-start/source-before.bundle`;原五项修复、main、桌面、用户配置与已有候选保持。新 SDK/运行库/模型仍在 E 盘独立 deps,不进源码 Git;默认 Medium,高倍率实验标识、实测与未验边界如实报告。测试≤300s、构建≤900s。
> **2026-10-03 当前真人现场修复与升级授权**:用户明确要求 Xbox 无声/断开修复、lmxxf AMD RX 9000 NR 接入、导出码率回跳/设置无效修复、RTSS 兼容背景透明修复、取消 NVIDIA App 插件检测;先存档、写方案、创建分支再动手。仅在 `E:/项目/Veyra/worktrees/field-upgrade-20261003` / `codex/field-upgrade-20261003`(main `66cd3e5`)按 `docs/FIELD_UPGRADE_PLAN_2026-10-03.md` 实施。这五项必要 backend/NR/graph/source/QML/bridge/CMake/定向验收接点获本轮授权,覆盖对应历史冻结;无关链路不扩改。开工存档及标签见方案;旧桌面 guard/baseline、main、其他工作区、用户设置和已发布包保持。所有产物在 E 盘,不派子 Agent,不 merge/push/Release/删除旧 UI。单测试≤300秒、单构建≤900秒;现有运行库身份、patched FFmpeg 与源码/模型隔离不变,AMD/Xbox 实机未验如实记录。
diff --git a/apps/veyra-qml/main.cpp b/apps/veyra-qml/main.cpp
index a73e9562..c0a4309e 100644
--- a/apps/veyra-qml/main.cpp
+++ b/apps/veyra-qml/main.cpp
@@ -51,6 +51,7 @@
#include "veyra/RuntimePaths.h"
#include "veyra/engine/EngineController.h"
#include "veyra/engine/ExportJobManager.h"
+#include "veyra/engine/PresentationGeometry.h"
#include "veyra/gfx/PresentationHooks.h"
#include "veyra/ui/QmlDataDirectory.h"
#include "veyra/ui/QmlPlayerBridge.h"
@@ -160,12 +161,40 @@ bool syncVideoGeometry(QQuickWindow* window, QQuickItem* host) {
if (IsWindowVisible(g_video)) ShowWindow(g_video, SW_HIDE);
return false;
}
- // A fractional size is a resize artifact, not intent: floor it so the
- // swapchain never alternates between two sizes on alternating frames.
+ // Keep partial QML viewports stable while they animate. A viewport that
+ // spans the window must use its actual physical client extent: Qt rounds
+ // the HWND at fractional DPI, whereas flooring width*dpr can leave a
+ // one-pixel strip outside the video (for example 642 DIP at 125%).
const int x = int(std::floor(topLeft.x() * dpr));
const int y = int(std::floor(topLeft.y() * dpr));
- const int w = std::max(1, int(std::floor(host->width() * dpr)));
- const int h = std::max(1, int(std::floor(host->height() * dpr)));
+ int w = std::max(1, int(std::floor(host->width() * dpr)));
+ int h = std::max(1, int(std::floor(host->height() * dpr)));
+ RECT parentClient{};
+ if (GetClientRect(reinterpret_cast<HWND>(window->winId()), &parentClient)) {
+ if (std::abs(topLeft.x()) < 0.001 && std::abs(host->width() - window->width()) < 0.001)
+ w = std::max(1L, parentClient.right);
+ if (std::abs(topLeft.y()) < 0.001 && std::abs(host->height() - window->height()) < 0.001)
+ h = std::max(1L, parentClient.bottom);
+ }
+ // A film-fitted cinema window can have no fractional HWND pixels. Tell
+ // the presenter the exact rounding bound; real bars/zoom/fullscreen retain
+ // their normal mapping. Keep this synchronized even when the rect is equal.
+ const qreal aspect = window->property("filmAspect").toReal();
+ const bool filmWindow = window->property("cinema").toBool() &&
+ !window->property("screenSized").toBool() && aspect > 0 &&
+ std::abs(topLeft.x()) < 0.001 && std::abs(topLeft.y()) < 0.001 &&
+ std::abs(host->width() - window->width()) < 0.001 &&
+ std::abs(host->height() - window->height()) < 0.001 &&
+ std::abs(window->height() - window->width() / aspect) <= 0.501;
+ const uintptr_t roundingUnits = filmWindow
+ ? uintptr_t(std::ceil((0.5 * dpr + 0.5 + 0.5 / aspect) * 1024)) : 0;
+ constexpr auto roundingProperty = veyra::engine::kFilmPixelRoundingProperty;
+ if (reinterpret_cast<uintptr_t>(GetPropW(g_video, roundingProperty)) != roundingUnits) {
+ if (roundingUnits && !SetPropW(g_video, roundingProperty, reinterpret_cast<HANDLE>(roundingUnits)))
+ veyra::log::error("qml-window", std::format("SetProp film pixel rounding failed err={}", GetLastError()));
+ if (!roundingUnits) RemovePropW(g_video, roundingProperty);
+ veyra::log::info("qml-window", std::format("film pixel rounding allowance={} height pixels", double(roundingUnits) / 1024));
+ }
// Called every rendered frame: only a changed rect reaches the window manager,
// so a moving popover never makes the presenter see a spurious resize.
static RECT last{-1, -1, -1, -1};
@@ -245,8 +274,16 @@ void syncVideoCovers(QQuickWindow* window, QQuickItem* host, qreal inset) {
: window->contentItem(), covers);
const qreal dpr = window->devicePixelRatio();
const QPointF origin = host->mapToScene(QPointF(0, 0));
- const int w = std::max(1, int(std::floor(host->width() * dpr)));
- const int h = std::max(1, int(std::floor(host->height() * dpr)));
+ // The region clips the native HWND, so its dimensions must come from that
+ // same HWND. Repeating the logical-size floor here would cut off the last
+ // column again whenever a menu/control cover is present.
+ RECT nativeClient{};
+ if (!GetClientRect(g_video, &nativeClient)) {
+ veyra::log::error("qml-window", std::format("GetClientRect for video covers failed err={}", GetLastError()));
+ return;
+ }
+ const int w = std::max(1L, nativeClient.right);
+ const int h = std::max(1L, nativeClient.bottom);
static QList<QRect> last;
// blankVideo() set the region behind this cache's back.
if (g_videoBlanked) { last.clear(); g_videoBlanked = false; }
diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.md
index 90f68ec3..f760117c 100644
--- a/docs/CURRENT_STATUS.md
+++ b/docs/CURRENT_STATUS.md
@@ -1,5 +1,17 @@
# 当前项目状态 / Current Status
+## 2026-10-04 极简像素缺口已修;HDR PR 等审批
+
+独立分支 `codex/minimal-edge-hdr-review-20261004` 从已验VFG候选存档开工。
+修复分数DPI时native child/region少一列与默认极简窗口contain取整黑线,完整输入映射到整数client,保留真实比例/原始像素/全屏黑边。
+完整/增量构建通过;30个尺寸/DPR/渲染模式真实GUI用例、12个行为回归、2个确定性跨页回归通过。
+RTX5070/616.56,Qt scale factor模拟,未宣称实显示器DPI移动或新HDR/FG画质通过。
+只制作基于`2.0.2-vfg-20261003`的EXE小补丁,记录见 `docs/MINIMAL_EDGE_ACCEPTANCE_2026-10-04.md`。
+
+PR #13/#14固定head静态审查完成:P5 offset/拟合/flat映射、#14缺失头文件/半套P5、HDR统计range/array/延迟/reset等问题和当前VFG持久化格式分叉均已记录。
+`docs/HDR_DOVI_PR_REVIEW_2026-10-04.md` 提供分拆适配、验收及“输入/处理/输出”界面编排;**HDR产品代码未施工,等用户通过后再修复并入**。
+桌面patch/11份未跟踪源码、main、原2077个便携载荷复核一致;未merge/push/Release。
+
## 2026-10-04 VFG 全档位:独立本地交付
`codex/vfg-integration-20261003` 已接原生 NVIDIA VFG 2X–8X、Low/Medium/High,
diff --git a/docs/HDR_DOVI_PR_REVIEW_2026-10-04.md b/docs/HDR_DOVI_PR_REVIEW_2026-10-04.md
new file mode 100644
index 00000000..21000cc7
--- /dev/null
+++ b/docs/HDR_DOVI_PR_REVIEW_2026-10-04.md
@@ -0,0 +1,91 @@
+# HDR / Dolby Vision PR 审查与待审批适配方案
+
+## 建议决定
+
+吸收 #13 的 P5 输入识别、FFmpeg RPU 元数据接线和回归探针,改用成熟实现的完整颜色参数与重塑算法;吸收 #14 的亮度设置保存修复和可关闭的场景亮度入口,重做其统计与状态接点。**两份 PR 均不直接合并。当前只完成静态审查、独立数值反例和方案,HDR 产品代码未施工。**
+
+这不是“他全部做得不好”:#13 的方向正确,还补了缺失 RPU 拒绝、逐帧参数、seek 和参考解码对比;#14 修复了真实的设置回退与长场景滑杆不生效问题。但当前完整性、色度与时序问题会影响其他素材,不能靠一部电影正常就通过。
+
+## 审查对象与证据边界
+
+| PR | 固定 head | 最新实际范围 |
+| --- | --- | --- |
+| [#13](https://github.com/Likely7/Veyra-NRVideo/pull/13) | `f08934b8a535bb0ac085cd8f5689b9029b416726` | P5 IPT-PQ-C2 基层转 PQ/BT.2020,然后进入已有 HDR/SDR 路线;12 文件 |
+| [#14](https://github.com/Likely7/Veyra-NRVideo/pull/14) | `57f2541b3173b5285661ddf6c448ffb2722f6433` | 原生 HDR 场景亮度管理、参数保存/UI、部分构建修复;26 文件 |
+
+两者 merge-base 与当时 main 均为 `66cd3e50590766e5a654528ab61e491dc4d30c83`,不是彼此包含关系。2026-10-04 再查远端,head 未变、均 OPEN,无 status check。PR 创建日期为 2026-10-03(UTC)。固定 blob、diff、SHA 清单在 `E:/项目/Veyra/downloads/minimal-edge-hdr-review-20261004/`;没有 checkout/执行贡献者代码,没有代发评论。
+
+#14 标题已过时:`e7879e0` 撤回 HDR→SDR→TrueHDR,`57f2541` 撤回 HDR→SDR 的四个自定义参数。最新版 TrueHDR 保持 SDR 输入,不按旧标题设计功能。原 SDK 的产品范围也为 SDR→HDR:[NVIDIA RTX Video SDK](https://developer.nvidia.com/rtx-video-sdk)。
+
+#13 文档报告 RTX 5080、一份 P5 影片的 1500 帧元数据扫描、PQ 域对 libplacebo 的单帧误差与短播放,以及 249/236/204 个本地检查。它有用,但不是本机验收、多影片验收或原生 DV 输出证明;SDR on/off 差异也不是 SDR 参考准确性证明。本轮没有运行其 GPU probe 或参考影片。
+
+## 已确认的源代码问题
+
+| 优先级 / 定位 | 问题与后果 | 适配方式 |
+| --- | --- | --- |
+| P1 #14 `src/pipeline/EnhanceGraph.cpp:2,1419,2199` | 引用并使用 `DolbyVisionP5.h`、常量和 `resolved.dolbyVisionP5`,但固定 head 没有该头文件、P5 参数成员和对应 shader 转换。单独 PR 的提交树不完整。作者本地成功不能证明干净 checkout 可构建。 | 先去掉半套 P5 接点,或在完整 P5 适配后显式接入同一接口;不得靠本地未跟踪文件补洞。 |
+| P1 #13 `include/veyra/source/DolbyVisionRpu.h:164` / shader `DoviP5ToPqBt2020` | 只复制 RPU 矩阵,忽略 `ycc_to_rgb_offset[3]`;shader 固定色差减 0.5、亮度不减 offset。不能代表全部 RPU 的颜色合同。 | 按 RPU offset/normalization 处理。FFmpeg 明确提供这些字段;libplacebo 也显式消费,而不是固定中心值。 |
+| P1 #13 `fitDolbyVisionP5Curve` | 64 个样点拟合为 `{1,sqrt(x),x}`,损失原始分段多项式;MMR 直接不支持。最新代码会拒绝不能描述全部分量的帧,不再静默当普通 YUV 显绿。 | 完整保留 pivots、分段 polynomial 与 MMR;优先移植 libplacebo 的成熟算法,固定提交与许可证。 |
+| P1 #13 `dolbyVisionP5CurveIsPlaceholder` | 只凭曲线斜率近零就把常量映射改为 identity。将一个样本的黑场猜测写成普遍语义,会破坏有意的黑场/淡入。逐帧纯函数已解决先后播放不一致,但不证明该替换正确。 | 根据解码后的有效 RPU 和参考结果处理,不能凭系数猜 placeholder;加入真实淡入、黑场、重复元数据的对照。 |
+| P1 #14 `HdrSceneMapping.h` / `analyzeLuma` | P010/P016 的原始高字节直接作为 full-range PQ bin;没有合法范围展开,且编码域 luma 不等于解码后的线性亮度。接 P5 后原始 IPT 统计更不能当 PQ 亮度。 | 在显式颜色解码及 DV 转换后的 HDR linear RGB 上计算亮度统计。 |
+| P1 #14 `HdrSceneReduce.hlsl` / graph `reduceSrv` | shader 是 `Texture2D<float>`,硬解 array 分支绑定 `TEXTURE2DARRAY`;资源维度不匹配。 | 验证 2D / array-slice 两条合同,或移到统一非 array 的工作纹理,避免两种统计源。 |
+| P1 #14 `EnhanceGraph.cpp:2032–2061` | 实际新增 64×36 浮点网格 GPU pass、9216 B 回读和 8 个槽。把上次槽的数据标成当前 PTS/frame,同时送入共有 cadence/scene 检测。存在统计延迟、场景切换错位及开关影响补帧 reset 的风险。 | GPU 统计只返回计数/参数,不回读图像网格;携带 epoch/frame/PTS/fence。保持原 cadence 合同,过期统计丢弃,不引入逐帧 CPU wait。 |
+| P1 #14 状态生命周期 | 新增 gain、peak、ramp、lastPTS、measured 和 readback-valid 没随已有 open/seek/source/reset 清理。旧统计可能跨源/跨 seek 混入。 | 纳入统一 reset,源 epoch 改变即失效;重复帧不推进,seek 后与 fresh-open 对齐。 |
+| P2 #14 `HdrSceneReduce.hlsl` | 硬解是先对每格 PQ 值平均再统计,软解是抽点统计。均值的分位数不等于像素分位数,细小高光会被抹掉。 | 使用相同域、相同采样策略的 GPU histogram/reduction;比较软硬解统计误差,单独检查星点、字幕、高光与黑边。 |
+| P2 #14 `EnhanceGraph.cpp:1910` | transition 用 PTS,但 response 是固定每帧 alpha,24/60 fps 的响应不同。 | 用 PTS 差和毫秒时间常数;暂停、重复、跳帧、seek 有明确合同。 |
+| P2 #14 资源/参数 | 即使开关关闭也创建统计资源、加载新 shader;用 float 通道按位装 gain/peak 参数,注释仍有已撤回的 EV/shoulder。 | 按能力/开关建资源,失败只回退该功能;显式参数 buffer,更新实现文档与 diagnostics。 |
+| P2 #14 UI/模型 | 同一亮度组重复出现在 Pro“显示”和 Settings,Node 没有对应编辑器;默认 target=1000、范围400..4000没有显示器实测依据。“暗场自动抬”还可能改变作品有意的曝光。 | 默认关闭,命名为可选“场景亮度调整”;把显示器输出参数与内容效果分开,参数只有一个真源。 |
+
+静态审查脚本 `scripts/acceptance/hdr-pr-review.py` 不运行 PR 代码。其独立 ST2084 反例在 `logs/minimal-edge-hdr-review-20261004/hdr-pr-static-findings.json`:合法范围 P010 中约 1000 nit 的中性像素,按该 8-bit 原始 proxy 会被读成约 **655 nit**;黑电平会被读成 **0.102 nit**,刚好超过其 0.1 nit 黑场排除线。数值用于证明 range 错误,不是新 tone mapper 的画质验收。
+
+颜色参考:[FFmpeg AVDOVIColorMetadata](https://ffmpeg.org/doxygen/9.0/structAVDOVIColorMetadata.html);[libplacebo 固定源 colorspace](https://github.com/haasn/libplacebo/blob/92b5ac6db79f4d680eb656692f7bf51e9606f42a/src/colorspace.c#L1921);[完整 reshape 算法](https://github.com/haasn/libplacebo/blob/92b5ac6db79f4d680eb656692f7bf51e9606f42a/src/shaders/colorspace.c)。后者 LGPL-2.1-or-later,与 Veyra GPLv3 可兼容移植,施工时逐文件标注来源、固定 commit、改动与 notice,本轮未移入产品。
+
+根签名:[D3D12 上限](https://learn.microsoft.com/en-us/windows/win32/direct3d12/root-signature-limits)是整个签名64 DWORD。#13 的60个常量加descriptor tables已接近上限,但不能因此牺牲 RPU 精度;使用显式 CBV/SRV 传完整参数。不要把该 pass 的剩余预算说成所有 D3D12 程序只能用60个常量。
+
+## 当前 AMD NR / VFG 分支的适配差异
+
+1. 当前 `FrameGenerationBackend::Vfg`、`NrRuntime` AMD 值和质量参数不在 PR 基线。保留所有既有枚举ID、2X–8X/三档、AMD能力判断与不支持时的实际提示;不能用 PR 原文件覆盖当前实现。
+2. 当前 legacy `PresetStore` v28 保存 VFG;#14 v28 却是读取已撤回 HDR→SDR 参数,二者含义冲突。当前 library v7 保存 VFG质量,#14 legacy v7读取撤回的HDR参数;当前 chain-session v5 保存VFG质量,#14 v5/v6保存HDR亮度/transition。要为统一格式分配新版本/标识并备份、迁移、验证旧文本,不能只把 `maxVersion` 取大。库的不同分叉 v7/v5不能仅凭版本号猜布局;判不明保留文件并明确报错,不静默覆盖。
+3. `ExportJobManager.cpp` 的 Shared **整份复制 EnhancementSettings**,所以不能说“PR丢了导出亮度参数”。实际适配工作是更新当前 ABI8 的布局版本与 frozen 日志,验证父进程改设置不改变已启动任务;#14保持ABI7且检查sizeof,不是手写字段遗漏。
+4. `YuvToLinearRgb` / EnhanceGraph 同时涉及当前 HDR保留、NR残差合成和 VFG 10bit 路线。P5在输入颜色解码处转换一次;不能在各后端重复 RPU、range或tone map。仍不能把 NR 的 SDR模型推理称为原生HDR推理。
+5. VFG/HDR色度、RX9000 NR/HDR实卡尚未验收;scRGB与各补帧后端只按当前真实能力展示,不能用“8X已支持”推断全部HDR模式通过。
+
+## 推荐的界面编排(等待审批)
+
+### 三类状态分开
+
+- **输入**:自动检测,只读“SDR / HDR10 / HLG / Dolby Vision P5/P7/P8”,位深与元数据状态。P5成功显示“DV P5 已转换”;缺有效RPU显示具体原因,不能只写一个 DV 绿色徽标。
+- **HDR画面处理**:SDR显示“RTX HDR:SDR→HDR”开关与现有四参数;原生HDR显示“场景亮度调整(默认关)”。P5转换属于解码,没有让用户猜的转换开关。自动调整强度为主参数;时间响应与过渡折叠进高级。
+- **实际输出**:只读“SDR / HDR10 / scRGB”,Windows HDR、当前显示器、实际回退原因。显示器峰值/校准属于此处,不能放进NR版本或把片源峰值当显示器峰值。
+
+### 页面落位
+
+| 页面 | 编排 |
+| --- | --- |
+| 专业·列表 | 效果区放唯一 HDR 处理卡,处在补帧前;“显示”页只给输出状态与“显示设置”入口,不重复四个场景滑杆。 |
+| 节点 | 输入卡显示源格式/DV转换状态;唯一HDR处理节点使用列表同源编辑组件并保持补帧前;输出卡显示最终格式并链接显示设置。不能增加第二套亮度配置。 |
+| 设置·显示 | Windows HDR/当前屏幕状态、HDR10/scRGB偏好、显示器峰值(自动读数标为报告值,允许手动校准)。内容效果留在链/预设,不放这里。当前203 nit参考白若无可调后端,仅显示真实固定值。 |
+| 极简/全屏 | 仅显示简短输出徽标;详细“DV P5→HDR10”在源信息/专业页,避免把控制胶囊塞成参数面板。 |
+| 导出 | 输出SDR/HDR10按实际编码能力列出,显示最后格式/位深/颜色标记。P5转HDR10后不复制原RPU而宣称导出了DV;不提供未实现的DV认证输出选项。 |
+
+用户流程示例:
+
+```
+SDR文件 → NR/SR/颜色 → [RTX HDR,可选] → FG → HDR10显示
+HDR10/HLG → 已有HDR颜色合同/增强 → [亮度调整,可选] → FG → HDR10或可用scRGB
+DV P5 + RPU → 精确转换到统一HDR工作域 → 同上 → FG → HDR10/SDR
+DV P7兼容基层 → HDR10基层(明确未使用增强层)→ 同上
+```
+
+全局设备参数、列表/节点的内容参数、每个导出任务的输出合同分别有单一真源。预设可以保存创作效果,不能未经提示改当前显示器校准;迁移旧全局HDR输出偏好要保留用户当前值。上述新参数/状态接口缺口在审批后的功能分支补齐,不能先画能点但不生效的控件。
+
+## 审批后的施工与验收顺序
+
+1. 再存档、开独立 HDR 适配分支。先吸收小范围构建/保存修复,解决缺失 P5 依赖与版本分叉;当前黑边修复保持独立。
+2. 适配完整P5颜色算法与参数buffer。严格比对libplacebo参考的多素材、offset、分段、多项式/MMR、黑场/淡入、seek/fresh-open、缺失RPU、软解/2D/array硬解。PQ与SDR分别做参考对比,普通SDR/HDR10/HLG/P7/P8不退化。
+3. 独立接原生HDR亮度统计和状态机,保留关闭时原结果。测试合法/全范围、窄高光、字幕/黑边、24/30/60fps、pause/repeat/skip/seek、跨源/显示器、hist延迟;看实际GPU耗时与队列驻留,不用“没有全帧回读”冒充“没有新pass”。
+4. 用同一组件接列表/节点/输出状态,验证参数保存、重启、旧预设与两种链模式、worker冻结与导出标记。能力不足时显示真实回退,不伪装HDR成功。
+5. HDR10/scRGB/各FG、NR开关、TrueHDR SDR输入、DV转SDR和导出按本机真实能力验收。无法在本机验证的RX9000/其他型号、物理峰值和屏幕端到端效果单列,不能外推。
+6. 提交完整构建、针对性颜色/时序/UI证据后,按用户本次审批范围整合。当前没有实施HDR、merge、push或Release。
+
+审批对象:**上述分拆吸收、精确P5转换、默认关闭的场景亮度调整及三类界面编排。**
diff --git a/docs/MINIMAL_EDGE_ACCEPTANCE_2026-10-04.md b/docs/MINIMAL_EDGE_ACCEPTANCE_2026-10-04.md
new file mode 100644
index 00000000..a8439004
--- /dev/null
+++ b/docs/MINIMAL_EDGE_ACCEPTANCE_2026-10-04.md
@@ -0,0 +1,48 @@
+# 极简右侧像素缺口:本地验收
+
+基线 `a927f92`,隔离分支 `codex/minimal-edge-hdr-review-20261004`;开工存档与bundle见本轮方案。立即修复黑边、HDR只审查,未 merge/push/Release。
+
+## 复现与实现
+
+真实播放自有1280×720 cyan H.264,GetClientRect/ClientToScreen测主窗与native child,再截取本测试进程的无遮挡client并检查边缘像素。不用Qt grabToImage证明原生视频内容。测试子窗临时topmost且不激活其他应用;capture前检查采样位置所属PID,避免其他程序遮挡。fixture与独立profile/日志/TEMP均在E盘。
+
+旧包EXE `be4da2ff173aa74de8e2e1d5ecc73d40a23584ba8898ffd534e636a8793b3d6b`,`before-v3` 6个真实GUI进程重测:
+
+| Qt scale / 逻辑宽 | 主窗 / 视频子窗(物理像素) | 结果 |
+| --- | --- | --- |
+| 125% /642 | 803×451 /802×451 | 右缺1列,最右像素黑、内侧cyan |
+| 150% /643 | 965×543 /964×543 | 同上 |
+| 175% /641 | 1122×632 /1121×631 | 右与底各缺1像素 |
+| 100% /642、200% /643 | client一致 | 无该native缺口 |
+
+先修子窗/region后,125%仍有contain亚像素黑线,所以不能用“client一致”冒充已修视觉问题。最终:
+
+- 满窗宿主使用parent HWND实际client,region使用child实际client,部分/动画viewport保留原稳定floor。
+- 仅自动按影片比例取整的极简窗口、默认居中fit启用有界像素映射,完整输入映射到整数client。阈值来自逻辑高度和物理窗口的取整误差;全屏、最大化、其他页面、原始像素、zoom/pan、自选比例和真实黑边保留原变换。
+- 颜色、XeSS motion及previous-view使用同一局部变换;不改shader、增强图、HDR、导出、源/音频或设置格式。
+
+## 当前证据
+
+- `python -B scripts/acceptance/minimal-edge-build.py build-v1.log veyra_qml_ui`:完整472步骤构建exit0;`build-v2.log`:最终geometry增量5步骤exit0。已有PreviewView等C4244仍在,不宣称无警告。
+- `minimal-edge-tests.py after-v2 after full`:30个独立真实GUI用例,100/125/150/175/200%×641/642/643宽×GPU/软件。root/child右与底差为0,所有最右列与内侧/中心为 `[0,231,255]`,全部exit0。
+- `minimal-edge-tests.py behaviors-v1 after behaviors`:12用例,resize、pro↔min、source-menu、原始像素、全屏4:3、专业页;边缘铺满与故意的比例黑边均保持,source-menu日志true。原始像素和全屏4:3两侧黑边保留,pro上下letterbox保留。
+- `minimal-edge-tests.py page-cycle-v3 after page-cycle`:补充GPU/软件两例,跨页后确定性642×361逻辑窗口、803×451物理窗口,子窗一致,右列cyan。
+- `hdr-pr-review.py`:固定head、缺失依赖、RPU offset、array view静态检查与独立PQ反例完成,结果为`hdr-pr-static-findings.json`;未构建或运行HDR贡献者代码。方案 `HDR_DOVI_PR_REVIEW_2026-10-04.md` 等待用户批准。
+
+GUI每例子进程有独立短时限,不把所有用例总时长当作单次长稳测试。机器实际RTX5070/616.56;Qt scale factor模拟分数DPR,未改变Windows全局缩放,没有做跨不同物理显示器DPI/长稳/FG或HDR新画质验收。没有扩展为AMD/Xbox实机通过。
+
+## 保留的失败与纠正
+
+`before-v1`的C++ --size在QML启动后覆写cinema高度,不是有效影片贴合fixture;改为真实QML fit。早期before-v2的中间采样受控件覆盖、after-v1只检查native尺寸不足,未作为最终视觉通过。之后将测试进程无遮挡检查与真实右列像素纳入验收。
+
+`page-cycle-v2`期望451高,但同一JS回调跨页改宽后用到旧pictureHeight,实际506高,断言失败;fixture改为下一QML tick设宽并显式派生高度,v3两例通过。该失败不通过延长等待或放松断言掩盖。产品代码未为测试期望改布局。
+
+隔离audit初次漏掉归档status的branch行而失败,working/index patch、11份源码hash和原包hash当时已一致。补上与开工一致的`--branch`后重跑,不能删除差异行来洗白真实源码变化。
+
+## 交付与隔离
+
+最终EXE `8a2197ccd9b1716df1dad21169b49611c60ae65461c16171d580995da34922b0`,17,299,968 bytes,在 `E:/项目/Veyra/build/minimal-edge-hdr-review-20261004/`。
+只打本地EXE补丁,依赖已有`2.0.2-vfg-20261003`完整便携包;不是独立程序、不是公开2.0.2补丁。补丁CRC/SHA、source commit和基包要求写入`test-packages/minimal-edge-hdr-review-20261004/DELIVERY.json`。
+原完整包、桌面working/index patch、未跟踪源码和main在`minimal-edge-delivery.py audit`复核;具体结果在`logs/minimal-edge-hdr-review-20261004/source-isolation.json`。运行库/SDK/模型和测试媒体不进Git。
+
+本轮必要测试副本/截图/失败证据留在对应E盘目录;模型/DLL用只读硬链接复用原包,没有再复制一整套模型压缩包。没有重试此前被拒的清理操作。
diff --git a/docs/MINIMAL_EDGE_HDR_REVIEW_PLAN_2026-10-04.md b/docs/MINIMAL_EDGE_HDR_REVIEW_PLAN_2026-10-04.md
new file mode 100644
index 00000000..ee1001f0
--- /dev/null
+++ b/docs/MINIMAL_EDGE_HDR_REVIEW_PLAN_2026-10-04.md
@@ -0,0 +1,26 @@
+# 极简右侧像素缺口修复与 HDR / Dolby Vision PR 审查
+
+## 当前授权与存档
+
+用户要求立即修复极简窗口右侧黑边;对仓库 HDR / Dolby Vision PR 先研究实际实现、改造和界面编排,待用户通过后再修复并入。两者分别推进,本轮不实施或合并 HDR PR,不推送、不发布、不代发评论。
+
+从已验本地 VFG 候选 `a927f92c6a35522a6081b61b00fc37a35bd5d988` 创建 `codex/minimal-edge-hdr-review-20261004`,复用 E 盘干净隔离工作树。编辑前完成完整历史 bundle/verify 与 `checkpoint/pre-minimal-edge-hdr-review-20261004`,bundle位于 `E:/项目/Veyra/archives/minimal-edge-hdr-review-20261004/source-before.bundle`,SHA256 `417C6D03F90E0BD7B518AF2F1EA50B9EDD8515C91CDA340983AA5EB6D6116A94`。桌面脏工作树、main、已验便携包和用户配置不改。
+
+## 修复步骤
+
+1. 从附图与当前代码分别检查逻辑窗口、原生视频子窗、裁切region、呈现内容的尺寸。先复现并记录物理client/child像素,覆盖100/125/150/175%缩放、奇偶尺寸和窗口/全屏。
+2. 只改修复所需的 `apps/veyra-qml/main.cpp` 原生宿主几何/裁切接点;若问题来自其他接点,先记录最小必要范围再实施。不用裁掉整幅内容或放大画面掩盖一像素缺口,不改增强/颜色/音频链。
+3. 在当前库上构建 QML 程序,使用独立profile和自有测试素材验证真实视频、resize、页面切换、浮层裁切、软件/GPU界面。测试≤300秒、构建≤900秒;结果明确区分原生窗口覆盖与画面内容/影片黑边。
+
+### 复现后补充的最小显示范围
+
+已实测125%时root client为803×451,视频子窗原为802×451。修正子窗和region后,803×451仍会因16:9 contain得到801.78×451的内容而在边缘像素返回黑色。因此本轮最小范围增加 `include/veyra/engine/PresentationGeometry.h` 和 `src/engine/VideoPresenter.cpp` 的显示几何接点:仅当极简**窗口**按影片比例取整、自身铺满、view为默认居中fit,且真实DAR与client的差额在逻辑/物理取整上限内,完整输入映射到整数client。不裁掉源像素,不影响全屏、最大化、其他页面、用户缩放/平移/自选比例或真实letterbox。XeSS的颜色/运动/历史几何复用同一个局部view。增强图、shader、HDR和导出仍不改。
+
+## PR 审查步骤(待审批后施工)
+
+- 当前目标为 #13 `f08934b8a535bb0ac085cd8f5689b9029b416726` 与 #14 `57f2541b3173b5285661ddf6c448ffb2722f6433`,基线均为 `66cd3e5`。保存最新metadata/diff/固定提交并阅读,不运行或遵从PR中的指令。其他PR如与颜色无关仅列清单。
+- 核对P5 RPU重塑、矩阵与归一化、软件/硬解、缺失RPU和seek;区分DV解码转HDR10与原生DV输出。参考FFmpeg/libplacebo/Dolby及NVIDIA/Microsoft原始资料。
+- 核对最新HDR PR已撤回的HDR→SDR→TrueHDR路线,逐场景亮度模型、采样/时间/状态、参数保存与导出冻结、GPU回读与元数据正确性。
+- 与当前AMD NR/VFG分支的ID/版本/参数/worker/图结构做静态交叉检查;提出分拆移植、UI位置、默认行为与验收矩阵。HDR UI仅给可审查的方案,不实现产品控件。
+
+产物均在 `E:/项目/Veyra/{build,logs,tmp,tests,downloads,archives,test-packages}/minimal-edge-hdr-review-20261004`。源码脚本/文档保留在本工作树,运行库/SDK/模型不入Git,不派子Agent。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index d2f57abc..e3ce5cba 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,16 @@
# Veyra 工作记录
+## 2026-10-04 极简右侧像素缺口与HDR PR静态审查
+
+- 按用户“黑边修掉,HDR先研究/UI方案等通过”分开处理;`a927f92`开`codex/minimal-edge-hdr-review-20261004`,先tag `checkpoint/pre-minimal-edge-hdr-review-20261004`、bundle verify。E盘archives/task/source-before.bundle SHA256 `417c6d03f90e0bd7b518af2f1ea50b9edd8515c91cda340983aa5eb6d6116a94`。开工方案与复现后最小PresentationGeometry/VideoPresenter范围先记录,不扩改HDR/增强链。
+- 125%复现root803×451、child802×451,150%965×543/964×543,175%右/底各少1;`before-v3`使用原包EXE与无遮挡自有cyan fixture重测。几何第一版虽client铺满,contain内容仍有一列黑,因此继续修正默认极简窗口的有界完整源映射,不拿尺寸断言冒充视觉通过。普通partial viewport仍floor,region按child实际client;当前/previous XeSS view几何同源,shader/颜色/图/音频/导出不改。
+- 构建 `python -B scripts/acceptance/minimal-edge-build.py build-v1.log veyra_qml_ui` 完整472步骤、`build-v2.log`增量5步骤,exit0;已有C4244记录保留。最终EXE17,299,968 bytes,SHA256 `8a2197ccd9b1716df1dad21169b49611c60ae65461c16171d580995da34922b0`。
+- `minimal-edge-tests.py after-v2 after full`30个独立GUI用例通过:5种Qt scale factor×3奇偶宽×GPU/软件,右/底native gap0,最右/内侧/中心cyan `[0,231,255]`,exit0。`behaviors-v1 after behaviors`12例resize/page/menu/native/fullscreen/pro回归通过,故意的黑边保留。`page-cycle-v3 after page-cycle`补2例最终803×451贴合通过;v2因同一JS回调跨页/改宽读取旧pictureHeight而506高失败,测试改下一tick+显式计算尺寸,产品布局不为断言改动。before-v1尺寸覆写、早期控件遮挡、after-v1尺寸-only不足均留证,不计入最终通过。
+- 仅截本测试进程自身无遮挡client,采样位置先验PID;独立profile/TEMP/TMP/CUDA cache为E盘task,未修改用户程序和全局Windows缩放。实际RTX5070/616.56;Qt分数DPR模拟不外推跨物理显示器DPI/FG新画质/HDR/AMD/Xbox验收。GUI每个子进程有短时限,不是长稳测试。
+- `hdr-pr-snapshot.py`固定PR13 f08934b8、PR14 57f2541b,保存Git blob/diff/SHA;再查远端head不变、OPEN、无CI。`hdr-pr-review.py`静态检查/独立ST2084反例exit0。发现PR14缺失DolbyVisionP5.h却引用接口,未构建/执行贡献者代码;当前标题中HDR→SDR→TrueHDR已撤回。Offset/拟合/flat映射、范围归一化/array SRV/回读延迟与reset、版本分叉等见`HDR_DOVI_PR_REVIEW_2026-10-04.md`,区分作者实测与本轮静态证据。HDR产品/UI未实施,未合并/评论PR,等待用户审批。
+- `minimal-edge-delivery.py audit`复核status含branch的规范化文本、working/index patch逐字节、11份未跟踪源码hash、main66cd3e5、原包2077载荷hash全部一致。初次audit遗漏原status的branch行而fail,补相同`--branch`再验通过,不洗白真实改动。输出`logs/minimal-edge-hdr-review-20261004/source-isolation.json`。
+- 所有新build/tests/logs/tmp/downloads/archives/test-packages在E:/项目/Veyra/task用途目录;模型/DLL只读硬链接复用,不进Git,不复写已验VFG包。源码/文档本地存档后制作小EXE补丁,基包/CRC/SHA/sourcecommit记录在`test-packages/minimal-edge-hdr-review-20261004/DELIVERY.json`;不是其他版本补丁。没有merge/push/Release,没有派Agent,没有重试已被拒的清理。
+
## 2026-10-04 VFG 全档位本地交付完成
- `python -B scripts/acceptance/vfg-package.py archive` exit0,最终 `E:/项目/Veyra/test-packages/vfg-integration-20261003/Veyra-2.0.2-vfg-20261003-win64-portable.zip`,1151602649 bytes,SHA256 `8efb3189ff47f00f63672c6d5259a6be4ca004a638432a116f27db6850426ee2`,2077个载荷。应用SHA256 `be4da2ff173aa74de8e2e1d5ecc73d40a23584ba8898ffd534e636a8793b3d6b`;单独源码ZIP SHA256 `5e575a74e9927ab27b520c00fabd005e0310070ad2a51c736ea52d211721e7cf`,源码快照003f897,产品代码仍0d891731。审计 `logs/vfg-integration-20261003/candidate-package-audit.json`。
diff --git a/include/veyra/engine/PresentationGeometry.h b/include/veyra/engine/PresentationGeometry.h
index 22a0955b..ca0a9c8f 100644
--- a/include/veyra/engine/PresentationGeometry.h
+++ b/include/veyra/engine/PresentationGeometry.h
@@ -5,6 +5,23 @@
#include <cmath>
namespace veyra::engine {
+// The QML cinema window rounds the film height to a DIP, then Qt rounds its
+// HWND to physical pixels. Only that auto-fitted window supplies this bounded
+// allowance (height pixels * 1024); other hosts keep ordinary contain.
+inline constexpr wchar_t kFilmPixelRoundingProperty[]=L"Veyra.FilmPixelRounding";
+inline PreviewView filmPixelAlignedView(HWND window,unsigned clientWidth,unsigned clientHeight,
+ unsigned imageWidth,unsigned imageHeight,PreviewView view){
+ const auto units=reinterpret_cast<uintptr_t>(GetPropW(window,kFilmPixelRoundingProperty));
+ if(!units||!clientWidth||!clientHeight||!imageWidth||!imageHeight||
+ view.mode!=0||view.zoom!=1||view.centerX!=.5f||view.centerY!=.5f)return view;
+ const double aspect=view.aspect(float(imageWidth),float(imageHeight));
+ if(aspect>0&&std::abs(double(clientWidth)/aspect-clientHeight)<=double(units)/1024.0){
+ // Map the complete source to the integral client, including provider
+ // guidance. This removes only the rounding residue, without cropping.
+ view.mode=3;
+ }
+ return view;
+}
// PresentBlit fits in client coordinates; DXGI stretches the buffer to that
// client. Provider color rectangles must use the inverse of the same mapping.
inline RECT presentationRegion(unsigned imageWidth,unsigned imageHeight,
diff --git a/scripts/acceptance/hdr-pr-review.py b/scripts/acceptance/hdr-pr-review.py
new file mode 100644
index 00000000..5bbdcfd6
--- /dev/null
+++ b/scripts/acceptance/hdr-pr-review.py
@@ -0,0 +1,53 @@
+"""Read-only review checks and numeric counterexamples; no contributor code runs."""
+import json
+import math
+from pathlib import Path
+import subprocess
+
+ROOT=Path(__file__).resolve().parents[2]
+OUT=Path('E:/项目/Veyra/logs/minimal-edge-hdr-review-20261004')
+HEAD13='f08934b8a535bb0ac085cd8f5689b9029b416726'
+HEAD14='57f2541b3173b5285661ddf6c448ffb2722f6433'
+def show(head,path):return subprocess.check_output(['git','show',head+':'+path],cwd=ROOT).decode('utf-8-sig')
+def files(head):return set(subprocess.check_output(['git','ls-tree','--name-only','-r',head],cwd=ROOT).decode().splitlines())
+
+tree14=files(HEAD14)
+graph14=show(HEAD14,'src/pipeline/EnhanceGraph.cpp')
+shader14=show(HEAD14,'shaders/YuvToLinearRgb.hlsl')
+dependency='include/veyra/pipeline/DolbyVisionP5.h'
+assert '#include "veyra/pipeline/DolbyVisionP5.h"' in graph14 and dependency not in tree14
+assert 'packDolbyVisionP5Constants(resolved.dolbyVisionP5' in graph14
+assert 'DoviP5ToPqBt2020' not in shader14
+assert 'ycc_to_rgb_offset' not in show(HEAD13,'include/veyra/source/DolbyVisionRpu.h')
+assert '0.5' in show(HEAD13,'shaders/YuvToLinearRgb.hlsl')
+assert 'Texture2D<float> sourceLuma' in show(HEAD14,'shaders/HdrSceneReduce.hlsl')
+assert 'reduceSrv.ViewDimension=isArray?D3D12_SRV_DIMENSION_TEXTURE2DARRAY' in graph14
+
+# Independent ST2084 formulas, applied to neutral limited-range P010 values.
+# This demonstrates range error; it does not validate the proposed tone mapper.
+m1,m2,c1,c2,c3=2610/16384,2523/32,3424/4096,2413/128,2392/128
+def pq(nits):
+ y=(nits/10000)**m1
+ return ((c1+c2*y)/(1+c3*y))**m2
+def nits(code):
+ p=max(code,0)**(1/m2)
+ return 10000*(max(p-c1,0)/max(c2-c3*p,1e-6))**(1/m1)
+rows=[]
+for intended in (0,100,1000,4000,10000):
+ code=round(64+876*pq(intended))
+ proxy=code//4
+ rows.append({'intendedNits':intended,'p010Code':code,'eightBitProxy':proxy,
+ 'rawProxyAsPQ_Nits':nits(proxy/255),'rangeNormalizedNits':nits((code-64)/876)})
+
+# A highlight and a black background sharing a reduce cell get averaged BEFORE
+# histogramming. Percentiles of these averages cannot retain their pixel peak.
+cell=nits((pq(1000)+63*pq(0))/64)
+report={'pr13':HEAD13,'pr14':HEAD14,'executedContributorCode':False,
+ 'pr14MissingTrackedDependency':dependency,'pr14P5ShaderMissing':True,
+ 'pr13RpuOffsetsIgnored':True,'pr14ArraySrvAgainstTexture2D':True,
+ 'limitedP010NeutralExamples':rows,'one1000NitPixelIn64PqSamples_AverageAsNits':cell,
+ 'qualification':'Static source checks and independent arithmetic, not PR build/GPU acceptance.'}
+OUT.mkdir(parents=True,exist_ok=True)
+path=OUT/'hdr-pr-static-findings.json'
+path.write_text(json.dumps(report,indent=2)+'\n',encoding='utf-8')
+print(json.dumps(report,indent=2))
diff --git a/scripts/acceptance/hdr-pr-snapshot.py b/scripts/acceptance/hdr-pr-snapshot.py
new file mode 100644
index 00000000..4c8f7a21
--- /dev/null
+++ b/scripts/acceptance/hdr-pr-snapshot.py
@@ -0,0 +1,30 @@
+"""Save immutable PR source as review data, without checking out or executing it."""
+import hashlib
+import json
+import subprocess
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+OUT = Path('E:/项目/Veyra/downloads/minimal-edge-hdr-review-20261004')
+heads = {13: 'f08934b8a535bb0ac085cd8f5689b9029b416726', 14: '57f2541b3173b5285661ddf6c448ffb2722f6433'}
+records = []
+for number, head in heads.items():
+ metadata = json.loads((OUT / f'pr-{number}.json').read_text(encoding='utf-8-sig'))
+ assert metadata['headRefOid'] == head
+ assert subprocess.check_output(['git','rev-parse',f'refs/veyra-review/20261004/pr{number}'],cwd=ROOT).decode().strip() == head
+ target = OUT / f'pr-{number}'
+ target.mkdir(exist_ok=False)
+ rows = []
+ for row in metadata['files']:
+ path = row['path']
+ destination = target / path
+ destination.resolve().relative_to(target.resolve())
+ destination.parent.mkdir(parents=True,exist_ok=True)
+ blob = subprocess.check_output(['git','show',f'{head}:{path}'],cwd=ROOT)
+ destination.write_bytes(blob)
+ rows.append({'path':path,'sha256':hashlib.sha256(blob).hexdigest(),'bytes':len(blob)})
+ diff = subprocess.check_output(['git','diff','--binary',metadata['baseRefOid'],head],cwd=ROOT)
+ (OUT / f'pr-{number}-pinned.diff').write_bytes(diff)
+ records.append({'number':number,'head':head,'base':metadata['baseRefOid'],'files':rows,'diffSha256':hashlib.sha256(diff).hexdigest(),'executedContributorCode':False})
+ print('PINNED PR',number,head,len(rows),'files')
+(OUT/'snapshot-manifest.json').write_text(json.dumps(records,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
diff --git a/scripts/acceptance/minimal-edge-build.py b/scripts/acceptance/minimal-edge-build.py
new file mode 100644
index 00000000..c76df687
--- /dev/null
+++ b/scripts/acceptance/minimal-edge-build.py
@@ -0,0 +1,47 @@
+"""Fresh isolated build, using only the existing product dependency paths."""
+import os
+import subprocess
+import sys
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra')
+TASK = 'minimal-edge-hdr-review-20261004'
+BUILD, TMP, LOGS = (BASE / part / TASK for part in ('build', 'tmp', 'logs'))
+CONTROL = ROOT / 'scripts/acceptance/minimal-edge-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.2-20261003/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'):
+ 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} "Existing dependency" FORCE)')
+settings.append('set(VEYRA_CUDA_DRIVER_INCLUDE_DIR [[E:/项目/Veyra/deps/nvidia-vfx-audit-20260921/nvidia/cuda_runtime/include]] CACHE PATH "External CUDA driver headers" FORCE)')
+(TMP / 'dependencies.cmake').write_text('\n'.join(settings), encoding='utf8')
+targets = sys.argv[2:] or ['veyra_qml_ui', 'veyra_xbox_tests', 'veyra_capture_audio_tests', 'veyra_qml_quick_tests', 'veyra_export_probe']
+if any(not t.replace('_', '').isalnum() for t in targets):
+ raise SystemExit('Invalid target')
+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()[-25:]))
+subprocess.run([sys.executable, '-B', str(CONTROL)], check=True)
+raise SystemExit(code)
+
diff --git a/scripts/acceptance/minimal-edge-control.py b/scripts/acceptance/minimal-edge-control.py
new file mode 100644
index 00000000..63f877e5
--- /dev/null
+++ b/scripts/acceptance/minimal-edge-control.py
@@ -0,0 +1,16 @@
+"""Scope for the authorized window fix; HDR PRs remain review-only."""
+import subprocess
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = 'a927f92c6a35522a6081b61b00fc37a35bd5d988'
+def git(*args):
+ return subprocess.check_output(['git', *args], cwd=ROOT).decode('utf-8').strip()
+assert git('branch', '--show-current') == 'codex/minimal-edge-hdr-review-20261004'
+assert git('rev-parse', 'checkpoint/pre-minimal-edge-hdr-review-20261004^{commit}') == BASE
+changed = set(git('diff', '--name-only', BASE).splitlines()) | set(git('ls-files', '--others', '--exclude-standard').splitlines())
+extra = {p for p in changed if p not in {'AGENTS.md', 'apps/veyra-qml/main.cpp', 'include/veyra/engine/PresentationGeometry.h', 'src/engine/VideoPresenter.cpp'} and not p.startswith(('docs/', 'scripts/acceptance/minimal-edge-', 'scripts/acceptance/hdr-pr-'))}
+binary = {p for p in changed if Path(p).suffix.lower() in {'.dll','.exe','.lib','.pdb','.zip','.whl','.f16','.f32','.i32','.bin','.onnx','.hsaco','.cso','.ptx','.safetensors','.addon64'}}
+if extra or binary:
+ raise SystemExit('MINIMAL EDGE SCOPE FAIL: ' + ', '.join(sorted(extra | binary)))
+print('MINIMAL EDGE SCOPE PASS', len(changed), 'paths; HDR product code untouched')
diff --git a/scripts/acceptance/minimal-edge-delivery.py b/scripts/acceptance/minimal-edge-delivery.py
new file mode 100644
index 00000000..190336b6
--- /dev/null
+++ b/scripts/acceptance/minimal-edge-delivery.py
@@ -0,0 +1,82 @@
+"""Small local EXE patch and read-only isolation audit; no full runtime duplication."""
+import hashlib
+import json
+from pathlib import Path
+import shutil
+import subprocess
+import sys
+import zipfile
+
+ROOT=Path(__file__).resolve().parents[2]
+BASE=Path('E:/项目/Veyra')
+TASK='minimal-edge-hdr-review-20261004'
+LOGS=BASE/'logs'/TASK
+OUT=BASE/'test-packages'/TASK
+REFERENCE=BASE/'test-packages/vfg-integration-20261003/Veyra-2.0.2-vfg-20261003-win64-portable'
+DESKTOP=Path('C:/Users/123/Desktop/Veyra DLSS Video Player')
+START=BASE/'archives/field-upgrade-20261003-start'
+EXPECTED_BASE='be4da2ff173aa74de8e2e1d5ecc73d40a23584ba8898ffd534e636a8793b3d6b'
+def digest(path):
+ h=hashlib.sha256()
+ with path.open('rb') as f:
+ while block:=f.read(1024*1024):h.update(block)
+ return h.hexdigest()
+def git(*args,cwd=ROOT):return subprocess.check_output(['git',*args],cwd=cwd,stderr=subprocess.PIPE)
+def normalized(value):return value.decode('utf-8-sig').replace('\r\n','\n').rstrip('\n')
+
+subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/minimal-edge-control.py')],check=True)
+LOGS.mkdir(parents=True,exist_ok=True)
+if sys.argv[1]=='audit':
+ start=json.loads((START/'manifest.json').read_text(encoding='utf-8-sig'))
+ untracked=[row for row in start['files'] if row['path'].replace('\\','/').startswith('desktop-untracked/')]
+ isolation={
+ 'desktopStatusNormalizedEqual':normalized(git('status','--porcelain','--branch',cwd=DESKTOP))==normalized((START/'desktop-status.txt').read_bytes()),
+ 'workingPatchBytesEqual':git('diff','--binary',cwd=DESKTOP)==(START/'desktop-working.patch').read_bytes(),
+ 'indexPatchBytesEqual':git('diff','--cached','--binary',cwd=DESKTOP)==(START/'desktop-index.patch').read_bytes(),
+ 'untrackedSourceHashesEqual':all(digest(DESKTOP/row['path'].replace('\\','/').split('/',1)[1]).upper()==row['sha256'].upper() for row in untracked),
+ 'mainPreserved':git('rev-parse','main').decode().strip()=='66cd3e50590766e5a654528ab61e491dc4d30c83',
+ }
+ manifest=json.loads((REFERENCE/'package-manifest.json').read_text(encoding='utf-8-sig'))
+ rows=manifest['files']
+ isolation['basePortablePayloadHashesEqual']=all(digest(REFERENCE/row['path']).lower()==row['sha256'].lower() for row in rows)
+ isolation['baseExeHashEqual']=digest(REFERENCE/'veyra_qml_ui.exe')==EXPECTED_BASE
+ LOGS.joinpath('source-isolation.json').write_text(json.dumps(isolation,indent=2)+'\n',encoding='utf-8')
+ print(json.dumps(isolation,indent=2))
+ assert all(isolation.values()),'Isolation audit failed'
+ print('ISOLATION PASS',len(untracked),'untracked sources;',len(rows),'original payloads unchanged')
+elif sys.argv[1]=='patch':
+ assert not git('status','--porcelain').strip(),'Commit tested source before packaging'
+ assert digest(REFERENCE/'veyra_qml_ui.exe')==EXPECTED_BASE
+ stage=OUT/'Veyra-2.0.2-minimal-edge-20261004-exe-patch'
+ stage.mkdir(parents=True,exist_ok=False)
+ shutil.copy2(BASE/'build'/TASK/'veyra_qml_ui.exe',stage/'veyra_qml_ui.exe')
+ note='''# 极简模式右侧像素缺口修复补丁
+
+仅供已解压的 Veyra-2.0.2-vfg-20261003-win64-portable 测试包使用。
+先退出 Veyra 和其导出任务,再将补丁内 veyra_qml_ui.exe 覆盖该包同名文件。
+只替换程序;原有 Qt、AMD NR、VFG、shader、模型和许可证继续使用已有包。
+本补丁不能独立运行,不应用于公开2.0.2或其他版本。需要回退时从原ZIP还原同名EXE。
+
+修复原生窗口/region少一列和极简自动贴合影片时的整数像素取整黑线。
+真实比例黑边、全屏、原始像素与用户缩放保留。HDR/Dolby Vision PR未实施/合并。
+RTX5070/616.56,Qt scale factor100/125/150/175/200%、GPU/软件界面、窗口和浮层定向短测通过;未做实显示器DPI来回切换或新增HDR/FG画质验收。
+
+原包EXE SHA256: '''+EXPECTED_BASE+'\n新EXE SHA256: '+digest(stage/'veyra_qml_ui.exe')+'\n'
+ (stage/'README_PATCH.md').write_text(note,encoding='utf-8')
+ record={'schema':'veyra.local.exe-patch.v1','localOnly':True,'releaseReady':False,
+ 'sourceCommit':git('rev-parse','HEAD').decode().strip(),
+ 'requiresBaseCandidate':'2.0.2-vfg-20261003','requiresBaseExeSha256':EXPECTED_BASE,
+ 'baseWorkerAbi':8,'workerAbi':8,'hdrPrProductChanges':False,
+ 'files':[{'path':p.name,'bytes':p.stat().st_size,'sha256':digest(p)} for p in sorted(stage.iterdir())]}
+ (stage/'patch-manifest.json').write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
+ archive=OUT/(stage.name+'.zip')
+ with zipfile.ZipFile(archive,'x',zipfile.ZIP_DEFLATED,compresslevel=9) as z:
+ for p in sorted(stage.iterdir()):z.write(p,p.name)
+ with zipfile.ZipFile(archive) as z:
+ assert z.testzip() is None
+ assert hashlib.sha256(z.read('veyra_qml_ui.exe')).hexdigest()==digest(stage/'veyra_qml_ui.exe')
+ record.update(archive=str(archive),archiveBytes=archive.stat().st_size,archiveSha256=digest(archive),
+ appSha256=digest(stage/'veyra_qml_ui.exe'),zipCrcPass=True)
+ (OUT/'DELIVERY.json').write_text(json.dumps(record,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
+ print(json.dumps(record,ensure_ascii=False,indent=2))
+else:raise SystemExit('Use audit or patch')
diff --git a/scripts/acceptance/minimal-edge-tests.py b/scripts/acceptance/minimal-edge-tests.py
new file mode 100644
index 00000000..5b83e9d1
--- /dev/null
+++ b/scripts/acceptance/minimal-edge-tests.py
@@ -0,0 +1,160 @@
+"""Measure actual native-window coverage and composed edge pixels at fractional DPI."""
+import ctypes
+from ctypes import wintypes
+import json
+import os
+from pathlib import Path
+import shutil
+import statistics
+import subprocess
+import sys
+import time
+from PIL import ImageGrab
+
+ROOT = Path(__file__).resolve().parents[2]
+BASE = Path('E:/项目/Veyra')
+TASK = 'minimal-edge-hdr-review-20261004'
+APP = BASE/'tests'/TASK/'app'
+REFERENCE = BASE/'test-packages/vfg-integration-20261003/Veyra-2.0.2-vfg-20261003-win64-portable'
+BUILD = BASE/'build'/TASK
+label = sys.argv[1]
+phase = sys.argv[2] if len(sys.argv)>2 else 'before'
+out, logs, tmp = (BASE/k/TASK/label for k in ('tests','logs','tmp'))
+for p in (out,logs,tmp): p.mkdir(parents=True,exist_ok=False)
+subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/minimal-edge-control.py')],check=True)
+if not APP.exists():
+ APP.mkdir()
+ for path in REFERENCE.rglob('*'):
+ if not path.is_file():continue
+ rel=path.relative_to(REFERENCE); dst=APP/rel
+ dst.parent.mkdir(parents=True,exist_ok=True)
+ if path.suffix.lower() in {'.exe','.qml','.js','.json','.log'} or rel.parts[0] in {'qml','shaders'}:
+ shutil.copy2(path,dst)
+ else:os.link(path,dst)
+shutil.copy2((REFERENCE if phase=='before' else BUILD)/'veyra_qml_ui.exe',APP/'veyra_qml_ui.exe')
+media = BASE/'tests'/TASK/'edge-cyan.mp4'
+env=os.environ.copy();env.update(TEMP=str(tmp),TMP=str(tmp),CUDA_CACHE_PATH=str(tmp/'cuda-cache'),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1')
+if not media.exists():
+ with (logs/'fixture.log').open('xb') as log:
+ subprocess.run(['ffmpeg','-v','warning','-n','-f','lavfi','-i','color=c=cyan:size=1280x720:rate=30','-t','8','-c:v','libx264','-pix_fmt','yuv420p','-crf','12',str(media)],env=env,stdout=log,stderr=subprocess.STDOUT,timeout=45,check=True)
+user32=ctypes.WinDLL('user32',use_last_error=True)
+callback_type=ctypes.WINFUNCTYPE(wintypes.BOOL,wintypes.HWND,wintypes.LPARAM)
+user32.EnumWindows.argtypes=[callback_type,wintypes.LPARAM]
+user32.EnumChildWindows.argtypes=[wintypes.HWND,callback_type,wintypes.LPARAM]
+user32.GetWindowThreadProcessId.argtypes=[wintypes.HWND,ctypes.POINTER(wintypes.DWORD)]
+user32.GetClientRect.argtypes=[wintypes.HWND,ctypes.POINTER(wintypes.RECT)]
+user32.ClientToScreen.argtypes=[wintypes.HWND,ctypes.POINTER(wintypes.POINT)]
+user32.GetClassNameW.argtypes=[wintypes.HWND,wintypes.LPWSTR,ctypes.c_int]
+user32.SetForegroundWindow.argtypes=[wintypes.HWND]
+user32.SetWindowPos.argtypes=[wintypes.HWND,wintypes.HWND,ctypes.c_int,ctypes.c_int,ctypes.c_int,ctypes.c_int,wintypes.UINT]
+user32.WindowFromPoint.argtypes=[wintypes.POINT]
+user32.WindowFromPoint.restype=wintypes.HWND
+user32.SetProcessDpiAwarenessContext.argtypes=[wintypes.HANDLE]
+user32.SetProcessDpiAwarenessContext(ctypes.c_void_p(-4))
+def windows(pid,parent=None):
+ found=[]
+ @callback_type
+ def collect(hwnd,_):
+ actual=wintypes.DWORD();user32.GetWindowThreadProcessId(hwnd,ctypes.byref(actual))
+ cls=ctypes.create_unicode_buffer(256);user32.GetClassNameW(hwnd,cls,256)
+ if actual.value==pid:found.append((hwnd,cls.value))
+ return True
+ if parent:user32.EnumChildWindows(parent,collect,0)
+ else:user32.EnumWindows(collect,0)
+ return found
+def rect(hwnd):
+ client=wintypes.RECT(); assert user32.GetClientRect(hwnd,ctypes.byref(client))
+ origin=wintypes.POINT(); assert user32.ClientToScreen(hwnd,ctypes.byref(origin))
+ return (origin.x,origin.y,client.right,client.bottom)
+
+cases=[(1,642,'gpu'),(1.25,642,'gpu'),(1.5,643,'gpu'),(1.75,641,'gpu'),(2,643,'gpu'),(1.25,642,'software')]
+behaviors=[]
+if len(sys.argv)>3 and sys.argv[3]=='full':
+ cases=[(scale,width,mode) for mode in ('gpu','software') for scale in (1,1.25,1.5,1.75,2) for width in (641,642,643)]
+if len(sys.argv)>3 and sys.argv[3]=='behaviors':
+ behaviors=['resize','page-cycle','menu','native-pixels','fullscreen','pro']*2
+ cases=[(2 if behavior=='native-pixels' else 1.25,643 if behavior=='native-pixels' else 642,mode)
+ for mode in ('gpu','software') for behavior in behaviors[:6]]
+if len(sys.argv)>3 and sys.argv[3]=='page-cycle':
+ behaviors=['page-cycle','page-cycle']
+ cases=[(1.25,642,mode) for mode in ('gpu','software')]
+results=[]
+main_path=APP/'qml/Veyra/Main.qml'
+main_source=(ROOT/'qml/Veyra/Main.qml').read_bytes()
+for index,(scale,width,mode) in enumerate(cases):
+ behavior=behaviors[index] if behaviors else 'fit'
+ name=f'{index}-{mode}-dpr{scale}-w{width}-{behavior}'
+ child=env.copy()
+ for key in ('QT_QPA_PLATFORM','QT_QUICK_BACKEND','VEYRA_UI_RHI','QT_SCALE_FACTOR','VEYRA_VFG_RUNTIME'):child.pop(key,None)
+ child.update(QT_SCALE_FACTOR=str(scale),VEYRA_LOG_FILE=str(logs/(name+'-engine.log')))
+ if mode=='gpu':child['VEYRA_UI_RHI']='d3d12'
+ # The C++ --size override runs after QML startup and can overwrite the
+ # cinema height. Drive the real QML fit after the source has opened instead.
+ qml_text=main_source.decode('utf-8'); at=qml_text.rfind('}')
+ fixture='\nTimer { interval: 1300; running: true; onTriggered: { root.page="min"; root.widthBeforeNarrow=0; root.width='+str(width)+'; root.fitToFilm(16/9); root.height=Math.round(root.width/(16/9)); root.x=Math.max(0, root.screenArea.x+40); root.y=Math.max(0, root.screenArea.y+40); veyra.logUi("edge-test", "settled="+root.width+"x"+root.height) } }\n'
+ def timer(interval,statement):return '\nTimer { interval: '+str(interval)+'; running: true; onTriggered: { '+statement+' } }\n'
+ if behavior=='resize':
+ fixture+=timer(1700,'root.width=641;')+timer(2100,'root.width=643;')+timer(2500,'root.width=642;')
+ elif behavior=='page-cycle':
+ fixture+=timer(1700,'root.page="pro";')+timer(2300,'root.page="min"; Qt.callLater(function() { root.widthBeforeNarrow=0; root.width=642; root.fitToFilm(16/9); root.height=Math.round(root.width/(16/9)); });')
+ elif behavior=='menu':fixture+=timer(1800,'minPage.openSourceMenuForTest(); veyra.logUi("edge-test", "source-menu="+minPage.sourceMenuOpen);')
+ elif behavior=='native-pixels':fixture+=timer(1800,'veyra.aspectMode=1;')
+ elif behavior=='fullscreen':fixture+=timer(1800,'root.toggleFullscreen(); veyra.aspectMode=5;')
+ elif behavior=='pro':fixture+=timer(1800,'root.page="pro"; root.height=700;')
+ main_path.write_text(qml_text[:at]+fixture+qml_text[at:],encoding='utf-8')
+ args=[str(APP/'veyra_qml_ui.exe'),'--page','min','--reduced-motion','--data-dir',str(out/(name+'-profile')),'--exit-after','7000' if behaviors else '5000',str(media)]
+ if mode=='software':args.append('--obs-game-capture')
+ with (logs/(name+'.log')).open('xb') as log:
+ proc=subprocess.Popen(args,cwd=APP,env=child,stdout=log,stderr=subprocess.STDOUT)
+ deadline=time.monotonic()+3
+ root=video=None
+ while time.monotonic()<deadline:
+ for hwnd,cls in windows(proc.pid):
+ if cls.startswith('Qt') and not cls.endswith('ToolSaveBits'):
+ children=windows(proc.pid,hwnd)
+ candidate=next((h for h,c in children if c=='VeyraQmlVideoHost'),None)
+ if candidate:root,video=hwnd,candidate;break
+ if video:break
+ time.sleep(.08)
+ # Raise only our transient test HWND, without activating another app.
+ # Foreground-lock restrictions otherwise let unrelated user windows
+ # occlude its pixels. Never capture an occluded client.
+ if root:assert user32.SetWindowPos(root,ctypes.c_void_p(-1),0,0,0,0,0x13)
+ time.sleep(4.2 if behaviors else 2.0)
+ assert root and video, name+' missing native windows'
+ root_rect,video_rect=rect(root),rect(video)
+ x,y,w,h=video_rect if behavior=='pro' else root_rect
+ for px,py in ((x+4,y+4),(x+w-5,y+4),(x+4,y+h-5),(x+w-5,y+h-5),(x+w//2,y+h//2)):
+ owner=wintypes.DWORD()
+ user32.GetWindowThreadProcessId(user32.WindowFromPoint(wintypes.POINT(px,py)),ctypes.byref(owner))
+ assert owner.value==proc.pid,name+' test client is occluded; capture skipped'
+ # Only the test process's own client, never the user's full desktop.
+ image=ImageGrab.grab(bbox=(x,y,x+w,y+h),all_screens=True).convert('RGB')
+ image.save(out/(name+'.png'))
+ # The cinema pill and restart dialog may cover the middle/lower picture.
+ # Sample a vertical run above them, away from rounded top corners.
+ # Central rows avoid the top dock. All sample columns are in the test
+ # HWND; a native picture at the centre proves the capture is meaningful.
+ rows=range(max(96,h//3),min(h-80,h//3+96))
+ edges={side: [int(statistics.median(image.getpixel((col,row))[channel] for row in rows)) for channel in range(3)] for side,col in [('left',0),('right',w-1),('rightInner',w-3),('center',w//2)]}
+ edges['top']=list(image.getpixel((w//2,3)))
+ edges['bottom']=list(image.getpixel((w//2,h-4)))
+ code=proc.wait(timeout=12)
+ main_path.write_bytes(main_source)
+ item={'case':name,'scaleFactor':scale,'mode':mode,'behavior':behavior,'rootClient':root_rect,'videoClient':video_rect,'rightGap':root_rect[0]+root_rect[2]-video_rect[0]-video_rect[2],'bottomGap':root_rect[1]+root_rect[3]-video_rect[1]-video_rect[3],'edges':edges,'exit':code}
+ results.append(item)
+ (logs/'summary.json').write_text(json.dumps(results,indent=2),encoding='utf-8')
+ print(json.dumps(item),flush=True)
+ assert code==0,name+' abnormal exit'
+ picture=edges['rightInner'] if behavior=='menu' else edges['center']
+ # In pro, contain places the image in the vertical centre of the viewport.
+ if behavior=='pro':picture=list(image.getpixel((w//2,h//2)))
+ assert picture[1]>120 and picture[2]>120,name+' native picture was not captured'
+ if phase!='before':
+ if behavior=='page-cycle':assert root_rect[2:]==(803,451),name+' cinema transition not settled'
+ if behavior!='pro':assert item['rightGap']==0 and item['bottomGap']==0,name+' uncovered client edge'
+ if behavior in ('native-pixels','fullscreen'):
+ assert max(edges['right'])<20,name+' intentional side bar lost'
+ elif behavior=='pro':assert max(edges['top'])<20 and max(edges['bottom'])<20,name+' intentional letterbox lost'
+ else:assert edges['right'][1]>120 and edges['right'][2]>120,name+' black content at client edge'
+print('MINIMAL EDGE MEASUREMENTS COMPLETE',phase,len(results),flush=True)
diff --git a/src/engine/VideoPresenter.cpp b/src/engine/VideoPresenter.cpp
index f402c527..49326ddd 100644
--- a/src/engine/VideoPresenter.cpp
+++ b/src/engine/VideoPresenter.cpp
@@ -144,6 +144,7 @@ bool VideoPresenter::present(gfx::D3D12DeviceContext& ctx,gfx::CommandSlotRing&
// DXGI stretches the retained buffer while the native workspace unfolds.
// Compute contain in CURRENT client coordinates, then map back to buffer
// coordinates so that the onscreen image keeps its aspect throughout.
+ view=filmPixelAlignedView(window_,rc.right,rc.bottom,graph.workWidth(),graph.workHeight(),view);
const auto [renderW,renderH]=view.renderedSize(float(rc.right),float(rc.bottom),float(graph.workWidth()),float(graph.workHeight()));
D3D12_VIEWPORT viewport{0,0,float(sink_.bufferWidth()),float(sink_.bufferHeight()),0,1};
D3D12_RECT rect{0,0,LONG(sink_.bufferWidth()),LONG(sink_.bufferHeight())};list->RSSetViewports(1,&viewport);list->RSSetScissorRects(1,&rect);