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: display-stats reported counters that cannot measure scanout; frame pacing measured as ineffective

Veyra Goal Agent04f47dc2507b
diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cpp
index 47fad7ec..60930a02 100644
--- a/apps/veyra/ui/AppShell.cpp
+++ b/apps/veyra/ui/AppShell.cpp
@@ -71,6 +71,9 @@ veyra::ui::PlaybackPowerGuard playbackPower;
HWND inspector=nullptr,metricLabel=nullptr,tooltips=nullptr,diagnosticPanel=nullptr,liveStatusPanel=nullptr;bool showDiagnostics=false,inspectorResizing=false;int proposedInspectorWidth=320;bool preferWatching=true,jobPaused=false;int subtitlePixels=22;
veyra::engine::EnhancementSettings jobExpected;uint64_t masterPendingRevision=0,masterPendingSession=0;bool masterPreviousEnabled=true;
std::wstring smokeView;bool smokeViewApplied=false;
+// Smoke-only presentation override so frame pacing can be A/B tested from the
+// command line (--smoke-pacing off|lowqueue|even|reflex [--smoke-pacing-vsync]).
+std::wstring smokePacing;bool smokePacingVsync=false,smokePacingApplied=false;
std::wstring smokeDualOutput;bool smokeEmpty=false;DWORD modeGdiStart=0,modeHandlesStart=0;SIZE_T modePrivateStart=0;
bool smokeDual=false,smokeDualPause=false,smokeMaster=false,smokeMasterReject=false,smokeAudio=false,smokeJob=false,smokeJobCancel=false,smokeJobExit=false,smokeColor=false;int dualStep=0,masterStep=0,audioStep=0,jobStep=0,colorStep=0;double pausedPosition=-1,jobPosition=0;uint64_t pausedFrames=0;ULONGLONG jobPauseTick=0;HANDLE workerMapping=nullptr;
// Test/acceptance convenience: start in professional mode with the colour page
@@ -858,6 +861,12 @@ setText(GetDlgItem(hwnd,EmptyTitle),s.failed?L"播放已停止":L"开始观看")
if(dragging&&GetCapture()!=seekBar){dragging=false;seekPreview.released=true;}
seekPreview.tick(&s);
if(!dragging&&s.duration>0){int position=int((s.seekPresented<s.seekRequested&&!s.failed?s.seekTarget:s.position)/s.duration*10000);if(SendMessageW(seekBar,TBM_GETPOS,0,0)!=position)SendMessageW(seekBar,TBM_SETPOS,TRUE,position);}
+if(!smokePacingApplied&&!smokePacing.empty()&&s.frames>0){smokePacingApplied=true;
+ veyra::engine::PresentationSettings p{};
+ p.enabled=smokePacing!=L"off";
+ p.mode=smokePacing==L"even"?veyra::engine::PacingMode::Even:smokePacing==L"reflex"?veyra::engine::PacingMode::Reflex:veyra::engine::PacingMode::LowQueue;
+ p.display=smokePacingVsync?veyra::engine::DisplaySync::Vsync:veyra::engine::DisplaySync::Tearing;
+ engine.requestPresentation(p);}
if(!smokeViewApplied&&!smokeView.empty()&&(s.frames>0||smokeEmpty)){smokeViewApplied=true;if(smokeView==L"small")SetWindowPos(hwnd,nullptr,0,0,800,600,SWP_NOMOVE|SWP_NOZORDER);if(smokeView!=L"daily"&&smokeView!=L"empty"&&uiState.mode==veyra::ui::Mode::Daily)switchMode();if(smokeView==L"export")selectInspector(3);if(smokeView==L"diagnostics"){showDiagnostics=true;layout();}if(smokeView==L"fullscreen")toggleFullscreen();}
if(smokeDualPause&&pausedPosition<0&&s.frames>20){engine.pause(true);pausedPosition=s.position;pausedFrames=s.frames;}
if(smokeDual&&startTick&&s.frames>10&&dualStep<40&&GetTickCount64()-startTick>ULONGLONG(1500+dualStep*200)){if(dualStep==4){modeGdiStart=GetGuiResources(GetCurrentProcess(),GR_GDIOBJECTS);GetProcessHandleCount(GetCurrentProcess(),&modeHandlesStart);PROCESS_MEMORY_COUNTERS_EX pm{};pm.cb=sizeof(pm);GetProcessMemoryInfo(GetCurrentProcess(),reinterpret_cast<PROCESS_MEMORY_COUNTERS*>(&pm),sizeof(pm));modePrivateStart=pm.PrivateUsage;}switchMode();
@@ -1269,7 +1278,7 @@ SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);INITCO
CoInitializeEx(nullptr,COINIT_APARTMENTTHREADED);
initialOptions=veyra::engine::PlayerOptions::from(veyra::ui::defaultSettings());
-int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<argc;++i){const std::wstring arg=argv[i];if(arg==L"--export-worker"&&i+1<argc)workerMapping=reinterpret_cast<HANDLE>(_wcstoui64(argv[++i],nullptr,10));else if(arg==L"--smoke-view"&&i+1<argc)smokeView=argv[++i];else if(arg==L"--smoke-fg-only")smokeFgOnly=true;else if(arg==L"--smoke-transport")smokeTransport=true;else if(arg==L"--smoke-repair-ui")smokeRepair=true;else if(arg==L"--smoke-repair-ui-reject")smokeRepair=smokeRepairReject=true;else if(arg==L"--smoke-hover")smokeZoom=smokeHover=true;else if(arg==L"--smoke-protection")smokeProtection=true;else if(arg==L"--smoke-zoom")smokeZoom=true;else if(arg==L"--smoke-empty")smokeEmpty=true;else if(arg==L"--smoke-dual")smokeDual=true;else if(arg==L"--smoke-dual-pause"){smokeDual=smokeDualPause=true;}else if(arg==L"--smoke-master-reject")smokeMaster=smokeMasterReject=true;else if(arg==L"--smoke-master")smokeMaster=true;else if(arg==L"--smoke-audio")smokeAudio=true;else if(arg==L"--smoke-job-cancel")smokeJobCancel=true;else if(arg==L"--smoke-job-exit")smokeJobExit=true;else if(arg==L"--smoke-job")smokeJob=true;else if(arg==L"--smoke-dual-export"&&i+1<argc)smokeDualOutput=argv[++i];else if(arg==L"--smoke-seconds"&&i+1<argc)smokeSeconds=std::clamp(_wtoi(argv[++i]),1,240);else if(arg==L"--export-out"&&i+1<argc)exportOutput=argv[++i];else if(arg==L"--max-frames"&&i+1<argc)exportFrames=std::max(1,_wtoi(argv[++i]));else if(arg==L"--cancel-after-ms"&&i+1<argc)cancelAfterMs=std::clamp(_wtoi(argv[++i]),1,240000);else if(arg==L"--hevc")exportHevc=true;else if(arg==L"--bitrate-mbps"&&i+1<argc)initialOptions.settings.exportBitrateMbps=uint32_t(std::clamp(_wtoi(argv[++i]),0,300));else if(arg==L"--subtitle-primary"&&i+1<argc)subtitleRequestPrimary=std::clamp(_wtoi(argv[++i]),-1,64);else if(arg==L"--subtitle-secondary"&&i+1<argc)subtitleRequestSecondary=std::clamp(_wtoi(argv[++i]),-1,64);else if(arg==L"--subtitle-offset-ms"&&i+1<argc)subtitleRequestOffsetMs=std::clamp(_wtoi(argv[++i]),-30000,30000);else if(arg==L"--subtitle-font-size"&&i+1<argc)subtitlePixels=std::clamp(_wtoi(argv[++i]),16,56);else if(arg==L"--subtitle-no-outline")uiState.subtitleOutline=false;else if(arg==L"--subtitle-background")uiState.subtitleBackground=true;else if(arg==L"--subtitle-auto-align")subtitleRequestAutoAlign=true;else if(arg==L"--smoke-rollback-flow"){smokeRollback=true;smokeRollbackFlow=true;}else if(arg==L"--smoke-rollback")smokeRollback=true;else if(arg==L"--smoke-ui")smokeUi=true;else if(arg==L"--video-hdr")initialOptions.settings.videoHdr.enabled=true;else if(arg==L"--no-fg")initialOptions.fg=false;else if(arg==L"--smoke-settings")smokeSettings=true;else if(arg==L"--smoke-color")smokeColor=true;else if(arg==L"--smoke-screenshot")smokeScreenshot=true;else if(arg==L"--smoke-controls")smokeControls=true;else if(arg==L"--smoke-save"&&i+1<argc)smokeSave=argv[++i];else if(arg==L"--native")initialOptions.realtime=false;else if(arg==L"--realtime")initialOptions.realtime=true;else if(arg==L"--fg")initialOptions.fg=true;else if(arg==L"--fg-multiplier"&&i+1<argc){initialOptions.fgMultiplier=std::clamp(_wtoi(argv[++i]),2,6);initialOptions.fg=true;}else if(arg==L"--capture-audio"&&i+1<argc)initialOptions.settings.captureAudio=static_cast<veyra::engine::CaptureAudioIngress>(std::clamp(_wtoi(argv[++i]),0,2));else if(arg==L"--flow-amd")initialOptions.settings.opticalFlowBackend=veyra::engine::OpticalFlowBackend::AmdFidelityFx;else if(arg==L"--flow-gpudis")initialOptions.settings.opticalFlowBackend=veyra::engine::OpticalFlowBackend::GpuDis;else if(arg==L"--video-sr"&&i+1<argc){initialOptions.settings.videoSrQuality=std::clamp(_wtoi(argv[++i]),1,5);initialOptions.sr=true;}else if(arg==L"--nr-ampere")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Ampere;else if(arg==L"--nr-community")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Community;else if(arg==L"--nr-original")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Original;else if(arg==L"--sr")initialOptions.sr=true;else if(arg==L"--no-nr")initialOptions.nr=false;else if(arg==L"--nr")initialOptions.nr=true;else if(arg==L"--no-sr")initialOptions.sr=false;else autoInput=arg;}LocalFree(argv);
+int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<argc;++i){const std::wstring arg=argv[i];if(arg==L"--export-worker"&&i+1<argc)workerMapping=reinterpret_cast<HANDLE>(_wcstoui64(argv[++i],nullptr,10));else if(arg==L"--smoke-view"&&i+1<argc)smokeView=argv[++i];else if(arg==L"--smoke-pacing"&&i+1<argc)smokePacing=argv[++i];else if(arg==L"--smoke-pacing-vsync")smokePacingVsync=true;else if(arg==L"--smoke-fg-only")smokeFgOnly=true;else if(arg==L"--smoke-transport")smokeTransport=true;else if(arg==L"--smoke-repair-ui")smokeRepair=true;else if(arg==L"--smoke-repair-ui-reject")smokeRepair=smokeRepairReject=true;else if(arg==L"--smoke-hover")smokeZoom=smokeHover=true;else if(arg==L"--smoke-protection")smokeProtection=true;else if(arg==L"--smoke-zoom")smokeZoom=true;else if(arg==L"--smoke-empty")smokeEmpty=true;else if(arg==L"--smoke-dual")smokeDual=true;else if(arg==L"--smoke-dual-pause"){smokeDual=smokeDualPause=true;}else if(arg==L"--smoke-master-reject")smokeMaster=smokeMasterReject=true;else if(arg==L"--smoke-master")smokeMaster=true;else if(arg==L"--smoke-audio")smokeAudio=true;else if(arg==L"--smoke-job-cancel")smokeJobCancel=true;else if(arg==L"--smoke-job-exit")smokeJobExit=true;else if(arg==L"--smoke-job")smokeJob=true;else if(arg==L"--smoke-dual-export"&&i+1<argc)smokeDualOutput=argv[++i];else if(arg==L"--smoke-seconds"&&i+1<argc)smokeSeconds=std::clamp(_wtoi(argv[++i]),1,240);else if(arg==L"--export-out"&&i+1<argc)exportOutput=argv[++i];else if(arg==L"--max-frames"&&i+1<argc)exportFrames=std::max(1,_wtoi(argv[++i]));else if(arg==L"--cancel-after-ms"&&i+1<argc)cancelAfterMs=std::clamp(_wtoi(argv[++i]),1,240000);else if(arg==L"--hevc")exportHevc=true;else if(arg==L"--bitrate-mbps"&&i+1<argc)initialOptions.settings.exportBitrateMbps=uint32_t(std::clamp(_wtoi(argv[++i]),0,300));else if(arg==L"--subtitle-primary"&&i+1<argc)subtitleRequestPrimary=std::clamp(_wtoi(argv[++i]),-1,64);else if(arg==L"--subtitle-secondary"&&i+1<argc)subtitleRequestSecondary=std::clamp(_wtoi(argv[++i]),-1,64);else if(arg==L"--subtitle-offset-ms"&&i+1<argc)subtitleRequestOffsetMs=std::clamp(_wtoi(argv[++i]),-30000,30000);else if(arg==L"--subtitle-font-size"&&i+1<argc)subtitlePixels=std::clamp(_wtoi(argv[++i]),16,56);else if(arg==L"--subtitle-no-outline")uiState.subtitleOutline=false;else if(arg==L"--subtitle-background")uiState.subtitleBackground=true;else if(arg==L"--subtitle-auto-align")subtitleRequestAutoAlign=true;else if(arg==L"--smoke-rollback-flow"){smokeRollback=true;smokeRollbackFlow=true;}else if(arg==L"--smoke-rollback")smokeRollback=true;else if(arg==L"--smoke-ui")smokeUi=true;else if(arg==L"--video-hdr")initialOptions.settings.videoHdr.enabled=true;else if(arg==L"--no-fg")initialOptions.fg=false;else if(arg==L"--smoke-settings")smokeSettings=true;else if(arg==L"--smoke-color")smokeColor=true;else if(arg==L"--smoke-screenshot")smokeScreenshot=true;else if(arg==L"--smoke-controls")smokeControls=true;else if(arg==L"--smoke-save"&&i+1<argc)smokeSave=argv[++i];else if(arg==L"--native")initialOptions.realtime=false;else if(arg==L"--realtime")initialOptions.realtime=true;else if(arg==L"--fg")initialOptions.fg=true;else if(arg==L"--fg-multiplier"&&i+1<argc){initialOptions.fgMultiplier=std::clamp(_wtoi(argv[++i]),2,6);initialOptions.fg=true;}else if(arg==L"--capture-audio"&&i+1<argc)initialOptions.settings.captureAudio=static_cast<veyra::engine::CaptureAudioIngress>(std::clamp(_wtoi(argv[++i]),0,2));else if(arg==L"--flow-amd")initialOptions.settings.opticalFlowBackend=veyra::engine::OpticalFlowBackend::AmdFidelityFx;else if(arg==L"--flow-gpudis")initialOptions.settings.opticalFlowBackend=veyra::engine::OpticalFlowBackend::GpuDis;else if(arg==L"--video-sr"&&i+1<argc){initialOptions.settings.videoSrQuality=std::clamp(_wtoi(argv[++i]),1,5);initialOptions.sr=true;}else if(arg==L"--nr-ampere")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Ampere;else if(arg==L"--nr-community")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Community;else if(arg==L"--nr-original")initialOptions.settings.nrRuntime=veyra::engine::NrRuntime::Original;else if(arg==L"--sr")initialOptions.sr=true;else if(arg==L"--no-nr")initialOptions.nr=false;else if(arg==L"--nr")initialOptions.nr=true;else if(arg==L"--no-sr")initialOptions.sr=false;else autoInput=arg;}LocalFree(argv);
// Diagnostic: force the colour grade on with a fixed exposure (EV). The grade is
// fused into the ingest dispatch, so this flag is how the graded cost is measured
// against the grade-off baseline on the same clip.
@@ -1289,7 +1298,7 @@ int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<a
// capture panel checkbox and persists captureFlipVertical with presets.
{int flipArgc=0;auto flipArgv=CommandLineToArgvW(GetCommandLineW(),&flipArgc);for(int i=1;i<flipArgc;++i){if(!_wcsicmp(flipArgv[i],L"--capture-flip"))initialOptions.settings.captureFlipVertical=true;else if(!wcsncmp(flipArgv[i],L"--capture-buffer=",17)){const wchar_t* value=flipArgv[i]+17;if(!_wcsicmp(value,L"auto"))initialOptions.settings.captureBuffer=veyra::source::CaptureBufferMode::Auto;else if(!_wcsicmp(value,L"minimum"))initialOptions.settings.captureBuffer=veyra::source::CaptureBufferMode::Minimum;else if(!_wcsicmp(value,L"driver"))initialOptions.settings.captureBuffer=veyra::source::CaptureBufferMode::DriverDefault;}else if(!_wcsicmp(flipArgv[i],L"--capture-cpu-unpack"))initialOptions.captureCpuUnpack=true;}LocalFree(flipArgv);}
int positionalArgc=0;auto positionalArgv=CommandLineToArgvW(GetCommandLineW(),&positionalArgc);std::wstring positional;
- const wchar_t* valueFlags[]={L"--export-worker",L"--smoke-view",L"--smoke-dual-export",L"--smoke-seconds",L"--export-out",L"--max-frames",L"--cancel-after-ms",L"--smoke-save",L"--fg-multiplier",L"--capture-audio",L"--video-sr",L"--bitrate-mbps",L"--subtitle-primary",L"--subtitle-secondary",L"--subtitle-offset-ms",L"--subtitle-font-size"};
+ const wchar_t* valueFlags[]={L"--export-worker",L"--smoke-view",L"--smoke-pacing",L"--smoke-dual-export",L"--smoke-seconds",L"--export-out",L"--max-frames",L"--cancel-after-ms",L"--smoke-save",L"--fg-multiplier",L"--capture-audio",L"--video-sr",L"--bitrate-mbps",L"--subtitle-primary",L"--subtitle-secondary",L"--subtitle-offset-ms",L"--subtitle-font-size"};
for(int i=1;i<positionalArgc;++i){const std::wstring a=positionalArgv[i];
bool takesValue=false;for(const wchar_t* flag:valueFlags)if(a==flag){takesValue=true;break;}
if(takesValue){++i;continue;}
diff --git a/docs/UNIFIED_REPAIR_EXECUTION_2026-09-22.md b/docs/UNIFIED_REPAIR_EXECUTION_2026-09-22.md
index b3a69020..bf83c706 100644
--- a/docs/UNIFIED_REPAIR_EXECUTION_2026-09-22.md
+++ b/docs/UNIFIED_REPAIR_EXECUTION_2026-09-22.md
@@ -527,6 +527,63 @@ DXGI `GetFrameStatistics`,逐秒增量取均值;`pres/s` 与 `sd`/`min`/`max
交付构建 SHA256 前 16 位 `1EB4288CBF1CF701`。
+## 3j. 重大更正:display-stats 指标是错的,§3h / §3i 的送显结论全部撤回
+
+### 错在哪
+
+`PresentSink::sampleFrameStatistics` 把 `delta.displayed` 取成了
+`DXGI_FRAME_STATISTICS::PresentRefreshCount` 的增量。该字段是"最后一次显示的提交落在
+第几次刷新",是一个**刷新序号**,它每秒的增量恒等于刷新率,与显示了多少帧无关。
+于是派生出的 `notDisplayed = presents - displayed` 与
+`refreshesWithoutNewFrame = refreshes - displayed` 在结构上必然接近 0。
+
+破绽其实一直在数据里:不开补帧时 `presents=60.7` 而 `displayed=101.18`,
+显示比提交还多,物理上不可能。此前在 XeSS 两行看到同样现象时被错误解释为
+"提供方自己送显",该解释不成立。
+
+### 改用 PresentCount 也不对
+
+先把 `displayed` 改成 `DXGI_FRAME_STATISTICS::PresentCount`,实测(`b15/`):
+
+```
+refreshHz=100.000 presents=273 displayed=273 refreshes=100 displayedRefreshDelta=100
+```
+
+`PresentCount` 的增量等于我们自己的 Present 调用数(273),两个 refresh 计数器都等于
+刷新率(100)。**在"关闭垂直同步 + 允许撕裂 + 翻转丢弃"的交换链上,
+`GetFrameStatistics` 的任何字段或组合都给不出"面板实际显示了多少帧"**——
+撕裂状态下一次刷新可能显示多帧的拼接,"显示帧数"本身不是良定义的量。
+
+### 最终处理
+
+日志改为只报原始计数并写明其局限,删除两个派生的伪指标:
+
+```
+display-stats] refreshHz presentCalls dxgiPresentCount refreshes presentRefreshDelta backend
+(这些计数器无法反映面板实际显示了多少帧;测量扫描输出需要 PresentMon)
+```
+
+`scripts/acceptance/fg-independent-ab.py` 同步兼容新旧字段名。
+
+### 撤回的结论
+
+- **§3h 全部撤回**:其核心论据"两种配置 `displayed` 相同、`refreshesWithoutNewFrame`
+ 全为 0"来自错误指标,不成立。因此"Reduced 在送显口径上等同或更好"**没有证据支持**。
+- **§3i 的"实际显示/s"与"缺帧刷新/s"两列作废**,该表其余列(提交/s、逐秒 sd、
+ 最低秒、提交间隔、Present 阻塞)来自自有 trace,仍然有效。
+- **§3e / §3g 基于提交帧数的判定重新成为唯一有数据支持的口径**,但它们本身也只
+ 衡量软件提交侧,不等于观感。
+
+即:**Reduced 路径到底是赚是亏,目前没有可信结论**。默认值维持开启(现状),
+不因为一个已被推翻的论据去改它;要定论必须先有 PresentMon 或等价的扫描输出测量。
+
+### 教训
+
+本轮第三次判据错误:先是跨时段比较(§3c.1 推翻 §3),再是用提交帧数当观感
+(§3h 推翻 §3e/§3g),现在是指标定义本身错误(本节推翻 §3h)。
+**新增一条硬规矩:任何新指标在用于判断之前,必须先做一次"物理不可能"检查**——
+本例中"显示帧数 > 提交帧数"和"100 Hz 面板显示 270 帧/s"都应当在第一次出现时就拦下。
+
## 4. 未做项的原因与下一步
- **C3/C4/延迟 3b(采集三缓冲、锁外复制、直写 upload 堆)**:需要重构 mailbox 所有权
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index fc8091b7..243bc1df 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,25 @@
# Veyra 工作记录
+## 2026-09-22 display-stats 指标错误,送显口径结论全部撤回;帧同步实测无效
+
+**指标 bug**:`sampleFrameStatistics` 把 `displayed` 取成 `PresentRefreshCount` 增量
+(刷新序号,每秒增量恒等于刷新率),导致 `notDisplayed` 与 `refreshesWithoutNewFrame`
+结构上恒为 0。破绽是"不开补帧时 displayed 101 > presents 60",物理不可能。
+改用 `PresentCount` 同样不对(实测 `presents=273 displayed=273 refreshes=100`):
+**撕裂 + 翻转丢弃下 DXGI 给不出面板实际显示帧数**。日志改为只报原始计数并写明局限,
+删除两个派生伪指标。**据此撤回 §3h 全部结论与 §3i 的两列**,Reduced 是赚是亏
+目前无可信结论,默认维持开启不动。详见 [执行记录 §3j](UNIFIED_REPAIR_EXECUTION_2026-09-22.md)。
+
+**帧同步实测无效**(用户反馈属实):新增冒烟开关 `--smoke-pacing off|lowqueue|even|reflex`,
+同时段交替各 2 轮。四个模式在吞吐、逐秒 sd、媒体时钟偏差上无可测差异,逐秒 sd 开启后
+略差(DLSS 4X 关 3.3–3.55,开 3.44–4.79)。设置确实生效(`effective=true/2/0`,
+开补帧时按设计退回低排队)。原因:XeSS/FSR 下帧同步被整体禁用、Reflex 遇补帧退回低排队、
+低排队仅把 DXGI 队列深度 3 改 1。**保留**:队列深度对"提交到上屏"的排队延迟有影响,
+但该延迟需 PresentMon 才能测,未下"完全无用"的结论。数据 `b13/pacing-ab/`。
+
+**功耗**:本机 30 s 五工况功耗 sd 0.8–2.4 W(175–241 W 上),波动 <1%;
+240 s 长测见下一条。
+
## 2026-09-22 更正:Reduced 判定用错口径,恢复默认开启
补上 DXGI 送显数据后推翻前一条结论。100 Hz 面板上,降级开/关两种配置的**实际显示
diff --git a/include/veyra/gfx/PresentSink.h b/include/veyra/gfx/PresentSink.h
index 88f28517..e040fb04 100644
--- a/include/veyra/gfx/PresentSink.h
+++ b/include/veyra/gfx/PresentSink.h
@@ -93,9 +93,17 @@ public:
// presents - displayed = submissions that never reached the screen (with
// tearing/vsync off, dropped by flip). Unsupported (proxy swapchain or
// pre-first-present) leaves supported=false; nothing is invented.
+ // Raw DXGI counters, deltas over the sampling window. NONE of these is a
+ // count of frames the panel actually showed, and no combination of them
+ // yields one on a tearing flip-discard swapchain (measured 2026-09-22:
+ // with 273 Present calls per second on a 100 Hz panel, PresentCount also
+ // reads 273 while both refresh counters read 100). Use PresentMon for
+ // scanout. presents: our own Present() calls. displayed: DXGI PresentCount
+ // (completed presents). refreshes: SyncRefreshCount (vblanks elapsed).
+ // displayedRefresh: PresentRefreshCount (vblank index, also ~= refreshes).
struct FrameStatisticsDelta {
bool supported=false;
- uint64_t presents=0,displayed=0,refreshes=0;
+ uint64_t presents=0,displayed=0,refreshes=0,displayedRefresh=0;
HRESULT result=S_OK;
};
FrameStatisticsDelta sampleFrameStatistics();
@@ -165,7 +173,7 @@ private:
double displayRefreshHz_=0;
bool frameStatisticsBaseValid_=false;
uint64_t frameStatisticsBasePresents_=0;
- UINT frameStatisticsBasePresentRefresh_=0,frameStatisticsBaseSyncRefresh_=0;
+ UINT frameStatisticsBasePresentRefresh_=0,frameStatisticsBaseSyncRefresh_=0,frameStatisticsBaseDisplayed_=0;
};
} // namespace veyra::gfx
diff --git a/scripts/acceptance/fg-independent-ab.py b/scripts/acceptance/fg-independent-ab.py
index 4e9371a3..a4b97fb5 100644
--- a/scripts/acceptance/fg-independent-ab.py
+++ b/scripts/acceptance/fg-independent-ab.py
@@ -110,7 +110,12 @@ def summarise(case_dir: Path, seconds: int):
out["displayStatsSamples"] = len(stats)
out["displayed"] = dist([float(s["displayed"]) for s in stats])
out["presents"] = dist([float(s["presents"]) for s in stats])
- out["notDisplayed"] = dist([float(s["notDisplayed"]) for s in stats])
+ # "discarded" replaced the old "notDisplayed" when displayed was fixed
+ # to use DXGI PresentCount (2026-09-22); accept either spelling.
+ key = "discarded" if "discarded" in stats[0] else "notDisplayed"
+ out["discarded"] = dist([float(s[key]) for s in stats])
+ if "refreshes" in stats[0]:
+ out["refreshes"] = dist([float(s["refreshes"]) for s in stats])
out["refreshesWithoutNewFrame"] = dist([float(s["refreshesWithoutNewFrame"]) for s in stats])
else:
unavailable = next((l for l in lines if "[display-stats] unavailable" in l), None)
diff --git a/src/engine/VideoPresenter.cpp b/src/engine/VideoPresenter.cpp
index 64303b35..75e97d4e 100644
--- a/src/engine/VideoPresenter.cpp
+++ b/src/engine/VideoPresenter.cpp
@@ -257,7 +257,7 @@ bool VideoPresenter::present(gfx::D3D12DeviceContext& ctx,gfx::CommandSlotRing&
// display actually scanned out. This is still not a photon measurement.
static const bool displayStats=GetEnvironmentVariableW(L"VEYRA_TEST_NO_DISPLAY_STATS",nullptr,0)==0;
const auto stats=displayStats?sink_.sampleFrameStatistics():gfx::PresentSink::FrameStatisticsDelta{};
- if(stats.supported)veyra::log::info("display-stats",std::format("refreshHz={:.3f} presents={} displayed={} refreshes={} notDisplayed={} refreshesWithoutNewFrame={} backend={} (DXGI GetFrameStatistics delta over ~1s; XeSS/FSR generated presents are provider-internal and not counted in presents)",sink_.displayRefreshHz(),stats.presents,stats.displayed,stats.refreshes,stats.presents>stats.displayed?stats.presents-stats.displayed:0,stats.refreshes>stats.displayed?stats.refreshes-stats.displayed:0,sink_.xess()?"XeSS":sink_.fsr()?"FSR":"DXGI"));
+ if(stats.supported)veyra::log::info("display-stats",std::format("refreshHz={:.3f} presentCalls={} dxgiPresentCount={} refreshes={} presentRefreshDelta={} backend={} (DXGI GetFrameStatistics delta over ~1s. These counters CANNOT tell how many frames the panel actually showed: with vsync off and tearing allowed, dxgiPresentCount tracks completed Present calls, and both refresh counters just advance with the monitor. Measuring scanout needs PresentMon. XeSS/FSR generated presents are provider-internal.)",sink_.displayRefreshHz(),stats.presents,stats.displayed,stats.refreshes,stats.displayedRefresh,sink_.xess()?"XeSS":sink_.fsr()?"FSR":"DXGI"));
else if(FAILED(stats.result))veyra::log::info("display-stats",std::format("unavailable hr=0x{:X} backend={}",unsigned(stats.result),sink_.xess()?"XeSS":sink_.fsr()?"FSR":"DXGI"));
const auto& timing=sink_.lastPresentTiming();
veyra::log::info("present-cost",std::format("generated={} totalMs={:.3f} recordSubmitMs={:.3f} slotWaitMs={:.3f} dxgiMs={:.3f} slow={} source={} epoch={} backend={} resized={} resizeMs={:.3f} beginMs={:.3f} commandsMs={:.3f} beforeMs={:.3f} presentCallMs={:.3f} bufferMs={:.3f} afterMs={:.3f} hr=0x{:X}",generated,
diff --git a/src/gfx/PresentSink.cpp b/src/gfx/PresentSink.cpp
index dffc36da..a5715634 100644
--- a/src/gfx/PresentSink.cpp
+++ b/src/gfx/PresentSink.cpp
@@ -447,11 +447,18 @@ PresentSink::FrameStatisticsDelta PresentSink::sampleFrameStatistics(){
if(frameStatisticsBaseValid_){
delta.supported=true;
delta.presents=presentCount_-frameStatisticsBasePresents_;
- delta.displayed=uint64_t(stats.PresentRefreshCount-frameStatisticsBasePresentRefresh_);
+ // PresentCount is the one that counts frames the display actually
+ // showed. PresentRefreshCount is a vblank index: its delta is just the
+ // refresh count, so using it as "displayed" made every configuration
+ // look like it displayed exactly refreshHz frames and made
+ // refreshes-displayed structurally zero (bug found 2026-09-22).
+ delta.displayed=uint64_t(stats.PresentCount-frameStatisticsBaseDisplayed_);
+ delta.displayedRefresh=uint64_t(stats.PresentRefreshCount-frameStatisticsBasePresentRefresh_);
delta.refreshes=uint64_t(stats.SyncRefreshCount-frameStatisticsBaseSyncRefresh_);
}
frameStatisticsBaseValid_=true;
frameStatisticsBasePresents_=presentCount_;
+ frameStatisticsBaseDisplayed_=stats.PresentCount;
frameStatisticsBasePresentRefresh_=stats.PresentRefreshCount;
frameStatisticsBaseSyncRefresh_=stats.SyncRefreshCount;
return delta;