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: reject unchecked duplicate predictions with transient-frame counterexample

Veyra Goal Agentf2eb0d4a472a
diff --git a/docs/PERF_1C_CADENCE_REJECTION_2026-10-04.md b/docs/PERF_1C_CADENCE_REJECTION_2026-10-04.md
new file mode 100644
index 00000000..432bedf0
--- /dev/null
+++ b/docs/PERF_1C_CADENCE_REJECTION_2026-10-04.md
@@ -0,0 +1,25 @@
+# 1c 重复帧节奏预测:正确性反例与拒绝记录
+
+## 结论
+
+拒绝原方案“预测为重复时不比较直接复用、每8帧验证”的产品实现。已知节奏不能证明未检查的一帧像素没有变化;漏掉的一帧可在下一帧自行消失,之后的抽查没有足够信息恢复它。无法同时满足“节奏打破1帧内退出”和“输出逐帧一致”。此结论不依赖GPU速度或NR模型。
+
+本节点没有修改产品路径,因此没有需撤销的产品代码。保留现有行为、测试与拒绝存档;1a继续评估精确比较,允许原版Magpie的安全动态策略:省略比较时完整处理该帧。该安全策略不能称为预测重复帧跳过。
+
+## 可复现证据
+
+命令:`py -3.11 -B tests/perf/CadencePredictionCounterexample.py E:/项目/Veyra/logs/perf-nr-20261004/1c-counterexample-v1/result.json`,exit0。
+
+模拟使用作者生成的16×16 RGBA帧与identity处理器,并预先给候选准确节奏,排除“学习不足”的借口。第49帧是未抽查的预测重复位;仅改(9,7)像素R,下一帧恢复正常源内容。参照处理器输出所有源帧,候选盲复用上一帧。
+
+| 节奏 | 输入帧数 | 候选不同帧 | 抽查检测错误 | 精确比较不同帧 |
+|---|---:|---|---:|---:|
+| 30-in-60 | 160 | 第49帧 | 0 | 0 |
+| 24-in-60,整帧2:3重复 | 160 | 第49帧 | 0 | 0 |
+| 40-in-120 | 160 | 第49帧 | 0 | 0 |
+
+完整规则、assert和源SHA在测试及JSON中。这是正确性反例,未执行真实播放器/GPU,不记录虚构性能收益;整帧2:3重复不是交错场telecine。
+
+## 对抗审查
+
+提高抽查频率仍会留下未检查的帧;让抽查间隔变成1才退化为精确比较。用上一帧统计或游戏帧率无法证明当前帧未出现字幕、HUD、瞬时闪光或细节变化。保留PTS和输出帧数也不能修复被替换的像素内容。后续不得用“校验误判率0”证明未校验帧正确。
diff --git a/docs/PERF_EXECUTION_NR_2026-10-04.md b/docs/PERF_EXECUTION_NR_2026-10-04.md
index c38a022c..fd5011f3 100644
--- a/docs/PERF_EXECUTION_NR_2026-10-04.md
+++ b/docs/PERF_EXECUTION_NR_2026-10-04.md
@@ -37,7 +37,7 @@
| 2b | 后台建图与帧边界切换 | pending | 取决于E2,不移除必要同步 |
| 3b | NR自动内部尺寸 | pending | 取决于E1、真实预算/画质证据 |
| 1b | 内容帧率预算 | pending | 精确去重统计与自动档联动 |
-| 1c | 重复节奏预测 | pending | 先测不比较帧导致漏帧的反例;不以牺牲正确性换性能 |
+| 1c | 重复节奏预测 | rejected | 三种节奏单像素瞬态反例均漏第49帧且后续未检测;PERF_1C_CADENCE_REJECTION;无产品代码需回退 |
| 3c | 队列分工/呈现优先级 | pending | 先测HIGH呈现与compute list兼容性 |
| 5b | 文件/导出跨帧并行 | pending | 保留源帧/PTS/flow依赖,不扩大实时延迟 |
| 4a | 多NR整链低分辨率调度 | pending | 保留每层残差参数;先测同尺寸与一致性 |
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 8f9d7144..94cf6ebb 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,10 @@
# Veyra 工作记录
+## 2026-10-04 NR优化1c:盲预测重复帧拒绝存档
+
+- 节点before标签checkpoint/perf-nr-1c-before-20261004,产品源码仍8cdc。`py -3.11 -B tests/perf/CadencePredictionCounterexample.py E:/项目/Veyra/logs/perf-nr-20261004/1c-counterexample-v1/result.json` exit0:准确已知30-in-60/24-in-60整帧2:3/40-in-120节奏,第49未抽查的重复位只改一个像素,候选三组都替换错这一帧,后续检测错误0;精确比较输出均0不同帧。
+- 证明每8帧抽查无法保证未检查帧,违反方案1帧恢复与逐帧一致验收;拒绝产品接入,保留原行为与反例证据,未写入不安全产品候选,因此没有产品改动需revert。1a精确比较及“跳过比较时仍完整处理”的安全动态策略继续。结论文档PERF_1C_CADENCE_REJECTION_2026-10-04.md,不将CPU证明冒充GPU性能数据。
+
## 2026-10-04 NR优化:文档归档与优化前真实GPU基线进行中
- 文档对齐commit37bc0c090918566f7ebebc9f5edb24ba60c5f5a3,checkpoint/perf-nr-initial-docs-20261004;initial-docs/source.bundle verify成功,SHA34d888b290e094b4f3b9d7dd3aa01d6b34c5a568fe722ef3e18327f3e207e0fd,patch/commit/parent receipt在本轮archives。起点8cdc产品不变,原桌面/main保护guard持续通过。
diff --git a/tests/perf/CadencePredictionCounterexample.py b/tests/perf/CadencePredictionCounterexample.py
new file mode 100644
index 00000000..6c58f99b
--- /dev/null
+++ b/tests/perf/CadencePredictionCounterexample.py
@@ -0,0 +1,91 @@
+"""Adversarial proof for plan 1c, independent of GPU/model performance.
+
+Even a perfect learned cadence cannot identify a transient change on a frame
+whose pixels it never inspects. An identity enhancer makes lost source content
+observable without attributing this simulation to the product or NR runtime.
+"""
+from pathlib import Path
+import hashlib
+import json
+import sys
+
+
+def frame(content_id):
+ # Authored 16x16 RGBA image, including an actual changed source pixel.
+ return bytes((content_id % 251, 37, 89, 255)) * 256
+
+
+def cadence_frames(cadence, count=160):
+ sequence = []
+ content_id = -1
+ for index in range(count):
+ if cadence[index % len(cadence)]:
+ content_id += 1
+ sequence.append(frame(content_id))
+ return sequence
+
+
+def plan_prediction(sequence, cadence, start=32, verify_every=8):
+ """Optimistic candidate: already knows the exact transport cadence.
+
+ Inspect all new slots and every eighth slot; otherwise reuse blindly.
+ The verification detects an unexpected different pixel on a predicted
+ duplicate *only when that slot was inspected*. The identity enhancer
+ processes all accepted frames exactly, so it introduces no image noise.
+ """
+ output, last, missed, detected = [], None, [], []
+ for index, pixels in enumerate(sequence):
+ expected_new = cadence[index % len(cadence)]
+ inspected = index < start or expected_new or index % verify_every == 0
+ if inspected:
+ if not expected_new and pixels != last and index >= start:
+ detected.append(index)
+ last = pixels
+ elif pixels != last:
+ missed.append(index)
+ output.append(last)
+ return output, missed, detected
+
+
+def case(name, cadence):
+ pristine = cadence_frames(cadence)
+ normal, missed, detected = plan_prediction(pristine, cadence)
+ assert normal == pristine and not missed and not detected
+ attack = next(i for i in range(49, 90)
+ if not cadence[i % len(cadence)] and i % 8 != 0)
+ altered = pristine.copy()
+ changed = bytearray(altered[attack])
+ changed[(7 * 16 + 9) * 4] ^= 0x80
+ altered[attack] = bytes(changed)
+ candidate, missed, detected = plan_prediction(altered, cadence)
+ unequal = [i for i, (a, b) in enumerate(zip(candidate, altered)) if a != b]
+ assert attack in missed and attack in unequal and attack not in detected
+ # Exact comparison accepts this distinct frame; no source pixels vanish.
+ exact, last, reused = [], None, 0
+ for pixels in altered:
+ if pixels == last:
+ reused += 1
+ else:
+ last = pixels
+ exact.append(last)
+ assert exact == altered
+ return {'case': name, 'cadence': list(cadence), 'frameCount': len(altered),
+ 'singlePixelTransientFrame': attack, 'candidateDifferentFrames': unequal,
+ 'uninspectedChangedFrames': missed, 'detectedPredictionErrors': detected,
+ 'recoveryWithinOneFrame': False,
+ 'exactComparisonDifferentFrames': 0, 'exactReuseFrames': reused,
+ 'sourceSha256': hashlib.sha256(b''.join(altered)).hexdigest()}
+
+
+if __name__ == '__main__':
+ path = Path(sys.argv[1])
+ path.parent.mkdir(parents=True, exist_ok=True)
+ results = [case('30-in-60', (True, False)),
+ case('24-in-60 whole-frame 2:3 repeat', (True, False, True, False, False)),
+ case('40-in-120', (True, False, False))]
+ receipt = {'purpose': 'Correctness counterexample; no real-player/GPU performance claim',
+ 'candidateRule': 'Blind reuse of predicted duplicates; verify every 8 slots',
+ 'passed': True, 'rejectPlan1c': True, 'cases': results}
+ with path.open('x', encoding='utf-8') as out:
+ json.dump(receipt, out, ensure_ascii=False, indent=2)
+ print(json.dumps(receipt, ensure_ascii=False))