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

test(vfg): record matched playback and GPU export regressions

Veyra Goal Agente18942096bb6
diff --git a/docs/VFG_NEXT_REPORT_2026-10-07.md b/docs/VFG_NEXT_REPORT_2026-10-07.md
new file mode 100644
index 00000000..9a949cee
--- /dev/null
+++ b/docs/VFG_NEXT_REPORT_2026-10-07.md
@@ -0,0 +1,70 @@
+# VFG 继续优化:调度成本与严重过载恢复
+
+状态:本机VFG定向验收通过;本地候选 `2.0.6-vfg-next`。正式 2.0.6、main 及其它工作树保持原状。最终包审计和 ZIP 冷启动以 `E:/项目/Veyra/verify/vfg-next-20261007/final-check.json` 为准。
+
+这轮保留两项 VFG 文件播放调度修正:降档组按实际的一次插帧估算排队成本;完整组成本过期后,严重过载场景保留有依据的估计,减少盲目重试。高档 3X 的软件提交帧率有所提高;严重超预算的高档 8X 请求能更持续地输出既有 2X 回退,但仍有重测迟到,不能算实现了完整 8X。
+
+## 条件与统计方法
+
+- RTX 5070 / 12GB,驱动 616.56;GPU 优先级 requested=2、actual=2(普通),呈现队列优先级 0。
+- 原片 `E:/Ai/知识/小七姐/GTAVI_An_Extended_Look_4K_Native.mp4`,4K30;原片身份沿用已核验 SHA256 `93db61292353f19aaf6bfa2fbd3a094d1140300785ab2d93b0c06aa7881f8b3f`,大小 14115273308 字节,mtimeNs 1789034773254693400。
+- 原版 NVIDIA NR,单层内部 1920×1080、强度 1、风格 0、零运动;自动画面调控/SR/HDR/调色关闭。VFG 输入和输出仍为原生 3840×2160。
+- 同一候选 EXE,独立配置,窗口 1280×800、Auto 同步、输出限帧关闭。5 秒预热后观察 20 或 40 秒;GPU 测试串行,性能观察期间没有构建或竞争 GPU 负载。
+- 帧率是每秒软件 Present 读数的中位数,不是平均帧率、物理扫描输出或端到端延迟。过期插帧、预览跳源按观察段 `player-timing` 累计量的首尾差统计;这不包括预热阶段。
+- 对照开关仅对测试子进程设置:`VEYRA_TEST_VFG_FULL_REDUCED_QUEUE_COST=1` 恢复旧排队估算,`VEYRA_TEST_VFG_NO_OVERLOAD_ESTIMATE=1` 关闭新严重过载保护。无用户设置或驱动修改。
+
+## 最终同 EXE 对照
+
+最终 EXE SHA256:`c007c7fc9072a6114eb2479b1880b65f5386a5fd445e6c58513faf3c1328a2b2`。生产代码提交 `ba38f7e`;后续只整理验收脚本及文档,最终构建/归档提交见包清单。
+
+| 档位 / 请求倍率 | 观察 | 旧策略提交 FPS | 新策略提交 FPS | 观察段过期插帧:旧→新 | 观察段预览跳源:旧→新 |
+| --- | --- | ---: | ---: | ---: | ---: |
+| 高 / 3X | 20 秒 | 70 | 74 | 4→7 | 0→0 |
+| 高 / 8X | 40 秒 | 37 | 60 | 215→38 | 36→16 |
+| 中 / 8X | 20 秒 | 209 | 216 | 10→6 | 0→0 |
+| 中 / 7X,先旧后新 | 40 秒 | 200 | 210 | 10→2 | 0→0 |
+| 中 / 7X,先新后旧 | 40 秒 | 200 | 202.5 | 19→20 | 0→0 |
+
+高档 3X 最终对照约 +5.7%;前面相邻对照 69→73、69→74.5、69→75,增幅约 5.8%–8.7%。主要减少无效预热:最终整轮 `fgWarmup` 从 144 降到 2,整轮有效生成帧送显从 1012 增至 1095。这两个整轮计数包含预热,不能混用为表格观察段数据。最终高档 3X 的过期数稍增,不能声称所有迟到指标都下降。
+
+中档 8X 两轮分别 208.5→216、209→216,约 +3.4%–3.6%,模型 FG 耗时没有明显下降。中档 7X 短测曾出现 210→200,随后两组加长并交换顺序没有重复下降;这个档位波动较大,不给出确定提升承诺。
+
+高档 8X 请求中,大部分输入对仍降档为 2X:30fps 源约输出 60fps,不是 240fps。最终 40 秒对照中,过期插帧减少约 82.3%、预览跳源减少约 55.6%;软件呈现入口绝对偏差 P95 的窗口中位数从 33.083ms 到 0.521ms。这是软件时序偏差,不能换算成屏幕延迟降低。30 秒重新测量仍可能造成一次迟到及跳源,未消除全部卡顿。
+
+最终普通负载锚点:低档 8X=240fps,中档 4X=120fps,高档 2X=60fps;观察段预览跳源均 0。低 8X / 中 4X / 高 2X 过期插帧分别 3 / 1 / 0。
+
+## 两处原因及实现
+
+1. `pendingCompletions` 把已经降为 2X、只执行一次插帧的 VFG 组,仍按所请求的完整倍率计费。现在用 base + 实测 Fg1 GPU P95,并以原完整估算为上界。测量缺失、非法、多次执行或历史预热保持原估计;只作用于 VFG。
+2. 完整 FG 成本两秒过期后,原预算退回 base。高档 8X 一整组 FG 约 115ms,而源间隔约 33.3ms;成本缺失反复触发整组重试,造成迟到、丢弃和历史恢复。新 VFG 专用估计只在完整成本缺失、非预热且整组估计超过两源间隔时额外否决;以当前首张 GPU 时间修正保留比例,不伪造新 GPU 测量。首张比参考快超过 20% 时不再额外拦截;原始 admission 仍须通过。
+
+源/history/settings reset 清空该关系;新的完整组实测更新关系。为防止后续插帧一次异常而第一张不变造成永久降档,每 30 秒最多预约一次完整重测,且必须通过原 admission;提交前预约,防止多个异步组一起重试。没有修改截止时间、宽限、模型、分辨率、着色器、共享 `FgRecoveryBudget` 或其它补帧后端。
+
+高档 8X 的性能球在降档后反映实际 2X 工作;它显示有余量,并不代表剩余时间能容纳七次高档推理。这轮改善调度和无效工作,没有使 NVIDIA 模型本身推理变快。
+
+## 撤回的尝试与对抗式复查
+
+- 同一输入对只做一次 producer 依赖的实验,同 EXE 高 3X=68/68.5、中 8X=210/210、中 6X=180/180fps,无可确认收益。`VfgBackend.cpp` 已恢复正式基线原字节;实验提交 `ff8fdf4` 和 `tests/vfg-next-20261007/bin/producer-v1` 留证。
+- 本地 SDK 1.3 在正确创建 CUDA context 后,`CudaGraph` Get/Set 均返回 -5,未启用 CUDA 图。[官方参数说明](https://docs.nvidia.com/maxine/vfx/latest/API/Reference/TypeDefinitions.html)说明该能力依赖具体效果;[VFG 官方接口](https://docs.nvidia.com/maxine/vfx/latest/Filters/VideoFrameGeneration.html)仍按每次调用生成一张输出使用。没有下载或替换 SDK。
+- 初版严重过载估计在 20/40 秒得到 60fps、过期和跳源均 0,但缺少低频恢复探测,可能被一次异常成本长期锁住,未交付该版。最终加入 30 秒重测后重新跑全部主对照;不拿初版 0 迟到的结果冒充最终版。
+
+## 验收与证据
+
+- `overload-v2` 构建成功;VFG 设置、预算边界、未知测量、reset 与限频探测:353 检查,0 失败。
+- `final-matrix.json`:13 个最终普通播放案例,均正常退出、增强持续开启、配置未回滚、无错误;3 个质量档均覆盖。
+- `final-native-720-sync`、`final-native-720-async`、`final-native-4k-async`:各 1033 检查,0 失败,8/10-bit、3 质量×2X–8X、切镜、相同地址更新、反向 parity、中途索引、重复槽及无 CPU 排空更新通过。各 42 组/168 张输出的逐像素哈希与对应基线一致;720p 两条与本轮正式 2.0.6 基线比较,4K 与此前已核验同模型/实现的 4K 记录比较。4K 测试 117.937 秒。
+- `final-lifecycle`:实际 GUI 2X–8X/三质量热切换、VFG 8X↔DLSS 6X、暂停/seek/resize、全屏往返、列表/节点预设及重启、缺库回退、注入 Run 失败禁用增强并继续基础播放;四进程均通过。导出 worker 冻结的高档 8X 作业生成 64 帧、240fps。
+- `final-exports`:21 个 720p 三质量×七倍率、一个原生 4K NR+VFG 4X、取消及缺库边界,共 24 例通过;22 个成功导出均核对 HEVC、8×倍率帧数、严格递增 CFR PTS 与时长,使用实际共享图/D3D12 NVENC。4K NR+VFG4 为 8 源帧、21 插帧、3 首帧 hold、32 编码帧;不把 hold 当新增有效插帧。
+- `measurements.json` 核验全部 587 项编译输入、生产差异仅 EngineController 与两个 VFG 预算头文件;`VfgBackend`、DLSS/XeSS/FSR、NR、shader/QML/CMake 保持基线。默认 SDK/DLL/模型原字节,源码 Git 无新增运行组件。
+
+所有证据位于 `E:/项目/Veyra/logs/vfg-next-20261007` 和 `E:/项目/Veyra/verify/vfg-next-20261007`;源码位于 `E:/项目/Veyra/worktrees/vfg-next-20261007`。原始日志与失败回执保留,未声称独立 Reviewer 验收。
+
+初次构建曾指定不存在的 settings target;首次能力探针未建 CUDA context;两例日志解析遗漏 P95 数字;unit 首次命令预建目标目录导致参数契约 exit2;首版 Low8 与重编重叠且后续 Medium4 触发 EXE SHA 断言。这些均已记录 WORKLOG,保留失败且用最终串行案例重新验证。
+
+## 本地复测与边界
+
+完整 NVIDIA 本地候选位于 `E:/项目/Veyra/test-packages/vfg-next-20261007/Veyra-2.0.6-VFG-next-NVIDIA-win64-portable.zip`,对应源码和 SHA256SUMS 同目录。解压后运行 `veyra_qml_ui.exe`,用原 GTA 视频、单层原版 1080NR、GPU 普通优先级测试高档 3X / 中档 8X;需要原生高档 8X 时仍须更充裕的 GPU 预算。
+
+该包以正式 2.0.6 独立复制,只更换 EXE,增加本说明与新包清单;QML/着色器/运行组件及许可证原字节保留。ZIP 冷启动使用独立 E 盘配置、只保留系统 PATH,核验实际加载的 Qt/codec 来自解压包;完成结果以 `final-check.json` 为准。
+
+本轮是本机短测;其它 GPU、真实采集/串流、HDR 内容与长时间稳定性不由这些数据代替。NVIDIA 显存持续增长未在本轮排查或宣称修复。main 合并、推送、正式发布及关机均未执行。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 083cf6a5..c2cf9904 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,13 @@
# WORKLOG
+## 2026-10-07 VFG继续优化定向验收
+
+- 最终C007同EXE串行13例(final-matrix):High3旧70→74fps,观察过期4→7/跳源0→0;High8四十秒旧37→60fps、过期215→38(-82.3%)/跳源36→16(-55.6%),仍多数为2X且30秒重测造成一次迟到,不是240fps。Medium8旧209→216,Medium7四十秒先旧后新200→210、反序200→202.5;短窗210→200未重复,不宣称中档7稳定收益。低8/中4/高2=240/120/60,观察跳源0。软件Present中位数,不是物理显示或端到端延迟。
+- vfg-next-regression.py:720同步/异步、4K异步各1033检查0失败,4K117.937秒;三套各42组/168图像素哈希分别与对应基线一致(4K基线为已核验旧同模型日志)。GUI四阶段56.625/4.203/7.937/5.484秒通过全部倍率/质量、VFG↔DLSS6、暂停/seek/resize/全屏、列表节点预设/重启、缺库及注入失败回退;导出worker64帧240fps冻结设置正确。
+- final-exports:24例通过,21个720p质量×倍率、原生4K NR+VFG4及取消/缺库;22成功例核对HEVC/完整帧数/单调CFR PTS/时长,实际共享图与D3D12 NVENC,4K为8源/21生成/3首帧hold/32编码,不把hold当有效插帧。
+- vfg-next-results.py通过,verify/vfg-next-20261007/measurements.json记录587编译输入哈希及原始回执hash;生产差异仅EngineController与VfgQueueBudget/VfgOverloadEstimate,VfgBackend恢复基线、其它后端/NR/shader/QML/CMake冻结。353设置检查通过;报告docs/VFG_NEXT_REPORT_2026-10-07.md含正反结果和恢复探测的代价。
+- 后续仅同内容最终构建、完整本地NVIDIA包/对应源码、全文件/PE闭包/最终ZIP冷启与任务缓存清理。原正式包及34工作树/3691原件保护继续通过。没有新main合并、推送、发布或关机。
+
## 2026-10-07 VFG第三节点:严重过载及恢复边界
- 第二节点矩阵11例完成:High4旧68→72,Medium8旧208.5→216、Medium7旧201→204.5;High8仍42.5→44fps/过期103→92/跳源17→14。Medium7另一对210→200、过期2→16,不能宣称该档无回归,最终版加长并反向顺序复测。全程GTA4K30/原版1080NR/普通GPU/原模型,提交FPS只表示软件Present。
diff --git a/scripts/acceptance/vfg-next-close.py b/scripts/acceptance/vfg-next-close.py
new file mode 100644
index 00000000..0de513ea
--- /dev/null
+++ b/scripts/acceptance/vfg-next-close.py
@@ -0,0 +1,65 @@
+"""Close the local candidate with source/ZIP evidence and safe task-only cleanup."""
+from pathlib import Path
+import ast,hashlib,json,re,shutil,subprocess,sys,zipfile,psutil
+ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='vfg-next-20261007';VERIFY=BASE/'verify'/TASK;LOG=BASE/'logs'/TASK
+def read(p):return json.loads(p.read_text(encoding='utf-8-sig'))
+def sha(p):
+ with Path(p).open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
+def git(*args):return subprocess.check_output(['git',*args],cwd=ROOT,encoding='utf8').strip()
+subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/vfg-next-control.py')],cwd=ROOT,check=True)
+assert not any(p.info['name'].lower() in ('veyra.exe','veyra_qml_ui.exe','veyra_vfg_gpu_tests.exe','veyra_vfg_export_probe.exe') for p in psutil.process_iter(['name']))
+subprocess.run(['git','diff','--check'],cwd=ROOT,check=True);assert not git('status','--porcelain=v1')
+measure=read(VERIFY/'measurements.json');package=read(VERIFY/'candidate-package.json');cold=read(VERIFY/'candidate-cold.json');build=read(LOG/'candidate-final.json')
+assert measure['passed'] and cold['passed'] and build['exit']==0
+assert measure['exeSha256']==package['exeSha256']==cold['exeSha256']==sha(BASE/'build'/TASK/'veyra_qml_ui.exe')
+assert package['buildSource']==build['sourceHead']==git('rev-parse','HEAD')
+for path,digest in build['sourceFiles'].items():assert sha(ROOT/path)==digest,path
+assert not git('diff','--name-only',measure['productSourceCommit'],'HEAD','--','src','include','shaders','qml','CMakeLists.txt','tests')
+app=Path(package['app']);manifest=read(app/'package-manifest.json')
+assert manifest['localOnly'] and not manifest['releaseReady'] and manifest['displayVersion']=='2.0.6-vfg-next'
+assert sha(app/'package-manifest.json')==package['packageManifestSha256']
+for row in manifest['files']:assert sha(app/row['path'])==row['sha256'],row['path']
+assert {p.relative_to(app).as_posix() for p in app.rglob('*') if p.is_file()}=={r['path'] for r in manifest['files']}|{'package-manifest.json'}
+assert sha(ROOT/'docs/VFG_NEXT_REPORT_2026-10-07.md')==sha(app/'VFG-NEXT-NOTES.zh-CN.md')
+assert sha(Path(package['archive']))==package['archiveSha256']==cold['archiveSha256']
+with zipfile.ZipFile(package['archive']) as z:
+ assert z.testzip() is None
+ assert {i.filename for i in z.infolist()}=={app.name+'/'+r['path'] for r in manifest['files']}|{app.name+'/package-manifest.json'}
+ for row in manifest['files']:
+ assert z.getinfo(app.name+'/'+row['path']).file_size==row['size'],row['path']
+ with z.open(app.name+'/'+row['path']) as stream:assert hashlib.file_digest(stream,'sha256').hexdigest()==row['sha256'],row['path']
+source=Path(package['source']);assert sha(source)==package['sourceSha256']
+paths=list(build['sourceFiles']);assert all('\n' not in p for p in paths)
+objects=subprocess.run(['git','cat-file','--batch'],input=''.join(package['buildSource']+':'+p+'\n' for p in paths).encode('utf8'),cwd=ROOT,stdout=subprocess.PIPE,check=True).stdout
+committed={};offset=0
+for path in paths:
+ end=objects.index(b'\n',offset);header=objects[offset:end].split();assert len(header)==3 and header[1]==b'blob',path
+ size=int(header[2]);offset=end+1;committed[path]=objects[offset:offset+size];offset+=size+1
+assert offset==len(objects)
+with zipfile.ZipFile(source) as z:
+ assert z.testzip() is None
+ for path in paths:
+ archived=z.read('Veyra-vfg-next/'+path);blob=committed[path]
+ assert archived==blob or (b'\0' not in blob and archived.replace(b'\r\n',b'\n')==blob.replace(b'\r\n',b'\n')),path
+ for item in z.infolist():assert not re.search(r'\.(dll|lib|exe|pdb|onnx|f16|hsaco|cubin)$',item.filename,re.I),item.filename
+pythonFiles=list((ROOT/'scripts/acceptance').glob('vfg-next-*.py'))
+for path in pythonFiles:ast.parse(path.read_text(encoding='utf8'),filename=str(path))
+targets=[BASE/'tests'/TASK/'app',VERIFY/'candidate-extracted',BASE/'tmp'/TASK]
+cleanup=[]
+for path in targets:
+ # Validate absolute resolved targets before any recursive removal. No user
+ # data, published directories, build, source, test evidence or package is removed.
+ resolved=path.resolve();assert path.is_absolute() and resolved.is_relative_to(BASE.resolve()) and TASK in resolved.parts
+ assert resolved==path and not path.is_symlink(),str(path)
+ if path.exists():
+ files=[p for p in path.rglob('*') if p.is_file()];size=sum(p.stat().st_size for p in files)
+ cleanup.append({'path':str(path),'files':len(files),'bytes':size});shutil.rmtree(path)
+result={'passed':True,'head':git('rev-parse','HEAD'),'branch':git('branch','--show-current'),'productSourceCommit':measure['productSourceCommit'],
+ 'exeSha256':package['exeSha256'],'sourceSha256':package['sourceSha256'],'archiveSha256':package['archiveSha256'],'candidate':str(app),'archive':package['archive'],
+ 'compiledInputsVerified':len(build['sourceFiles']),'pythonSyntaxFiles':len(pythonFiles),'matrixCases':len(measure['matrix']),'native':measure['native'],'exportCases':measure['exportCases'],'lifecycle':measure['lifecycle'],
+ 'cold':cold,'unchangedApprovedRuntimeAndQml':True,'publishedAndOther34WorktreesPreserved':True,'noSdkOrRuntimeAddedToGit':True,'cleanup':cleanup,'removedBytes':sum(x['bytes'] for x in cleanup),
+ 'measurementReceiptSha256':sha(VERIFY/'measurements.json'),'packageManifestSha256':sha(app/'package-manifest.json'),'finalZipAllFilesAndCrcVerified':True,'sourceArchiveCompiledInputsVerified':True}
+(LOG/'cleanup.json').write_text(json.dumps(cleanup,ensure_ascii=False,indent=2),encoding='utf8')
+subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/vfg-next-control.py')],cwd=ROOT,check=True)
+(VERIFY/'final-check.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf8')
+print('VFG LOCAL FINAL AUDIT PASS',result['head'],len(manifest['files']),'payload files;',result['removedBytes'],'temporary bytes removed',flush=True)
diff --git a/scripts/acceptance/vfg-next-cold.py b/scripts/acceptance/vfg-next-cold.py
index 3dca8331..f34b31b9 100644
--- a/scripts/acceptance/vfg-next-cold.py
+++ b/scripts/acceptance/vfg-next-cold.py
@@ -27,7 +27,7 @@ verify_payload();assert sha(APP/'veyra_qml_ui.exe')==receipt['exeSha256']
subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/vfg-next-audit.py'),str(APP),'NVIDIA','candidate-zip-audit'],cwd=ROOT,check=True,timeout=90)
out,logs,tmp=(BASE/k/TASK/'candidate-cold' for k in ('tests','logs','tmp'))
for p in (out,logs,tmp):p.mkdir(parents=True,exist_ok=False)
-profile=out/'profile';shutil.copytree(BASE/'tests'/TASK/'overload-medium4/profile',profile)
+profile=out/'profile';shutil.copytree(BASE/'tests'/TASK/'final-medium4/profile',profile)
env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_'))}
windows=Path(env['WINDIR']);engine=logs/'engine.log';console=logs/'console.log'
env.update(TEMP=str(tmp),TMP=str(tmp),CUDA_CACHE_PATH=str(tmp/'cuda-cache'),VEYRA_LOG_FILE=str(engine),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1',PATH=os.pathsep.join(map(str,(windows/'System32',windows,windows/'System32/Wbem'))))
diff --git a/scripts/acceptance/vfg-next-exports.py b/scripts/acceptance/vfg-next-exports.py
index 31f3a53e..02cf44bc 100644
--- a/scripts/acceptance/vfg-next-exports.py
+++ b/scripts/acceptance/vfg-next-exports.py
@@ -1,6 +1,6 @@
"""Serial real graph/NVENC export checks, including frame counts and PTS."""
from pathlib import Path
-import argparse,json,os,re,shutil,subprocess,psutil
+import argparse,json,os,re,shutil,subprocess,time,psutil
ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='vfg-next-20261007';APP=BASE/'tests'/TASK/'app'
p=argparse.ArgumentParser();p.add_argument('label');a=p.parse_args();assert a.label.replace('-','').isalnum()
subprocess.run(['python','-B',str(ROOT/'scripts/acceptance/vfg-next-control.py')],cwd=ROOT,check=True)
@@ -14,6 +14,7 @@ env.update(TEMP=str(tmp),TMP=str(tmp),CUDA_CACHE_PATH=str(tmp/'cuda-cache'),VEYR
env['PATH']=os.pathsep.join((env['WINDIR']+'/System32',env['WINDIR'],env['WINDIR']+'/System32/Wbem'))
source=BASE/'tests/runtime-size-20261004/export-basic-v2/input.mp4';assert source.is_file();results=[]
def run(name,media,m,q,flags=(),expected='success'):
+ start=time.monotonic()
file=out/(name+'.mp4');child=env.copy()
if expected=='missing':child['VEYRA_VFG_RUNTIME']=str(tmp/'missing-runtime')
log=logs/(name+'.log');cmd=[str(APP/'veyra_vfg_export_probe.exe'),str(media),str(file),str(m),str(q),*flags]
@@ -42,6 +43,7 @@ def run(name,media,m,q,flags=(),expected='success'):
pts=[float(x['pts_time']) for x in packets];assert len(pts)==8*m and all(b>a and abs(b-a-1/(30*m))<=2*tick+1e-9 for a,b in zip(pts,pts[1:])),pts
if '--nr' in flags:assert 'nr=1' in text and (v['width'],v['height'])==(3840,2160),text[-5000:]
item.update(frames=8*m,probe=data,pts=pts)
+ item['seconds']=time.monotonic()-start;assert item['seconds']<300,item
results.append(item);(logs/'summary.json').write_text(json.dumps(results,ensure_ascii=False,indent=2),encoding='utf8');print('VFG EXPORT PASS',name,flush=True)
for quality in range(3):
for multiplier in range(2,9):run(f'720p30-quality{quality}-vfg{multiplier}',source,multiplier,quality)
diff --git a/scripts/acceptance/vfg-next-native.py b/scripts/acceptance/vfg-next-native.py
index 1ccb0329..5e9a4acf 100644
--- a/scripts/acceptance/vfg-next-native.py
+++ b/scripts/acceptance/vfg-next-native.py
@@ -21,4 +21,4 @@ with log.open('x',encoding='utf8') as f:
except subprocess.TimeoutExpired:rc=124
receipt={'command':cmd,'exit':rc,'seconds':time.monotonic()-start,'log':str(log)}
log.with_suffix('.json').write_text(json.dumps(receipt,ensure_ascii=False,indent=2),encoding='utf8')
-print(receipt);print('\n'.join(log.read_text(encoding='utf8',errors='replace').splitlines()[-15:]));raise SystemExit(rc)
+print(receipt);print('\n'.join(log.read_text(encoding='utf8',errors='replace').splitlines()[-15:]));subprocess.run(['python','-B',str(ROOT/'scripts/acceptance/vfg-next-control.py')],cwd=ROOT,check=True);raise SystemExit(rc)
diff --git a/scripts/acceptance/vfg-next-regression.py b/scripts/acceptance/vfg-next-regression.py
new file mode 100644
index 00000000..ab6dd7f3
--- /dev/null
+++ b/scripts/acceptance/vfg-next-regression.py
@@ -0,0 +1,23 @@
+"""Serial GPU correctness, lifecycle and offline-export regression of the final binary."""
+from pathlib import Path
+import hashlib,json,subprocess,sys,time
+ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='vfg-next-20261007'
+PACKAGE=BASE/'releases/release-2.0.6-20261007/packages/Veyra-2.0.6-NVIDIA-win64-portable';APP=BASE/'tests'/TASK/'app'
+def sha(p):
+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
+manifest=json.loads((PACKAGE/'package-manifest.json').read_text(encoding='utf8'))
+for row in manifest['files']:
+ if row['path']!='veyra_qml_ui.exe':assert sha(APP/row['path'])==row['sha256'],row['path']
+assert sha(APP/'veyra_qml_ui.exe')==sha(BASE/'build'/TASK/'veyra_qml_ui.exe')=='c007c7fc9072a6114eb2479b1880b65f5386a5fd445e6c58513faf3c1328a2b2'
+matrix=json.loads((BASE/'logs'/TASK/'final-matrix.json').read_text(encoding='utf8'));assert len(matrix)==13
+cases=[('native','final-native-720-sync',[],360),('native','final-native-720-async',['--async-submit'],360),
+ ('native','final-native-4k-async',['--width','3840','--height','2160','--async-submit'],360),
+ ('lifecycle','final-lifecycle',[],1200),('exports','final-exports',[],1200)]
+results=[]
+for script,label,flags,limit in cases:
+ start=time.monotonic();log=BASE/'logs'/TASK/(label+'-driver.log')
+ with log.open('xb') as stream:
+ rc=subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance'/('vfg-next-'+script+'.py')),label,*flags],cwd=ROOT,stdout=stream,stderr=subprocess.STDOUT,timeout=limit).returncode
+ results.append({'script':script,'label':label,'exit':rc,'suiteSeconds':time.monotonic()-start,'log':str(log)})
+ (BASE/'logs'/TASK/'regression.json').write_text(json.dumps(results,ensure_ascii=False,indent=2),encoding='utf8')
+ print(json.dumps(results[-1],ensure_ascii=False),flush=True);assert rc==0,(label,rc,str(log))
diff --git a/scripts/acceptance/vfg-next-results.py b/scripts/acceptance/vfg-next-results.py
new file mode 100644
index 00000000..a83daf37
--- /dev/null
+++ b/scripts/acceptance/vfg-next-results.py
@@ -0,0 +1,59 @@
+"""Collect final measurements and actual GPU/GUI/export evidence without changing logs."""
+from pathlib import Path
+import hashlib,json,re,subprocess,sys
+ROOT=Path(__file__).resolve().parents[2];BASE=Path('E:/项目/Veyra');TASK='vfg-next-20261007';LOG=BASE/'logs'/TASK;VERIFY=BASE/'verify'/TASK
+def read(p):return json.loads(p.read_text(encoding='utf-8-sig'))
+def sha(p):
+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
+def git(*args):return subprocess.check_output(['git',*args],cwd=ROOT,encoding='utf8').strip()
+subprocess.run([sys.executable,'-B',str(ROOT/'scripts/acceptance/vfg-next-control.py')],cwd=ROOT,check=True)
+expected='c007c7fc9072a6114eb2479b1880b65f5386a5fd445e6c58513faf3c1328a2b2'
+assert sha(BASE/'build'/TASK/'veyra_qml_ui.exe')==expected
+build=read(LOG/'overload-v2.json');assert build['exit']==0
+for path,digest in build['sourceFiles'].items():assert sha(ROOT/path)==digest,path
+products=set(git('diff','--name-only','96a7c8de','--','src','include','shaders','qml','CMakeLists.txt').splitlines())
+assert products=={'src/engine/EngineController.cpp','include/veyra/engine/VfgQueueBudget.h','include/veyra/engine/VfgOverloadEstimate.h'},products
+matrix=read(LOG/'final-matrix.json');assert len(matrix)==13
+for row in matrix:
+ data=read(LOG/row['label']/'result.json');assert data['passed'] and not data['errors'] and data['exeSha256']==expected
+ assert any('requested=2 actual=2' in x for x in data['normalSchedulingClass'])
+ samples=read(LOG/row['label']/'samples.json')
+ assert all(s['nr'] and s['fg'] and s['backend']=='vfg' and s['cap']==0 and not s['strict'] for s in samples)
+ assert all(s['multiplier']==row['multiplier'] and s['quality']==row['quality'] for s in samples)
+ row.update(receiptSha256=sha(LOG/row['label']/'result.json'),rawLogSha256=sha(LOG/row['label']/'player.log'))
+by={x['label']:x for x in matrix}
+assert by['final-high3']['fps']>by['final-control-high3']['fps']
+assert by['final-high8']['fps']>by['final-control-high8']['fps'] and by['final-high8']['timing']['expiredGenerated']<by['final-control-high8']['timing']['expiredGenerated']
+assert by['final-high8']['timing']['previewSkipped']<by['final-control-high8']['timing']['previewSkipped']
+for label,target in [('final-low8',240),('final-medium4',120),('final-high2',60)]:assert by[label]['fps']>=target*.97
+native=[]
+def pixels(path):
+ text=path.read_text(encoding='utf8',errors='replace');values={}
+ for line in text.splitlines():
+ m=re.match(r'VFG format=(\d+) size=(\d+)x(\d+) quality=(\d+) multiplier=(\d+).* hashes=([0-9a-f,]+)',line)
+ if m:
+ key=tuple(int(x) for x in m.groups()[:5]);hashes=m.group(6).strip(',').split(',');assert len(hashes)==key[4]-1
+ values[key]=hashes
+ assert len(values)==42 and sum(map(len,values.values()))==168,path
+ return values
+golden=pixels(LOG/'baseline-native-720.log')
+for label in ('final-native-720-sync','final-native-720-async','final-native-4k-async'):
+ receipt=read(LOG/(label+'.json'));text=(LOG/(label+'.log')).read_text(encoding='utf8',errors='replace')
+ assert receipt['exit']==0 and receipt['seconds']<300 and 'Native GPU VFG: 1033 checks 0 failures.' in text,label
+ image=pixels(LOG/(label+'.log'))
+ if '720' in label:assert image==golden,label
+ else:assert image==pixels(BASE/'logs/vfg-optimization-20261007/async-native-4k-v2.log'),label
+ native.append({'label':label,'checks':1033,'seconds':receipt['seconds'],'pixelGroups':42,'pixelImages':168,'allPixelFingerprintsMatch':True,'rawLogSha256':sha(LOG/(label+'.log'))})
+lifecycle=read(LOG/'final-lifecycle/summary.json');assert len(lifecycle)==4 and all(x['passed'] and x['seconds']<300 for x in lifecycle)
+exports=read(LOG/'final-exports/summary.json');assert len(exports)==24 and all(x['seconds']<300 for x in exports)
+assert sum(x['expected']=='success' for x in exports)==22
+assert 'VFG settings 353 checks, 0 failures' in (LOG/'overload-v2-settings.log').read_text(encoding='utf8')
+assert '[vfg-overload-probe]' in (LOG/'final-high8/player.log').read_text(encoding='utf8',errors='replace')
+result={'passed':True,'productSourceCommit':git('rev-parse','ba38f7e'),'exeSha256':expected,'compiledInputFiles':len(build['sourceFiles']),
+ 'compiledInputSha256':build['sourceFiles'],'productFiles':sorted(products),'settingsChecks':353,'matrix':matrix,'native':native,'lifecycle':lifecycle,
+ 'exportCases':len(exports),'exportSuccessCases':22,'exportBoundaryCases':['cancel','missing-runtime'],
+ 'method':'RTX5070; original GTA 4K30; original NR 1080p strength1; VFG native4K; normal requested/actual GPU priority2; 5s warmup; 20/40s observations; median 1Hz software Present FPS, not scanout or end-to-end latency',
+ 'knownLimits':['High8 remains a 2X fallback in most pairs; a 30s full probe can still be late','Medium7 has run-to-run variance; no consistent tier-wide gain is claimed','High3 expired counts vary; the final pair was 4 before and 7 after despite higher valid throughput','NVIDIA VRAM growth and other GPUs/real capture/streaming long stability were not evaluated here']}
+VERIFY.mkdir(parents=True,exist_ok=True);assert not (VERIFY/'measurements.json').exists()
+(VERIFY/'measurements.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf8')
+print('VFG FINAL MEASUREMENTS PASS',len(matrix),'preview cases;',len(native),'GPU suites;',len(exports),'export cases',flush=True)