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(ui): account for intentional cadence and display rate limits

Veyra Goal Agent4557ab64e4fb
diff --git a/AGENTS.md b/AGENTS.md
index 64e0327f..929485e1 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Veyra 项目 Agent 执行规则
+> **2026-10-11 内容节奏/显示限速状态授权**:用户要求纠正去重、垂直同步等正常运行误报“输出未达标”,状态上方显示选项与原因。按 docs/CADENCE_STATUS_PLAN_2026-10-11.md,从已验e8300d9在codex/cadence-status-20261011隔离实施共享状态判定/bridge/QML/翻译及定向测试;覆盖这些UI接点旧冻结。58旧树/504脏文件与运行库原件保护;不派Agent,不改采集/去重/补帧/NR/SR/呈现算法、不加Timer或提高UI刷新率/GPU优先级,不改用户配置。产物全E盘,测试≤300秒/构建≤900秒;无main合并/push/打包/Release/关机。
+
> **2026-10-11 DLSS 4.5 SR 接手授权**:用户要求接手 Claude 最新未完成的超分接入并启动软件供测试。按 docs/DLSS45_SR_PLAN_2026-10-11.md,在 codex/dlss45-sr-handoff-20261011 从049902b继承已封存的9文件patch,完成 K/M/L 模型选择的必要 settings/NGX/graph、预设/session、bridge/QML/翻译及定向构建验收接点;此范围覆盖历史冻结。原57工作树/504脏文件由独立start保护,Claude原树不改;不派Agent、不改运行库/模型/驱动/用户配置,不改变33ms UI统计/GPU优先级,不顺手合入VFG mixed。全产物E盘,每测试≤300秒、构建≤900秒;本轮不main合并/push/Release,画质由用户验收,不把Create成功当画质提升。
> **2026-10-11 Claude修复合并完成**:已验整合tip `9c14ee2` 通过本地main功能merge `3a08ce8` 合入,完整Git树相同,随后只补收尾文档。六Claude分支、UI29e33df和退出回调竞态修复在main;26项回归、滚动clip0、卡死诊断/恢复/有界退出及普通class2 NR性能核对通过。软件CPU首次+15.09%触发守卫,倒序复测及双顺序平均+6.52%通过同一阈值,完整失败/复测数据保留,不宣传普遍性能收益。保持33ms统计、负优化回退和未实卡边界;54旧工作树/496脏文件、七来源tip及原包1626文件保持,唯main按授权更新。没有push/新包/Release/关机;最终回执reports/merge-claude-fixes-20261011/final.json。
diff --git a/apps/veyra/ui/LiveStatusHistory.h b/apps/veyra/ui/LiveStatusHistory.h
index fa1b30fa..d8b85c19 100644
--- a/apps/veyra/ui/LiveStatusHistory.h
+++ b/apps/veyra/ui/LiveStatusHistory.h
@@ -2,17 +2,80 @@
#include "veyra/engine/EngineController.h"
#include <deque>
#include <optional>
+#include <chrono>
+#include <algorithm>
+#include <cmath>
namespace veyra::ui::live_status {
+struct RateContext {
+ double displayHz=0;
+ bool comparison=false;
+ double nowSeconds=-1; // explicit monotonic time for deterministic contract tests
+};
+struct OutputRateAssessment {
+ double transportFps=0,contentFps=0,requestedFps=0,targetFps=0,actualFps=0;
+ double skippedFps=0;
+ bool deduplicating=false,halfRate=false,displayLimited=false,outputLimited=false;
+ bool comparison=false,speedAdjusted=false;
+ bool policyLimited()const{return deduplicating||halfRate||displayLimited||outputLimited||comparison||speedAdjusted;}
+};
+inline OutputRateAssessment assessOutputRate(const engine::PlayerSnapshot& s,const RateContext& context,double skippedFps=0){
+ OutputRateAssessment result;
+ const bool measuredInput=s.capture&&s.captureReceived>30&&s.captureFps>0;
+ result.transportFps=measuredInput?std::min(s.nominalSourceFps,s.captureFps):s.nominalSourceFps;
+ result.contentFps=result.transportFps;
+ result.halfRate=s.captureHalfRate;
+ if(result.halfRate)result.contentFps*=.5;
+ if(s.capture&&s.applied.content!=engine::ContentRate::Transport&&skippedFps>0){
+ result.skippedFps=std::clamp(skippedFps,0.0,std::max(0.0,result.transportFps-1.0));
+ double unique=std::max(1.0,result.transportFps-result.skippedFps);
+ // Counter-window quantisation must not make regular 29.97/30 fps
+ // content oscillate across the warning threshold. The learned rate is
+ // only a nearby hint after actual intentional skips were observed.
+ if(s.contentFps>0&&std::abs(unique-s.contentFps)<=std::max(1.0,result.transportFps*.04))unique=s.contentFps;
+ result.contentFps=std::min(result.contentFps,unique);
+ result.deduplicating=result.skippedFps>=.5;
+ }
+ if(!s.capture&&s.playbackRate>0&&std::isfinite(s.playbackRate)){
+ result.contentFps*=s.playbackRate;result.speedAdjusted=std::abs(s.playbackRate-1.0)>.001;
+ }
+ result.comparison=context.comparison&&s.applied.multiplier>1;
+ result.requestedFps=result.contentFps*(result.comparison?1u:s.applied.multiplier);
+ result.targetFps=result.requestedFps;
+ const auto& effective=s.presentationEffective;
+ if(effective.outputRate==engine::OutputRateMode::Custom&&effective.customFps>0&&std::isfinite(effective.customFps)){
+ result.outputLimited=effective.customFps<result.targetFps*.99;
+ result.targetFps=std::min(result.targetFps,effective.customFps);
+ }else if(effective.outputRate==engine::OutputRateMode::FollowDisplay&&context.displayHz>0){
+ result.outputLimited=context.displayHz<result.targetFps*.99;
+ result.targetFps=std::min(result.targetFps,context.displayHz);
+ }
+ if(engine::presentationVsync(effective)&&context.displayHz>0&&std::isfinite(context.displayHz)){
+ result.displayLimited=context.displayHz<result.targetFps*.99;
+ result.targetFps=std::min(result.targetFps,context.displayHz);
+ }
+ const bool provider=s.applied.multiplier>1&&engine::presentSinkFrameGeneration(s.applied.frameGenerationBackend);
+ result.actualFps=provider?s.metrics.flow.xessSdkSubmitFps:s.metrics.flow.presentSubmitFps;
+ return result;
+}
struct DashboardHistory {
std::deque<std::optional<double>> points;
uint64_t session=0,revision=0,epoch=0;
unsigned low=0,good=0,inputLow=0,resetSamples=0;
bool overloaded=false,inputLimited=false;
- void sample(const engine::PlayerSnapshot& s){
+ OutputRateAssessment output;
+ struct SkipSample{double seconds;uint64_t count;};
+ std::deque<SkipSample> skipped;
+ uint64_t presentationRevision=0;
+ double previousHz=0;
+ bool previousComparison=false;
+ void sample(const engine::PlayerSnapshot& s,RateContext context={}){
if(session!=s.sessionId||revision!=s.applied.revision){
points.clear();low=good=inputLow=resetSamples=0;epoch=0;
- overloaded=inputLimited=false;session=s.sessionId;revision=s.applied.revision;
+ skipped.clear();overloaded=inputLimited=false;session=s.sessionId;revision=s.applied.revision;
+ }
+ if(presentationRevision!=s.presentationRevision||std::abs(previousHz-context.displayHz)>.5||previousComparison!=context.comparison){
+ low=good=0;overloaded=false;presentationRevision=s.presentationRevision;previousHz=context.displayHz;previousComparison=context.comparison;
}
const bool active=s.running&&!s.image&&s.transport==engine::TransportState::Playing&&!s.applying;
points.push_back(active?s.metrics.flow.enhancementProcessing.mean:std::optional<double>{});
@@ -22,13 +85,21 @@ struct DashboardHistory {
else if(resetSamples) --resetSamples;
epoch=nextEpoch;
const bool measuredInput=s.capture&&s.captureReceived>30&&s.captureFps>0;
- const double source=measuredInput?std::min(s.nominalSourceFps,s.captureFps):s.nominalSourceFps;
if(active&&measuredInput&&s.captureFps<s.nominalSourceFps*.95)inputLow=std::min(inputLow+1,8u);
else inputLow=0;
inputLimited=inputLow>=8;
- const bool xess=s.applied.multiplier>1&&engine::presentSinkFrameGeneration(s.applied.frameGenerationBackend);
- const double actual=xess?s.metrics.flow.xessSdkSubmitFps:s.metrics.flow.presentSubmitFps;
- const double target=source*(s.captureHalfRate?.5:1)*s.applied.multiplier;
+ double skippedFps=0;
+ if(active&&s.capture&&s.applied.content!=engine::ContentRate::Transport){
+ const double now=context.nowSeconds>=0?context.nowSeconds:std::chrono::duration<double>(std::chrono::steady_clock::now().time_since_epoch()).count();
+ if(!skipped.empty()&&(now<skipped.back().seconds||s.captureRateSkipped<skipped.back().count))skipped.clear();
+ if(skipped.empty()||now>skipped.back().seconds)skipped.push_back({now,s.captureRateSkipped});
+ while(skipped.size()>1&&skipped[1].seconds<=now-1.0)skipped.pop_front();
+ while(skipped.size()>32)skipped.pop_front();
+ const double span=now-skipped.front().seconds;
+ if(span>=.5)skippedFps=double(s.captureRateSkipped-skipped.front().count)/span;
+ }else skipped.clear();
+ output=assessOutputRate(s,context,skippedFps);
+ const double actual=output.actualFps,target=output.targetFps;
if(!active||!s.metrics.flow.rateWindowReady||target<=0){low=good=0;overloaded=false;return;}
if(actual<target*.95){good=0;if(++low>=8)overloaded=true;}
else{low=0;if(++good>=8)overloaded=false;}
@@ -36,7 +107,8 @@ struct DashboardHistory {
const wchar_t* rateStatus(const engine::PlayerSnapshot& s)const{
if(resetSamples>=3)return L"输入时间线异常";
if(inputLimited)return L"输入帧率不足";
- if(s.applied.multiplier>1&&(s.fgBudgetLimited||s.xessGenerationSuppressed))return L"补帧调度降档";
+ if(s.applied.multiplier>1&&!output.comparison&&(s.fgBudgetLimited||s.xessGenerationSuppressed)&&
+ (!output.policyLimited()||overloaded))return L"补帧调度降档";
return overloaded?L"输出未达标":L"正常";
}
};
diff --git a/docs/CADENCE_STATUS_PLAN_2026-10-11.md b/docs/CADENCE_STATUS_PLAN_2026-10-11.md
new file mode 100644
index 00000000..81b6a388
--- /dev/null
+++ b/docs/CADENCE_STATUS_PLAN_2026-10-11.md
@@ -0,0 +1,13 @@
+# 内容节奏与显示限速状态修正(2026-10-11)
+
+用户要求:自动识别内容节奏去重、垂直同步及其它正常限速不再误报输出未达标;状态条上方显示当前开启的选项和原因,正常按设置运行显示正常。
+
+基线是刚验收的 DLSS45 接入分支 e8300d9,单独 codex/cadence-status-20261011,不丢掉用户正在试的新超分,不合并 main。开工 start.json / 增量 source-before.bundle 位于 E:/项目/Veyra/archives/cadence-status-20261011,保护58原工作树/504脏文件及原测试程序,不修改旧保护记录。
+
+1. 只改显示状态判定、bridge/QML/翻译及必要定向测试。共享状态评估计算内容去重、60→30、播放速度、有效输出上限、屏幕同步后的目标;拒绝把已设置但未生效的选项当限速。实际去重使用已有 captureRateSkipped 计数按有界时间窗估算,不改采集、去重、补帧、NR/SR、呈现算法或用户配置。
+2. 对比模式按原帧节奏判断。输入不足/时间线异常、真正低于有效目标、没有正常限速理由的补帧降档继续告警;不通过将目标等于实测输出来制造正常。静止画面正常去重也应考虑主动跳过的帧。
+3. 列表状态条上方与节点统计区域显示相同选项说明及有效目标。文案支持换行/完整提示和多语言,不能溢出或增加持续绘制。保持33ms统计与250ms性能发布节奏;不开新Timer,不改GPU优先级。
+4. 验证状态策略矩阵及真实GUI的限帧/播放速度/对比和模式切换。每测试≤300秒;沿用当前已验构建对象、DeckLink和patched FFmpeg,构建≤900秒。失败原证据保留,实卡去重/其它屏幕/provider未实际验证如实说明。
+5. 全产物 E:/项目/Veyra/{build,tests,logs,tmp,archives}/cadence-status-20261011;私有运行目录原子替换、独立data-dir与缓存。交付前核对原包与58旧树,记录WORKLOG与报告。无main合并、push、打包、Release或关机授权。
+
+实测追加:GUI 同一回调关闭 DLSS 4X 并设 0.5X 会触发 seek,重建后的缓存帧在 discardBefore 检查被跳过,局部 transaction 标志丢失;实际输出15fps而 applied 仍为4X,applying永久为true。仅补 EngineController 的 pendingSettingsAck,跨循环保留确认,到新设置首帧成功 process 后发布真实 applied;不提前确认,不改重建/seek/颜色/补帧/呈现算法,不增加逐帧锁或等待。用同一实际GUI序列回归,另跑重建和回滚检查。
diff --git a/docs/CADENCE_STATUS_REPORT_2026-10-11.md b/docs/CADENCE_STATUS_REPORT_2026-10-11.md
new file mode 100644
index 00000000..0a3cc4f1
--- /dev/null
+++ b/docs/CADENCE_STATUS_REPORT_2026-10-11.md
@@ -0,0 +1,39 @@
+# 内容节奏、同步与正常限速状态修正
+
+基线 e8300d9,分支 codex/cadence-status-20261011,保留刚验收的新超分接入;本轮只修状态与说明,以及实测发现的设置应用确认遗漏。没有修改采集、去重、补帧、NR/SR、呈现算法,没有提高界面刷新频率或 GPU 优先级。
+
+## 原因和修正
+
+旧状态把源传输帧率乘补帧倍率当成目标。60 Hz 传输中的30张独立画面去重后只需处理30张,屏幕同步、有效输出上限、慢放、对比暂停补帧也会改变目标,原比较会误报。
+
+- 共享 DashboardHistory 用已有 captureRateSkipped 的有界一秒窗口扣除主动跳过的帧,60→30只计算一次;不能仅因为勾选Auto或存在内容帧率提示就降低目标。静止画面的正常去重也计入,目标下限1fps,停住不能伪装正常。
+- 输出目标依次考虑内容帧率、播放速度、实际补帧倍率、对比暂停、已生效限帧、实际视频窗口所在屏幕的同步上限。XeSS采用SDK提交口径,被provider取消的请求上限不能当作已生效。屏幕刷新率只读Qt缓存,不猜未知值。
+- 保留原95%阈值和8次连续采样确认;输入不足、时间线异常、真正低于有效目标或无正常限速理由的补帧降档继续告警。不用实测输出直接充当目标。
+- 性能球预算按进入增强的内容帧间隔计算。去重和慢放会改变这个间隔,输出限帧和垂直同步本身不会虚增处理预算。
+- 列表状态条上方、节点统计区显示已开启选项、当前内容节奏或未生效原因;状态详情显示有效目标。长文本换行并提供完整悬停提示。列表原固定172像素统计区会随文本适当增高,避免说明把状态挤出窗口;四种语言共补16条翻译。
+
+实际GUI还复现:同一回调关闭DLSS 4X并设0.5X,速度修改触发seek,重建后的缓存帧在discardBefore处跳过。局部transaction标记丢失,实际已经15fps,applied仍为4X,界面永久“调整中”。EngineController增加pendingSettingsAck跨循环保留确认,只在新设置首帧成功process后发布实际applied;不提前确认,不加逐帧锁、等待或额外重建。真实GUI同一序列及永久集成用例都通过。
+
+## 本轮验证
+
+全部路径前缀为 E:/项目/Veyra/。
+
+| 检查 | 结果及证据 |
+| --- | --- |
+| 增量构建 | tmp/cadence-status-20261011/build.py;最终 logs/cadence-status-20261011/build-20261011-215110/receipt.json,15.0秒,7个源依赖对象及资源/MOC、10个EXE。复用已验构建缓存、DeckLink和patched FFmpeg,不能冒称全量clean构建。新apps/veyra/ui include优先于旧缓存路径。 |
+| 状态策略 | harness/regress.py ui-contracts;logs/cadence-status-20261011/cadence-status/tests-20261011-213440,27条新策略断言和原UI契约通过;覆盖去重/静止/半率/同步/限帧/provider/倍速/对比及真正欠速、未知刷新率、策略切换失效。 |
+| 真实生产GUI | harness/ui-smoke.py;logs/cadence-status-20261011/ui-20261011-215150,48.2秒,9种状态、6次布局检查通过;GTA 1080p30素材,真实提交30、限帧15、DLSS 4X+VSync提交120、对比30、慢放15、组合限帧12。简中/繁中/英文/日文,列表与节点、1120和1440宽度通过,无Binding loop/TypeError/D3D12 error。截图为Qt界面,不包含独立原生视频子窗口,不能用它判断视频是否黑屏。 |
+| 设置重建与跳转 | harness/regress.py video;logs/cadence-status-20261011/cadence-status/tests-20261011-215330/video,原4K GTA输入、1080p NR,43.0秒,8轮NR/FG/SR切换及新增全效果关闭+0.5X+seek确认通过。 |
+| 失败回滚 | 同批 rollback,17.8秒,原回滚诊断与恢复出帧检查通过。 |
+| 翻译/静态 | scripts/i18n/extract.py --check,placeholder problems=0;原有29条未翻译保留,没有删除旧词条。git diff --check通过。 |
+| 原件保护 | archives/cadence-status-20261011/protect.py verify:58个原工作树、504个脏文件及source-before.bundle不变;每次staging/回归前后核验donor原包1626文件。最终再次核验见logs/cadence-status-20261011/final.json。 |
+
+失败证据完整保留:213650首次GUI发现统计卡片越界并修正;213826为重启夹具在打开文件前等待applying的错误;213957/214052为夹具未等补帧冷初始化/250ms状态发布完成;214312/214630真实复现同回调FG关闭+速度seek后应用确认丢失,修复后215150通过。没有将这些失败批次记成通过。
+
+最终GUI SHA256:be00985661932e578f305e454589999c1dc8117f45bad787f10c1eee0a0ac442;显示版本2.0.6-cadence-status-test-20261011。独立运行目录 tests/cadence-status-20261011/app,测试夹具已从生产Main.qml移除并恢复源码字节。用户测试profile复制先前私有测试配置,GUI自动验证使用另一个gui-profile;不改真实用户配置。
+
+## 验证边界
+
+本机RTX5070与320Hz显示器;本次真实VSync 4X提交120fps未触及320Hz上限,60Hz上限的降目标与低于上限告警由契约矩阵验证。没有现场连接30-in-60采集卡,也未实际运行其它显卡/provider组合;去重计数与这些策略的交互由共享判定用例验证,仍需用户实卡复核。提交FPS和SDK计数不是物理扫描帧率。本轮没有性能A/B或画质评测,不能宣称提速;保留原统计采样和有限动画,没有新增生产Timer。
+
+源码、构建、测试、日志、临时缓存与增量归档分别留在worktrees/build/tests/logs/tmp/archives的cadence-status-20261011子目录。必要证据保留,失败GUI的临时CUDA/Qt缓存清理记录在final.json。未合并main、push、打包、发布或关机。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 0c2ac857..1d5b50ae 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -9101,3 +9101,16 @@ ui-software-damage-test.py performance-final四例顺序40秒有效播放、各5
`harness/ui-smoke.py`实际生产列表/节点入口及bridge切换、保存/恢复M/L、K回退通过(ui-20261011-205634/selection,30.3秒)。无片源restart夹具错误地等待applying=false停在state0;仅修驱动后`ui-smoke.py restart`205851用5.2秒验证列表M/节点L独立恢复与预设持久化通过。生产Main.qml恢复为源码原字节,测试Loader移除。首次K Create8.84秒,在8.14秒触发既有无响应诊断,栈为NVIDIA JIT编译器,随后正常返回并恢复画面;不隐藏这项限制或靠提高看门狗阈值制造通过。最终以M、1080p GTA→4K、SR单独开启供用户测试。
regress每轮前后核验donor1626文件原件SHA;原子替换私有app的变更文件,不向硬链接原件写入。`protect.py verify`核对原57工作树/504脏文件、Claude封存patch与9原文件通过。详细结果/失败/冷编译边界见docs/DLSS45_SR_REPORT_2026-10-11.md;最终源码归档、保护与软件启动见本轮logs/final.json。其它显卡/实卡/HDR/长期显存及主观画质未验,本轮未做性能对照,不声称提速。未合并main、push、打包、发布或关机。
+
+
+## 2026-10-11 内容节奏与显示限速状态修正(Codex)
+
+按用户要求在codex/cadence-status-20261011、e8300d9基线上修正常去重/同步/限帧误报,保留新超分,不合并main。archives/cadence-status-20261011/start.json与source-before.bundle保护58旧树/504脏文件。共享LiveStatusHistory以已有主动跳帧计数有界一秒窗口、已生效呈现设置、实际窗口屏幕、播放速度和对比状态算有效目标;勾选Auto但没有实际去重不降低目标,真输入不足/时间线异常/欠速/无正常限制的补帧降档继续告警。预算按内容帧而非输出上限计算,不改UI统计频率/新增Timer/优先级/实际GPU链路算法。列表和节点在状态上方显示选项及原因,长文本换行/悬停,修固定172px区越界,补16条四语翻译且保留原词条。
+
+GUI实际复现同回调FG关闭+0.5X触发seek,缓存帧被discardBefore跳过后局部transaction确认丢失,实际15fps但applied仍4X、永久调整中。仅补EngineController的pendingSettingsAck跨循环到首帧成功process再发布applied,不提前确认、不新增逐帧锁/等待/重建;新增永久集成回归覆盖全效果关闭+慢放+seek。
+
+命令py -3.11 -X utf8 -B -I tmp/cadence-status-20261011/build.py;最终logs/cadence-status-20261011/build-20261011-215110/receipt.json增量15.0秒,7依赖对象和资源/MOC、10EXE;复用已验缓存/DeckLink/patched FFmpeg,不称clean全量。harness/regress.py ui-contracts 213440通过27条新策略断言与原UI契约;harness/ui-smoke.py 215150用48.2秒通过9真实状态、6布局、简中/繁中/英/日,限帧15、DLSS4X+同步120、对比30、慢放15、组合上限12均正常。VSync实机屏幕320Hz,未触及刷新上限,60Hz限速由契约验证,不能混称实卡通过。
+
+harness/regress.py video rollback在logs/cadence-status-20261011/cadence-status/tests-20261011-215330分别43.0/17.8秒通过:8轮NR/SR/FG热切换、新增事务+seek确认、失败回滚恢复出帧。原4K GTA输入、内部1080NR。所有本轮失败与修复详见docs/CADENCE_STATUS_REPORT_2026-10-11.md;213650卡片越界、213826/213957/214052夹具等待、214312/214630真实事务确认错误的原证据保留,没有冒称通过。i18n --check占位符0错误,原29条未译保持,diff --check通过。
+
+最终GUI SHA be00985661932e578f305e454589999c1dc8117f45bad787f10c1eee0a0ac442,tests/cadence-status-20261011/app,版本2.0.6-cadence-status-test-20261011。生产Main.qml恢复原字节,GUI夹具移除;用户测试profile复制已正常退出的上一私有测试实例,实际用户配置不动。所有源码/构建/测试/日志/临时缓存/归档在E:/项目/Veyra下本轮子目录;失败GUI的临时JIT/Qt缓存已清理,仅留成功缓存供运行与原失败日志。最后源文件/构建输入/10EXE/QML/原包1626文件/58旧树504脏文件校验及启动见logs/cadence-status-20261011/final.json。未进行性能A/B、未接真实去重采集卡或验其它显卡/provider,不宣称提速/物理屏幕FPS/全硬件通过。无main合并、push、打包、Release或关机。
diff --git a/i18n/catalog.json b/i18n/catalog.json
index ae5f8cac..6c536110 100644
--- a/i18n/catalog.json
+++ b/i18n/catalog.json
@@ -15128,6 +15128,118 @@
"zh-TW": "K 保留原有模型;M、L 為 DLSS 4.5。L 針對較低輸入解析度,實際畫質與耗時取決於片源。",
"en": "K retains the original model; M and L use DLSS 4.5. L targets lower input resolutions. Quality and processing time depend on the source.",
"ja": "K は従来モデル、M・L は DLSS 4.5 です。L は低い入力解像度向けです。画質と処理時間は映像により異なります。"
+ },
+ {
+ "zh": "识别 %1 fps 内容",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "辨識 %1 fps 內容",
+ "en": "Detect %1 fps content",
+ "ja": "%1 fps のコンテンツを検出"
+ },
+ {
+ "zh": "%1 · 当前约 %2 fps",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "%1 · 目前約 %2 fps",
+ "en": "%1 · currently about %2 fps",
+ "ja": "%1 · 現在約 %2 fps"
+ },
+ {
+ "zh": "%1 · 去重后约 %2 fps",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "%1 · 去重後約 %2 fps",
+ "en": "%1 · about %2 fps after deduplication",
+ "ja": "%1 · 重複除去後は約 %2 fps"
+ },
+ {
+ "zh": "%1 · 当前来源未去重",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "%1 · 目前來源未去重",
+ "en": "%1 · deduplication inactive for this source",
+ "ja": "%1 · このソースでは重複除去は無効"
+ },
+ {
+ "zh": "%1 · 尚未观察到去重",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "%1 · 尚未觀察到去重",
+ "en": "%1 · no intentional frame skips observed yet",
+ "ja": "%1 · 重複除去によるスキップはまだありません"
+ },
+ {
+ "zh": "自动显示同步",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "自動顯示同步",
+ "en": "Automatic display sync",
+ "ja": "自動ディスプレイ同期"
+ },
+ {
+ "zh": "%1 · 屏幕 %2 Hz",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "%1 · 螢幕 %2 Hz",
+ "en": "%1 · display %2 Hz",
+ "ja": "%1 · ディスプレイ %2 Hz"
+ },
+ {
+ "zh": "输出限帧 · 当前未生效",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "輸出限幀 · 目前未生效",
+ "en": "Output cap · currently inactive",
+ "ja": "出力制限 · 現在無効"
+ },
+ {
+ "zh": "输出限帧 · 跟随屏幕",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "輸出限幀 · 跟隨螢幕",
+ "en": "Output cap · follow display",
+ "ja": "出力制限 · ディスプレイに合わせる"
+ },
+ {
+ "zh": "输出限帧 · %1 fps",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "輸出限幀 · %1 fps",
+ "en": "Output cap · %1 fps",
+ "ja": "出力制限 · %1 fps"
+ },
+ {
+ "zh": "低延迟队列 · 当前未生效",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "低延遲佇列 · 目前未生效",
+ "en": "Low-latency queue · currently inactive",
+ "ja": "低遅延キュー · 現在無効"
+ },
+ {
+ "zh": "播放速度 %1×",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "播放速度 %1×",
+ "en": "Playback speed %1×",
+ "ja": "再生速度 %1×"
+ },
+ {
+ "zh": "画面对比 · 补帧暂停",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "畫面對比 · 補幀暫停",
+ "en": "Image comparison · frame generation paused",
+ "ja": "映像比較 · フレーム生成は一時停止中"
+ },
+ {
+ "zh": "有效目标 %1 fps",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "有效目標 %1 fps",
+ "en": "Effective target %1 fps",
+ "ja": "実効目標 %1 fps"
+ },
+ {
+ "zh": "已开启:%1",
+ "src": "qml/ProPage.qml",
+ "zh-TW": "已開啟:%1",
+ "en": "Enabled: %1",
+ "ja": "有効:%1"
+ },
+ {
+ "zh": "采集 60→30",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "擷取 60→30",
+ "en": "Capture 60→30",
+ "ja": "キャプチャ 60→30"
}
]
}
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index 84dd25dd..86e95ac8 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -312,7 +312,9 @@ class QmlPlayerBridge : public QObject {
Q_PROPERTY(QString runStatus READ runStatus NOTIFY perfChanged)
Q_PROPERTY(QString runStatusLevel READ runStatusLevel NOTIFY perfChanged)
Q_PROPERTY(QString runStatusDetail READ runStatusDetail NOTIFY perfChanged)
- // Achieved output rate / target (source x multiplier); -1 while unknown.
+ Q_PROPERTY(QStringList runOptions READ runOptions NOTIFY perfChanged)
+ Q_PROPERTY(double effectiveOutputFps READ effectiveOutputFps NOTIFY perfChanged)
+ // Achieved output rate / effective policy target; -1 while unknown.
Q_PROPERTY(double outputRateRatio READ outputRateRatio NOTIFY perfChanged)
// Frame interval history (ms, newest last) for the frame-time line.
Q_PROPERTY(QVariantList frameTimes READ frameTimes NOTIFY perfChanged)
@@ -819,6 +821,8 @@ public:
QString runStatus() const;
QString runStatusLevel() const;
QString runStatusDetail() const;
+ QStringList runOptions() const;
+ double effectiveOutputFps() const;
double outputRateRatio() const;
QVariantList frameTimes() const;
int flowQuality() const;
diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qml
index 9ef3572b..39a6d19f 100644
--- a/qml/Veyra/NodePage.qml
+++ b/qml/Veyra/NodePage.qml
@@ -373,7 +373,7 @@ VPage {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
- height: compact ? 72 : 40
+ height: (compact ? 72 : 40) + nodeStatus.implicitHeight + 8
color: Theme.card
GridLayout {
@@ -500,6 +500,14 @@ VPage {
text: qsTr("节点预设:") + veyra.currentPresetName
onClicked: nodePresetMenu.openAt(this, "down")
}
+ ProPage.StatusSummary {
+ id: nodeStatus
+ Layout.row: statsBar.compact ? 2 : 1
+ Layout.column: 0
+ Layout.columnSpan: statsBar.compact ? 8 : 9
+ Layout.fillWidth: true
+ Layout.bottomMargin: 4
+ }
}
}
}
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index abb0e915..3713df2c 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -2,7 +2,7 @@
//
// The design's grid: 1fr | 376px columns, rows auto | 1fr | auto, gap 10,
// padding 14. The inspector spans rows 2-3 on the right; the three meters sit
-// under the video at a fixed 172px.
+// under the video with room for the active rate-policy explanation.
//
// The chain order is fixed (SR → NR layers → protect → HDR → 补帧) and is NOT
// reorderable here: the user's reason was that dragging breaks the pipeline for
@@ -278,6 +278,7 @@ VPage {
: veyra.runStatusLevel === "err" ? Theme.err : Qt.rgba(1, 1, 1, 0.3)
Item {
Layout.fillWidth: true
+ Layout.minimumWidth: 32
Layout.preferredHeight: 4
Rectangle {
id: strip
@@ -299,14 +300,46 @@ VPage {
}
}
Text {
+ objectName: "run-status"
+ Layout.maximumWidth: Math.max(0, light.width - 40)
+ Layout.preferredWidth: Math.min(implicitWidth, light.width * 0.75)
text: veyra.runStatus + (veyra.runStatusDetail.length > 0 ? " · " + veyra.runStatusDetail : "")
color: light.tone
font.family: Theme.fontUi
font.pixelSize: 11
font.weight: Font.Medium
+ horizontalAlignment: Text.AlignRight
+ wrapMode: Text.Wrap
+ maximumLineCount: 2
+ elide: Text.ElideRight
+ HoverHandler { id: statusHover }
+ ToolTip.visible: statusHover.hovered
+ ToolTip.delay: 400
+ ToolTip.text: text
}
}
+ component StatusSummary: ColumnLayout {
+ spacing: 5
+ Text {
+ objectName: "run-active-options"
+ Layout.fillWidth: true
+ visible: veyra.runOptions.length > 0
+ text: qsTr("已开启:%1").arg(veyra.runOptions.join(";"))
+ color: Theme.t2
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ wrapMode: Text.Wrap
+ maximumLineCount: 3
+ elide: Text.ElideRight
+ HoverHandler { id: optionsHover }
+ ToolTip.visible: optionsHover.hovered
+ ToolTip.delay: 400
+ ToolTip.text: text
+ }
+ StatusLight { Layout.fillWidth: true }
+ }
+
component NrLayerCard: VAccordion {
id: card
required property var layerData
@@ -454,7 +487,7 @@ VPage {
anchors.top: head.bottom
anchors.topMargin: 10
width: root.width - insp.width - 14 * 2 - 10
- height: root.height - 14 - head.height - 10 - 172 - 10 - 14
+ height: root.height - 14 - head.height - 10 - Math.max(172, meter3Content.implicitHeight + 28) - 10 - 14
radius: Theme.rCard
color: Theme.card
border.width: 1
@@ -684,7 +717,7 @@ VPage {
}
}
- // --- meters (fixed 172px, three cards) --------------------------------
+ // --- meters (at least 172px, three cards) -----------------------------
RowLayout {
id: meters
visible: !root.overlay
@@ -883,6 +916,7 @@ VPage {
border.width: 1
border.color: Theme.stroke
ColumnLayout {
+ id: meter3Content
anchors.fill: parent
anchors.margins: 14
spacing: 6
@@ -978,7 +1012,7 @@ VPage {
}
PerfOrbs { visible: meter3.wide; size: 50; Layout.alignment: Qt.AlignVCenter }
}
- StatusLight { Layout.fillWidth: true }
+ StatusSummary { Layout.fillWidth: true }
}
}
}
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index 929fc458..3afe6618 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -1207,6 +1207,10 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
// the lambdas reference below this line.
AutoNrController autoNrControl;autoNrControl.reset(host100ns());
uint64_t autoNrRevision=options.settings.revision;int64_t autoNrLogAt=0;
+ // A simultaneous seek/speed change may discard the cached frame
+ // after a successful rebuild. Keep its status acknowledgement
+ // until the first successfully processed frame, across loop turns.
+ bool pendingSettingsAck=false;
OnExit stopPresentation{[&]{liveScheduler.reset();finishReset(stop_?diagnostics::ResetOutcome::Cancelled:diagnostics::ResetOutcome::Failed);std::lock_guard lock(mutex_);if(snapshot_.sessionId==runSessionId){if(frameFlow)snapshot_.metrics.flow=frameFlow->snapshot(host100ns());activeFlow_.reset();}}};
while(!stop_){
watchdog_->beat();
@@ -1415,7 +1419,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
if(!backendRecoveryWarning.empty()){
std::lock_guard lock(mutex_);desired_.rejectVideoRequest(requested,next.snapshot());snapshot_.desired=desired_;snapshot_.rejectedRevision=requested.revision;snapshot_.backendWarning=backendRecoveryWarning;
}
- options=next;gd=nextDesc;transaction=true;reset=true;
+ options=next;gd=nextDesc;transaction=true;pendingSettingsAck=true;reset=true;
resetRecord->epoch=0;
if(!nvidiaAdapter&&((next.nr&&!amdNrAdapter)||next.sr||(next.fg&&!xessFg)))veyra::log::warn("capability",std::format("non-NVIDIA adapter disabled requested settings revision={} nr={} sr={} fgBackend={} flowBackend={}",requested.revision,next.nr,next.sr,frameGenerationBackendName(requested.frameGenerationBackend),opticalFlowBackendName(requested.opticalFlowBackend)));
}
@@ -2045,7 +2049,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
}else{if(!stop_)status(L"参数回滚失败,已停止",true);break;}
}else{status(std::wstring(backendFailureName(failedComponent))+L"执行失败;请查看日志",true);break;}
}
- if(transaction){std::lock_guard lock(mutex_);snapshot_.applied=options.snapshot();snapshot_.applying=desired_!=snapshot_.applied;snapshot_.status=std::format(L"输入 {}×{} / 底图 {}×{} / NR {}×{} / 光流 {}×{} / FG与输出 {}×{} | {}",width,height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.flowWidth,gd.flowHeight,gd.workWidth,gd.workHeight,gd.nrBeforeSr?L"低延迟 · NR先行后超分":gd.nrWidth<gd.workWidth?L"实时内部处理并回填":L"原生NR(性能成本较高)");veyra::log::info("display-color",std::format("hdrInput={} hdrOutput={} forceSdrPreview={}",gd.hdrInput,gd.hdrOutput,options.settings.forceSdrPreview));veyra::log::info("settings",std::format("Applied revision={} sourcePtsMs={} fgBackend={} flowBackend={} multiplier={} (source kept open)",options.settings.revision,pts,frameGenerationBackendName(options.settings.frameGenerationBackend),opticalFlowBackendName(options.settings.opticalFlowBackend),options.snapshot().multiplier));}
+ if(transaction||pendingSettingsAck){std::lock_guard lock(mutex_);snapshot_.applied=options.snapshot();snapshot_.applying=desired_!=snapshot_.applied;pendingSettingsAck=false;snapshot_.status=std::format(L"输入 {}×{} / 底图 {}×{} / NR {}×{} / 光流 {}×{} / FG与输出 {}×{} | {}",width,height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.flowWidth,gd.flowHeight,gd.workWidth,gd.workHeight,gd.nrBeforeSr?L"低延迟 · NR先行后超分":gd.nrWidth<gd.workWidth?L"实时内部处理并回填":L"原生NR(性能成本较高)");veyra::log::info("display-color",std::format("hdrInput={} hdrOutput={} forceSdrPreview={}",gd.hdrInput,gd.hdrOutput,options.settings.forceSdrPreview));veyra::log::info("settings",std::format("Applied revision={} sourcePtsMs={} fgBackend={} flowBackend={} multiplier={} (source kept open)",options.settings.revision,pts,frameGenerationBackendName(options.settings.frameGenerationBackend),opticalFlowBackendName(options.settings.opticalFlowBackend),options.snapshot().multiplier));}
if(veyra::log::verboseFrameLogs())veyra::log::info("source-identity",std::format("source={} totalRead={} graphProcessed={} cached={} revision={} nvofStandalone={}",pkt.sequence,sourceFrames,frames+1,rereadCached,options.settings.revision,gd.enableNvofStandalone));
presenter.sourceProcessed(out.batch.identity);
if(out.fgReduced||previewFgMultiplier!=options.fgMultiplier){std::lock_guard lock(mutex_);snapshot_.previewFgMultiplier=out.fgReduced?2u:previewFgMultiplier;}
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index a4b5aec4..80298101 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -384,6 +384,8 @@ struct QmlPlayerBridge::Impl {
ui::live_status::DashboardHistory history;
int historyTicks = 0;
QString runStatus, runLevel, runDetail;
+ QStringList runOptions;
+ double effectiveOutputFps=-1;
std::atomic<double> gpuUtil{-1.0};
// Hardware adapters in Windows' high-performance order (discrete first). The
// sampler only counts engines of the adapter whose LUID is in gpuMonitorLuid
@@ -1648,12 +1650,12 @@ QVariantMap QmlPlayerBridge::nodeTimings() const {
}
double QmlPlayerBridge::stageBudgetMs() const {
- // One source period: the budget a stage has to stay inside. Zero when the
- // source rate is unknown, which the UI shows as unmeasured.
- // With 60->30 capture half rate only every other frame is enhanced, so each has two
- // source periods; dividing by one read 19 ms of 8K work as 115-130 % while it kept up
- // (logs8, 2026-10-01).
- const double fps = impl_->snapshot.nominalSourceFps * (impl_->snapshot.captureHalfRate ? 0.5 : 1.0);
+ // Budget per content frame entering enhancement. Intentional dedup and
+ // playback speed change that interval; a presentation cap alone does not.
+ // Reuse the bounded status sample, without sampling or repainting faster.
+ const auto& s=impl_->snapshot;const auto& h=impl_->history;
+ const double fps=h.session==s.sessionId&&h.revision==s.applied.revision&&h.output.contentFps>0
+ ?h.output.contentFps:s.nominalSourceFps*(s.captureHalfRate?.5:1.0);
return fps > 0.01 ? 1000.0 / fps : 0.0;
}
@@ -6244,6 +6246,8 @@ bool QmlPlayerBridge::gpuUtilizationKnown() const { return impl_->gpuUtil.load()
QString QmlPlayerBridge::runStatus() const { return impl_->runStatus; }
QString QmlPlayerBridge::runStatusLevel() const { return impl_->runLevel; }
QString QmlPlayerBridge::runStatusDetail() const { return impl_->runDetail; }
+QStringList QmlPlayerBridge::runOptions() const { return impl_->runOptions; }
+double QmlPlayerBridge::effectiveOutputFps() const { return impl_->effectiveOutputFps; }
double QmlPlayerBridge::outputRateRatio() const { return impl_->rateRatio; }
void QmlPlayerBridge::startGpuSampler() {
@@ -6291,15 +6295,19 @@ void QmlPlayerBridge::startGpuSampler() {
void QmlPlayerBridge::updateRunStatus() {
auto& i = *impl_;
const auto& s = i.snapshot;
- i.history.sample(s);
+ // QScreen's cached rate for the actual video host, not an arbitrary popup
+ // or another monitor. This uses the existing bounded status cadence.
+ double refresh=0;
+ const HWND owner=i.videoWindow?GetAncestor(i.videoWindow,GA_ROOT):nullptr;
+ for(auto* window:QGuiApplication::topLevelWindows())
+ if(window->isVisible()&&window->screen()&&reinterpret_cast<HWND>(window->winId())==owner){refresh=window->screen()->refreshRate();break;}
+ i.history.sample(s,{refresh,i.compareMode!=0});
+ const auto& rate=i.history.output;
const auto& f = s.metrics.flow;
const bool active = s.running && !s.image && s.transport == engine::TransportState::Playing;
QString status = tr("待机"), level = QStringLiteral("idle");
if (s.failed) { status = tr("错误"); level = QStringLiteral("err"); }
else if (s.remoteRecovering) { status = tr("恢复中"); level = QStringLiteral("warn"); }
- // Comparison pauses frame generation by design; the output then runs at the source
- // rate, which the rate check would call 输出未达标 (a field user read that as broken FG).
- else if (active && i.compareMode != 0 && s.applied.multiplier > 1) { status = tr("对比中"); level = QStringLiteral("ok"); }
else if (active && !s.applying && f.rateWindowReady) {
// Judged on the engine's own words, shown in the interface language.
const std::wstring rate = i.history.rateStatus(s);
@@ -6309,6 +6317,38 @@ void QmlPlayerBridge::updateRunStatus() {
else if (s.applying && s.running) { status = tr("调整中"); level = QStringLiteral("warn"); }
else if (active) status = tr("采样中");
else if (s.transport == engine::TransportState::Paused) status = tr("已暂停");
+ QStringList options;
+ const auto chosen=settings();
+ if(chosen.content!=engine::ContentRate::Transport){
+ QString cadence;
+ switch(chosen.content){
+ case engine::ContentRate::Auto:cadence=tr("自动识别内容节奏");break;
+ case engine::ContentRate::Fps30:cadence=tr("识别 %1 fps 内容").arg(30);break;
+ case engine::ContentRate::Fps50:cadence=tr("识别 %1 fps 内容").arg(50);break;
+ case engine::ContentRate::Fps60:cadence=tr("识别 %1 fps 内容").arg(60);break;
+ case engine::ContentRate::Capture60To30:cadence=tr("采集 60→30");break;
+ default:break;
+ }
+ if(s.running&&rate.halfRate)options<<tr("%1 · 当前约 %2 fps").arg(cadence).arg(rate.contentFps,0,'f',0);
+ else if(s.running&&rate.deduplicating)options<<tr("%1 · 去重后约 %2 fps").arg(cadence).arg(rate.contentFps,0,'f',0);
+ else if(s.running&&!s.capture)options<<tr("%1 · 当前来源未去重").arg(cadence);
+ else if(s.running)options<<tr("%1 · 尚未观察到去重").arg(cadence);
+ else options<<cadence;
+ }
+ if(i.presentation.display!=engine::DisplaySync::Tearing){
+ const auto sync=i.presentation.display==engine::DisplaySync::Vsync?tr("垂直同步"):tr("自动显示同步");
+ options<<((refresh>0)?tr("%1 · 屏幕 %2 Hz").arg(sync).arg(refresh,0,'f',1):sync);
+ }
+ if(i.presentation.outputRate!=engine::OutputRateMode::Off){
+ if(s.running&&s.presentationEffective.outputRate==engine::OutputRateMode::Off)
+ options<<tr("输出限帧 · 当前未生效");
+ else if(i.presentation.outputRate==engine::OutputRateMode::FollowDisplay)
+ options<<tr("输出限帧 · 跟随屏幕");
+ else options<<tr("输出限帧 · %1 fps").arg(i.presentation.customFps,0,'f',1);
+ }
+ if(i.presentation.enabled)options<<(s.running&&!s.presentationEffective.enabled?tr("低延迟队列 · 当前未生效"):tr("低延迟队列"));
+ if(!s.capture&&std::abs(s.playbackRate-1.0)>.001)options<<tr("播放速度 %1×").arg(s.playbackRate,0,'f',2);
+ if(i.compareMode!=0)options<<tr("画面对比 · 补帧暂停");
QStringList detail;
if (s.running && !s.image) {
if (s.applied.multiplier > 1) {
@@ -6325,41 +6365,31 @@ void QmlPlayerBridge::updateRunStatus() {
}
else detail << tr("未补帧");
if (s.applied.multiplier > 1 && impl_->compareMode != 0) detail << tr("补帧暂停");
- else if (s.applied.multiplier > 1 && (s.fgBudgetLimited || s.xessGenerationSuppressed)) detail << tr("调度降档");
+ else if (s.applied.multiplier > 1 && (s.fgBudgetLimited || s.xessGenerationSuppressed) &&
+ (!rate.policyLimited()||i.history.overloaded)) detail << tr("调度降档");
// Why VFG cannot hold the requested multiplier. One VFG interpolation
// costs about the same at any resolution, so what fits follows from its
// measured cost, the rest of the chain and the source interval; the
// display refresh caps what can be shown. A hint only: no setting changes.
if (s.applied.multiplier > 1 && s.applied.frameGenerationBackend == engine::FrameGenerationBackend::Vfg && i.compareMode == 0) {
- const double source = s.nominalSourceFps * (s.captureHalfRate ? 0.5 : 1.0);
+ const double source = rate.contentFps;
const auto perRun = f.gpuTiming[size_t(diagnostics::GpuStage::Fg1)].p95;
const auto batch = f.gpuTiming[size_t(diagnostics::GpuStage::FgBatch)].p95;
const auto whole = f.enhancementProcessing.p95;
- if (s.fgBudgetLimited && source > 1 && perRun && *perRun > 0 && batch && whole) {
+ if (s.fgBudgetLimited && (!rate.policyLimited()||i.history.overloaded) && source > 1 && perRun && *perRun > 0 && batch && whole) {
const double base = std::max(0.0, *whole - *batch);
const int fits = std::clamp(1 + int(std::floor((1000.0 / source - base) / *perRun)), 1, int(s.applied.multiplier));
if (fits < int(s.applied.multiplier)) detail << tr("VFG 每张约 %1 ms,当前负载约可稳定 %2X").arg(*perRun, 0, 'f', 1).arg(fits);
}
- double refresh = 0;
- for (auto* window : QGuiApplication::topLevelWindows())
- if (window->isVisible() && window->screen()) { refresh = window->screen()->refreshRate(); break; }
if (refresh > 1 && source > 1 && source * s.applied.multiplier > refresh * 1.02)
detail << tr("屏幕 %1 Hz 最多显示约 %2X").arg(refresh, 0, 'f', 0).arg(std::max(1, int(refresh / source)));
}
if (s.nominalSourceFps > 0.01) detail << tr("源 %1 fps").arg(s.nominalSourceFps, 0, 'f', 2);
+ if(active&&f.rateWindowReady&&rate.targetFps>0)detail<<tr("有效目标 %1 fps").arg(rate.targetFps,0,'f',1);
const auto autoState=nrAutoStatus();if(!autoState.isEmpty())detail<<autoState;
}
- // 1.4.4 DashboardHistory: target = source x multiplier (half-rate capture
- // halves it); actual = what reached present (XeSS: its SDK submit rate).
double ratio = -1.0;
- if (active && f.rateWindowReady) {
- const bool measuredInput = s.capture && s.captureReceived > 30 && s.captureFps > 0;
- const double source = measuredInput ? std::min(s.nominalSourceFps, s.captureFps) : s.nominalSourceFps;
- const bool xessSink = s.applied.multiplier > 1 && engine::presentSinkFrameGeneration(s.applied.frameGenerationBackend);
- const double actual = xessSink ? f.xessSdkSubmitFps : f.presentSubmitFps;
- const double target = source * (s.captureHalfRate ? 0.5 : 1.0) * (i.compareMode != 0 ? 1u : s.applied.multiplier);
- if (target > 0) ratio = actual / target;
- }
+ if (active && f.rateWindowReady && rate.targetFps>0)ratio=rate.actualFps/rate.targetFps;
const bool ratioChanged = std::abs(ratio - i.rateRatio) > 0.005;
i.rateRatio = ratio;
// Frame-time line: the submit interval while playing (a real display rate is
@@ -6370,8 +6400,10 @@ void QmlPlayerBridge::updateRunStatus() {
} else if (!s.running && !i.frameTimes.empty()) i.frameTimes.clear();
const QString text = detail.join(QStringLiteral(" · "));
const double gpu = i.gpuUtil.load();
- const bool changed = ratioChanged || active || status != i.runStatus || level != i.runLevel || text != i.runDetail || std::abs(gpu - i.gpuPublished) > 0.05;
+ const double target=active&&f.rateWindowReady&&rate.targetFps>0?rate.targetFps:-1;
+ const bool changed = ratioChanged || active || status != i.runStatus || level != i.runLevel || text != i.runDetail || options!=i.runOptions || std::abs(target-i.effectiveOutputFps)>.05 || std::abs(gpu - i.gpuPublished) > 0.05;
i.runStatus = status; i.runLevel = level; i.runDetail = text; i.gpuPublished = gpu;
+ i.runOptions=options;i.effectiveOutputFps=target;
if (changed) emit perfChanged();
}
diff --git a/tests/integration/LivePresentationTests.cpp b/tests/integration/LivePresentationTests.cpp
index 431fee9d..05c18e41 100644
--- a/tests/integration/LivePresentationTests.cpp
+++ b/tests/integration/LivePresentationTests.cpp
@@ -283,6 +283,18 @@ int wmain(int argc,wchar_t**argv){
SetWindowPos(window,nullptr,monitor.rcMonitor.left,monitor.rcMonitor.top,monitor.rcMonitor.right-monitor.rcMonitor.left,monitor.rcMonitor.bottom-monitor.rcMonitor.top,SWP_NOZORDER|SWP_NOACTIVATE);
}
}
+ if(!failures){
+ // Rebuild and seek in the same owner-loop turn: the old cached
+ // frame is before the seek target and must not lose the applied
+ // acknowledgement when that frame is discarded.
+ const auto before=engine.snapshot();auto changed=before.applied;
+ changed.nr=changed.sr=false;changed.multiplier=1;
+ check(engine.requestSettings(changed),"all-effects-off transaction accepted before a seek");
+ const auto revision=engine.snapshot().desired.revision;
+ check(engine.setPlaybackRate(.5),"half-speed request accepted during the transaction");
+ engine.seek(before.position+1);
+ check(until([&](const auto& s){return !s.applying&&s.applied.revision==revision&&s.applied.multiplier==1&&!s.fgActive&&!s.nrActive&&!s.srActive&&s.frames>before.frames+12;},30),"discarded transaction frame still confirms the actual settings after rebuild plus seek");
+ }
engine.stop();check(until([&](const auto&){return engine.idle();},8),"settings session drains");
DestroyWindow(window);CoUninitialize();return failures?1:0;
}
diff --git a/tests/unit/UiContractTests.cpp b/tests/unit/UiContractTests.cpp
index 3204358e..e088eac3 100644
--- a/tests/unit/UiContractTests.cpp
+++ b/tests/unit/UiContractTests.cpp
@@ -14,8 +14,93 @@
#include <vector>
#include <stdexcept>
void require(bool value,const char* why){if(!value)throw std::runtime_error(why);}
+// Judge intentional rate changes against policy, never against measured output.
+void outputRateContracts(){
+ using namespace veyra;
+ using ui::live_status::DashboardHistory;
+ using ui::live_status::RateContext;
+ const auto live=[](){
+ engine::PlayerSnapshot s;s.running=s.capture=true;s.transport=engine::TransportState::Playing;
+ s.sessionId=1;s.applied.revision=1;s.captureReceived=120;s.captureFps=s.nominalSourceFps=60;
+ s.metrics.flow.rateWindowReady=true;s.presentationEffective.display=engine::DisplaySync::Tearing;
+ return s;
+ };
+ const auto settle=[](DashboardHistory& h,engine::PlayerSnapshot& s,double skipHz,RateContext c={}){
+ for(int i=0;i<24;++i){c.nowSeconds=i*.25;s.captureRateSkipped=uint64_t(skipHz*c.nowSeconds);h.sample(s,c);}
+ };
+ DashboardHistory h;auto s=live();
+ s.applied.content=engine::ContentRate::Auto;s.contentFps=30;s.metrics.flow.presentSubmitFps=30;
+ settle(h,s,30);
+ require(std::abs(h.output.targetFps-30)<.01&&!h.overloaded&&std::wstring(h.rateStatus(s))==L"正常","60Hz transport with 30 unique frames is healthy at 30fps");
+ require(h.output.deduplicating,"dedup reason requires observed intentional skips");
+ s.metrics.flow.presentSubmitFps=15;settle(h,s,30);
+ require(h.overloaded,"real output deficit remains visible after dedup");
+ h={};s=live();s.applied.content=engine::ContentRate::Auto;s.contentFps=30;s.metrics.flow.presentSubmitFps=30;
+ settle(h,s,0);
+ require(h.overloaded&&!h.output.deduplicating&&h.output.targetFps==60,"enabling Auto or a learned hint alone cannot excuse missing frames");
+ h={};s=live();s.applied.content=engine::ContentRate::Auto;s.contentFps=4;s.metrics.flow.presentSubmitFps=4;
+ settle(h,s,56);
+ require(!h.overloaded&&h.output.targetFps==4,"intentional static-picture dedup is healthy");
+ s.metrics.flow.presentSubmitFps=0;settle(h,s,60);
+ require(h.overloaded&&h.output.targetFps>=1,"even maximal skip counts cannot hide a stopped presenter");
+ h={};s=live();s.applied.content=engine::ContentRate::Capture60To30;s.captureHalfRate=true;s.contentFps=30;
+ s.metrics.flow.presentSubmitFps=30;settle(h,s,30);
+ require(h.output.targetFps==30&&!h.overloaded,"60-to-30 and its skip counter are counted once");
+ h={};s=live();s.captureFps=40;s.applied.content=engine::ContentRate::Auto;s.contentFps=20;
+ s.metrics.flow.presentSubmitFps=20;settle(h,s,20);
+ require(!h.overloaded&&h.inputLimited&&std::wstring(h.rateStatus(s))==L"输入帧率不足","dedup never hides a deficient input");
+ h={};s=live();s.applied.multiplier=4;s.presentationEffective.display=engine::DisplaySync::Vsync;
+ s.metrics.flow.presentSubmitFps=60;settle(h,s,0,{60});
+ require(h.output.targetFps==60&&h.output.displayLimited&&!h.overloaded,"VSync target is bounded by the actual display");
+ s.fgBudgetLimited=true;settle(h,s,0,{60});
+ require(std::wstring(h.rateStatus(s))==L"正常","meeting a display-limited target is normal despite redundant FG admission being reduced");
+ s.metrics.flow.presentSubmitFps=45;settle(h,s,0,{60});
+ require(h.overloaded&&std::wstring(h.rateStatus(s))!=L"正常","VSync cannot hide output below its effective target");
+ h={};s=live();s.applied.multiplier=4;s.presentationEffective.display=engine::DisplaySync::Automatic;
+ s.metrics.flow.presentSubmitFps=60;settle(h,s,0,{60});
+ require(!h.overloaded&&h.output.displayLimited,"Automatic display sync also uses the refresh limit");
+ s.presentationEffective.display=engine::DisplaySync::Tearing;++s.presentationRevision;settle(h,s,0,{60});
+ require(h.overloaded&&h.output.targetFps==240&&!h.output.displayLimited,"Tearing does not inherit a display cap");
+ h={};s=live();s.applied.multiplier=4;s.presentationEffective.display=engine::DisplaySync::Vsync;
+ s.metrics.flow.presentSubmitFps=60;settle(h,s,0);
+ require(h.overloaded&&!h.output.displayLimited,"unknown monitor refresh is never guessed");
+ h={};s=live();s.applied.multiplier=4;s.presentationEffective.outputRate=engine::OutputRateMode::Custom;
+ s.presentationEffective.customFps=30;s.metrics.flow.presentSubmitFps=30;settle(h,s,0);
+ require(!h.overloaded&&h.output.outputLimited&&h.output.targetFps==30,"effective custom output cap is a normal target");
+ s.metrics.flow.presentSubmitFps=15;settle(h,s,0);
+ require(h.overloaded,"real deficit below a custom cap remains visible");
+ h={};s=live();s.applied.multiplier=4;s.presentationEffective.outputRate=engine::OutputRateMode::FollowDisplay;
+ s.metrics.flow.presentSubmitFps=144;settle(h,s,0,{144});
+ require(!h.overloaded&&h.output.targetFps==144&&h.output.outputLimited,"follow-display cap is applied even with unsynchronized present");
+ h={};s=live();s.applied.multiplier=2;s.applied.frameGenerationBackend=engine::FrameGenerationBackend::XeSS;
+ s.presentation.outputRate=engine::OutputRateMode::Custom;s.presentation.customFps=30;
+ s.presentationEffective.outputRate=engine::OutputRateMode::Off;s.metrics.flow.xessSdkSubmitFps=120;
+ settle(h,s,0);
+ require(!h.overloaded&&h.output.targetFps==120&&!h.output.outputLimited,"provider-disabled requested cap cannot lower the target");
+ s.metrics.flow.xessSdkSubmitFps=30;settle(h,s,0);
+ require(h.overloaded,"requested but ineffective provider cap cannot conceal missing SDK submissions");
+ h={};s=live();s.capture=false;s.nominalSourceFps=30;s.playbackRate=.5;s.metrics.flow.presentSubmitFps=15;
+ settle(h,s,0);require(!h.overloaded&&h.output.targetFps==15&&h.output.speedAdjusted,"half-speed file playback is healthy at half the source rate");
+ s.playbackRate=1.5;s.metrics.flow.presentSubmitFps=45;settle(h,s,0);
+ require(!h.overloaded&&h.output.targetFps==45,"faster file playback raises rather than lowers the target");
+ h={};s=live();s.applied.multiplier=4;s.metrics.flow.presentSubmitFps=60;
+ settle(h,s,0,{0,true});require(!h.overloaded&&h.output.targetFps==60,"comparison suspends FG and is judged at the original-frame rate");
+ s.metrics.flow.presentSubmitFps=30;settle(h,s,0,{0,true});
+ require(h.overloaded,"comparison still reports original-frame starvation");
+ h={};s=live();s.presentationEffective.enabled=true;s.metrics.flow.presentSubmitFps=30;
+ settle(h,s,0);require(h.overloaded&&h.output.targetFps==60,"low-latency queue alone is not a rate cap");
+ s.presentationEffective.outputRate=engine::OutputRateMode::Custom;s.presentationEffective.customFps=30;++s.presentationRevision;
+ h.sample(s,{0,false,6});require(!h.overloaded,"changing the effective presentation policy revokes stale output warnings");
+ h={};s=live();s.applied.content=engine::ContentRate::Auto;s.contentFps=30;s.metrics.flow.presentSubmitFps=30;
+ settle(h,s,30);s.applied.content=engine::ContentRate::Transport;++s.applied.revision;
+ h.sample(s,{0,false,6});require(h.skipped.empty()&&!h.output.deduplicating&&h.output.targetFps==60,"source-timestamp mode revokes dedup history");
+ s.applied.multiplier=2;s.fgBudgetLimited=true;settle(h,s,0);
+ require(std::wstring(h.rateStatus(s))==L"补帧调度降档","uncapped FG admission shortfall retains its own warning");
+ std::cout<<"PASS output-rate policy: dedup, static, half-rate, display sync, caps, provider, speed, comparison, real deficits and resets\n";
+}
int wmain(int argc,wchar_t** argv){try{
using namespace veyra;
+ outputRateContracts();
{source::CaptureAudioClock c;require(c.observe({},100,10,false)==100,"untimed audio anchors to arrival");require(c.observe({},170,10,false)==110,"driver arrival jitter cannot stretch untimed PCM");require(c.observe(120,180,10,false)==120,"valid driver timestamp takes precedence");require(c.observe({},190,10,false)==130,"missing timestamps continue from valid samples");require(c.observe({},500,10,true)==500,"discontinuity reanchors untimed audio");require(c.observe(0,510,10,true)==0,"timestamp zero remains valid");}
{
ui::live_status::DashboardHistory history;engine::PlayerSnapshot s;