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++

perf(export): enable measured two-frame NVENC pipeline with event waits

Veyra Goal Agent4fceda83ba5f
diff --git a/docs/PERF_5B_CROSS_FRAME_2026-10-05.md b/docs/PERF_5B_CROSS_FRAME_2026-10-05.md
index ff20e5ca..5659a8a4 100644
--- a/docs/PERF_5B_CROSS_FRAME_2026-10-05.md
+++ b/docs/PERF_5B_CROSS_FRAME_2026-10-05.md
@@ -45,3 +45,5 @@ build-export-baseline-v1 UI/probe构建成功,编译产品源码86e0458;只
`nr-export-edges.py B2d B5b-edges-v1`15/15通过(编译产品f94d0bc,EXE SHA256 `0bd9993fda49d55210456764e09a790ca12e5ce72c5617925b1bec9fb2975359`):单帧、双NR/NR+SR的debug层、DLSS2X保持串行、取消后无正式/owned partial、事件创建/注册错误回退、既有作者HDR720p/PQ/Main10导出。7组对照整个输出文件SHA相同;debug ERROR/CORRUPTION为0,removedReason=0。事件故障是逻辑注入ERROR_INVALID_HANDLE/E_FAIL,未制造真实内存不足、设备移除或GPU压力。
原始日志和收据在`E:/项目/Veyra/logs/perf-nr-20261004/B5b-edges-v1-summary/summary.json`及15个case目录;HDR源SHA256 `05827c1b08f27a84be2074435365289a82e21ae435f39f4891cc26d921128e2d`,它是既有作者测试媒体,不冒充自然HDR影片或全效果HDR验收。候选仍默认关闭,下一步仅将已测无FG/NVENC路径启为默认,并以显式B-off保护复测产品worker生命周期。
+
+默认提升候选:仅NVENC且无FG、无slow-frame hook默认使用两帧/事件;FG/MFT保持串行。`VEYRA_TEST_EXPORT_SERIAL=1`明确关闭两者,独立ASYNC/FENCE_EVENTS测试开关支持0/1,不把无ENV的默认版误记为串行。原baseline/四策略原始EXE及数据不改写。边界存档前首次guard因WORKLOG空白行含一个空格失败,提交后工作区检查不再覆盖该提交;本次明确移除空格并在promotion前检查整个分支diff,不将这次格式错误隐藏为首次通过。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index a5d7205f..97bfccac 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -8304,7 +8304,7 @@ B4a-native-v2 20/20通过、800 PNG及逐图SHA/PTS保留;debug/设备移除0
5b基线A-A完整1620 decoded帧及PTS/尺寸/轨道/时长15/15全同,8K实为7680×4320,收据B5b-serial-v2-decoded-review.json。新增默认关闭候选:两帧pending lease/producer/consumer fence严格有界、复用前GPU完成、NVENC独立inputFence;独立fence事件等待、失败回轮询、取消/健康/30秒保留。源码审查修正std::move(out)之后取real.lease的潜在空指针,改先保存consumerFence再move,未构建/执行有缺陷版本。两个机制分组计时,尚未标收益。
5b build-export-candidate-v1通过;60组普通同EXE串行/事件/两帧/组合三轮通过,payload全SHA保持,源帧/最终编码足量,maxInFlight1/2及真实NR数核实。组合总耗时普通4K降44.37%、单NR23.60%、双NR14.20%、NR+SR4K6.41%、SR8K3.91%;处理区间各降57.66/54.24/16.85/15.03/10.45%,明确不混算。完整75文件/8100decoded帧/PTS/尺寸/轨道/时长全同,连整个文件SHA也全同。E:/项目/Veyra/logs/perf-nr-20261004/B5b-candidate-v1-summary/comparison.json及B5b-candidate-v1-decoded-review.json。报表初读日志遇运行库非UTF8字节,errors=replace仅解析ASCII字段,raw未改。下一步仅必要debug/取消/单帧/FG串行/事件失败回退,不造GPU压力/设备重置;测试hook默认关闭。
-
+
## 2026-10-05 NR性能5b导出边界检查
`py -3.11 -B scripts/perf/nr-export-edges.py B2d B5b-edges-v1` exit0,15/15真实生产exportVideo通过,7对输出整个SHA一致。单帧、debug双NR/NR+SR、FG保持串行、取消清理、逻辑事件故障回退和既有HDR Main10通过;debug0/removed0。日志`E:/项目/Veyra/logs/perf-nr-20261004/B5b-edges-v1-summary/summary.json`。未运行压力或设备重置;5b的NVOF未来帧准备尚未完成,不把导出两帧在途冒充该部分。
diff --git a/scripts/perf/nr-export-edges.py b/scripts/perf/nr-export-edges.py
index 01510945..87fa1e8c 100644
--- a/scripts/perf/nr-export-edges.py
+++ b/scripts/perf/nr-export-edges.py
@@ -10,16 +10,17 @@ folder=BASE/'logs'/TASK/(label+'-summary');folder.mkdir(parents=True,exist_ok=Fa
payload={str(p.relative_to(app)):matrix.digest(p) for p in app.rglob('*') if p.is_file() and p.suffix.lower() in ('.exe','.dll','.qml')}
(folder/'artifacts.json').write_text(json.dumps(payload,ensure_ascii=False,indent=2),encoding='utf-8')
active={'VEYRA_TEST_EXPORT_ASYNC':'1','VEYRA_TEST_EXPORT_FENCE_EVENTS':'1'}
+serial={'VEYRA_TEST_EXPORT_SERIAL':'1'}
hdr=BASE/'tests/video-hdr-20260918/hdr-export.mp4'
-cases=[('single-off','none',1,{},False,None),('single-on','none',1,active,False,None),
- ('nr2-debug-off','nr2',24,{'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),('nr2-debug-on','nr2',24,{**active,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),
- ('nrsr-debug-off','nrsr4k',24,{'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),('nrsr-debug-on','nrsr4k',24,{**active,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),
- ('fg-off','fg2',40,{},False,None),('fg-on','fg2',40,active,False,None),
- ('cancel-off','nrsr4k',24,{},True,None),('cancel-on','nrsr4k',24,active,True,None),
- ('failure-reference','nr',32,{},False,None),
+cases=[('single-off','none',1,serial,False,None),('single-on','none',1,active,False,None),
+ ('nr2-debug-off','nr2',24,{**serial,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),('nr2-debug-on','nr2',24,{**active,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),
+ ('nrsr-debug-off','nrsr4k',24,{**serial,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),('nrsr-debug-on','nrsr4k',24,{**active,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,None),
+ ('fg-off','fg2',40,serial,False,None),('fg-on','fg2',40,active,False,None),
+ ('cancel-off','nrsr4k',24,serial,True,None),('cancel-on','nrsr4k',24,active,True,None),
+ ('failure-reference','nr',32,serial,False,None),
('event-create-failure','nr',32,{**active,'VEYRA_TEST_EXPORT_EVENT_CREATE_FAIL':'1'},False,None),
('event-register-failure','nr',32,{**active,'VEYRA_TEST_EXPORT_EVENT_REGISTER_FAIL':'1'},False,None),
- ('hdr-off','none',16,{'VEYRA_TEST_EXPORT_DEBUG':'1'},False,hdr),('hdr-on','none',16,{**active,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,hdr)]
+ ('hdr-off','none',16,{**serial,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,hdr),('hdr-on','none',16,{**active,'VEYRA_TEST_EXPORT_DEBUG':'1'},False,hdr)]
results=[]
for name,group,frames,flags,cancel,source in cases:
matrix.assert_gpu_tests_idle();source=source or matrix.SOURCES['M1'];run=label+'-'+name;out=BASE/'logs'/TASK/run;tmp=BASE/'tmp'/TASK/run
diff --git a/scripts/perf/nr-export-pipeline.py b/scripts/perf/nr-export-pipeline.py
index 6028cb43..11387b9a 100644
--- a/scripts/perf/nr-export-pipeline.py
+++ b/scripts/perf/nr-export-pipeline.py
@@ -4,7 +4,7 @@ import importlib.util,json,os,re,shutil,subprocess,sys,time
ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='perf-nr-20261004'
spec=importlib.util.spec_from_file_location('matrix',ROOT/'scripts/perf/nr-matrix.py');matrix=importlib.util.module_from_spec(spec);spec.loader.exec_module(matrix)
variant,label,mode=sys.argv[1:4];groups=sys.argv[4:] or ['none4k','nr','nr2','nrsr4k','sr8k']
-assert mode in ('serial','events','async','async-events','interleaved','all')
+assert mode in ('default','serial','events','async','async-events','interleaved','all')
assert all(g in ('none4k','nr','nr2','sr4k','nrsr4k','sr8k','fg2') for g in groups)
matrix.assert_gpu_tests_idle();app=BASE/'tests'/TASK/(label+'-app');assert not app.exists()
shutil.copytree(BASE/'test-packages'/TASK/'Veyra-2.0.3-perf-baseline-A-NVIDIA-win64-portable',app,copy_function=matrix.copy_dependency)
@@ -25,6 +25,9 @@ for group in groups:
for key in tuple(env):
if key.upper().startswith('VEYRA_'):env.pop(key)
env.update(TEMP=str(tmp),TMP=str(tmp))
+ if current=='serial':env['VEYRA_TEST_EXPORT_SERIAL']='1'
+ if current=='events':env['VEYRA_TEST_EXPORT_ASYNC']='0'
+ if current=='async':env['VEYRA_TEST_EXPORT_FENCE_EVENTS']='0'
if current in ('async','async-events'):env['VEYRA_TEST_EXPORT_ASYNC']='1'
if current in ('events','async-events'):env['VEYRA_TEST_EXPORT_FENCE_EVENTS']='1'
command=[str(exe),str(source),str(dest),config,str(frames),str(out)]
diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cpp
index 8a62d8cf..c75c9e79 100644
--- a/src/engine/VideoExportJob.cpp
+++ b/src/engine/VideoExportJob.cpp
@@ -220,11 +220,17 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOpti
int removeDeviceIndex=-1;
{wchar_t hook[16]{};if(resumeAttempt==0&&GetEnvironmentVariableW(L"VEYRA_TEST_EXPORT_REMOVE_DEVICE_AT",hook,16))removeDeviceIndex=_wtoi(hook);}
bool deviceLost=false;uint32_t removedReason=0;
- // Isolated 5b candidates. FG status still requires completed GPU readback;
- // NVENC receives the existing conversion fence, never an unready pixel read.
- const bool asyncNvenc=GetEnvironmentVariableW(L"VEYRA_TEST_EXPORT_ASYNC",nullptr,0)>0&&
- !options.fg&&encoder->backend()==sink::EncoderBackend::Nvenc&&slowFrameIndex<0;
- bool fenceEvents=GetEnvironmentVariableW(L"VEYRA_TEST_EXPORT_FENCE_EVENTS",nullptr,0)>0;
+ // Measured 5b default: bounded NVENC exports without generated-frame readback.
+ // Keep FG/MFT serial; NVENC retains the conversion input fence and its slots.
+ // Explicit test overrides preserve the serial and independent-component controls.
+ auto testFlag=[](const wchar_t* key,bool fallback){
+ wchar_t value[8]{};const DWORD n=GetEnvironmentVariableW(key,value,8);
+ return n&&n<8?_wtoi(value)!=0:fallback;
+ };
+ const bool serialOverride=testFlag(L"VEYRA_TEST_EXPORT_SERIAL",false);
+ const bool eligibleNvenc=!options.fg&&encoder->backend()==sink::EncoderBackend::Nvenc&&slowFrameIndex<0;
+ const bool asyncNvenc=!serialOverride&&eligibleNvenc&&testFlag(L"VEYRA_TEST_EXPORT_ASYNC",eligibleNvenc);
+ bool fenceEvents=!serialOverride&&testFlag(L"VEYRA_TEST_EXPORT_FENCE_EVENTS",eligibleNvenc);
if(fenceEvents){
const bool injected=GetEnvironmentVariableW(L"VEYRA_TEST_EXPORT_EVENT_CREATE_FAIL",nullptr,0)>0;
if(!injected)completionEvent.value=CreateEventW(nullptr,FALSE,FALSE,nullptr);