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 adaptive VSync capacity wait and minimal volume editing

Veyra Goal Agent9e836ab02300
diff --git a/AGENTS.md b/AGENTS.md
index a2baecfb..728b23b9 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,9 @@
# Veyra Agent 工作规则
+> **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。
+
+> **2026-11-02 垂直同步等待跟随抖动(最新)**:用户问60 Hz垂直同步为何仍丢帧,选择“上限3 ms”。活动树现在分支`claude/vsync-jitter-wait-20261102`(基于main `8535791`,未提交、未merge、未push/Release):显式垂直同步、输出不高于80 fps时,生成帧的容量等待随测得的回调抖动增加,上限3 ms;自动模式和高刷规则不变。`VEYRA_TEST_FIXED_CAPACITY_WAIT=1`恢复固定等待。记录`docs/VSYNC_JITTER_WAIT_2026-11-02.md`,分析`E:/项目/Veyra/reports/claude-vsync-slots-20261102/FINDINGS.md`。320 Hz回归通过。真实60 Hz回放注入1.9 ms抖动:DLSS生成帧提交缺口37.7→5.6/分,VFG中档5.6→2.8/分(短样本,非实际显示丢帧)。原上屏格点估算不能证明屏幕延迟,已撤销其验收结论。Codex于本地11-01完成续接、最小复验及配置/运行组件核验,回执reports/codex-vsync-handoff-20261101/FINAL.json;分支仍未提交、未合并。没有用真实采集卡和高抖动实卡验证。
+
> **2026-11-01 用户授权并入main(最新)**:Claude的补帧延迟返工及VFG自动调控已原样提交为`6e79a5e`,由main `13016a8`快进合入。活动树现在main;覆盖下面该任务“未合并”的旧状态。合并记录`docs/MAIN_INTEGRATION_2026-11-01.md`,回执`E:/项目/Veyra/reports/codex-main-integration-20261101/FINAL.json`。本轮相关构建、8组合同/设置、QtQuick123/0/1、VFG开关/DLSS6X/XeSS2X短测及列表/节点真实开关和重启保存通过;原配置/默认运行组件保持。没有重做60Hz性能A/B、实卡采集或5060Ti验收;未push/Release,正式版仍2.1.1。
> **2026-11-01 补帧延迟不增长返工(最新)**:用户不接受10-31修复的延迟增长。分支`claude/fg-no-latency-growth-20261101`(基于main 13016a8,未合并、未push/Release)撤掉自动模式队列、长等待和放宽的VFG预算,改平滑呈现锚点,VFG 2X赶不上刷新时这一对改用下一档模型。真实60 Hz实测见docs/FG_NO_LATENCY_GROWTH_2026-11-01.md,回执E:/项目/Veyra/reports/claude-fg-sidefx-20261101/FINAL.json。`VEYRA_TEST_LEGACY_LIVE_PACING=1`恢复旧规则。真实采集卡和5060 Ti未验证,5060 Ti速度是人为加延迟模拟的。
diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.md
index 1f707dbe..d19768d3 100644
--- a/docs/CURRENT_STATUS.md
+++ b/docs/CURRENT_STATUS.md
@@ -1,6 +1,10 @@
# 当前项目状态
-更新:2026-11-01。这里只描述现在;历史过程见[历史索引](history/INDEX.md)。
+更新:2026-11-02。这里只描述现在;历史过程见[历史索引](history/INDEX.md)。
+
+**2026-11-01 极简音量修复**:当前独立分支工作区新增播放条音量拖动/端点命中、数值回车与空白提交、焦点归还修复;完整QtQuick132/0/1与真实Windows极简交互通过,运行目录已更新,未提交/合并/发布。[修复记录](MINIMAL_VOLUME_FIX_2026-11-01.md)。
+
+**2026-11-02 垂直同步等待跟随抖动**:分支 `claude/vsync-jitter-wait-20261102`,基于main `8535791`,未提交、未merge、未push/Release。显式垂直同步、输出不高于80 fps时,生成帧的容量等待随测得的回调抖动增加,上限3 ms,用户选定。真实60 Hz回放注入1.9 ms抖动(相当于KUHAIMI 4K60 Version),DLSS生成帧提交缺口37.7→5.6/分、VFG中档5.6→2.8/分(短样本,非实际显示丢帧);原刷新格点估算不能证明屏幕延迟,已撤销其验收结论;0.05 ms抖动(相当于T911、G50)无差别。真实采集卡和高抖动实卡未验证。见[执行记录](VSYNC_JITTER_WAIT_2026-11-02.md)。
**2026-11-01 补帧返工已合入本地main**:用户授权将Claude最新修复合并。源分支 `claude/fg-no-latency-growth-20261101` 的37个文件提交为 `6e79a5e`,从main `13016a8`快进,无代码冲突。撤掉10-31自动队列、长等待和放宽预算,改平滑呈现锚点;VFG自动调控开关及“自动剔除重复帧”改名同时并入。构建、相关合同、QtQuick、3组GPU短测、列表/节点真实开关与重启保存检查通过。见[合并记录](MAIN_INTEGRATION_2026-11-01.md)和[实现/原有A/B](FG_NO_LATENCY_GROWTH_2026-11-01.md)。原A/B的真实60Hz屏是RTX5070,5060Ti速度为人为加延迟模拟;本轮没有重测性能或宣称所有延迟口径不增长。额外模型约占1.9GB、会改用下一档,仍需真实采集卡和5060Ti验证。未push/Release,正式版仍2.1.1。
diff --git a/docs/MINIMAL_VOLUME_FIX_2026-11-01.md b/docs/MINIMAL_VOLUME_FIX_2026-11-01.md
new file mode 100644
index 00000000..f8568d0b
--- /dev/null
+++ b/docs/MINIMAL_VOLUME_FIX_2026-11-01.md
@@ -0,0 +1,33 @@
+# 极简播放条音量拖动和数值确认修复
+
+用户反馈:音量难拖;打开数值输入后,回车及点击空白处不能确认。
+
+在当前 `claude/vsync-jitter-wait-20261102` 未提交工作区继续,仅修改 QML/相关界面测试,不提交、不合并 main、不推送或发布。此前补帧修改保留。
+
+## 原因与处理
+
+- 极简和全屏共用独立 `FullscreenBar`。原窗口设置 `WindowDoesNotAcceptFocus`,输入框的 QML 焦点不能代替 Windows 键盘焦点。改为固定可激活的窗口标志;音量按住/编辑时保留焦点,结束后请求回到主窗口;外部窗口激活或播放条隐藏时提交编辑。全屏编辑期间不自动隐藏。
+- `VSlider` 原 `activeTranslation` 在拖动激活时从零开始,跨过阈值的第一下会被漏掉,单次快速移动可完全不改变值。现在按下时保存起始值,按当前位置减按下位置计算完整位移,并在激活时立即应用;停用后的位移复位不写值。
+- 滑块两端凸出轨道,原输入区只含轨道,100% 中心及外侧不能完整命中。音量专用 `fullKnobHitArea` 包含完整滑块;扩大音量区域至 104×32、保证轨道宽度。密集参数面板仍用原命中边界。
+- 音量按下/拖动/编辑时禁止播放条的窗口移动手势抢占;保留空白区域拖动窗口。音量跟随模型更新,拖动期间用草稿值显示。
+- 内嵌数值框接收快捷键覆盖,主回车/数字键盘 Enter 确认、Esc 取消;被动观察窗口内外部按下,空白也能提交且不吃下一控件点击。关闭清理隐藏输入焦点,转到其他输入时不抢焦点。
+
+## 验证与纠错
+
+复用 `E:/项目/Veyra/build/claude-screen-recording-20261022` 和 `E:/项目/Veyra/tests/claude-sr-stage-20261028/app`,独立配置在 `tests/codex-cinema-volume-20261101/profile`。原文件保全在 `archives/codex-cinema-volume-20261101`。
+
+构建:`python -X utf8 -B scripts/acceptance/build-recording-handoff.py --task codex-cinema-volume-20261101 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --label 2.1.1-test --jobs 2 veyra_qml_ui veyra_qml_quick_tests`,最终增量 0.7 秒退出 0,日志 `logs/codex-cinema-volume-20261101/build-20261101-235611`。
+
+QtQuick 最终 **132 passed / 0 failed / 1 existing skipped**,33.4 秒,日志 `quick-complete-results.txt`。覆盖共享组件、拖动、模型绑定、输入、普通/数字键盘回车、空白提交、下一输入框焦点、Esc、快捷键恢复、0%/100% 两端拖动、单次快速拖动、空白移动窗口,以及 NR 等原参数控件。翻译检查 2718 条、缺失/占位符问题 0;diff 检查通过。
+
+实际 Windows 窗口用 computer-use 操作、真实本地视频、独立配置验证:从 100% 端点单次快速拖至约 21.95%;输入 63 回车应用为 0.63;输入 41 点击播放条空白应用为 0.41。界面观察和桥接模型日志一致,编辑后隐藏焦点清除,播放条完整显示,窗口未随音量拖动移动。观察探针只注入运行目录,完成后四个 QML 逐字节恢复到产品源码;没有在产品引入定时诊断刷新。此处验证交互和引擎参数,不是声学音量测量。全屏使用同一控件且隐藏条件已修正,本轮人工操作在窗口化极简模式。
+
+过程失败如实保留:
+
+1. 初版随编辑动态改变 `WindowDoesNotAcceptFocus`,实际软件渲染悬浮条内容丢失;撤回动态标志,保持原生窗口标志稳定。该原型的本轮测试 PID 14532 经 EXE/独立 data-dir 核对后停止,未停止用户进程;其余用例退出记录见各日志。
+2. 初次 QtQuick 使用了构建目录中的旧测试夹具,只证明原 123 项回归;复制新夹具后另行验证,没有把旧测试数当新增测试通过。
+3. 第一轮完整新用例 130/2/1:快速单次拖动仍漏位移,改用 centroid 的按下/当前位置;NR 模式选择被扩大的公共命中范围影响,对照原组件和去掉 padding 都通过,故命中扩展改为仅音量 opt-in。最终完整 132/0/1。
+
+本轮未改音频后端、补帧、GPU 设置、驱动或运行 DLL。原真实配置 7 文件、97 个默认运行组件的保护核验,以及完整文件 SHA、空间和证据在 `E:/项目/Veyra/reports/codex-cinema-volume-20261101/FINAL.json`。只保留小型测试缓存以复用,没有复制完整运行包或声称物理空间回收。
+
+继续测试可使用原 `E:/项目/Veyra/tests/claude-fg-60hz-pacing-20261031/启动补帧刷新率测试.cmd`,其运行目录已更新。
diff --git a/docs/README.md b/docs/README.md
index b89ecd12..fffef981 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -2,6 +2,8 @@
日常只从这些入口开始:
+当前独立分支已完成续接收尾、未提交:[垂直同步等待上限3 ms](VSYNC_JITTER_WAIT_2026-11-02.md)。
+
最新并入本地main(未发布):[11-01合并记录](MAIN_INTEGRATION_2026-11-01.md)、[补帧返工与VFG自动调控](FG_NO_LATENCY_GROWTH_2026-11-01.md)。
最近并入本地 main(未发布):[补帧接近刷新率的间歇掉帧](FG_60HZ_PACING_2026-10-31.md)、[英伟达低延迟三档](NVIDIA_LOW_LATENCY_2026-10-28.md)、[RX 7000 NR](AMD_RDNA3_NR_PLAN_2026-10-29.md)、[屏幕捕获与采集音频](CAPTURE_FPS_AUDIO_REPORT_2026-10-27.md)。
diff --git a/docs/VSYNC_JITTER_WAIT_2026-11-02.md b/docs/VSYNC_JITTER_WAIT_2026-11-02.md
new file mode 100644
index 00000000..4f6572fe
--- /dev/null
+++ b/docs/VSYNC_JITTER_WAIT_2026-11-02.md
@@ -0,0 +1,125 @@
+# 垂直同步容量等待跟随回调抖动(2026-11-02)
+
+用户在 60 Hz 丢帧的问题上问“垂直同步也还是会丢部分帧,那有什么解决办法吗”,看完方案对比后选择“上限 3 ms”。
+
+分支 `claude/vsync-jitter-wait-20261102`,基于 main `8535791`。未提交、未 merge、未 push、未 Release。
+
+分析和选项对比见 `E:/项目/Veyra/reports/claude-vsync-slots-20261102/FINDINGS.md`,脚本在 `E:/项目/Veyra/tmp/claude-vsync-slots-20261102/`。
+
+## 原因
+
+垂直同步下的丢帧分两种:
+
+1. 时钟差造成的滑移,比如 59.944 fps 对 60.005 Hz,每约 16.5 秒一次。软件消不掉,只有可变刷新能消除。这次没有动。
+2. 回调抖动造成的额外丢帧。相位靠近刷新边界时生成帧偶尔赶不上,屏幕队列被占住,等约 1 ms 仍没有空位就丢掉(`[fg-drops] capacity`)。
+
+第二种取决于采集卡。日志里的回调抖动:MCS T911 和 KUHAIMI G50 是 0.01–0.06 ms,KUHAIMI 4K60 Version(4K30)是 1.87 ms。11-01 实测注入的 1.9 ms 只代表最后这张卡。
+
+## 改动
+
+`liveSmoothedCapacityWaitMs(输出间隔, 回调抖动)`:
+
+| 输出间隔 | 等待 |
+|---|---|
+| 短于 12.5 ms(高于 80 fps) | 原规则,不看抖动 |
+| 12.5 ms 及以上 | `1 + 3.125 × 平均偏差`,下限是原规则,上限 3 ms |
+
+- 平均偏差是 `LiveArrivalSmoother::jitterMs()`,约等于 0.8 倍标准差,所以公式等于 `1 + 2.5 × sd`。
+- 只影响显式垂直同步下的图内补帧,且只在平滑锚点生效时(物理和屏幕采集)。自动模式没有这个等待。内容去重和串流没有平滑锚点,仍是原来的 2 ms。
+- `[live-anchor]` 增加 `capacityWaitMs`。自动模式下这个值只是算出来的,不起作用。
+- `VEYRA_TEST_FIXED_CAPACITY_WAIT=1` 恢复固定等待,用于 A/B。
+- 单测:`tests/unit/LivePresentationTimingTests.cpp`。
+
+## 预期(模型,不是实测)
+
+59.94 fps 对 60.005 Hz,生成帧就绪 5 ms,每分钟丢帧数和相对旧规则的真实帧延迟:
+
+| 抖动 sd | 旧 | 新(上限 3 ms) | 平均 | P99 |
+|---|---|---|---|---|
+| 0.05 ms | 0.1 | 0 | +0.01 ms | 0 |
+| 0.3 ms | 0.5 | 0 | +0.03 ms | 0 |
+| 0.6 ms | 5.2 | 0 | +0.40 ms | +0.4 ms |
+| 1 ms | 14.8 | 0.1 | +0.82 ms | +0.7 ms |
+| 1.87 ms | 37.7 | 5.7 | +1.38 ms | +0.8 ms |
+| 2.6 ms | 63.0 | 22.3 | +1.42 ms | +0.3 ms |
+
+高抖动的卡延迟确实会增加,这是用户看过上表后选的取舍。
+
+## 实测
+
+### 构建
+
+`py -3.11 -I -B tmp/claude-vsync-slots-20261102/build/build.py veyra_live_timing_tests veyra_realtime_preview_tests veyra_presentation_pacing_tests veyra_live_presentation_tests veyra_qml_ui`。
+
+第一次失败:调用点所在的 lambda 是显式捕获,`error C3493` 没有捕获 `liveArrival`。当时用管道看输出,后台任务报告退出码 0,是管道造成的,后来改成直接检查退出码。补上捕获后 69.4 秒通过。
+
+### 320 Hz 短测
+
+`verify.py wait sanity`:真实程序 + 4K 回放(`VEYRA_TEST_REPLAY_AS_CARD`),VFG 中档 2X,每轮 8 秒。结果 `tmp/claude-vsync-slots-20261102/wait-sanity.txt`。
+
+| 同步 | 注入抖动 | 规则 | 测得平均偏差 | 等待 | 容量丢帧 | 呈现 平均/P95 | 面板平均 |
+|---|---|---|---|---|---|---|---|
+| 垂直同步 | 0.05 ms | 新 | 0.048 | 1.15 ms | 0 | 22.26/22.60 | 24.15 |
+| 垂直同步 | 0.6 ms | 新 | 0.514 | 2.60 ms | 0 | 22.36/22.78 | 24.24 |
+| 垂直同步 | 1.9 ms | 新 | 1.623 | 3.00 ms | 0 | 22.36/23.07 | 24.25 |
+| 垂直同步 | 1.9 ms | 固定 | 1.624 | 1.02 ms | 0 | 22.42/23.19 | 24.33 |
+| 自动 | 1.9 ms | 新 | 1.624 | 不适用 | 0 | 22.36/22.99 | 24.10 |
+
+估计值符合预期。启动后前几秒偏差读数略高(0.05 ms 时短暂到 0.17),等待短暂到 1.5 ms,随后回落。320 Hz 下队列本来不紧张,所以这只说明没有副作用,不能说明丢帧减少。
+
+### 回归
+
+`verify.py cpu`、`cpu2`、`gpu`、`live`,结果在 `E:/项目/Veyra/reports/claude-vsync-slots-20261102/`,都在 320 Hz 屏上跑。
+
+| 阶段 | 结果 |
+|---|---|
+| `veyra_live_timing_tests` | 通过,151 项,含新增规则和估计值测试 |
+| `veyra_realtime_preview_tests` | 通过 |
+| `cpu` | 14 项通过。列出的 7 个失败项都是没传参数(`usage:`),名单和上个任务相同,由 `cpu2` 带参数覆盖 |
+| `cpu2` | 12/0 |
+| `gpu` | 20/0(VFG、DLSS 6X、FSR、XeSS、过载、生命周期) |
+| `live` | 5/1。`--source-gap` 失败:结束时的快照 `last real source frame is completed and current epoch fully presented`。上个任务记录过同一项,在未改动的 main 上 3 次只过 1 次,这次没有再查 |
+
+没有重跑 `qml` 和 `lifecycle`,这次没有动界面和设置。
+
+### 真实 60 Hz 实测
+
+用户把本机屏幕切到 60.000 Hz(每轮日志都核对过)。RTX 5070,4K 片源按采集卡节奏回放,自身时钟偏 800 ppm,输出 59.74/s,垂直同步,2X。`verify.py wait hz60`、`hz60b`、`hz60c`,共 14 轮,全部退出 0,无 D3D12 错误。固定规则用 `VEYRA_TEST_FIXED_CAPACITY_WAIT=1`,长轮次按“旧新新旧”交替。
+
+统计跳过每轮前 5 秒。Codex 接手时复算了所有 14 轮原始日志(`reports/codex-vsync-handoff-20261101/evidence-review.json`):
+
+| 补帧 / 注入抖动 | 规则 | 稳定段 | 真实帧 / 生成帧提交数 | 提交数差折算每分钟 | 回调时钟拟合线→Present 结束均值 |
+|---|---|---|---|---|---|
+| DLSS / 1.9 ms | 固定 | 3 轮合计约 43 秒 | 1284 / 1257 | 37.7 | 21.88 ms |
+| DLSS / 1.9 ms | 自适应 | 3 轮合计约 43 秒 | 1285 / 1281 | 5.6 | 21.97 ms |
+| VFG 中档 / 1.9 ms | 固定 | 3 轮合计约 43 秒 | 1284 / 1280 | 5.6 | 21.85 ms |
+| VFG 中档 / 1.9 ms | 自适应 | 3 轮合计约 43 秒 | 1286 / 1284 | 2.8 | 21.83 ms |
+| DLSS / 0.05 ms | 固定 / 自适应 | 各约 9 秒 | 269/269、268/268 | 都为 0 | 21.87 / 21.92 ms |
+
+这里计数来自应用的呈现提交记录,不是实际显示的帧。提交差还受统计窗口边界、生成准入与提供方输出影响,不能逐帧等同于容量丢弃。包括启动段的日志累计容量丢弃:DLSS 固定 29、自适应 10;VFG 中档 13→8,支持容量等待确实减少提前丢弃的方向。日志按秒记录累计值,尾部还可能有未记录的丢弃,不能把它当作结束时精确总数。
+
+原结论“DLSS 少显示帧减少 85%”改为“短样本中的生成帧提交缺口减少约 85%”。VFG 是 4→2 的小样本,不能给稳定收益保证。回调时钟拟合线→Present 的均值差分别约 +0.095 ms、−0.018 ms,只是软件时刻,不是屏幕端到端延迟;也不保证零延迟代价。
+
+原 `panel_est.py` 强制为每次提交分配互不重复的刷新格点,并拟合每秒延迟中位数。这个假设无法判断哪些提交实际被替换;原“上屏平均 +1.27/+0.39 ms”“重复帧/分”及其 P95/P99/最大值不再作为验收证据。原文件与脚本保留供追溯。原 `wait-*.json` 的 `captureToPresent*` 直接用 host 时间减相对媒体 PTS,也无物理意义,不采信。这里的误差不是靠增加小数精度能补救的。
+
+中途纠错:第一版统计包含 DLSS 启动的前 2–3 秒,呈现 P95 一度读成 34 ms;两套规则都有该启动段,已排除前 5 秒。当前短测不足以证明所有尾延迟都没有增长。
+
+## Codex 续接收尾(本地日期 2026-11-01)
+
+已读 Claude 最新会话 `9720f799-88ff-48b9-847a-6fef8a5f00e5`,确认用户选择 3 ms,并已自行切屏到 60 Hz;中断发生在 14 轮对比和最终编译完成后的整理阶段。本文原日期及分支使用 11-02,是原任务标识,续接按用户所在时区记 11-01。
+
+保全 7 个未提交文件、原补丁和 SHA 到 `archives/codex-vsync-handoff-20261101`。产品算法、调用点和单测不重写;仅把头文件中不能成立的物理显示收益注释改为提交口径。增量构建 4 个相关目标通过,11.8 秒;日志 `logs/codex-vsync-handoff-20261101/build-20261101-223612/compile.log`。
+
+两组 CPU 合同通过;再跑 DLSS 2X 和 VFG 中档 2X 各 8 秒测量窗口,均核对 `refreshHz=60.000`、实际提供方生成、正常退出、无 D3D12 错误,抖动 1.9 ms 时预算从约 1.02 ms 跟随到 3 ms。测试夹具含初始化,所以进程分别用时 18.9 / 10.2 秒。没有复制整套运行包,没有修改显示模式或连接真实采集卡。Claude 原有 GPU 20 项等结果与本轮 4 项复验分开记录;已知 `source-gap` EOF 快照失败保留,不冒称全套通过。
+
+运行目录仍为 `E:/项目/Veyra/tests/claude-sr-stage-20261028/app`,原测试启动脚本 `E:/项目/Veyra/tests/claude-fg-60hz-pacing-20261031/启动补帧刷新率测试.cmd` 使用独立配置。EXE/worker/shader 与构建核对,97 个默认运行组件及原用户配置核对结果见最终回执。活动分支保留 `claude/vsync-jitter-wait-20261102`,未提交、未合并 main、未 push/Release。
+
+最终证据:`E:/项目/Veyra/reports/codex-vsync-handoff-20261101/FINAL.json`。
+
+## 未验证
+
+- 没有在真实采集卡上跑,都是回放加注入抖动。T911 的低抖动来自日志,不是这次测量。
+- 高抖动实卡(KUHAIMI 4K60 Version)没有。
+- 只测了 DLSS 和 VFG 中档 2X,FSR、VFG 高档没有在 60 Hz 上对比。
+- 现场时钟差比这里小(59.94 对 60.005,每 16.5 秒一次),丢帧的绝对数字会不同。
+- 主观观感没有评估。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 96d3af50..57b6a466 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -330,3 +330,41 @@ RTX5060Ti、4K30 NV12→VFG2X/60Hz,主要稳定段NR/SR关闭。中档84.016
真实GUI两次启动、独立profile:列表开关、低档/超过2X置灰、节点实际双向切换及置灰、中文/英文改名、保存重启均通过,无QML错误;补上Claude只加载节点页未点开关的空缺。Main.qml恢复。EXE/worker/shader与构建一致,QML/翻译一致;正式供体1730项、原默认运行组件97项核验,原用户配置7文件SHA未变;i18n2718条缺失/占位符问题0。
证据reports/codex-main-integration-20261101:before/merge/cpu-merge/qml/gpu-merge/ui-regulate/audit/FINAL.json与复现脚本;日志logs同任务;运行目录仍tests/claude-sr-stage-20261028/app。没有重做60Hz性能A/B、实卡采集/5060Ti/RX7000/VRR验收,没有重复全量测试或跑原8K危险组合;Claude的已知source-gap/FSR探针依赖问题边界保持,不冒称全部通过。仅清本轮可再生TEMP,清理逻辑字节和保留路径见cleanup.json;未测物理净回收。
+
+## 2026-11-02 垂直同步容量等待跟随回调抖动(Claude)
+
+用户问60 Hz垂直同步为何仍丢部分帧、有什么办法,看完选项后选“上限3 ms”。分支claude/vsync-jitter-wait-20261102从main 8535791,未提交、未merge、未push/Release。执行记录[VSYNC_JITTER_WAIT_2026-11-02](VSYNC_JITTER_WAIT_2026-11-02.md),分析reports/claude-vsync-slots-20261102/FINDINGS.md,脚本tmp/claude-vsync-slots-20261102。
+
+分析:现场日志`[capture-callback]`算出回调到达抖动,T911和G50为0.01–0.06 ms,KUHAIMI 4K60 Version(veyra-qml(69).log,4K30)为1.87 ms,所以11-01注入的1.9 ms只代表最后这张卡。先试“预分配刷新格点”,模型显示没有优势,撤回;屏幕刷新率匹配同样无效;只有等待时长能换丢帧,且代价随抖动增加。
+
+改动:`liveSmoothedCapacityWaitMs`增加抖动参数,输出不高于80 fps时等待为`1+3.125×平均偏差`,下限原规则,上限3 ms;自动模式、高刷MFG、内容去重、串流不变。`[live-anchor]`加`capacityWaitMs`,`VEYRA_TEST_FIXED_CAPACITY_WAIT=1`恢复固定等待。
+
+失败与修正:第一次构建失败(error C3493,显式捕获的lambda没有`liveArrival`),因为输出经过管道,后台任务报退出码0,那轮单测跑的是引擎未更新的程序,已作废。补捕获后69.4秒通过,并改为直接核对build.py退出码。
+
+结果(320 Hz):timing 151项、preview通过;cpu 14项通过,另7项是没传参数的usage退出(名单和上个任务相同);cpu2 12/0;gpu 20/0;live 5/1,`--source-gap`失败,是已记录的不稳定项,这次没有再查。`wait sanity`注入0.05/0.6/1.9 ms,测得平均偏差0.048/0.514/1.623,等待1.15/2.60/3.00 ms,容量丢帧都是0,面板平均24.15–24.25 ms(固定规则24.33 ms)。320 Hz队列不紧张,这只说明没有副作用。
+
+真实60 Hz(用户切屏,日志核对60.000 Hz;`wait hz60/hz60b/hz60c`共14轮全部退出0,每轮跳过前5秒):DLSS注入1.9 ms,固定→新,少显示生成帧37.7→5.6/分(各43秒,27→4帧),上屏估算平均30.93→32.20 ms,P95 38.64→39.73,P99 39.97→40.68,最大46.68→41.69。VFG中档注入1.9 ms,5.6→2.8/分(4→2帧,样本少),平均30.78→31.17,P99 39.35→39.73,最大49.30→40.55。DLSS注入0.05 ms(等待1.02→1.15 ms,各9秒),都是0,平均30.05→29.97。上屏时刻是按刷新格点估算的,拟合误差0.16–0.89 ms。中途纠错:第一版统计含DLSS启动段,呈现P95读成34 ms,逐秒看后确认是启动的2–3秒、新旧规则都有,统计改为跳过前5秒。证据reports/claude-vsync-slots-20261102。
+
+未验证:真实采集卡、高抖动实卡、FSR和VFG高档的60 Hz对比。未改真实配置、运行组件、采集卡。
+
+
+## 2026-11-01 Codex接手Claude垂直同步3 ms等待收尾
+
+完整核对最新Claude会话9720f799-88ff-48b9-847a-6fef8a5f00e5的用户选择、切屏确认、测试完成和额度中断。当前claude/vsync-jitter-wait-20261102基于main8535791,7文件原始SHA/ZIP/补丁保全在archives/codex-vsync-handoff-20261101。没有新功能要求,不改算法;头文件注释撤回不成立的物理上屏收益,保持Claude代码/测试主体。
+
+本节纠正上一节“少显示生成帧”和“上屏估算”口径:14轮日志复算,DLSS高抖动稳态真实/生成提交1284/1257→1285/1281,VFG中档1284/1280→1286/1284;分别是提交差27→4、4→2,不是扫描显示计数。原panel_est.py强制每次提交占不同刷新格点,不能验证被替换帧及真实上屏延迟;+1.27/+0.39 ms和重复帧率/P95/P99等推估不作验收。原captureToPresent*混用相对PTS和host时间无意义。有效软件时刻拟合线→Present均值DLSS21.88→21.97 ms、VFG21.85→21.83 ms,不是物理延迟或零增长保证。原始报告保留,正文和当前入口纠正。
+
+命令:python -X utf8 -B scripts/acceptance/build-recording-handoff.py --task codex-vsync-handoff-20261101 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --label 2.1.1-test --jobs 2 veyra_live_timing_tests veyra_realtime_preview_tests veyra_presentation_pacing_tests veyra_qml_ui;11.8秒退出0。reports/codex-vsync-handoff-20261101/verify.py stage/handoff:两组CPU和DLSS/VFG中档8秒实测窗口通过,真实60Hz、预算跟随至3ms、提供方实际生成、干净退出、无D3D12错误。没有重跑全量或更改显示/用户进程;继承Claude的source-gap失败如实保留。
+
+运行目录仍tests/claude-sr-stage-20261028/app,测试入口tests/claude-fg-60hz-pacing-20261031/启动补帧刷新率测试.cmd。最终配置/运行组件SHA、清理、空间与产物在reports/codex-vsync-handoff-20261101/FINAL.json。未提交、未合并main、未push/Release;真实采集卡与物理显示延迟未验。详见docs/VSYNC_JITTER_WAIT_2026-11-02.md。
+
+收尾核验:原用户配置7文件SHA未变、默认运行组件97项一致;EXE/worker/shader均匹配构建。自动审批两次拒绝本轮可再生TEMP清理,仅返回blocked by policy,无具体理由;未删除任何缓存,保留两个run目录共7617338逻辑字节,见cleanup.json。无物理空间回收声明。
+
+
+## 2026-11-01 极简播放条音量交互修复
+
+用户反馈难拖、输入后空白与回车不确认。在当前claude/vsync-jitter-wait-20261102保留此前未提交改动,只修QML与对应测试。FullscreenBar固定可激活标志、交互结束归还焦点,外部失焦/隐藏提交;VSlider完整按下位移、端点命中音量专用扩展、空白被动提交与键盘确认/取消/隐藏焦点清理;CineBar扩大音量区域并禁止其手势触发移动窗口;全屏编辑不自动隐藏。
+
+构建产品与QuickTest最终0.7秒通过(并发2,build-20261101-235611);新旧夹具分开检查后最终132/0/1既有跳过、33.4秒,包含单次快速/两端拖动、模型绑定、Return/Enter、空白、焦点、Esc及原NR控件。i18n2718条缺失/占位符0,diff检查通过。真实Windows极简窗口操作确认100%→21.95%快速拖、63回车→0.63、41点击空白→0.41,未随之移动窗口,测试观测代码已恢复为产品源码。不是声学音量测试;人工未覆盖全屏。详细记录docs/MINIMAL_VOLUME_FIX_2026-11-01.md,回执reports/codex-cinema-volume-20261101/FINAL.json。
+
+失败/纠正:动态窗口flag导致软件渲染内容丢失,已改稳定flag;一次整轮130/2/1,快速拖改用centroid总位移,公共扩大命中影响NR选择则缩到音量opt-in,最终全过。一个原型测试进程核对PID/EXE/私有data-dir后停止;未停用户进程。首次123项使用旧夹具,未计入新测试证明。原补帧代码及原配置/运行组件保护结果、产物空间见FINAL。未提交、未合并main、未push/Release。
diff --git a/include/veyra/engine/LivePresentationTiming.h b/include/veyra/engine/LivePresentationTiming.h
index 80352166..7782439e 100644
--- a/include/veyra/engine/LivePresentationTiming.h
+++ b/include/veyra/engine/LivePresentationTiming.h
@@ -104,5 +104,17 @@ inline bool liveFramesShareRefresh(int64_t generated,int64_t real,int64_t lastVb
// 2X model: 2 ms keeps 0.6% more frames but holds real frames 0.7 ms longer on
// average than 1 ms. 320 Hz A/B: 1 ms loses 3-6% of the presents for nothing at
// P99, and 2 ms shows no growth against the callback anchor.
-inline double liveSmoothedCapacityWaitMs(double outputIntervalMs){return std::clamp(2-(outputIntervalMs-5)/12,1.0,2.0);}
+// Near 60 Hz the frames this limit loses come from callback jitter, and that differs
+// between cards by two orders: sd 0.01-0.06 ms on MCS T911 and KUHAIMI G50, 1.87 ms
+// on KUHAIMI 4K60 Version at 4K30 (field logs, 2026-11). So there the wait follows
+// the jitter the smoother measures, 1 ms + 2.5 sd (its mean distance is 0.8 sd), to
+// at most 3 ms. Real 60 Hz replay with injected callback jitter reduced missing
+// generated-frame submissions in the short A/B runs. Submission counts and a
+// fitted refresh grid do not establish physical display loss or panel latency;
+// see docs/VSYNC_JITTER_WAIT_2026-11-02.md for evidence and measurement limits.
+inline constexpr double kLiveJitterWaitMinIntervalMs=12.5,kLiveJitterWaitMaxMs=3;
+inline double liveSmoothedCapacityWaitMs(double outputIntervalMs,double callbackJitterMs=0){
+ const double base=std::clamp(2-(outputIntervalMs-5)/12,1.0,2.0);
+ return outputIntervalMs<kLiveJitterWaitMinIntervalMs?base:std::clamp(1+3.125*callbackJitterMs,base,kLiveJitterWaitMaxMs);
+}
}
diff --git a/qml/Veyra/CineBar.qml b/qml/Veyra/CineBar.qml
index 8e10c592..cbf095e5 100644
--- a/qml/Veyra/CineBar.qml
+++ b/qml/Veyra/CineBar.qml
@@ -30,13 +30,16 @@ Rectangle {
// The pointer is over the pill.
readonly property bool hovered: barHover.hovered
readonly property bool seekPreviewOpen: seekMouse.containsMouse && seekMouse.enabled
+ readonly property bool editing: volumeSlider.editing
+ readonly property bool interacting: volumeSlider.pressed || editing
+ function finishEditing() { volumeSlider.closeEditor(true) }
HoverHandler { id: barHover }
// Buttons, the seek rail and the volume slider take their own presses first; only
// a drag that starts on empty pill reaches this one.
DragHandler {
objectName: "cine-move"
target: null
- enabled: !bar.fullscreen
+ enabled: !bar.fullscreen && !volumeSlider.pressed && !volumeSlider.editing
// Never take a drag over from a control: by default a DragHandler steals the grab
// from an item once the pointer passes the drag threshold, so scrubbing the seek
// rail moved the window instead (field report 2026-10-02).
@@ -367,7 +370,7 @@ Rectangle {
// --- right: preset, volume, fullscreen (230px) ---------------
RowLayout {
- Layout.preferredWidth: 284; Layout.minimumWidth: 284; Layout.maximumWidth: 284
+ Layout.preferredWidth: 308; Layout.minimumWidth: 308; Layout.maximumWidth: 308
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
spacing: 6
@@ -384,15 +387,22 @@ Rectangle {
}
Item {
- implicitWidth: 80
- implicitHeight: 20
+ implicitWidth: 104
+ implicitHeight: 32
+ Layout.minimumWidth: 104
RowLayout {
anchors.fill: parent
spacing: 6
VIcon { name: "vol"; color: Theme.t2 }
VSlider {
+ id: volumeSlider
+ objectName: "cine-volume"
Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.minimumWidth: 72
from: 0; to: 1; value: veyra.volume; inputScale: 100
+ valueFromModel: true
+ fullKnobHitArea: true
onMoved: moved => veyra.volume = moved
}
}
diff --git a/qml/Veyra/FullscreenBar.qml b/qml/Veyra/FullscreenBar.qml
index 735a0eeb..41b1d7ab 100644
--- a/qml/Veyra/FullscreenBar.qml
+++ b/qml/Veyra/FullscreenBar.qml
@@ -4,8 +4,8 @@
// is drawn above everything in the main window's scene. A bar in the main scene
// would need a hole cut out of the picture; the design (and D1 in the goal plan)
// puts it in a separate small window instead. It is owned by the main window
-// (always above it, never above other applications), takes no keyboard focus (the
-// shortcuts stay with the main window), and is hidden outright when the controls
+// (always above it, never above other applications), takes keyboard focus only
+// while typing a parameter, and is hidden outright when the controls
// hide, so a hidden bar composes nothing over the video.
//
// The window is taller than the pill so the preset menu can open upwards inside it;
@@ -30,6 +30,8 @@ Window {
signal activity()
readonly property bool hovered: bar.hovered
readonly property bool menuOpen: bar.menuOpen
+ readonly property bool editing: bar.editing
+ readonly property bool interacting: bar.interacting
// G3.2 (D1): the same window carries the cinema pill in windowed 极简 mode, where
// it straddles the picture's bottom edge: its top is pillTop (owner-relative),
// half over the native video window and half below it. In fullscreen it sits
@@ -38,7 +40,25 @@ Window {
property real pillTop: 0
transientParent: owner
- flags: Qt.Tool | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
+ // Keep the native flags stable: toggling WindowDoesNotAcceptFocus while
+ // visible can discard the software-rendered translucent window contents.
+ // Ordinary clicks hand activation back to the owner; typing keeps it here.
+ flags: Qt.Tool | Qt.FramelessWindowHint
+ // Clicking the video or another window must commit, too: the QML input
+ // can retain activeFocus inside a window that no longer has OS focus.
+ onActiveChanged: {
+ if (!active && editing) bar.finishEditing()
+ else if (active && !interacting) Qt.callLater(function() {
+ if (win.active && !win.interacting) owner.requestActivate()
+ })
+ }
+ onInteractingChanged: if (!interacting && active) Qt.callLater(function() {
+ if (win.active && !win.interacting) owner.requestActivate()
+ })
+ onShownChanged: {
+ if (!shown && editing) bar.finishEditing()
+ if (shown && cinema) enter()
+ }
color: "transparent"
// Room for the pill plus the preset menu above it (VMenu is at most 420 tall).
@@ -87,7 +107,6 @@ Window {
function enter() { barIn.restart() }
// The cinema pill enters with barIn each time it appears (page shown, dialog
// closed); the fullscreen one keeps the plain fade and rise.
- onShownChanged: if (shown && cinema) enter()
SequentialAnimation {
id: barIn
ScriptAction { script: { win.enterDy = 30; win.enterScale = 0.94; win.enterOpacity = 0 } }
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index f73a348e..2c66fd90 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -525,7 +525,7 @@ Window {
interval: 1600
onTriggered: {
if (!root.fullscreen || !root.fullControls) return
- if (fullBar.hovered || fullBar.menuOpen || root.test.fullBar === "shown") { restart(); return }
+ if (fullBar.hovered || fullBar.menuOpen || fullBar.editing || root.test.fullBar === "shown") { restart(); return }
root.fullControls = false
veyra.logUi("ui-fullscreen", "controls hidden; video and subtitles only")
}
diff --git a/qml/Veyra/VSlider.qml b/qml/Veyra/VSlider.qml
index 2e032089..f87f6ad9 100644
--- a/qml/Veyra/VSlider.qml
+++ b/qml/Veyra/VSlider.qml
@@ -11,6 +11,9 @@ Item {
property bool center: false // fill from the middle instead of the left
property bool showCenterFill: false // Colour controls opt in; other pages keep their visuals.
property bool enabledControl: true
+ // Compact standalone rails can include the protruding endpoint knob;
+ // dense parameter rows keep their original hit bounds.
+ property bool fullKnobHitArea: false
// A containing parameter widget can opt in without changing non-parameter sliders.
property bool resettable: parent && typeof parent.sliderResetEnabled !== "undefined" && parent.sliderResetEnabled
property real defaultValue: 0
@@ -25,6 +28,7 @@ Item {
property bool live: true
// True while the knob is held (tests read it; the owner may too).
readonly property bool dragging: drag.active
+ readonly property bool pressed: drag.active || trackTap.pressed
Timer {
id: liveTimer
interval: 40
@@ -51,18 +55,24 @@ Item {
if (!editable || !enabledControl) return
editorInput.text = Number((value * inputScale).toFixed(inputDecimals)).toString()
editor.visible = true
+ if (slider.Window.window) slider.Window.window.requestActivate()
editorInput.forceActiveFocus()
editorInput.selectAll()
}
function closeEditor(apply) {
if (!editor.visible) return
+ const heldFocus = editorInput.activeFocus
editor.visible = false
+ editorInput.focus = false
if (apply) {
const typed = Number(editorInput.text.trim().replace(",", "."))
if (editorInput.text.trim().length > 0 && isFinite(typed))
commitValue(Math.max(Math.min(from, to), Math.min(Math.max(from, to), typed / inputScale)))
}
- slider.forceActiveFocus()
+ // Losing focus to another editor must not steal it back. Clear hidden
+ // typing focus on explicit confirmation/cancel instead of reopening it.
+ if (heldFocus && slider.Window.window)
+ slider.Window.window.contentItem.forceActiveFocus()
}
// Keyboard (field request 2026-10-01): a clicked or dragged slider takes focus and the
@@ -82,7 +92,7 @@ Item {
|| (editable && (event.key === Qt.Key_Return || event.key === Qt.Key_Enter))) event.accepted = true
}
Keys.onPressed: event => {
- if (!enabledControl) return
+ if (!enabledControl || editing) return
if (event.key === Qt.Key_Left || event.key === Qt.Key_Down) { nudge(-1); event.accepted = true }
else if (event.key === Qt.Key_Right || event.key === Qt.Key_Up) { nudge(1); event.accepted = true }
else if (event.key === Qt.Key_Escape) { focus = false; event.accepted = true }
@@ -143,36 +153,49 @@ Item {
}
Item {
id: trackInput
- width: track.width
+ // The endpoint knob protrudes past the rail. Its whole circle must accept
+ // a press, especially at 100% where its centre is just outside the rail.
+ readonly property real hitPadding: slider.fullKnobHitArea ? knob.width / 2 : 0
+ x: -hitPadding
+ width: track.width + 2 * hitPadding
height: parent.height
HoverHandler { id: hover; cursorShape: Qt.PointingHandCursor; enabled: slider.enabledControl }
DragHandler {
id: drag
target: null
enabled: slider.enabledControl
- // activeTranslation is measured from the press, so it adds to where the knob
- // was then, not to where it is now.
+ // Measure from the original press, including the move which crossed the
+ // drag threshold; activeTranslation starts at activation and can be zero
+ // for that move.
property real startX: 0
- onActiveTranslationChanged: {
- const x = Math.max(0, Math.min(track.width, startX + activeTranslation.x))
+ function updateDragValue() {
+ const delta = centroid.position.x - centroid.pressPosition.x
+ const x = Math.max(0, Math.min(track.width, startX + delta))
slider.dragValue = slider.from + (x / track.width) * (slider.to - slider.from)
if (!slider.valueFromModel) slider.value = slider.dragValue
if (slider.live && !liveTimer.running) liveTimer.start()
}
+ onActiveTranslationChanged: if (active) updateDragValue()
onActiveChanged: {
if (active) {
slider.forceActiveFocus()
- slider.dragValue = slider.value
- startX = track.width * slider.frac
+ // The threshold-crossing move may be the only move in a quick
+ // drag. Apply it now, using the value captured at press time.
+ updateDragValue()
} else { liveTimer.stop(); slider.commitValue(slider.valueFromModel ? slider.dragValue : slider.value) }
}
}
TapHandler {
+ id: trackTap
enabled: slider.enabledControl
// Node cards may overlap: consume track clicks rather than also
// activating an inspector button on a card underneath this slider.
gesturePolicy: TapHandler.WithinBounds
property real beforeTap: 0
+ onPressedChanged: if (pressed) {
+ drag.startX = track.width * slider.frac
+ slider.dragValue = slider.value
+ }
onTapped: (point, button) => {
// The second tap of a double-click opens the editor and undoes the first
// tap's jump, so typing starts from the value the slider had.
@@ -183,7 +206,7 @@ Item {
}
beforeTap = slider.value
slider.forceActiveFocus()
- const x = Math.max(0, Math.min(track.width, point.position.x))
+ const x = Math.max(0, Math.min(track.width, point.position.x - trackInput.hitPadding))
slider.commitValue(slider.from + (x / track.width) * (slider.to - slider.from))
}
}
@@ -213,12 +236,24 @@ Item {
font.pixelSize: Theme.fsSmall
selectByMouse: true
inputMethodHints: Qt.ImhFormattedNumbersOnly
- Keys.onReturnPressed: slider.closeEditor(true)
- Keys.onEnterPressed: slider.closeEditor(true)
- Keys.onEscapePressed: slider.closeEditor(false)
+ Keys.onShortcutOverride: event => event.accepted = true
+ Keys.onReturnPressed: event => { event.accepted = true; slider.closeEditor(true) }
+ Keys.onEnterPressed: event => { event.accepted = true; slider.closeEditor(true) }
+ Keys.onEscapePressed: event => { event.accepted = true; slider.closeEditor(false) }
onActiveFocusChanged: if (!activeFocus && editor.visible) slider.closeEditor(true)
}
}
+ // Empty space often does not take focus. Observe outside presses passively,
+ // so they commit without swallowing the next control's click or drag.
+ TapHandler {
+ parent: slider.Window.window ? slider.Window.window.contentItem : slider
+ enabled: slider.editing
+ gesturePolicy: TapHandler.DragThreshold
+ onPressedChanged: if (pressed) {
+ const p = editor.mapFromItem(parent, point.position.x, point.position.y)
+ if (!editor.contains(p)) slider.closeEditor(true)
+ }
+ }
ToolButton {
objectName: "vslider-reset"
anchors.right: parent.right
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index a689b948..57bb13ad 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -1147,6 +1147,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
// VEYRA_TEST_LEGACY_LIVE_PACING=1 restores the callback anchor, the
// 2 ms capacity wait and the lone VFG probe for A/B runs.
static const bool legacyLivePacing=GetEnvironmentVariableW(L"VEYRA_TEST_LEGACY_LIVE_PACING",nullptr,0)>0;
+ // A/B: the capacity wait before it followed the measured callback jitter.
+ static const bool fixedCapacityWait=GetEnvironmentVariableW(L"VEYRA_TEST_FIXED_CAPACITY_WAIT",nullptr,0)>0;
LiveArrivalSmoother liveArrival;int64_t liveGeneratedGrace=kLiveGeneratedGrace100ns,nextLiveAnchorLog=0;
FgCostSettling vfgCostSettling;
double vfgChosenFgMs=0,vfgFastFgMs=0;uint64_t vfgFastPairs=0,vfgFastBudgetPairs=0,vfgChosenPairs=0;int64_t vfgChosenAt=0,nextVfgFastLog=0;
@@ -2548,7 +2550,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
liveTimeline.resetPair(out.batch.identity.epoch,out.batch.b100ns,presentAnchor,options.fg?pairDelay:0,paceSourcePts);
if(smoothAnchor&&host100ns()>=nextLiveAnchorLog){
nextLiveAnchorLog=host100ns()+10000000;
- veyra::log::info("live-anchor",std::format("revision={} callbackJitterMs={:.3f} clockDriftPpm={:.0f} snaps={} callbackMinusAnchorMs={:.3f} (presentation anchor: source PTS plus a tracked offset to the capture callback, less a 0.5 ms lead)",options.settings.revision,liveArrival.jitterMs(),liveArrival.driftPpm(liveInterval),liveArrival.snaps(),double(liveInputReady-presentAnchor)/10000));
+ veyra::log::info("live-anchor",std::format("revision={} callbackJitterMs={:.3f} clockDriftPpm={:.0f} snaps={} callbackMinusAnchorMs={:.3f} capacityWaitMs={:.2f} (presentation anchor: source PTS plus a tracked offset to the capture callback, less a 0.5 ms lead; capacity wait applies under explicit VSync)",options.settings.revision,liveArrival.jitterMs(),liveArrival.driftPpm(liveInterval),liveArrival.snaps(),double(liveInputReady-presentAnchor)/10000,liveSmoothedCapacityWaitMs(double(liveInterval)/10000/std::max(1u,previewFgMultiplier),fixedCapacityWait?0:liveArrival.jitterMs())));
}
}
else if(!liveTimeline.anchored(out.batch.identity.epoch,paceSourcePts))liveTimeline.reset(out.batch.identity.epoch,out.batch.b100ns,liveInputReady,options.fg?duration100ns:0,paceSourcePts);
@@ -2598,7 +2600,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
#ifdef VEYRA_ENABLE_XBOX
&xb,
#endif
- &seekDecoded,&seekStarted,&audio,&audioPipe,&audioStarted,&cadence,&ctx,&fileAudioAlignPending,&fileAwaitingVideo,&fileInputEnded,&generatedDropCap,&generatedDropCapacity,&generatedDropDeadline,&playbackRate,&frameFlow,&graph,&host100ns,&isCapture,&isImage,&livePresent,&liveScheduler,&nextFgDeadlineLog,&nowMs,&options,&pendingCompletions,&physicalCapture,&presentEntryDeviation,&presentReturnDeviation,&presentationEffective,&presentationGeneration,&presentationSkippedGenerated,&presenter,&ring,&runSessionId,&seekPreviewPending,&traceFrame,&traceSubframes,watch,step,timeline,captureArrival,baselineReady,delayEnhanced,activeSeekId,lineage,jobGeneration,rereadCached,sourceIntervalMs,submitThenPresent,generatedGrace=liveGeneratedGrace,smoothAnchor,flow=frameFlow](int64_t now)->LiveGpuScheduler::Step{
+ &seekDecoded,&seekStarted,&audio,&audioPipe,&audioStarted,&cadence,&ctx,&fileAudioAlignPending,&fileAwaitingVideo,&fileInputEnded,&generatedDropCap,&generatedDropCapacity,&generatedDropDeadline,&playbackRate,&frameFlow,&graph,&host100ns,&isCapture,&isImage,&liveArrival,&livePresent,&liveScheduler,&nextFgDeadlineLog,&nowMs,&options,&pendingCompletions,&physicalCapture,&presentEntryDeviation,&presentReturnDeviation,&presentationEffective,&presentationGeneration,&presentationSkippedGenerated,&presenter,&ring,&runSessionId,&seekPreviewPending,&traceFrame,&traceSubframes,watch,step,timeline,captureArrival,baselineReady,delayEnhanced,activeSeekId,lineage,jobGeneration,rereadCached,sourceIntervalMs,submitThenPresent,generatedGrace=liveGeneratedGrace,smoothAnchor,flow=frameFlow](int64_t now)->LiveGpuScheduler::Step{
using State=LiveGpuScheduler::State;auto& batch=watch->output;auto& s=*step;
auto updatePending=[&](LiveStepState*){
unsigned left=0;for(unsigned i=s.next;i<batch.batch.count;++i)if(batch.batch.frames[i].kind!=pipeline::FrameKind::Generated||batch.batch.frames[i].validity==pipeline::GenerationValidity::Valid)++left;
@@ -2686,7 +2688,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
if(generated&&!legacyVsyncQueue){
if(!s.capacityStart)s.capacityStart=Clock::now();
const double outputIntervalMs=sourceIntervalMs/std::max(1u,batch.batch.count);
- if(elapsedMs(*s.capacityStart)>std::min(smoothAnchor?liveSmoothedCapacityWaitMs(outputIntervalMs):2.0,outputIntervalMs/2)){++generatedDropCapacity;++s.dropped;++s.handled;++s.next;s.deadlineStart.reset();s.capacityStart.reset();continue;}
+ if(elapsedMs(*s.capacityStart)>std::min(smoothAnchor?liveSmoothedCapacityWaitMs(outputIntervalMs,fixedCapacityWait?0:liveArrival.jitterMs()):2.0,outputIntervalMs/2)){++generatedDropCapacity;++s.dropped;++s.handled;++s.next;s.deadlineStart.reset();s.capacityStart.reset();continue;}
}
return {State::Pending,optionalNow+2000};
}
diff --git a/tests/qml/quick/tst_slider_value.qml b/tests/qml/quick/tst_slider_value.qml
index ea9247ba..6506c074 100644
--- a/tests/qml/quick/tst_slider_value.qml
+++ b/tests/qml/quick/tst_slider_value.qml
@@ -4,7 +4,7 @@ import Veyra
Item {
id: root
- width: 420; height: 180
+ width: 420; height: 240
property real amount: 1.25
property int shortcuts: 0
Shortcut { sequence: "Right"; onActivated: root.shortcuts++ }
@@ -23,15 +23,36 @@ Item {
}
VButton { id: outside; x: 20; y: 90; width: 120; height: 30; text: "Other control"; onClicked: forceActiveFocus() }
TextInput { id: nextInput; x: 160; y: 90; width: 140; height: 30; text: "Next input"; selectByMouse: true }
+ Item {
+ id: pill
+ x: 20; y: 150; width: 350; height: 40
+ property int windowMoves: 0
+ DragHandler {
+ target: null
+ enabled: !pillSlider.pressed && !pillSlider.editing
+ grabPermissions: PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything
+ onActiveChanged: if (active) pill.windowMoves++
+ }
+ VSlider {
+ id: pillSlider
+ x: 10; y: 4; width: 82; height: 32
+ value: root.amount; valueFromModel: true
+ fullKnobHitArea: true
+ from: 0; to: 1; inputScale: 100
+ onMoved: value => root.amount = value
+ }
+ }
TestCase {
name: "SliderNumberInput"
when: windowShown
function init() {
number.closeEditor(false)
+ slider.closeEditor(false)
root.amount = 1.25
slider.from = 0; slider.to = 5; slider.inputScale = 1; slider.inputDecimals = 2
slider.enabledControl = true
root.shortcuts = 0
+ pill.windowMoves = 0
}
function type(text) {
mouseClick(number, 35, 12)
@@ -95,5 +116,75 @@ Item {
compare(nextInput.text, "7")
compare(root.amount, 3.25)
}
+ function inlineType(text) {
+ slider.openEditor()
+ const input = findChild(slider, "vslider-editor-input")
+ verify(input.activeFocus)
+ keyClick(Qt.Key_A, Qt.ControlModifier)
+ for (let i = 0; i < text.length; ++i) keyClick(text[i])
+ }
+ function test_inline_confirm_data() {
+ return [{tag:"return",key:Qt.Key_Return}, {tag:"numpad-enter",key:Qt.Key_Enter}]
+ }
+ function test_inline_confirm(data) {
+ slider.to = 1; slider.inputScale = 100; slider.inputDecimals = 0; root.amount = .4
+ inlineType("75"); keyClick(data.key)
+ compare(slider.editing, false); compare(root.amount, .75)
+ const input = findChild(slider, "vslider-editor-input")
+ verify(!input.focus && !input.activeFocus)
+ keyClick(Qt.Key_Right); tryCompare(root, "shortcuts", 1)
+ root.amount = .3; compare(slider.value, .3)
+ }
+ function test_inline_blank_commits_without_eating_click() {
+ inlineType("3.25")
+ mouseClick(root, 380, 200)
+ tryCompare(slider, "editing", false); compare(root.amount, 3.25)
+ }
+ function test_inline_next_input_keeps_focus() {
+ inlineType("3.25"); mouseClick(nextInput, 25, 12)
+ tryCompare(slider, "editing", false); verify(nextInput.activeFocus)
+ keyClick(Qt.Key_A, Qt.ControlModifier); keyClick("7")
+ compare(nextInput.text, "7"); compare(root.amount, 3.25)
+ }
+ function test_inline_escape_cancels() {
+ inlineType("4"); keyClick(Qt.Key_Escape)
+ compare(slider.editing, false); compare(root.amount, 1.25)
+ keyClick(Qt.Key_Right); tryCompare(root, "shortcuts", 1)
+ }
+ function test_pill_volume_drag_keeps_window_still() {
+ root.amount = .3
+ mousePress(pillSlider, 25, 16)
+ for (let i = 1; i <= 10; ++i) mouseMove(pillSlider, 25 + i * 5, 16, 10)
+ mouseRelease(pillSlider, 75, 16)
+ verify(root.amount > .85, "A narrow volume rail must follow the drag")
+ compare(pill.windowMoves, 0)
+ root.amount = .2; compare(pillSlider.value, .2)
+ mousePress(pill, 200, 20)
+ for (let i = 1; i <= 8; ++i) mouseMove(pill, 200 + i * 5, 20, 10)
+ mouseRelease(pill, 240, 20)
+ compare(pill.windowMoves, 1, "Empty pill space must still move the window")
+ }
+ function test_pill_volume_drag_from_endpoint_data() {
+ return [{tag:"full-volume",value:1,from:82,to:22,lower:.2,upper:.4},
+ {tag:"mute",value:0,from:0,to:60,lower:.6,upper:.85}]
+ }
+ function test_pill_volume_drag_from_endpoint(data) {
+ root.amount = data.value
+ mousePress(pillSlider, data.from, 16)
+ for (let i = 1; i <= 10; ++i)
+ mouseMove(pillSlider, data.from + (data.to-data.from)*i/10, 16, 10)
+ mouseRelease(pillSlider, data.to, 16)
+ verify(root.amount > data.lower && root.amount < data.upper)
+ compare(pill.windowMoves, 0)
+ }
+ function test_pill_volume_single_move_drag() {
+ root.amount = 1
+ mousePress(pillSlider, 82, 16)
+ mouseMove(pillSlider, 22, 16, 10)
+ mouseRelease(pillSlider, 22, 16)
+ verify(root.amount > .2 && root.amount < .4,
+ "The threshold-crossing move must not be discarded")
+ compare(pill.windowMoves, 0)
+ }
}
}
diff --git a/tests/unit/LivePresentationTimingTests.cpp b/tests/unit/LivePresentationTimingTests.cpp
index 8b6c8ac0..ec60b14f 100644
--- a/tests/unit/LivePresentationTimingTests.cpp
+++ b/tests/unit/LivePresentationTimingTests.cpp
@@ -225,6 +225,19 @@ int main(){
check(liveSmoothedCapacityWaitMs(3.125)==2&&liveSmoothedCapacityWaitMs(4.17)==2,"high refresh MFG keeps the 2 ms capacity wait");
check(std::abs(liveSmoothedCapacityWaitMs(16.68)-1.03)<.01&&liveSmoothedCapacityWaitMs(33.4)==1,"60 Hz 2X waits about 1 ms, and never less");
check(liveSmoothedCapacityWaitMs(8.33)>1.5&&liveSmoothedCapacityWaitMs(8.33)<2,"120 Hz 2X lies between");
+ check(liveSmoothedCapacityWaitMs(16.68,0)==liveSmoothedCapacityWaitMs(16.68),"no callback jitter: the same wait");
+ check(liveSmoothedCapacityWaitMs(16.68,.04)<1.2,"a steady card barely waits longer");
+ check(std::abs(liveSmoothedCapacityWaitMs(16.68,.48)-2.5)<.01,"sd 0.6 ms (mean distance 0.48 ms) waits 2.5 ms");
+ check(liveSmoothedCapacityWaitMs(16.68,1.5)==3&&liveSmoothedCapacityWaitMs(33.4,20)==3,"and nothing waits more than 3 ms");
+ check(liveSmoothedCapacityWaitMs(4.17,5)==2&&liveSmoothedCapacityWaitMs(8.33,5)==liveSmoothedCapacityWaitMs(8.33)&&liveSmoothedCapacityWaitMs(12.4,5)==liveSmoothedCapacityWaitMs(12.4),"above 80 fps the wait ignores the jitter");
+ const auto measuredJitter=[&](double sdMs){
+ LiveArrivalSmoother smoother;uint32_t seed=7;
+ for(unsigned n=0;n<2000;++n)smoother.anchor(int64_t(n*333643.0*(1-800e-6)),int64_t(n*333643.0+40000+gaussian(seed,sdMs*10000)),interval);
+ return smoother.jitterMs();
+ };
+ check(liveSmoothedCapacityWaitMs(16.68,measuredJitter(.05))<1.25,"the smoother's measure of sd 0.05 ms stays near 1 ms");
+ check(std::abs(liveSmoothedCapacityWaitMs(16.68,measuredJitter(.6))-2.5)<.4,"its measure of sd 0.6 ms lands near 2.5 ms");
+ check(liveSmoothedCapacityWaitMs(16.68,measuredJitter(1.87))==3,"its measure of sd 1.87 ms reaches the limit");
// Present(0,0) on 60.005 Hz fed with those pairs on the adaptive phase. VFG
// medium: generated ready 8.5 ms after the callback, 0.3 ms of wake-up jitter.
// The panel shows the last present before each refresh. A real frame replaced