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: wait for actual GPU context before verifying priority experiments

Veyra Goal Agentcc8db0ffb800
diff --git a/docs/PERF_3A_GPU_PRIORITY_2026-10-04.md b/docs/PERF_3A_GPU_PRIORITY_2026-10-04.md
index a94effed..5c2a4e74 100644
--- a/docs/PERF_3A_GPU_PRIORITY_2026-10-04.md
+++ b/docs/PERF_3A_GPU_PRIORITY_2026-10-04.md
@@ -5,3 +5,8 @@
本轮拥有的竞争程序用实际产品Graph:M1首张自然输入、三层原生1080p NR/NVOF,源PTS/id继续推进,连续提交并等完成,30帧预热。完整NR求值数、设备/debug、每秒完成Graph吞吐CSV;此吞吐不是游戏或屏幕FPS。目标播放器M1/S3单NR+DLSS SR到4K,50秒;对方保持正常GPU优先级。三轮交错顺序Normal/High/Realtime、Realtime/Normal/High、High/Realtime/Normal;记录目标真实成功Present软件返回间隔P50/P95/P99/max、跳帧及GPU处理、对方同稳态时间窗吞吐、GPU频率/功耗/显存,避免只用播放器改善判断。
仅本轮竞争程序PID允许与播放器共存,其他测试/构建仍不得重叠;对方连续存活由句柄/退出码核验;各GPU进程最长120或270秒,driver不执行GPU命令。优先级只是提交调度改动,完整画面回归归入R0,不能用软件Present宣称物理显示节奏。结果待填。
+
+
+## v1无效与修正
+
+v1在Popen后立即调用Set/Get,进程GPU上下文尚未创建,三个档位均NTSTATUS 0xC000000D,applied=false。数据不用于收益。只读核验已运行的两个本轮GPU进程时Get均成功、实际class=2,确认需要等待WDDM进程记录就绪。v1保存三个完整组,第四个本轮竞争fixture收到stop标记后正常退出、driver在对方早停断言退出;未关闭用户进程。v2竞争方在LOAD_READY后设置并读回,播放器等待Get首次成功(30秒上限、全部失败状态保留)后才设置并立即读回,不能读回则数据直接判无效。
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 239727f3..66638139 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -8203,3 +8203,8 @@ release. 5090 live acceptance, 15-second hitch and user flicker remain unresolve
## 2026-10-04 PERF 1b 内容预算前提拒绝
开工checkpoint/perf-nr-1b-before-20261004 c593679。运行ContentBudgetCounterexample.py exit0,以封存M1/S4滚动P95成本21.192ms构造300输入调度反例:真实60Hz安全预算13.333ms,原内容30Hz预算26.667ms错误放行。1a实际4500全输出图像已证明不能逐字节复用NR/SR,完整求值次数未减少。拒绝内容预算翻倍,未加入生产代码;3b按真实处理输入帧间隔。JSON在E:/项目/Veyra/logs/perf-nr-20261004/1b-budget-counterexample-v1.json,明确是构造模型而非新增60Hz GPU实测,详见PERF_1B_CONTENT_BUDGET。
+
+
+## 2026-10-04 PERF 3a API时机反例
+
+build-priority-load-v1 2步exit0。本轮三NR竞争fixture SHA a46c2923ab4b7a200ad9028de442377d7b5e0214d473722be4dabb4681014e2b。nr-priority.py B5c 3a-competition-v1 的Set/Get全部0xC000000D/applied=false,不能作为Normal/High/Realtime比较。只读已运行的本轮两个GPU进程Get均0/class2;修正为实际GPU上下文就绪后设置,完整Get失败重试序列与最终读回记录。v1前三完整组证据保留,第四owned load经其stop文件正常停止,driver对方早停断言exit1;没有强关用户应用。下一轮3a-competition-v2重新交错九组。
diff --git a/scripts/perf/nr-matrix.py b/scripts/perf/nr-matrix.py
index 96c4ada2..b8feb518 100644
--- a/scripts/perf/nr-matrix.py
+++ b/scripts/perf/nr-matrix.py
@@ -76,9 +76,16 @@ def set_owned_gpu_priority(proc, priority):
set_value=gdi.D3DKMTSetProcessSchedulingPriorityClass
set_value.argtypes=[wintypes.HANDLE,ctypes.c_int];set_value.restype=wintypes.LONG
before=ctypes.c_int(-1);after=ctypes.c_int(-1)
- a=get(int(proc._handle),ctypes.byref(before));b=set_value(int(proc._handle),priority);c=get(int(proc._handle),ctypes.byref(after))
+ # WDDM has no scheduling record before the child creates its GPU device.
+ # Wait for the actual Get to succeed, retaining every failed status.
+ deadline=time.monotonic()+30;attempts=[]
+ while True:
+ a=get(int(proc._handle),ctypes.byref(before));attempts.append(hex(a&0xffffffff))
+ if a==0 or proc.poll() is not None or time.monotonic()>=deadline:break
+ time.sleep(.1)
+ b=set_value(int(proc._handle),priority);c=get(int(proc._handle),ctypes.byref(after))
return {'pid':proc.pid,'beforeStatus':hex(a&0xffffffff),'beforeClass':before.value,
- 'setStatus':hex(b&0xffffffff),'afterStatus':hex(c&0xffffffff),'afterClass':after.value,
+ 'setStatus':hex(b&0xffffffff),'afterStatus':hex(c&0xffffffff),'afterClass':after.value,'getAttempts':attempts,
'applied':a==b==c==0 and after.value==priority}
def stage(variant):
diff --git a/scripts/perf/nr-priority.py b/scripts/perf/nr-priority.py
index 400e3819..1856bbc1 100644
--- a/scripts/perf/nr-priority.py
+++ b/scripts/perf/nr-priority.py
@@ -42,12 +42,14 @@ for repeat,order in enumerate(orders,1):
print('LOAD_START',run_label,flush=True);started=time.monotonic()
with (out/'console.log').open('xb') as console:
load=subprocess.Popen(command,cwd=app,env=env,stdout=console,stderr=subprocess.STDOUT)
- priority=set_owned(load,2)
+ priority=None
try:
while time.monotonic()-started<40 and load.poll() is None:
if 'LOAD_READY' in (out/'console.log').read_text(encoding='utf-8',errors='replace'):break
time.sleep(.25)
assert load.poll() is None and 'LOAD_READY' in (out/'console.log').read_text(encoding='utf-8',errors='replace'),'competition load did not start'
+ priority=set_owned(load,2)
+ assert priority['applied'], 'Owned GPU load priority was not actually applied'
target_begin=time.monotonic()
matrix.run(variant,'M1','S3',run_label,50,gpuPriority=classes[name],allowedGpuPids=(load.pid,))
target_end=time.monotonic()
@@ -74,6 +76,7 @@ for repeat,order in enumerate(orders,1):
'presentIntervalsMs':{'p50':percentile(intervals,.5),'p95':percentile(intervals,.95),'p99':percentile(intervals,.99),'max':max(intervals),'count':len(intervals)},
'targetSummary':receipt['summary'],'loadRawLog':str(out),'targetRawLog':str(target),
'passed':receipt['passed'] and priority['applied'] and receipt['gpuPriority']['applied'],'measurement':'Actual successful Present software return intervals; load completed NR graphs; neither is display scanout'}
+ assert receipt['gpuPriority']['applied'], 'Player GPU priority was not actually applied; measurements invalid'
(out/'result.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf-8');results.append(result)
print('PRIORITY_RESULT',json.dumps({k:result[k] for k in ('label','targetPriority','loadCompletedFpsMedian','presentIntervalsMs','passed')},ensure_ascii=False),flush=True)
with (BASE/'logs'/TASK/(label+'-summary.json')).open('x',encoding='utf-8') as f:json.dump(results,f,ensure_ascii=False,indent=2)