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++
Tolerate isolated capture noise in content dedup; drop the coarse FG duplicate discard
Veyra Goal Agent358be8cfe82a
diff --git a/AGENTS.md b/AGENTS.mdindex bd1a565b..6a1e3b76 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,5 +1,10 @@# Veyra Agent 工作规则+> **2026-11-02 自动剔除重复帧修复(最新)**:用户要求合并到main并重新打包2.1.2。修复在分支claude/dedup-precise-20261102提交后快进合入main,活动树回到main;未push/Release。重打的2.1.2包放在test-packages/claude-build-2.1.2-dedup-20261102,结果见活动树docs/BUILD_2.1.2_TEST_2026-11-02.md末节。+> - 改动:整画面去重容忍约百万分之五的超界分量;删除图内64×36弃帧。+> - 运行目录tests/claude-sr-stage-20261028/app已换成修复后的EXE fb1e3ad7…;Codex的首个2.1.2包目录(含用户设置)不动。+> - 记录:活动树docs/DEDUP_PRECISE_2026-11-02.md;回执reports/claude-dedup-precise-20261102/FINAL.json。+> **2026-11-02 用户授权main整合及2.1.2本地测试包**:最近14文件修复已提交9e836ab并快进main(原8535791);活动树现main。之前已完成Claude/Codex产品分支均是main祖先;Lecram两线和AverMedia诊断存档继续保留不并。2.1.2测试包已从main产品快照47b5e84构建并验证,PE2.1.2.0;交付test-packages/codex-build-2.1.2-20261102(两GPU包/ZIP/源码/独立配置启动脚本)。8组合同、QML132/0/1、三组GPU短测、ZIP及解压冷启动通过;记录活动树docs/BUILD_2.1.2_TEST_2026-11-02.md,后续仅文档提交。未授权GitHub推送/发布。准确结果见reports/codex-build-2.1.2-20261102/FINAL.json。> **2026-11-01 极简音量交互修复(最新)**:当前claude/vsync-jitter-wait-20261102工作区同时保留之前补帧修改与本轮QML音量修复,未提交/合并/发布。音量两端/快速拖动、Return/Enter和空白提交、焦点清理及播放条移动手势隔离已验;QtQuick132/0/1,真实Windows极简操作通过。运行目录仍tests/claude-sr-stage-20261028/app,记录活动树docs/MINIMAL_VOLUME_FIX_2026-11-01.md,回执reports/codex-cinema-volume-20261101/FINAL.json。diff --git a/docs/BUILD_2.1.2_TEST_2026-11-02.md b/docs/BUILD_2.1.2_TEST_2026-11-02.mdindex cb315600..83b33fab 100644--- a/docs/BUILD_2.1.2_TEST_2026-11-02.md+++ b/docs/BUILD_2.1.2_TEST_2026-11-02.md@@ -54,3 +54,15 @@ NVIDIA ZIP 676470641字节、1634项payload;AMD ZIP716404207字节、2260项pa阶段纠正:最初 `py_compile` 生成单个未跟踪pyc,导致stage的干净源码检查正确拒绝;核对绝对路径后只删除该自生成文件,再stage成功,源码ZIP无pyc/测试缓存。没有修改校验规则绕过检查。新27项模型/兼容组件来自此前已授权本地研发的固定子集,原默认运行组件原字节保持;没有新发布授权扩展。输出根目录 `E:/项目/Veyra/test-packages/codex-build-2.1.2-20261102`;独立启动脚本 `启动2.1.2-NVIDIA测试.cmd` / `启动2.1.2-AMD测试.cmd`,使用 `tests/codex-build-2.1.2-20261102/interactive-*` 配置。原共享开发运行目录也已更新,旧真实配置及所有旧脏树保护核验见FINAL。后续提交只补文档,用户包源码快照和产品二进制仍对应47b5e84;未push/Release,公开正式版仍2.1.1。++## 2026-11-02 重新打包:加入自动剔除重复帧修复(Claude)++用户在去重修复实测后要求“把修复合并到main,然后重新打包2.1.2”。修复见[执行记录](DEDUP_PRECISE_2026-11-02.md):整画面去重允许约百万分之五的超界分量,并删除图内64×36弃帧。版本仍为2.1.2(PE 2.1.2.0)。++- 新包输出到 `E:/项目/Veyra/test-packages/claude-build-2.1.2-dedup-20261102`,任务名 `claude-build-2.1.2-dedup-20261102`。+- `package-2.1.2.py` 增加 `--task` 参数,不传时仍为原任务名。+- 上面Codex的首个2.1.2包目录原样保留,包括用户运行它时生成的 `runtime_local/user-data-2.0.0`。+- 步骤与上面相同:`build-recording-handoff.py --task claude-build-2.1.2-dedup-20261102 ...`,随后执行 `package-2.1.2.py --task claude-build-2.1.2-dedup-20261102 stage|seal|cold`。+- 合同、QtQuick、GPU短测沿用Codex的同组检查。++实际结果在本节之后补记。diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.mdindex 7b89e00e..9c196bf8 100644--- a/docs/CURRENT_STATUS.md+++ b/docs/CURRENT_STATUS.md@@ -2,6 +2,12 @@更新:2026-11-02。这里只描述现在;历史过程见[历史索引](history/INDEX.md)。+**2026-11-02 自动剔除重复帧容忍零星噪点**:用户要求合并到main并重新打包2.1.2。分支`claude/dedup-precise-20261102`(基于main`30337c8`)已提交并快进合入main;未push/Release。重打的2.1.2包放在`test-packages/claude-build-2.1.2-dedup-20261102`,见[构建记录](BUILD_2.1.2_TEST_2026-11-02.md)末节。+- 整画面比较允许约百万分之五的分量超出±3级(4K NV12为63个),T911 4K60上HUD边缘的单点噪点不再把重复帧判成新帧;图内64×36粗判断的弃帧已删除。+- PS5 30帧实测:同一批画面误判5→0;实机新版每秒恒30张,86张带噪重复帧全部判对,计算前跳过0.29%。+- 回归cpu/cpu2/gpu通过;live仅--source-gap失败,属原有问题。其他采集卡和分辨率未验证。+- 见[执行记录](DEDUP_PRECISE_2026-11-02.md)。+**2026-11-02 当前main与2.1.2测试构建**:用户已授权合并各修复并构建2.1.2。9e836ab包含最近3ms等待与极简音量修复,已快进main;所有已完成的旧Claude/Codex产品分支tip均为main祖先。已从main快照47b5e84构建NVIDIA/AMD两个2.1.2测试包,PE2.1.2.0;8组合同/设置、QtQuick132/0/1、三组补帧短测、ZIP逐项校验和两个解压包冷启动通过。交付在E:/项目/Veyra/test-packages/codex-build-2.1.2-20261102,公开正式版仍2.1.1,不push/Release。见[本轮构建记录](BUILD_2.1.2_TEST_2026-11-02.md)。**2026-11-01 极简音量修复**:当前独立分支工作区新增播放条音量拖动/端点命中、数值回车与空白提交、焦点归还修复;完整QtQuick132/0/1与真实Windows极简交互通过,运行目录已更新,未提交/合并/发布。[修复记录](MINIMAL_VOLUME_FIX_2026-11-01.md)。diff --git a/docs/DEDUP_PRECISE_2026-11-02.md b/docs/DEDUP_PRECISE_2026-11-02.mdnew file mode 100644index 00000000..d87292af--- /dev/null+++ b/docs/DEDUP_PRECISE_2026-11-02.md@@ -0,0 +1,91 @@+# 自动剔除重复帧:容忍零星噪点(2026-11-02)++分支 `claude/dedup-precise-20261102`,基于 main `30337c8`,**未提交、未合并、未 push/Release**。用户要求:按排查结论重新修“自动剔除重复帧”,尽量精准;VFG 自动调控不要自动开启(不做原方案第 2 项);PS5 保持开着,用同一个 30 帧游戏实测。++## 起因++用户 2.1.2 现场(Codex 监测,排查见 `E:/项目/Veyra/reports/claude-live-monitor-20261102/FINDINGS.md`):+- 设置是 T911 4K60 NV12、VFG 高档 2X、自动剔除重复帧。+- 每秒保留超过 32 张的 95 秒只占全场 7%,却有 83% 的补帧计算前跳过。+- 原因是重复帧被判成新画面:旧规则只要整张画面有 1 个分量超出 ±3 级,就算新画面。一张误判帧把 33 ms 的帧对拆成两个 16.7 ms,VFG 高档放不下就跳过,节奏也乱。+- 图里另有一道 64×36 亮度点的粗判断,生成帧算完后把它判成重复的扔掉,静止画面出现“30 真实+15 生成=45 fps”。++## 实测:T911 4K60 NV12,PS5 30 帧游戏++均在 Veyra 关闭、采集卡空闲时用 ffmpeg 原格式(dshow NV12 3840×2160@60)读取,原始画面分析后已删除。++1. **5 秒原始片段(296 帧)**+ - 重复帧:约 15–31% 的亮度点差 1 级;差 2 级的有 12–11 217 个,且有成团的(最大一团 33 个);亮度最多 2 个点到 3 级;色度最多到 2 级。+ - 新帧:至少 10.6 万个分量超出 ±3 级,每帧最大差 51–207,其中 92% 以上是成片的。+2. **同一批画面上两种规则对比,90 秒在线,5401 个采样**++ | 规则 | 误判(重复帧判成新帧) | 每秒保留 |+ |---|---:|---|+ | 旧:1 个分量超界就算新帧 | 5 张 | 偶尔 31–32 |+ | 新:超界分量不超过 64 个仍算重复 | 0 张 | 恒为 30 |++ - 5 张误判都是单个亮度点差 4 级,位置都在 HUD 白字边缘(裁图在 `tests/claude-dedup-precise-20261102/lab-90s/crops`)。+ - 真实新帧这段最少 11.3 万个分量。+3. **用户现场日志(逐秒最小值)**+ - 多保留帧的那些秒,最小新帧差全部 ≤47;+ - 真实新帧最小 156(静止画面里的小变化);+ - 47 到 156 之间完全空档。+ - 另有 17 秒每秒保留 60 张、最小差恒为 14:画面几乎不动、只有小元素每个采样都在变(推测是 60 帧运行的菜单,未证实)。++## 改动++- **`PictureCompare.h`**:重复帧最多允许 `toleranceFor(分量数) = 分量数 / 196608` 个分量超出 ±3 级(4K NV12 为 63,1080p 为 15,小于 196608 个分量时为 0,也就是原规则)。+ - 参照画面仍是上一张新画面,所以小变化会累积,超过容差就算新帧。+ - P010 按字计数。+ - 60→30 区分第一份、第二份用的是同一组画面编号,一并变准。+- **`EnhanceGraph`**:删除图内 64×36 亮度点的重复判定,以及据它把生成帧标为无效的两处。相关字段(`FrameOutputs::contentDuplicate`、`fgDuplicateSuppressed`、`fgBothDisabled`)一并删除。+ - 理由:64×36 点抓不到小的真实变化,和整画面去重相互矛盾;两张相同画面插出来的本来就是同一张;生成帧在被扔之前已经算完,并不省算力。+ - 同一份采样用于场景切换判断的部分不变。+- **日志**+ - `[content-dedup]` 增加 `repeatMaxOver`(每秒重复帧里最大的超界分量数),可直接看出容差还剩多少余量。+ - `[fg-validity]` 去掉 `contentDuplicate=` 和 `both=` 两个字段。+ - `[capture-dedup]` 说明文字补上容差。+- **不改**:VFG 自动调控(用户的设置里本来就是关闭,`vfgAutoRegulate=false`)、去重模式下的平滑锚点、预算准入、33 ms 统计、250 ms 状态刷新、GPU 默认优先级。++## 验证(RTX 5070,320 Hz 屏)++- **构建**:`veyra_live_timing_tests` 19.8 s;`veyra_qml_ui` 及三个呈现测试 33.2 s,exit 0。+- **时序单测**:159 项全过,比原来多 8 项。新增的覆盖:+ - 4K 下 1 个点差 4 级、63 个超界点都算重复,第 64 个算新帧;+ - 13×12 的小变化(156 个分量)算新帧;+ - 14 个分量来回闪不算新画面;+ - 小变化累积到 70 个分量算新帧;+ - 4K P010 按字计 63/64。+- **实机对比**:用户 2.1.2 设置的私有副本,打开用户采集对话框给出的原样 URI,逐帧日志,每次 75 秒,统计去掉前 12 秒。旧版是 2.1.2 同一 EXE(`7f9ee826…`),新版是本分支。++ | | 旧版(51 秒) | 新版(57 秒) |+ |---|---|---|+ | 每秒保留 | 30–31,有 2 秒到 32 | 恒为 30–31 |+ | 误判成新帧的重复帧 | 2 张(都只差 1 个点) | 0 |+ | 带超界点、仍判成重复的帧 | 不适用 | 86/1735(最多 30 个点、差 7 级) |+ | 计算前跳过 | 0.58% | 0.29% |+ | 生成后过期、无效 | 0 | 0 |+ | 内容 fps 掉到 0 | 0 次 | 0 次 |++ - 新版没有一秒少于 30,也没有静止保持,说明没有吞掉真实帧;最小真实新帧 12.4 万个分量。+ - 两次是先后两段不同场景,新版那段噪点明显更大(超界帧占重复帧的 5%),所以严格对照看上面第 2 条同一批画面的对比。+- **回归**(`tmp/claude-dedup-precise-20261102/verify.py`):+ - cpu:14 项通过,另 7 项是缺参数打印用法退出(同前);+ - cpu2:12/12;+ - gpu:20/20,无 D3D12 错误;+ - live:5/6。`--source-gap` 失败(“last real source frame is completed and current epoch fully presented”);同次在 10-29 的旧 main 基线上同样失败,EOS 都是 1200/1198,属于原有问题。+- **预发布目录** `tests/claude-sr-stage-20261028/app` 已换成本分支 EXE `fb1e3ad7…`,97 个运行组件核验一致。++## 未验证与边界++- 容差 63 来自这一张卡、这一个游戏:噪点最多见过 30 个点(新版实测)、现场逐秒最小值 47;真实新帧最少 156。比这更吵的场景,或比 156 更小的真实变化,可能仍会判错。现在 `repeatMaxOver` 会记下来。+- 其他采集卡、1080p/1440p、P010 HDR 实机都没测。+- 真正以 60 帧运行的内容,VFG 高档在 4K 下仍会因预算跳帧。这一项按用户要求没动,VFG 自动调控不会自己打开。+- “每采样都变”那 17 秒是不是菜单,没有画面证据。+- 提交数和日志都不等于屏幕实际扫描;用户的主观观感未验证。++## 证据++- 报告:`E:/项目/Veyra/reports/claude-dedup-precise-20261102/`(stage/cpu/cpu2/gpu/live/gap.json、FINAL.json)。+- 实测:`E:/项目/Veyra/tests/claude-dedup-precise-20261102/`(lab-90s 逐采样与裁图、live-old/live-new 日志)。+- 脚本:`E:/项目/Veyra/tmp/claude-dedup-precise-20261102/`(analyze_clip.py、analyze_repeats.py、live_dedup_lab.py、live_run.py、live_compare.py、verify.py)。diff --git a/docs/TEST_NOTES_2.1.2.md b/docs/TEST_NOTES_2.1.2.mdindex f9e4129c..92bf662e 100644--- a/docs/TEST_NOTES_2.1.2.md+++ b/docs/TEST_NOTES_2.1.2.md@@ -12,6 +12,7 @@- 自适应垂直同步容量等待:抖动较大时适当多等,上限3ms;普通自动/允许撕裂保持原路径。自动+VRR若走垂直同步队列也受此规则约束。- 屏幕采集无补帧时就绪即呈现、捕获帧率、采集载波Dolby/DTS、F7/F8、60→30取第一份等已合入的修复。- 极简音量:修复快速拖动、0%/100%起拖、输入焦点、回车/数字键盘Enter及点击空白提交,Esc取消;音量操作不触发窗口移动。+- 自动剔除重复帧更准确:4K采集时零星噪点不再让重复帧被当成新画面,30帧游戏稳定保持每秒30帧,补帧不再因此跳帧;同时去掉了图内会在静止画面里扔掉一半补帧的粗略重复判断。## 启动与设置diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 1c0e4b14..5c7bc37b 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -389,3 +389,35 @@ RTX5060Ti、4K30 NV12→VFG2X/60Hz,主要稳定段NR/SR关闭。中档84.016PID61528,用户直接运行2.1.2 NVIDIA包;不激活窗口、不启动额外GPU负载、不改设置/驱动/进程。reports/live-monitor-2.1.2-20261102/watch.py只读日志约120秒(UTC10:37:28–10:39:28);用户要求停止后仅分析已保存数据,没有重启采样。当前4K60、NR1080p、VFG高2X、自动去重、Reflex增强/VRR请求;软件回调59.99–60.01,7120输入、4076有效真实帧全部提交,采集丢弃/邮箱覆盖新增0;625次候选在计算前跳过、6张生成后过期,容量/限帧丢弃新增0,另89对内容重复过滤。输出采样中位60.5、范围45–90,开头数秒45–52;本段错误/告警0、音频欠载增量0、显存3237–3254MiB。不把正常内容去重或提交FPS当物理显示证据。观察脚本的start.latest字典引用导致末态覆盖,已按独立落盘baseline.json复算增量、保留原记录并修正脚本,未采信错误零增量。简单报告及原始证据在上述reports目录。仅本工作日志追加,产品源码、用户设置和运行进程不改。用户要求标出时间/日志交Claude:已生成reports/live-monitor-2.1.2-20261102/CLAUDE_HANDOFF.md及per-second-deltas/evidence-anchors。只复核保存数据。更正归因:UTC10:37:28–34低45FPS段,fgSkippedBeforeEval和expired增量均0,fgInvalid/contentDuplicate新增89;后段625次预算跳过与6张过期单列,不能混为同一成因。报告含PST/UTC对应、原始完整日志、固定筛选片段与行号、epoch6→7和呈现revision14→15时间。未恢复监测、未修产品或改用户设置。++## 2026-11-02 自动剔除重复帧容忍零星噪点(Claude)++用户读完上节监测交接后要求排查,结论是去重把重复帧误判成新帧(E:/项目/Veyra/reports/claude-live-monitor-20261102/FINDINGS.md)。随后用户要求按方案重修、尽量精准;VFG自动调控不要自动开启,即原方案第2项不做;PS5开着,用同一个30帧游戏实测。分支claude/dedup-precise-20261102,基于main 30337c8,未提交。上节Codex的未提交记录原样保留。++**实测**:Veyra关闭、采集卡空闲时,用已安装的ffmpeg 8.1.1以dshow原格式NV12 3840x2160@60读取T911。+- 5秒NUT原始片段,296帧,3.7GB,分析后已删:重复帧亮度最多差3级,新帧至少10.6万个分量超界。+- 失败一次:Python从管道读,10秒画面跑了39秒,ffmpeg丢帧,这轮数据作废。改为ffmpeg每秒写一段到SSD、读完即删。+- 90秒共5401个采样、没有丢帧。同一批画面上旧规则误判5次,都是单点差4级、位于HUD白字边缘;容差64时误判0次,每秒恒为30。+- cv2.imwrite不支持中文路径,裁图改用imencode后写文件。++**改动**:+- PictureCompare.h:toleranceFor=分量数/196608(4K NV12为63),超界分量不超过它仍算重复。+- EnhanceGraph:删除64×36的contentDuplicate弃帧,连同相关字段和计数。+- EngineController:[content-dedup]增加repeatMaxOver;[fg-validity]去掉contentDuplicate/both。+- CaptureCardSource:日志文字补上容差。ContentDedup.h:注释同步。时序单测新增8项。+- 失败一次:EngineController.cpp用Python整体替换时被写成LF,已恢复CRLF,git diff只含实际改动的12行。++**构建与回归**:+- build.py:veyra_live_timing_tests 19.8秒;veyra_qml_ui加三个呈现测试33.2秒;均exit 0。+- 时序单测159项全过。+- verify.py stage:运行目录EXE换为fb1e3ad7…,97个运行组件一致。+- cpu:14过,另7个缺参数打印用法退出(同前)。cpu2:12/12。gpu:20/20,无D3D12错误。+- live:5/6,--source-gap失败。gap对照1次:本分支和10-29的旧main基线同样失败,EOS都是1200/1198,属于原有问题。++**实机**:live_run.py把用户2.1.2配置复制到私有目录(原文件不改),VEYRA_VERBOSE_FRAME_LOGS=1,--exit-after 75000。+- 失败一次:第一次依靠自动恢复来源,因用户会话里恢复是关的,没有打开采集卡,作废。之后改为传入用户采集对话框给出的原样URI。+- 旧版(与2.1.2同一EXE,7f9ee826…)稳定段51秒:每秒保留30–31,有2秒到32;误判2;跳过0.58%。+- 新版稳定段57秒:每秒恒30–31;1735张重复帧里86张带超界点(最多30个、差7级),仍判为重复;误判0;跳过0.29%;过期和无效均为0。++**未验证**:其他采集卡、其他分辨率、P010实机、更吵的场景;60帧内容下VFG高档的预算跳帧(本次未改);主观观感。+记录见docs/DEDUP_PRECISE_2026-11-02.md,回执见E:/项目/Veyra/reports/claude-dedup-precise-20261102/FINAL.json。diff --git a/include/veyra/engine/ContentDedup.h b/include/veyra/engine/ContentDedup.hindex eb8e82b4..666c662f 100644--- a/include/veyra/engine/ContentDedup.h+++ b/include/veyra/engine/ContentDedup.h@@ -17,8 +17,9 @@ namespace veyra::engine {//// A repeat is a sample with the same picture number as the last kept one: the// capture callback (or the engine, for CPU frames) compares every component of-// the whole picture with the last new picture and only a sample entirely within-// the capture-noise band keeps its number (PictureCompare.h). The first version+// the whole picture with the last new picture, and a sample within the+// capture-noise band but for a few isolated components keeps its number+// (PictureCompare.h). The first version// judged 64x36 sampled points with an 8-level gate: a running HDR game seen// from a still position lost most real pictures (6-16 kept of 60 per second,// field log 2026-10-12). Numbers rather than pictures also keep a picture whosediff --git a/include/veyra/pipeline/EnhanceGraph.h b/include/veyra/pipeline/EnhanceGraph.hindex 0310af3e..56ea5a4e 100644--- a/include/veyra/pipeline/EnhanceGraph.h+++ b/include/veyra/pipeline/EnhanceGraph.h@@ -570,7 +570,7 @@ public:uint32_t fgCandidates=0,fgEvaluated=0,fgSkippedBeforeEval=0,fgSkippedForReset=0;bool historyReset=false,fgRecovery=false,fgBudgetSeed=false,fgReduced=false,fgFast=false,fgFastForBudget=false;ResetReason detectedReset=ResetReason::None;- bool contentDuplicate=false;int measuredContentRate=0;+ int measuredContentRate=0;double ptsMs = 0.0;uint32_t videoSlot = 0; // videoFrame[videoSlot] holds this real frameuint64_t videoFenceValue = 0; // ring fence covering the video work@@ -648,7 +648,7 @@ public:uint64_t nvofFrameFailures = 0;uint64_t fgGeneratedFrames = 0;uint64_t fgSubmittedCandidates = 0, fgDisabledFrames = 0;- uint64_t fgProviderDisabled = 0, fgDuplicateSuppressed = 0, fgBothDisabled = 0;+ uint64_t fgProviderDisabled = 0;uint64_t nrMotionFrames = 0, sceneCutCount = 0, resetCount = 0;};const Metrics& metrics() const { return metrics_; }diff --git a/include/veyra/pipeline/PictureCompare.h b/include/veyra/pipeline/PictureCompare.hindex a5947581..997e8cac 100644--- a/include/veyra/pipeline/PictureCompare.h+++ b/include/veyra/pipeline/PictureCompare.h@@ -1,5 +1,6 @@#pragma once-// Repeated-picture detection with a capture-noise band (2026-10-12).+// Repeated-picture detection with a capture-noise band (2026-10-12) and an+// outlier tolerance (2026-11-02).//// Content dedup (ContentDedup.h) has to know whether a sample shows the same// picture as the last new one. Two earlier answers failed on a real card:@@ -10,12 +11,25 @@// few hundred by 2 and at most one by 3, while a new 30 fps game frame seen// from a still position has at least 240 pixels beyond 2 levels and peaks at// 6-16 (tests/claude-cadence-exact-20261012/harness/card_diff.py, 173 pairs).-// A sample repeats the reference only when EVERY component of every plane of-// the whole picture is within 3 levels on an 8-bit scale (bandFor(): the same-// fraction of a deeper component); one component beyond it makes a new picture. Packed-// layouts whose bytes are not components (v210, RGB10, RGB555/565) compare-// exactly. The reference is the last NEW picture, so a slow change accumulates-// past the band instead of slipping through it one small step at a time.+// A component differs when it is more than 3 levels off on an 8-bit scale+// (bandFor(): the same fraction of a deeper component). Packed layouts whose+// bytes are not components (v210, RGB10, RGB555/565) compare exactly. The+// reference is the last NEW picture, so a slow change accumulates past the band+// instead of slipping through it one small step at a time.+//+// One differing component used to make a new picture. At 3840x2160 NV12 the+// T911 now and then moves a single component of a repeated frame 4 levels, at+// bright HUD text edges: 5 of 2700 repeats in 90 s of a 30 fps PS5 game+// (tests/claude-dedup-precise-20261102). Each became a 16.7 ms frame+// generation pair that VFG High could not fit; the user's session kept up to+// 18 extra samples a second (field log 2026-11-02).+// So a sample repeats the reference while at most toleranceFor() components+// differ, about five per million (63 in 4K NV12). In that session every second+// that kept extra samples had one with at most 47 differing components, and+// the smallest real new picture, a still screen, had 156; a moving 30 fps game+// changes 100 000 and more. A small element that changes on every sample (17 s+// of 60 kept per second whose smallest change was 14 components) no longer+// makes every sample a new picture either.#include <algorithm>#include <cstddef>#include <cstdint>@@ -41,10 +55,13 @@ public:static constexpr unsigned bandFor(unsigned depth, unsigned shift) {return depth <= 8 ? kBand8 : ((kBand8 * ((1u << depth) - 1) + 127) / 255) << shift;}+ // Components a repeat may have beyond the band: 63 in 3840x2160 NV12, 15 in+ // 1920x1080 NV12, none below 196608 components.+ static constexpr uint64_t toleranceFor(uint64_t components) { return components / 196608; }struct Result {uint64_t id = 0; // picture number; equal ids show the same picture- bool repeat = false; // every component within the band of the reference- uint64_t over = 0; // components beyond the band (0 for a repeat)+ bool repeat = false; // at most toleranceFor() components beyond the band of the reference+ uint64_t over = 0; // components beyond the bandunsigned max8 = 0; // largest difference, 8-bit scale};// Ids of different references never collide (space in the top byte).@@ -66,7 +83,7 @@ public:else compareBytes(row, ref, planes[p].rowBytes, band, r.over, max);}r.max8 = band ? (max * kBand8 + band / 2) / band : max;- if (r.over == 0) { r.id = space_ | id_; r.repeat = true; return r; }+ if (r.over <= toleranceFor(kind == PictureComponents::Words ? total / 2 : total)) { r.id = space_ | id_; r.repeat = true; return r; }}// A new picture becomes the reference.if (reference_.size() < total) reference_.resize(total);diff --git a/scripts/acceptance/package-2.1.2.py b/scripts/acceptance/package-2.1.2.pyindex 746da4f3..5941a6eb 100644--- a/scripts/acceptance/package-2.1.2.py+++ b/scripts/acceptance/package-2.1.2.py@@ -172,6 +172,9 @@ def cold():audit(a,flavor);print('COLD PASS',flavor,presented,flush=True)write(REPORT/'cold.json',dict(passed=True,results=results,scope='Local RTX5070 startup/playback with default effects off, not AMD inference or physical capture'))if __name__=='__main__':- p=argparse.ArgumentParser();p.add_argument('mode',choices=['stage','seal','cold']);args=p.parse_args()+ p=argparse.ArgumentParser();p.add_argument('mode',choices=['stage','seal','cold'])+ # A rebuild of 2.1.2 gets its own task folders; earlier packages and the profiles in them stay untouched.+ p.add_argument('--task',default=T);args=p.parse_args()+ T=args.task;O=B/'test-packages'/T;REPORT=B/'reports'/Tfor folder in (O,REPORT):folder.mkdir(parents=True,exist_ok=True)dict(stage=stage,seal=seal,cold=cold)[args.mode]()diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cppindex 57bb13ad..c7f1d664 100644--- a/src/engine/EngineController.cpp+++ b/src/engine/EngineController.cpp@@ -1119,7 +1119,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sconst auto dedupContent=[](ContentRate content){return content!=ContentRate::Transport&&content!=ContentRate::Capture60To30;};// CPU frames are compared here; capture-card frames arrive numbered by the callback.pipeline::PictureReference enginePictures{2};- unsigned dedupRepeatMax8=0;uint64_t dedupNewMinOver=UINT64_MAX;+ unsigned dedupRepeatMax8=0;uint64_t dedupRepeatMaxOver=0,dedupNewMinOver=UINT64_MAX;FrameLineageTracker lineageTracker;auto completedProcessing=[&](pipeline::FrameIdentity id){std::lock_guard lock(mutex_);if(snapshot_.applied.revision==id.settingsRevision)++snapshot_.processedCompleted;};auto host100ns=[](){return std::chrono::duration_cast<std::chrono::nanoseconds>(Clock::now().time_since_epoch()).count()/100;};@@ -2049,7 +2049,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,spipeline::PictureReference::Result picture;const auto compareStart=Clock::now();const bool pictured=pipeline::captureFramePicture(frame,enginePictures,gd.packedInput==6||gd.packedInput==7,picture);- if(pictured&&picture.repeat)dedupRepeatMax8=std::max(dedupRepeatMax8,picture.max8);+ if(pictured&&picture.repeat){dedupRepeatMax8=std::max(dedupRepeatMax8,picture.max8);dedupRepeatMaxOver=std::max(dedupRepeatMaxOver,picture.over);}else if(pictured&&picture.over)dedupNewMinOver=std::min(dedupNewMinOver,picture.over);const bool boundary=reset||pipeline::breaksHistory(pkt.flags)||dedupRevision!=options.settings.revision;dedupRevision=options.settings.revision;@@ -2935,7 +2935,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sif(veyra::log::verboseFrameLogs()&&Clock::now()>=nextTimingLog){const auto [retained,overwritten]=Logger::instance().frameTraceSize();veyra::log::info("frame-trace",std::format("retained={} capacity=8192 overwritten={} (records available in diagnostic preview)",retained,overwritten));}if(options.settings.multiplier>1&&Clock::now()>=nextTimingLog)- veyra::log::info("fg-validity",std::format("revision={} candidate={} valid={} invalid={} providerDisabled={} contentDuplicate={} both={} contentPolicy={} sourceTransportFps={} backend={} (invalid union=provider+duplicate-both; no automatic content-rate/multiplier rewrite)",options.settings.revision,graphStats.fgSubmittedCandidates,graphStats.fgGeneratedFrames,graphStats.fgDisabledFrames,graphStats.fgProviderDisabled,graphStats.fgDuplicateSuppressed,graphStats.fgBothDisabled,int(options.settings.content),activeSource->info().averageFps,frameGenerationBackendName(options.settings.frameGenerationBackend)));+ veyra::log::info("fg-validity",std::format("revision={} candidate={} valid={} invalid={} providerDisabled={} contentPolicy={} sourceTransportFps={} backend={} (invalid = disabled by the provider; no automatic content-rate/multiplier rewrite)",options.settings.revision,graphStats.fgSubmittedCandidates,graphStats.fgGeneratedFrames,graphStats.fgDisabledFrames,graphStats.fgProviderDisabled,int(options.settings.content),activeSource->info().averageFps,frameGenerationBackendName(options.settings.frameGenerationBackend)));if(!isCapture&&Clock::now()>=nextTimingLog){const double playbackSpeedNow=[&]{std::lock_guard lock(mutex_);return snapshot_.playbackSpeed;}();// present-deviation / output-queue are folded into the// player-timing line below (sweep E5); the separate lines stay@@ -2955,10 +2955,10 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sveyra::log::info("frame-rate",std::format("revision={} gpuCompletedFps={:.2f} completedReal={} capture60To30={} rateSkipped={} presentSubmitFps={:.2f} windowMs=1000 vramMiB={} budgetMiB={} (not scanout FPS)",options.settings.revision,rates.fps,rates.processedCompleted,rates.captureHalfRate,rates.captureRateSkipped,rates.submissionFps.value_or(0),vramUsage>>20,vramBudget>>20));if(isCapture&&dedupContent(options.settings.content)&&!legacyCadence){const auto& st=contentDedup.stats();- veyra::log::info("content-dedup",std::format("revision={} mode={} observed={} kept={} repeats={} held={} blind={} regular={} irregular={} contentFps={:.2f} maxShiftMs={:.2f} repeatMaxDiff={} newMinOver={} band={} (per second; a repeat has every component of the whole picture within the band of the last new one, dropped before GPU work; kept frames carry content timestamps)",+ veyra::log::info("content-dedup",std::format("revision={} mode={} observed={} kept={} repeats={} held={} blind={} regular={} irregular={} contentFps={:.2f} maxShiftMs={:.2f} repeatMaxDiff={} repeatMaxOver={} newMinOver={} band={} (per second; a repeat has at most about 5 per million components of the whole picture beyond the band of the last new one, dropped before GPU work; kept frames carry content timestamps)",options.settings.revision,int(options.settings.content),st.observed-dedupLogged.observed,st.kept-dedupLogged.kept,st.repeats-dedupLogged.repeats,st.held-dedupLogged.held,st.blind-dedupLogged.blind,- st.regular-dedupLogged.regular,st.irregular-dedupLogged.irregular,contentDedup.contentFps(),st.maxShiftMs,dedupRepeatMax8,dedupNewMinOver==UINT64_MAX?0:dedupNewMinOver,pipeline::PictureReference::kBand8));- dedupLogged=st;dedupRepeatMax8=0;dedupNewMinOver=UINT64_MAX;+ st.regular-dedupLogged.regular,st.irregular-dedupLogged.irregular,contentDedup.contentFps(),st.maxShiftMs,dedupRepeatMax8,dedupRepeatMaxOver,dedupNewMinOver==UINT64_MAX?0:dedupNewMinOver,pipeline::PictureReference::kBand8));+ dedupLogged=st;dedupRepeatMax8=0;dedupRepeatMaxOver=0;dedupNewMinOver=UINT64_MAX;}veyra::log::info("capture-timing",std::format("revision={} received={} processed={} dropped={} callbackFps={:.2f} readAgeMs={:.3f} callbackToPresentReturnP95Ms={:.3f} processCpuP95Ms={:.3f} gpuReadyP95Ms={:.3f} schedulingWaitP95Ms={:.3f} presentCpuP95Ms={:.3f} gpuColorP95Ms={:.3f} gpuSrP95Ms={:.3f} gpuFlowP95Ms={:.3f} gpuNrP95Ms={:.3f} gpuResidualP95Ms={:.3f} gpuFgBatchP95Ms={:.3f} gpuBlitP95Ms={:.3f} slotWaits={} slotWaitMs={:.3f} commandSubmits={} displaySubmits={} expiredGenerated={} nr={} nvof={} generated={} historyResets={} presentationDrains={} presentationCompletedReal={} presentationSkippedGenerated={} presentationCancelledJobs={} singleGpuOwner=1 batchCapacity=2 (not HDMI-to-display latency)",options.settings.revision,captureStats.received,sourceFrames-statsSourceBase,captureStats.dropped,captureStats.callbackFps,captureStats.readAgeMs,ageP95,processTimes.p95(),liveScheduler?completed.readyP95:gpuReadyTimes.p95(),waitP95,presentP95,gpuP95(diagnostics::GpuStage::Color),gpuP95(diagnostics::GpuStage::Sr),gpuP95(diagnostics::GpuStage::Flow),gpuP95(diagnostics::GpuStage::Nr),gpuP95(diagnostics::GpuStage::Residual),gpuP95(diagnostics::GpuStage::FgBatch),gpuP95(diagnostics::GpuStage::Blit),slotWaitCount,slotWaitMilliseconds,commandSubmits,submitted,expired,graphStats.nrEvaluateCount,graphStats.nvofExecuteCount,graphStats.fgGeneratedFrames,historyResets.load(),presentationDrains.load(),presentationCompletedReal.load(),presentationSkippedGenerated.load(),presentationCancelledJobs.load()));nextTimingLog=Clock::now()+std::chrono::seconds(1);diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex 2d5458e5..99ef8a0a 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -2295,7 +2295,11 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Framecadence_.observe(ptsMs,sad,previousLuma_.size()==sample.size());out.measuredContentRate=cadence_.confirmedRate(desc_.contentRate);if(cadence_.conflicts(desc_.contentRate)&&realFrameIndex_%60==0)veyra::log::warn("cadence","requested content-rate identification conflicts with observed motion; preserving source timestamps");- out.contentDuplicate=desc_.contentRate!=engine::ContentRate::Transport&&previousLuma_.size()==sample.size()&&sad<0.0001;+ // This sample once also marked a pair a duplicate (SAD < 0.0001) and+ // discarded its generated frame after it was computed. 64x36 points+ // miss small real changes the whole-picture dedup keeps (PictureCompare.h):+ // a still screen ran at 30 real + 15 generated fps (field log 2026-11-02),+ // and a pair of equal pictures generates an equal picture anyway.// Source ids advance per received/decoded frame, including frames the// engine skipped or the capture mailbox replaced; normalise by that step.const uint64_t sourceStep=sceneLastSourceId_&&sourceFrameId>sceneLastSourceId_?sourceFrameId-sceneLastSourceId_:1;@@ -3457,8 +3461,7 @@ bool EnhanceGraph::resolveFrame(FrameOutputs& out,uint32_t index)}}if(fsrActive()||vfgBackend_){- frame.validity=out.contentDuplicate?GenerationValidity::Disabled:GenerationValidity::Valid;- if(out.contentDuplicate){++metrics_.fgDisabledFrames;++metrics_.fgDuplicateSuppressed;}else ++metrics_.fgGeneratedFrames;+ frame.validity=GenerationValidity::Valid;++metrics_.fgGeneratedFrames;return true;}// Readback heaps may stay mapped; the 4-byte status is read directly.@@ -3466,13 +3469,10 @@ bool EnhanceGraph::resolveFrame(FrameOutputs& out,uint32_t index)if(!mapped){D3D12_RANGE range{0,4};void* data=nullptr;const HRESULT hr=fgDisableReadback_[frame.lease->slot]->Map(0,&range,&data);if(FAILED(hr)){frame.validity=GenerationValidity::Failed;veyra::log::error("fg-status",std::format("Map hr=0x{:X}",unsigned(hr)));return true;}mapped=static_cast<const volatile uint8_t*>(data);}const bool disabled=*mapped!=0;- const bool rejected=disabled||out.contentDuplicate;metrics_.fgProviderDisabled+=disabled;- metrics_.fgDuplicateSuppressed+=out.contentDuplicate;- metrics_.fgBothDisabled+=disabled&&out.contentDuplicate;- frame.validity=rejected?GenerationValidity::Disabled:GenerationValidity::Valid;- if(rejected)++metrics_.fgDisabledFrames;else ++metrics_.fgGeneratedFrames;- if(veyra::log::verboseFrameLogs())veyra::log::info("fg-status",std::format("batch={} frame={} epoch={} revision={} subframe={} fence={} providerDisabled={} contentDuplicate={} valid={}",out.batch.batchId,out.realFrameIndex,out.batch.identity.epoch,out.batch.identity.settingsRevision,frame.subframe,frame.lease->readyFence,disabled,out.contentDuplicate,!rejected));+ frame.validity=disabled?GenerationValidity::Disabled:GenerationValidity::Valid;+ if(disabled)++metrics_.fgDisabledFrames;else ++metrics_.fgGeneratedFrames;+ if(veyra::log::verboseFrameLogs())veyra::log::info("fg-status",std::format("batch={} frame={} epoch={} revision={} subframe={} fence={} providerDisabled={} valid={}",out.batch.batchId,out.realFrameIndex,out.batch.identity.epoch,out.batch.identity.settingsRevision,frame.subframe,frame.lease->readyFence,disabled,!disabled));return true;}diff --git a/src/source/CaptureCardSource.cpp b/src/source/CaptureCardSource.cppindex 20f3bb32..9b876d1d 100644--- a/src/source/CaptureCardSource.cpp+++ b/src/source/CaptureCardSource.cpp@@ -941,7 +941,7 @@ void CaptureCardSource::setVerticalFlip(bool enabled){log::info("capture-flip",std::format("manual vertical flip={} (applies to the next sample; ingest only)",enabled?1:0));}void CaptureCardSource::setPictureCompare(bool enabled){- if(p_->pictureCompare.exchange(enabled)!=enabled)log::info("capture-dedup",std::format("picture compare={} (whole driver sample against the last new picture, band {} levels of 255; content dedup)",enabled?1:0,pipeline::PictureReference::kBand8));+ if(p_->pictureCompare.exchange(enabled)!=enabled)log::info("capture-dedup",std::format("picture compare={} (whole driver sample against the last new picture, band {} levels of 255, about 5 per million components may lie beyond it; content dedup)",enabled?1:0,pipeline::PictureReference::kBand8));}void CaptureCardSource::setCpuUnpack(bool enabled){auto& p=*p_;diff --git a/tests/unit/LivePresentationTimingTests.cpp b/tests/unit/LivePresentationTimingTests.cppindex ec60b14f..22ce9a6b 100644--- a/tests/unit/LivePresentationTimingTests.cpp+++ b/tests/unit/LivePresentationTimingTests.cpp@@ -337,6 +337,41 @@ int main(){check(!exact.observe(&e1,1,PictureComponents::Exact).repeat,"packed 10-bit / 5-6-bit layouts compare exactly");check(!bytes(ref,base,32).repeat,"a different layout is a new picture");PictureReference one{1},two{2};check(bytes(one,base).id!=bytes(two,base).id,"picture numbers of different references never collide");+ check(PictureReference::toleranceFor(3840ull*2160*3/2)==63&&PictureReference::toleranceFor(1920ull*1080*3/2)==15&&PictureReference::toleranceFor(base.size())==0,+ "outlier tolerance: 63 components in 4K NV12, 15 in 1080p, none in a small picture");+ // 4K NV12 (T911, 2026-11-02): a repeat now and then has one component 4 levels off.+ std::vector<uint8_t> luma(3840*2160),chroma(3840*1080);+ for(size_t i=0;i<luma.size();++i)luma[i]=uint8_t(40+(i*7919+i/3840*31)%160);+ for(size_t i=0;i<chroma.size();++i)chroma[i]=uint8_t(90+(i*104729)%60);+ auto nv12=[](PictureReference& r,const std::vector<uint8_t>& y,const std::vector<uint8_t>& uv){+ PicturePlane planes[2]{{y.data(),3840,3840,2160},{uv.data(),3840,3840,1080}};return r.observe(planes,2,PictureComponents::Bytes);};+ auto outliers=[&](unsigned count,int levels){auto y=luma;for(unsigned k=0;k<count;++k){auto& v=y[(size_t(k)*1048573+12345)%y.size()];v=uint8_t(v+levels);}return y;};+ PictureReference card;const auto shown=nv12(card,luma,chroma);+ const auto one4=nv12(card,outliers(1,4),chroma);+ check(one4.repeat&&one4.id==shown.id&&one4.over==1&&one4.max8==4,"4K: a repeat with one component 4 levels off keeps its number");+ const auto many=nv12(card,outliers(63,9),chroma);+ check(many.repeat&&many.id==shown.id&&many.over==63,"4K: 63 isolated components beyond the band are still the same picture");+ const auto past=nv12(card,outliers(64,9),chroma);+ check(!past.repeat&&past.id!=shown.id&&past.over==64,"4K: the 64th makes a new picture");+ {// The smallest real change seen in the field (a still screen, 156 components) stays a new picture.+ PictureReference still;nv12(still,luma,chroma);auto y=luma;for(unsigned row=0;row<12;++row)for(unsigned x=0;x<13;++x)y[(1000+row)*3840+2000+x]+=12;+ const auto r=nv12(still,y,chroma);check(!r.repeat&&r.over==156,"4K: a 13x12 change of a still screen is a new picture");}+ {// A small element changing on every sample, back and forth (14 components): one picture.+ PictureReference blink;const auto a=nv12(blink,luma,chroma);bool same=true;+ for(int k=1;k<8;++k){auto y=luma;if(k%2)for(unsigned x=0;x<14;++x)y[500*3840+300+x]+=60;same&=nv12(blink,y,chroma).id==a.id;}+ check(same,"4K: a 14-component element blinking every sample is not a new picture");}+ {// Below the tolerance a change accumulates against the last NEW picture until it counts.+ PictureReference grow;const auto a=nv12(grow,luma,chroma);auto y=luma;int samples=0;bool fresh=false;+ while(!fresh&&samples<20){for(unsigned x=0;x<10;++x)y[800*3840+size_t(samples)*10+x]+=20;fresh=!nv12(grow,y,chroma).repeat;++samples;}+ check(fresh&&samples==7,"4K: a growing 10-component change becomes a new picture once 70 components differ");}+ {// P010 at 4K: the tolerance counts words, not bytes.+ std::vector<uint16_t> y16(3840*2160),uv16(3840*1080);for(size_t i=0;i<y16.size();++i)y16[i]=uint16_t((64+(i*31)%800)<<6);for(size_t i=0;i<uv16.size();++i)uv16[i]=uint16_t(512<<6);+ auto p010=[](PictureReference& r,const std::vector<uint16_t>& y,const std::vector<uint16_t>& uv){+ PicturePlane planes[2]{{reinterpret_cast<const uint8_t*>(y.data()),7680,7680,2160},{reinterpret_cast<const uint8_t*>(uv.data()),7680,7680,1080}};+ return r.observe(planes,2,PictureComponents::Words,PictureReference::bandFor(10,6));};+ PictureReference deep4k;const auto a=p010(deep4k,y16,uv16);auto y=y16;for(unsigned k=0;k<63;++k)y[size_t(k)*99991]=uint16_t(y[size_t(k)*99991]+(20<<6));+ const auto b=p010(deep4k,y,uv16);y[5]=uint16_t(y[5]+(20<<6));const auto c=p010(deep4k,y,uv16);+ check(b.repeat&&b.id==a.id&&b.over==63&&!c.repeat&&c.over==64,"4K P010: 63 words beyond the band repeat, 64 are new");}}{// ContentDedup on picture numbers: synthetic pictures sampled at a capture rate.