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++
Add per-layer manual NR processing scale and diagnose FG logs
Veyra Goal Agentf7435560a4a0
diff --git a/AGENTS.md b/AGENTS.mdindex 17a265c7..9c923ad3 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,5 +1,7 @@# Veyra 项目 Agent 执行规则+> **2026-10-24 NR手动比例及日志排查(用户请求)**:从108c010在codex/nr-manual-scale-20261024实施每层NR内部手动百分比与条件滑条,按docs/NR_MANUAL_SCALE_PLAN_2026-10-24.md,仅扩展NR尺寸规划/既有参数桥接/共用QML滑条/翻译/必要合同测试与持久化兼容;这些新功能必要接点覆盖旧2.0.0 UI迁移冻结。不改FG预算/调度/采集/告警判定,用户指定调度降档只诊断。用户E:/App包/日志只读,私有测试不连真实主机或采集卡。单Agent,全E盘,复用当前同源构建-j2<=900秒/单测试<=300秒;不改专有运行文件/驱动/真实配置,无main合并/push/Release,Lecram暂停。+> **2026-10-23 依赖迁移与历史产物清理(用户明确授权)**:`C:\veyra-deps` 的149125个普通文件已逐文件SHA256核验并迁到 **`E:\项目\Veyra\deps\core`**,C盘旧实体已删除;`C:\veyra-deps` 仅为指向该E盘目录的 Junction,保留兼容旧脚本/CMake缓存,禁止删除此入口或重新在C盘建依赖实体。Qt实体仍为 `E:\项目\Veyra\deps\qt\6.8.3\msvc2022_64`,`deps\core\qt-veyra` 仅指向 `deps\qt`。新任务优先使用E盘实体路径;旧缓存不必为改路径强制全量重编译。共享路径清单 `E:\项目\Veyra\deps\DEPENDENCY_ROOTS.json`,共享规则 `E:\项目\Veyra\AGENTS.md`,证据 `E:\项目\Veyra\reports\dependency-migration-cleanup-20261023`。本条覆盖旧“C:\veyra-deps暂保留不迁移”的限制。历史测试/包按本轮清单清理;正式发布资产只保留2.0.7及以后(当前2.0.7/2.0.8/2.0.9/2.1.0),依GitHub资产SHA而非内部test文件名判定。当前未合入正式版的rot1交付单独保留;不删源码工作树/未提交改动/依赖模型/对应源码与必要验收记录。清理实际结果以该目录FINAL.json为准,不从计划推断已删除。不merge/push/发布,不继续Lecram。> **2026-10-23 画面旋转(Codex)**:用户要求极简/专业小按钮每次顺时针90°并适配UI。4eee190干净源码切codex/picture-rotation-20261023,起点标签checkpoint/pre-picture-rotation-20261023。按docs/PICTURE_ROTATION_PLAN_2026-10-23.md复用已有元数据呈现/坐标映射,允许必要PreviewView/EngineController/bridge/QML/翻译/定向测试接点,覆盖这些范围旧UI冻结;不继续Lecram或修改其它工作树。不改专有运行库/模型/驱动或真实配置,全E盘,复用同源构建限-j2≤900秒/单测试≤300秒,单Agent,无main合并/push/发布。diff --git a/docs/FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.md b/docs/FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.mdnew file mode 100644index 00000000..47afefe9--- /dev/null+++ b/docs/FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.md@@ -0,0 +1,41 @@+# 2026-10-24 用户日志:偶发“补帧调度降档”(仅诊断)++结论:这份日志**不足以把主因定为采集输入帧率不稳**。有两类明确证据:旧日志4K60+DLSS6X时NR约21ms、FG批次约9ms,预测整组约35ms,处理负载超过源帧间隔;最新主日志则多为平均输入稳定时的偶发处理/提交迟到,也有超过一秒的停顿。两类都会使补帧组无法满足当前期限而被拒绝。存在少量输入异常,但没有逐帧完整时序,不能据此断言每个尖峰的最底层原因。按用户要求,没有修复或调整补帧调度。++## 数据与对应实现++- 用户路径 `E:\App\Veyra-2.1.0-test-NVIDIA-win64-portable\logs`,四个日志只读快照保存 `E:\项目\Veyra\archives\nr-manual-scale-20261024\user-logs`,原始SHA见同任务 `user-log-hashes.json`。最新主日志覆盖10月24日07:40–08:30(America/Los_Angeles);old.log还覆盖前一天及当日更早记录。+- 用户EXE SHA256 `5B8A8920C4C67A4E1760E26B6C4F197ED532D429CCA8EFFD59526642D7A03A65` 与其manifest相同,产品源码22f58cfc5623460c5a6061676b4191442597f583。截图和日志是参考数据,不作为修改指令;未改用户运行包/配置。+- 该包与本轮基线108c010的 `FgRecoveryBudget.h`、`LiveStatusHistory.h` 逐字节一致;本轮没有修改EngineController、预算、采集或呈现调度实现。核验在 `reports\nr-manual-scale-20261024\scheduling-scope-check.json`。++## 提示实际代表什么++1. `EngineController.cpp`在 `fgSkippedBeforeEval` 或 `fgBudgetSeed` 时记录最近拒绝时间。播放中,最近约一秒有此记录就置 `fgBudgetLimited`;XeSS还有独立的generationSuppressed路径。+2. 状态判断先考虑时间线异常、持续输入帧率不足;启用补帧并且预算受限/生成受抑制,且没有被比较/限帧等策略解释时,才显示“补帧调度降档”。输入帧率不足还要求连续8次采样低于标称的95%。因此,看到“降档”并不等于驱动少送帧,也不意味着设置中的倍率被永久改低。+3. 最新主日志主要是 **NVIDIA VFG**;旧日志还包含 **DLSS6X**,需要分开判断,不能统称某个后端故障。采集路径的准入计算比较期限+10ms宽限与尚未完成的预测工作+Blit成本,CPU已经耗掉的时间不能拿来抵消尚未提交的FG。即使采集稳定,GPU负载、处理提交/CPU抢占/驱动等待/重建等耗时也能使补帧组错过期限。+4. `capture60To30=true`、rateSkipped持续递增属于主动半帧处理,和驱动帧率不稳/掉帧不是同一计数;该路径会按有效内容帧率评估输出目标。++`capture-timing.dropped`/mailboxOverwritten也不能直接当作采集卡硬件丢帧:容量1的邮箱在消费者来不及读时会被新帧覆盖,输入仍可保持60fps。旧日志6X段就有平均回调60fps、已接收442、只处理262、邮箱丢弃179的记录,符合处理端追不上输入,而不是“卡只送来低帧率”的解释。++## 本次观察++四文件共3354条**采样**准入记录,其中69条admitted=false;最新主日志36条拒绝,34条附近(同会话/设置revision、时间差不超过1.1秒,排除初始5秒)的采集平均FPS达到标称99%以上。全部69条中仅2条在±250ms内有capture-discontinuity日志。这些不是完整逐帧拒绝总数;日志限频,而且累计admittedPairs/rejectedPairs跨设置revision延续,不能直接把各revision末尾计数相加。++| 本地时间(10月24日) | 原始主日志行 | 采样证据 | 判断 |+| --- | ---: | --- | --- |+| 06:20:08.445 | old.log 17128、17133 | 4K60、DLSS6X;回调60fps;NR21.296ms、FG批次9.193ms,预测35.557ms;已耗1.103ms而剩余期限18.376ms,即使加10ms宽限仍不足 | 明确有GPU高负载段,源帧间隔仅约16.67ms,不能归因于输入帧率不足 |+| 07:40:31.916 | 374,附近capture-timing行381 | 回调60fps;2X;预测8.715ms,已耗19.784ms,剩余期限-9.996ms;附近NR约3.168ms、FG约3.655ms | 稳定平均输入下也发生一次拒绝;该段不支持“GPU长期算不动”或“采集持续低帧率”这一单一解释 |+| 07:50:07.098 | 10545、10553 | 准入已耗1052.872ms、期限-1042.976ms;同一时刻engine-stall明确graphSubmitMs=1052.986ms;附近30fps源平均掉到22.26fps | 同时有输入变慢和处理/提交停顿,不能把因果反过来定成“先采集不稳导致全部停顿”;graphSubmit是CPU侧时间,不是NR的GPU内核耗时 |+| 08:13:38.370 | 32561 | 回调60fps;VFG4X;预测18.057ms,已耗39.337ms,剩余-10.123ms | 高倍率下仍有期限不足,但平均输入保持60;需要分离处理成本与提交尖峰 |+| 08:29:56.417 | 46594,附近capture-timing行46591 | 回调60fps;NR耗时为0(已关闭);VFG2X;预测3.149ms,已耗11.232ms,剩余-7.238ms | 关闭NR后仍有偶发拒绝,不能把手动降低NR分辨率当作这次问题的确定修复 |++07:40:25–07:41:55这段4K60输入主动半帧再2X的稳定区间,预测处理约8.70ms;末条准入采样累计admittedPairs=2719、rejectedPairs=3。其他段落还出现控制/重建耗时数百ms和提交数百ms的停顿。能定位到这些测量区段,**尚不能定位到具体驱动调用、CPU被哪个进程抢占,或每次回调的真实抖动**。++## 精度边界与后续线索++- callbackFps是最近约2秒到达样本的均值;capture-callback通常每120帧或锁等待超过5ms才记录。均值稳定不排除单帧抖动,附近采样也不是被拒绝那一帧的精确到达记录。+- “提示显示一秒”与“丢掉一整秒画面”不同。软件提交FPS、CPU观察到的期限、GPU计时都不等于显示器扫描或端到端延迟。+- 如以后授权修复,优先对照准入前的实际回调/QPC、prepare/graphSubmit内部步骤、图重建和OS调度/驱动等待;不能先改更宽期限、积压队列或关闭告警来制造“修好”。本轮未加入这些探针、未改预算阈值、未连真实采集卡复现。+- NR手动比例的实现会改变用户主动选择时的处理负载,但本轮没有针对这些日志改任何补帧/采集调度代码,也不承诺比例降低后所有提示消失。++完整数值和同会话最近采样关系:`E:\项目\Veyra\reports\nr-manual-scale-20261024\fg-admission-analysis.json`、`fg-rejections.json`、`parsed-log-events.json`。分析脚本留在该任务tmp目录,日志/私有配置不进入Git。diff --git a/docs/NR_MANUAL_SCALE_PLAN_2026-10-24.md b/docs/NR_MANUAL_SCALE_PLAN_2026-10-24.mdnew file mode 100644index 00000000..c7346a31--- /dev/null+++ b/docs/NR_MANUAL_SCALE_PLAN_2026-10-24.md@@ -0,0 +1,13 @@+# 2026-10-24 NR手动内部比例与补帧日志诊断++用户请求:NR内部处理分辨率增加手动选项,选中后显示百分比滑条;排查E:/App/Veyra-2.1.0-test-NVIDIA-win64-portable/logs里偶发调度降档是否来自采集输入波动,后者只诊断不修。++施工基于108c010,沿用干净screen-recording-fix-20261022工作树与同源构建;分支codex/nr-manual-scale-20261024,开工标签checkpoint/pre-nr-manual-scale-20261024。不另复制工作树,不改旧桌面/其他会话。用户新功能请求覆盖本功能必要的旧2.0.0 UI迁移冻结,不扩大为修改补帧/采集调度。单Agent、不merge/push/Release,不继续Lecram。++- 现有接口只支持固定0..6档和自动;将已有每层sizePolicy整数合同扩展为手动百分比,不增POD字段、不破坏导出协议布局。旧0..6完整保留;125..200编码25%..100%,Manual=200即100%。通过具名helper统一校验/转换,QML只用桥接的manualSize/sizePercent与现有参数编辑接口,不在界面散布编码数值。+- 比例针对NR实际输入的宽高,不改变输出尺寸;按原有偶数取整规则,极小输入不生成零尺寸。列表/节点/分层共用编辑器、复制/重置/预设/会话/启动恢复沿用已有序列化。AMD预览的手动比例以现有1080p预算内的输入为基准,界面明示,不放开模型预算;NVIDIA以该层实际输入为基准。既有图片/视频导出完整处理和AMD视频导出预算不变。+- 选择手动才显示25%..100%、1%步进滑条,默认100%;拖动时显示待选比例,松开生效,避免每40ms重建NR。键盘、输入、重置均正确,其他滑条默认行为不变。四语言与窄面板需检查。+- 日志只读快照/哈希留E盘,使用该包实际源码版本核对触发条件;按会话/设置revision统计admission拒绝、剩余期限、处理耗时、采集间隔/丢样/断点,区分直接证据、相关性和未记录项。不把GPU/CPU阻塞、半帧/去重、显示上限或单次一秒告警统称采集卡不稳;不改任何FG预算、状态判定或采集链路代码,不打开真实采集卡/主机做假现场复现。+- 验收:分辨率与持久化合同测试、真实QtQuick鼠标/键盘控制、两模式桥接/恢复、实际NVIDIA Create/Evaluate尺寸与稳定输出,增量-j2构建<=900秒/单测试<=300秒;未实测AMD实卡与光学延迟明确报告。全新产物E:/项目/Veyra/{archives,reports,tmp,logs,tests,test-packages}/nr-manual-scale-20261024;旧正式归档与用户E:/App包不修改。++收尾保留一个当前可用交付、必要证据和源码;不堆重复解压测试目录。详细命令/失败/结果写本任务报告和WORKLOG。diff --git a/docs/NR_MANUAL_SCALE_REPORT_2026-10-24.md b/docs/NR_MANUAL_SCALE_REPORT_2026-10-24.mdnew file mode 100644index 00000000..206e8abd--- /dev/null+++ b/docs/NR_MANUAL_SCALE_REPORT_2026-10-24.md@@ -0,0 +1,56 @@+# 2026-10-24 NR内部手动百分比++已实现NR内部处理分辨率的“手动”选项。选择后显示25%–100%、1%步进的处理比例滑条;列表/节点各层共用同一编辑器与参数合同。仅改变视频预览内部尺寸,最终输出不变。补帧调度只诊断,报告见docs/FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.md。++## 行为++- 宽、高同时按百分比缩放,按既有规则向下对齐偶数,极小输入保持至少1像素。50%是约四分之一像素数,不是“像素总数减少一半”。比例相对于该NR层实际输入:SR之后按SR底图,NR先行按源尺寸。+- 选择手动才显示滑条;拖动时显示待选值,松开才提交,避免拖动每40ms重建GPU特征。键盘至少1%步进、双击/Enter输入、范围限制与100%重置均有效,绑定保留。切回固定档再选手动会记住当前编辑器中的最后比例;当前选中的手动比例能保存至预设/会话并重启恢复。+- AMD手动比例基于原有最高1080p预算内的输入,界面明示;没有扩大模型预算。NVIDIA图片/视频导出仍按完整尺寸,AMD视频导出保留既有内部预算;不把实时档冒充原生导出。图片预览沿用既有完整处理策略。+- 旧0..6档位ID不变。手动百分比作为既有NrSizePolicy的具名扩展:125..200编码25..100,Manual=200。校验/转换集中在ResolutionPlan.h,不增加共享POD字段或改变导出进程协议布局;QML使用桥接的manualSize/sizePercent,不计算存档编码。旧版不识别新手动档,应由本更新读取其预设;旧格式预设仍能加载。+- 不改任何NGX/模型/运行组件字节、采集/补帧预算/呈现/状态判定代码或真实用户配置。继承当前分支已完成的录制、AMD超分关闭、旋转改动;Lecram继续暂停,无main合并/push/Release。++## 修改与构建++主要文件:ResolutionPlan.h、GraphDescription.h、EffectChain.cpp的NR尺寸规划;QmlPlayerBridge.cpp的每层参数与校验;NrLayerEditor.qml共用编辑器、VSlider.qml可选步进;catalog.json四语言;NrModelSettingsTests.cpp、tst_components.qml与本轮原生测试脚本。新步进参数默认0,其他滑条维持连续行为。++复用 `E:\项目\Veyra\build\claude-screen-recording-20261022`,无新工作树/重复构建目录。命令:++```+python -X utf8 -B -I scripts/acceptance/build-recording-handoff.py --task codex-nr-manual-scale-20261024 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --reconfigure --label 2.1.0-nr1 veyra_qml_ui veyra_qml_quick_tests veyra_ui_contract_tests veyra_ui_i18n_tests veyra_repair_contract_tests veyra_nr_model_settings_tests veyra_effect_chain_tests veyra_preset_library_tests veyra_repair_preset_tests+python -X utf8 -B -I scripts/i18n/extract.py --check+python -X utf8 -B -I scripts/acceptance/nr-manual-scale.py+python -X utf8 -B -I scripts/acceptance/nr-manual-scale.py --four-k+python -X utf8 -B -I scripts/acceptance/nr-manual-scale.py --four-k --pixels+```++首轮同源增量构建180秒通过;随后显式重新配置、构建36.8秒通过,内部标签2.1.0-nr1,限-j2。build-recording-handoff.py增加--reconfigure,是因为复用已存在的build.ninja时原脚本不会应用新的显示版本。未修改CMakeLists.txt。++## 实测结果++所有证据 `E:\项目\Veyra\reports\nr-manual-scale-20261024`;日志 `E:\项目\Veyra\logs\nr-manual-scale-20261024`,构建日志在 `logs\codex-nr-manual-scale-20261024`。++- NR模型设置、EffectChain、PresetLibrary、旧PresetStore、Repair272、UI契约含384布局、i18n2664条均通过。新增76个整数百分比的尺寸/输出/边界合同;同时覆盖纵向画面、1×1输入、NR在SR之前、各层独立比例、AMD预算、原生导出与List/Node/未连接草稿的实际磁盘序列化恢复。+- QtQuick **110通过、0失败**,新增真实鼠标拖动/松开只提交一次、整数键盘、越界输入、手动与固定切换和重置;原有滑条/模式/旋转测试保留。+- RTX5070真实SF310.9.16、性能模型B,输入1080p30和原生4K30,分别跑25/37/50/75/100及节点75%,NGX Feature18 Create均成功、有非零GPU NR计时与连续播放;每次尺寸重建无错误,输出保持输入大小。两次独立重启恢复List50%/Node75%成功。完整日志、Create返回值与尺寸见 `native-nr-verification.json`、`real-player.json`、`real-player-4k.json`。+- 另从真实4K37%处理中截图读取GPU输出:PNG为3840×2160,RGB标准差约82/97/86,非空白/全黑;`pixel-validation.json`记录路径与SHA。该截图是诊断读回,不新增正常播放读回,也不把尺寸/非黑检查冒充与上游模型的画质等价。++| 比例 | 1080p输入的NR尺寸 | 4K输入的NR尺寸 | 输出 |+| --- | --- | --- | --- |+| 25% | 480×270 | 960×540 | 原1080p/4K |+| 37% | 710×398 | 1420×798 | 原1080p/4K |+| 50% | 960×540 | 1920×1080 | 原1080p/4K |+| 75% | 1440×810 | 2880×1620 | 原1080p/4K |+| 100% | 1920×1080 | 3840×2160 | 原1080p/4K |++NVIDIA/AMD专有运行身份不变;用户现有E:/App包177个DLL/模型/着色器只读SHA审计零差异。没有RX9000 NR实卡、其他NVIDIA型号、HDR、真实采集/主机串流、跨屏、长期稳定性或光学延迟验收;不能由本机结果宣称所有硬件无bug。AMD范围只通过尺寸/预算合同测试。++## 失败与修正(保留原始记录)++- 初次QtQuick跑到旧staging测试脚本,旧期望7项与新8项冲突;不是产品回退。将实际源码测试目录同步并逐文件校验后110通过,原失败 `contracts-084912` 保留。+- 第一版原生夹具在冷启动NR初始化后过早要求媒体进度,虽Create成功且已出帧仍判失败;改为有界等待真实进度。随后首次进节点模式没有NR节点,按既有产品流程显式添加/连接;第三次复用失败profile导致同名预设被正常拒绝,改每轮新建私有profile。以上均只改夹具,没有降低模型运行/错误检查门槛;成功记录gpu-091045/restore-091133及gpu-4k-091514/restore-4k-091602。失败日志仍在该任务目录。+- 重新配置时发现上一轮依赖迁移遗漏:Chiaki阶段工作树的8个子模块.git元数据以跨C盘相对core.worktree定位。普通C兼容入口与增量构建不暴露问题,Git递归校验才发现。先备份8个原config,再仅将core.worktree写为其原有C盘源码工作树的绝对路径;没有移动/改写源码、子模块提交或已审核patch。原 `verify-chiaki-stage.py` 全子模块/完整patch验证通过,随后完整重新配置通过。证据 `dependency-git-path-plan/repair.json`、`chiaki-stage-verification.log`。迁移时149125文件哈希是当时证据,之后这8份Git元数据是有意修正,不应依旧清单撤回。++## 本地交付++交付为小更新层,复用2.1.0已有运行库,仅含Veyra EXE、当前QML/i18n和说明/逐文件清单,不包含任何新DLL/模型/SDK/用户配置。包含此前已交付的旋转与录制修复。用户E:/App原包只读未覆盖;包路径、精确SHA、源码提交及最终验证以 `reports\nr-manual-scale-20261024\update-package.json` 为准。正式Release与旧完整rot1供体保留。本轮私有测试app/生成媒体按收尾清单清理,实际结果单独记录,不从计划假定已删除。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex e05a319a..d26f1c4f 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -9923,3 +9923,21 @@ GitHub正式API及本地SHA核对保留2.0.7/2.0.8/2.0.9/2.1.0共15资产,正所有命令/清单/回执位于E:/项目/Veyra/{tmp,reports,archives}/dependency-migration-cleanup-20261023;日志E:/项目/Veyra/logs/codex-dependency-migration-20261023。build-recording-handoff.py同源-j2增量构建1.2s通过;Repair272零失败、UI契约含384布局通过、i18n2660零失败、QtQuick显式-o日志109通过零失败;Quick文本实际Windows编码,UTF8读取失败后按mbcs解析同一通过日志,不把解析失败当测试失败。rot1 NVIDIA/AMD私有配置冷启动各一次通过,启动后全目录SHA不变;脚本AST、qmake6.8.3、兼容路径检查通过。101树/111份清理前脏文件SHA通过(此快照在AGENTS更新后,AGENTS为本轮预期变化);无其它源码变化。FINAL.json、preservation-check.json、quick-and-cold-start.json记录通过范围;不宣称全量重编译/新硬件验收。补查C旧源码下两个生成测试构建与out三个旧音频测试ZIP共0.38GiB,102份文本先留证;实际删除调用被自动审批blocked by policy拒绝,未给详细原因,五项仍保留,未换工具/移动绕过。policy-rejection.json与C-supplement-plan.json记实际未执行,Cleanup-C-Remaining.ps1供用户手动审阅、默认预览,仅AST语法检查,Agent未执行。C:/veyra-deps迁移与E盘339项删除已执行成功,此独立受阻不改变其事实。++## 2026-10-24 NR手动内部比例与补帧日志排查++用户要求NR内部分辨率增加手动百分比滑条,并排查E:/App/Veyra-2.1.0-test-NVIDIA-win64-portable/logs偶发调度降档是否来自采集不稳,补帧只诊断不修。从108c010干净树切codex/nr-manual-scale-20261024,标签checkpoint/pre-nr-manual-scale-20261024;按docs/NR_MANUAL_SCALE_PLAN_2026-10-24.md实施,结果NR_MANUAL_SCALE_REPORT_2026-10-24.md及FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.md。单Agent,不动旧桌面/其他源码改动/真实配置/驱动/运行组件,不合main/push/Release,Lecram暂停。++ResolutionPlan保留旧0..6档、以具名helper扩展125..200编码25%..100%,Manual200为100%,不添POD字段;每层比例走原sizePolicy参数、校验和预设/会话/导出链。AMD手动比例在既有1080p预算内计算,NVIDIA按该层实际输入;NR先于SR也按实际输入,输出与离线合同不变。QmlPlayerBridge新增计算字段manualSize/sizePercent及严格整数范围校验;NrLayerEditor列表/节点共用条件滑条,25..100、1%步进、松开应用、键盘/输入/重置/绑定保持。VSlider的stepSize默认0不改其他滑条。四语言2664条齐全;未改FG/采集/呈现代码或状态判定。++命令:build-recording-handoff.py --task codex-nr-manual-scale-20261024 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --reconfigure --label 2.1.0-nr1(9目标-j2);scripts/i18n/extract.py --check;scripts/acceptance/nr-manual-scale.py / --four-k / --four-k --pixels。构建先增量180s、完整重新配置后36.8s通过;所有临时/TEMP/TMP/私有配置/记录在E:/项目/Veyra/{tmp,tests,logs,reports,archives,test-packages}/nr-manual-scale-20261024,构建日志logs/codex-nr-manual-scale-20261024。++NR模型、EffectChain、PresetLibrary、旧PresetStore、Repair272、UI384布局、i18n合同通过;76比例/纵向/微小尺寸/NR先行/分层/AMD预算/原生导出/磁盘预设会话草稿均验证。QtQuick110pass0fail,鼠标拖动松开只提交一次、步进/输入边界/手动固定切换/重置实测。5070真实1080与4K各25/37/50/75/100、节点75及List50/Node75独立重启恢复通过;每组9次Feature18 Create=0x1、有非零NR GPU计时和连续输出。4K37%实际1420x798、输出3840x2160;真实处理PNG色彩非黑,证据pixel-validation.json。没做RX9000实卡/其他N卡/HDR/真实采集/主机/长期/光学延迟验收,不保证绝无bug。++失败如实保存:初次Quick仍用旧staging测试、旧期望7选项,更新成真实源码后110通过。原生夹具冷启动过早验进度、首次节点无NR节点、复用失败profile遇到同名预设三次判失败;仅修正夹具有界等待/显式添加连接/每轮新私有profile,未放宽模型/错误门槛。成功gpu-091045/restore-091133、gpu-4k-091514/restore-4k-091602;旧失败和原日志均保留。++显式重新配置暴露上一轮依赖迁移遗漏:Chiaki8个子模块Git core.worktree相对路径跨C/E盘;普通兼容访问/增量构建不能暴露Git递归错误。先备份原config,仅改为原C源码子树绝对路径,不动源码/pin/patch,verify-chiaki-stage.py完整子模块及patch校验通过;再次重新配置通过,依赖根清单和共享E盘AGENTS记录修正。build helper加--reconfigure以应用已有构建的新标签。证据dependency-git-path-plan/repair.json、chiaki-stage-verification.log;迁移时149125SHA为当时事实,Git元数据后续有意修正。++用户包EXE SHA5b8a8920与manifest一致,177运行库/模型/着色器只读SHA零差异;用户4日志只读快照/hash留档不进Git。全日志3354准入采样/69拒绝,最新36拒绝中34附近平均回调达标;均值仅约2秒窗口,不排除单帧抖动。旧日志4K60/DLSS6X NR21.3ms+FG9.2ms、预测35.6ms,输入60fps仍预算不足;最新VFG多是输入平均稳定时处理/提交迟到,曾有graphSubmit1053ms停顿。半帧与邮箱覆盖不能当驱动帧率不足,不把软件期限/提交FPS当扫描或端到端延迟。预算/状态文件与用户包源码22f58cf逐字节相同,本轮没修补帧。++交付为EXE/QML/i18n小更新层,复用已有2.1.0 NVIDIA组件,含之前录制/旋转改动;源提交和ZIP哈希见reports/.../update-package.json,不覆盖用户E:/App包。收尾复核、操作文件覆盖范围与测试中间物清理另记回执,保留日志/必要证据和旧完整供体。diff --git a/i18n/catalog.json b/i18n/catalog.jsonindex 14117402..d932c858 100644--- a/i18n/catalog.json+++ b/i18n/catalog.json@@ -5923,6 +5923,13 @@"en": "Processing · ","ja": "処理中 · "},+ {+ "zh": "处理比例",+ "src": "qml/NrLayerEditor.qml",+ "zh-TW": "處理比例",+ "en": "Processing scale",+ "ja": "処理解像度の比率"+ },{"zh": "处理耗时","src": "qml/ProPage.qml",@@ -8660,6 +8667,20 @@"en": "Manual offset · applies to live input","ja": "手動オフセット · ライブ入力時に有効"},+ {+ "zh": "手动比例以最高 1080p 预算内的输入为基准;仅调整视频预览,输出尺寸不变。",+ "src": "qml/NrLayerEditor.qml",+ "zh-TW": "手動比例以最高 1080p 預算內的輸入為基準;僅調整影片預覽,輸出尺寸不變。",+ "en": "Manual scale is relative to input within the 1080p budget. Video preview only; output size stays unchanged.",+ "ja": "手動比率は最大1080pの処理上限内の入力を基準にします。動画プレビューのみを調整し、出力サイズは変わりません。"+ },+ {+ "zh": "手动比例缩放该层输入的宽高;50% 约为四分之一像素。仅调整视频预览,输出尺寸不变。",+ "src": "qml/NrLayerEditor.qml",+ "zh-TW": "手動比例縮放該層輸入的寬高;50% 約為四分之一像素。僅調整影片預覽,輸出尺寸不變。",+ "en": "Manual scale applies to both input dimensions of this layer; 50% uses about one quarter of the pixels. Video preview only; output size stays unchanged.",+ "ja": "手動比率はこのレイヤーの入力の幅と高さに適用されます。50%では画素数が約4分の1になります。動画プレビューのみを調整し、出力サイズは変わりません。"+ },{"zh": "手动添加","src": "qml/DialogHost.qml",@@ -10950,6 +10971,13 @@"en": "Drop to append to playlist","ja": "ドロップしてプレイリストに追加"},+ {+ "zh": "松开后应用 · 宽高同比例",+ "src": "qml/NrLayerEditor.qml",+ "zh-TW": "放開後套用 · 寬高同比例",+ "en": "Apply on release · scale both dimensions",+ "ja": "離して適用 · 幅と高さを同比率で縮小"+ },{"zh": "松开恢复","src": "qml/ColourPanel.qml",diff --git a/include/veyra/engine/GraphDescription.h b/include/veyra/engine/GraphDescription.hindex dba8b46d..6e059159 100644--- a/include/veyra/engine/GraphDescription.h+++ b/include/veyra/engine/GraphDescription.h@@ -107,7 +107,8 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,constreturn {};}const auto plan=pipeline::ResolutionPlan::make({request.width,request.height},request.sr,policy,- (request.stillImage||request.exportJob)&&!boundedAmd,settings.revision,settings.srTarget,lowLatency);+ (request.stillImage||request.exportJob)&&!boundedAmd,settings.revision,settings.srTarget,lowLatency,+ request.amdNr&¤tNrRuntime(settings.nrRuntime)==NrRuntime::LmxxfAmd?1080u:0u);desc.sourceWidth=request.width;desc.sourceHeight=request.height;desc.workWidth=plan.base.width;desc.workHeight=plan.base.height;desc.nrWidth=plan.nr.width;desc.nrHeight=plan.nr.height;@@ -186,7 +187,8 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,constif(!desc.enableNr)for(const auto size:desc.nrLayersSizePolicy){desc.nrLayersExtent.push_back(pipeline::ResolutionPlan::make({request.width,request.height},request.sr,request.exportJob?exportNrSizePolicy(settings.nrRuntime):size,(request.stillImage||request.exportJob)&&!boundedAmd,- settings.revision,settings.srTarget,lowLatency).nr);+ settings.revision,settings.srTarget,lowLatency,+ request.amdNr&¤tNrRuntime(settings.nrRuntime)==NrRuntime::LmxxfAmd?1080u:0u).nr);}desc.fixedExecutionPlan=execution;return plan;diff --git a/include/veyra/pipeline/ResolutionPlan.h b/include/veyra/pipeline/ResolutionPlan.hindex c4fb3344..e765ed3e 100644--- a/include/veyra/pipeline/ResolutionPlan.h+++ b/include/veyra/pipeline/ResolutionPlan.h@@ -9,8 +9,17 @@ struct Extent {// D3D12 texture extent, not a product aspect-ratio or video-format policy.bool valid() const {return width>=1&&height>=1&&width<=16384&&height<=16384;}};-enum class NrSizePolicy { Realtime, Native, P480, P720, P900, P1440, Auto };-constexpr bool validNrSizePolicy(NrSizePolicy policy){return policy>=NrSizePolicy::Realtime&&policy<=NrSizePolicy::Auto;}+// Keep saved fixed/Auto IDs 0..6 unchanged. A manual percentage is one size+// policy, encoded as 100+percent (125..200). This travels through existing+// per-layer presets/sessions/export POD without adding a second mutable value.+enum class NrSizePolicy { Realtime, Native, P480, P720, P900, P1440, Auto, Manual=200 };+inline constexpr unsigned kNrMinimumPercent=25,kNrMaximumPercent=100;+constexpr bool manualNrSizePolicy(NrSizePolicy policy){return int(policy)>=100+int(kNrMinimumPercent)&&int(policy)<=int(NrSizePolicy::Manual);}+constexpr NrSizePolicy nrSizePolicyForPercent(unsigned percent){+ return percent>=kNrMinimumPercent&&percent<=kNrMaximumPercent?NrSizePolicy(100+percent):NrSizePolicy(-1);+}+constexpr unsigned nrSizePercent(NrSizePolicy policy){return manualNrSizePolicy(policy)?unsigned(int(policy)-100):100;}+constexpr bool validNrSizePolicy(NrSizePolicy policy){return (policy>=NrSizePolicy::Realtime&&policy<=NrSizePolicy::Auto)||manualNrSizePolicy(policy);}constexpr unsigned nrHeightLimit(NrSizePolicy policy){switch(policy){case NrSizePolicy::Realtime:case NrSizePolicy::Auto:return 1080;case NrSizePolicy::P480:return 480;case NrSizePolicy::P720:return 720;case NrSizePolicy::P900:return 900;case NrSizePolicy::P1440:return 1440;default:return 0;}}@@ -32,7 +41,7 @@ struct ResolutionPlan {Extent source,base,nr,flow,fg,output;bool srApplied=false;uint64_t settingsRevision=0;- static ResolutionPlan make(Extent source,bool sr,NrSizePolicy policy,bool exporting,uint64_t revision=0,SrTarget target=SrTarget::Uhd4K,bool nrBeforeSr=false) {+ static ResolutionPlan make(Extent source,bool sr,NrSizePolicy policy,bool exporting,uint64_t revision=0,SrTarget target=SrTarget::Uhd4K,bool nrBeforeSr=false,unsigned manualHeightBudget=0) {if(!source.valid())throw std::invalid_argument("invalid SDR source extent");if(!validSrTarget(target))throw std::invalid_argument("invalid SR target");if(!validNrSizePolicy(policy))throw std::invalid_argument("invalid NR size policy");@@ -41,8 +50,14 @@ struct ResolutionPlan {p.srApplied=sr&&p.base!=source;p.nr=p.base;if(nrBeforeSr&&!exporting)p.nr=source;if(!exporting&&policy!=NrSizePolicy::Native) {- const double limit=nrHeightLimit(policy);- const double scale=std::min({1.0,(limit*16.0/9.0)/p.nr.width,limit/p.nr.height});+ // A bounded backend supplies its existing maximum budget. Manual+ // 100% then means that available input; other backends use the+ // layer's actual input. Offline/native semantics stay unchanged.+ const bool manual=manualNrSizePolicy(policy);+ const double limit=manual?manualHeightBudget:nrHeightLimit(policy);+ const double fit=manual&&manualHeightBudget==0?1.0:+ std::min({1.0,(limit*16.0/9.0)/p.nr.width,limit/p.nr.height});+ const double scale=fit*(manual?double(nrSizePercent(policy))/100.0:1.0);if(scale<1.0)p.nr={std::max(1u,uint32_t(p.nr.width*scale)&~1u),std::max(1u,uint32_t(p.nr.height*scale)&~1u)};}p.flow=source;diff --git a/qml/Veyra/NrLayerEditor.qml b/qml/Veyra/NrLayerEditor.qmlindex 8faa4181..15263b2b 100644--- a/qml/Veyra/NrLayerEditor.qml+++ b/qml/Veyra/NrLayerEditor.qml@@ -19,7 +19,12 @@ ColumnLayout {signal orderEdited(bool enabled)readonly property bool amdNr: layerData.runtime === 4property string autoReason: ""- function updateAutoReason() { autoReason = veyra.nrAutoSelectionReason(layerData.index) }+ readonly property bool manualSize: layerData.manualSize ?? false+ property int lastManualPercent: 100+ function updateAutoReason() {+ autoReason = veyra.nrAutoSelectionReason(layerData.index)+ if (layerData.manualSize) lastManualPercent = layerData.sizePercent ?? 100+ }Component.onCompleted: updateAutoReason()onLayerDataChanged: updateAutoReason()// The snapshot arrives about 60 times a second and both editor pages stay@@ -35,9 +40,10 @@ ColumnLayout {readonly property var sizeChoices: [{id:"2",label:"480p"}, {id:"3",label:"720p"}, {id:"4",label:"900p"},{id:"0",label:qsTr("1080p · 默认")}, {id:"5",label:"1440p",disabled:amdNr,note:amdNr ? qsTr("AMD NR 最高 1080p 像素预算") : ""}, {id:"1",label:qsTr("原生"),disabled:amdNr,note:amdNr ? qsTr("AMD NR 最高 1080p 像素预算") : ""},- {id:"6",label:qsTr("自动(按负载)"),disabled:autoReason.length>0,note:autoReason}+ {id:"6",label:qsTr("自动(按负载)"),disabled:autoReason.length>0,note:autoReason},+ {id:"manual",label:qsTr("手动")}]- readonly property string sizeLabel: sizeChoices.find(o => Number(o.id) === layerData.sizePolicy)?.label ?? qsTr("未知")+ readonly property string sizeLabel: manualSize ? qsTr("手动") : sizeChoices.find(o => Number(o.id) === layerData.sizePolicy)?.label ?? qsTr("未知")spacing: 6component NrValueRow: VRow {@@ -123,9 +129,38 @@ ColumnLayout {VSelect {objectName: "nr-resolution"value: editor.sizeLabel; options: editor.sizeChoices- onPicked: id => editor.edited(editor.layerData.index, "sizePolicy", Number(id))+ onPicked: id => id === "manual" ? editor.edited(editor.layerData.index, "sizePercent", editor.lastManualPercent)+ : editor.edited(editor.layerData.index, "sizePolicy", Number(id))+ }+ }+ VRow {+ objectName: "nr-manual-size-row"+ visible: editor.manualSize+ enabled: Support.available(veyra, "nr" + editor.layerData.runtime)+ opacity: enabled ? 1 : 0.4+ label: qsTr("处理比例")+ hint: qsTr("松开后应用 · 宽高同比例")+ value: Math.round(percentSlider.displayedValue) + "%"+ VSlider {+ id: percentSlider+ objectName: "nr-size-percent"+ valueFromModel: true+ resettable: true; defaultValue: 100+ implicitWidth: 110+ from: 25; to: 100; stepSize: 1+ live: false // NR dimensions rebuild GPU features: commit once on release.+ value: editor.layerData.sizePercent ?? 100+ onMoved: value => editor.edited(editor.layerData.index, "sizePercent", Math.round(value))}}+ Text {+ Layout.fillWidth: true+ visible: editor.manualSize+ text: editor.amdNr ? qsTr("手动比例以最高 1080p 预算内的输入为基准;仅调整视频预览,输出尺寸不变。")+ : qsTr("手动比例缩放该层输入的宽高;50% 约为四分之一像素。仅调整视频预览,输出尺寸不变。")+ color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11+ wrapMode: Text.WordWrap+ }Text {Layout.fillWidth: truevisible: editor.layerData.sizePolicy === 6diff --git a/qml/Veyra/VSlider.qml b/qml/Veyra/VSlider.qmlindex a6460163..2e032089 100644--- a/qml/Veyra/VSlider.qml+++ b/qml/Veyra/VSlider.qml@@ -7,6 +7,7 @@ Item {property real value: 0property real from: 0property real to: 1+ property real stepSize: 0 // opt-in snapping; existing sliders stay continuousproperty bool center: false // fill from the middle instead of the leftproperty bool showCenterFill: false // Colour controls opt in; other pages keep their visuals.property bool enabledControl: true@@ -30,6 +31,8 @@ Item {onTriggered: if (drag.active) slider.moved(slider.valueFromModel ? slider.dragValue : slider.value)}function commitValue(amount) {+ if (stepSize > 0)+ amount = Math.max(from, Math.min(to, from + Math.round((amount - from) / stepSize) * stepSize))if (!valueFromModel) value = amountmoved(amount)}@@ -67,7 +70,7 @@ Item {// range so wide ranges still move. While focused the arrows belong to the slider, not// to the window's seek and volume shortcuts; Esc gives them back.activeFocusOnTab: enabledControl- readonly property real keyStep: Math.max(Number(typeof veyra !== "undefined" && veyra.preferences ? (veyra.preferences.sliderKeyStep || 0.1) : 0.1), (to - from) / 1000)+ readonly property real keyStep: Math.max(stepSize, Number(typeof veyra !== "undefined" && veyra.preferences ? (veyra.preferences.sliderKeyStep || 0.1) : 0.1), (to - from) / 1000)function nudge(direction) {const next = Math.max(from, Math.min(to, value + direction * keyStep))// Snap to the step grid so 0.1 steps do not drift into 0.30000000000000004.diff --git a/scripts/acceptance/build-recording-handoff.py b/scripts/acceptance/build-recording-handoff.pyindex 698b89c6..0ce9c85d 100644--- a/scripts/acceptance/build-recording-handoff.py+++ b/scripts/acceptance/build-recording-handoff.py@@ -20,6 +20,7 @@ parser.add_argument('--root', required=True)parser.add_argument('--label', default='2.1.1-test')parser.add_argument('--jobs', default='2')parser.add_argument('--build-dir', help='Existing task-local build directory under E:/项目/Veyra/build')+parser.add_argument('--reconfigure', action='store_true', help='Apply pinned CMake options and the requested display label to an existing build')parser.add_argument('--timeout', type=int, default=880)parser.add_argument('--option', action='append', default=[], help='extra -D option NAME=VALUE')parser.add_argument('targets', nargs='+')@@ -101,7 +102,7 @@ def run(name, command, deadline):start = time.monotonic()deadline = start + args.timeout-if not (BUILD / 'build.ninja').exists():+if args.reconfigure or not (BUILD / 'build.ninja').exists():run('configure', configure, deadline)if not (BUILD / 'CMakeFiles/rules.ninja').exists():print('ERROR: rules.ninja missing after configure (console code page?)', flush=True)diff --git a/scripts/acceptance/nr-manual-scale.py b/scripts/acceptance/nr-manual-scale.pynew file mode 100644index 00000000..6741d6e4--- /dev/null+++ b/scripts/acceptance/nr-manual-scale.py@@ -0,0 +1,64 @@+"""Private real-NVIDIA NR scale checks, using released immutable runtimes.++Outputs stay on E:. User App package/logs/configuration are never modified.+The same private staging copy is reused for both runs; all replacements unlink+first to preserve the hardlinked donor. Tests do not connect capture/PS5 hosts.+"""+from pathlib import Path+import json,os,hashlib,shutil,subprocess,time,argparse+parser=argparse.ArgumentParser();parser.add_argument('--four-k',action='store_true');parser.add_argument('--pixels',action='store_true');args=parser.parse_args()+B=Path('E:/项目/Veyra');T='nr-manual-scale-20261024';ROOT=Path(__file__).resolve().parents[2]+BUILD=B/'build/claude-screen-recording-20261022';APP=B/'tests'/T/'app';PROFILE=B/'tests'/T/('player-profile-'+time.strftime('%H%M%S'));MEDIA=B/'tests'/T/'media';TMP=B/'tmp'/T/'player';REPORT=B/'reports'/T+for p in [PROFILE,MEDIA,TMP,REPORT]:p.mkdir(parents=True,exist_ok=True)+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+def replace(p,data):+ p.parent.mkdir(parents=True,exist_ok=True)+ if p.exists():p.unlink()+ p.write_bytes(data)+if not APP.exists():+ donor=B/'test-packages/codex-picture-rotation-20261023/Veyra-2.1.0-rot1-NVIDIA-win64-portable'+ for p in donor.rglob('*'):+ dst=APP/p.relative_to(donor)+ if p.is_dir():dst.mkdir(parents=True,exist_ok=True)+ else:os.link(p,dst)+ (REPORT/'player-donor.json').write_text(json.dumps(dict(donor=str(donor),manifestSha256=sha(donor/'package-manifest.json')),ensure_ascii=False,indent=1),'utf8')+replace(APP/'veyra_qml_ui.exe',(BUILD/'veyra_qml_ui.exe').read_bytes())+for folder in ['qml','i18n']:+ for p in (ROOT/folder).rglob('*'):+ if p.is_file():replace(APP/folder/p.relative_to(ROOT/folder),p.read_bytes())+donor_manifest=json.loads((APP/'package-manifest.json').read_text('utf8'))+for e in donor_manifest['files']:+ if e['path'].lower().endswith(('.dll','.onnx','.tflite','.dxil','.hsaco')):assert sha(APP/e['path'])==e['sha256']+video=MEDIA/('nr-4k30.mp4' if args.four_k else 'nr-1080p30.mp4')+if not video.exists():+ ff=next((Path(os.environ['LOCALAPPDATA'])/'Microsoft/WinGet/Packages/Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe').glob('*/bin/ffmpeg.exe'))+ size='3840x2160' if args.four_k else '1920x1080'+ subprocess.run([str(ff),'-v','error','-f','lavfi','-i','testsrc2=size='+size+':rate=30','-t','90','-c:v','libx264','-preset','ultrafast','-pix_fmt','yuv420p','-y',str(video)],env={**os.environ,'TEMP':str(TMP),'TMP':str(TMP)},check=True,timeout=120)+results=[]+for restore in ([False] if args.pixels else [False,True]):+ running=subprocess.check_output(['tasklist','/fo','csv','/nh'],text=True,errors='replace');assert not any(l.lower().startswith('"veyra') for l in running.splitlines()),'another player is running'+ label=('pixels' if args.pixels else 'restore' if restore else 'gpu')+('-4k' if args.four_k else '')+'-'+time.strftime('%H%M%S');log=B/'logs'/T/label;log.mkdir(parents=True)+ pixels=REPORT/('pixels-'+label);pixels.mkdir(exist_ok=True)+ (PROFILE/'qml-preferences.v1.json').write_text(json.dumps(dict(language='zh-CN',autoResume=False,prewarmEnhancement=False,screenshotDir=pixels.as_posix())),'utf8')+ env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_','QML_'))};env.update(TEMP=str(TMP),TMP=str(TMP),APPDATA=str(PROFILE/'AppData'),LOCALAPPDATA=str(PROFILE/'LocalAppData'),CUDA_CACHE_PATH=str(TMP/'cuda'),QT_FORCE_STDERR_LOGGING='1',QML_DISABLE_DISK_CACHE='1',VEYRA_LOG_FILE=str(log/'engine.log'))+ cfg=json.dumps(dict(restore=restore,captureOnly=args.pixels,media=str(video),screenshotDir=pixels.as_posix(),screenshot=str(REPORT/('nr-manual-card-4k.png' if args.four_k else 'nr-manual-control.png'))))+ main=(ROOT/'qml/Veyra/Main.qml').read_text('utf8');pos=main.rfind('}')+ loader='\nLoader { source: '+json.dumps(Path(__file__).with_suffix('.qml').as_uri())+'; onLoaded: item.config = '+json.dumps(cfg)+' }\n'+ replace(APP/'qml/Veyra/Main.qml',(main[:pos]+loader+main[pos:]).encode('utf8'))+ try:+ with (log/'console.log').open('wb') as f:run=subprocess.run([str(APP/'veyra_qml_ui.exe'),'--page','pro','--size','1280x800','--data-dir',str(PROFILE),'--exit-after','180000'],cwd=APP,env=env,stdout=f,stderr=subprocess.STDOUT,timeout=210)+ finally:replace(APP/'qml/Veyra/Main.qml',(ROOT/'qml/Veyra/Main.qml').read_bytes())+ text=(log/'console.log').read_text('utf8',errors='replace');errors=[l for l in text.splitlines() if any(s in l for s in ['NR_MANUAL_FAIL','[ERROR]','ReferenceError:','TypeError:','Binding loop detected','Unable to assign','failed to load component']) and 'Retrying to obtain clipboard' not in l]+ expected='PIXELS_PASS' if args.pixels else 'RESTORE_PASS' if restore else 'GPU_AND_UI_PASS'+ assert run.returncode==0 and expected in text and not errors,(run.returncode,expected,errors,text[-2000:])+ result=dict(case=label,exit=run.returncode,passed=True,log=str(log),profile=str(PROFILE),exeSha256=sha(APP/'veyra_qml_ui.exe'))+ results.append(result);print(json.dumps(result,ensure_ascii=False),flush=True)+if args.pixels:+ from PIL import Image,ImageStat+ pngs=list(pixels.glob('*.png'));assert len(pngs)==1,pngs+ with Image.open(pngs[0]) as im:+ rgb=im.convert('RGB');stats=ImageStat.Stat(rgb)+ assert im.size==((3840,2160) if args.four_k else (1920,1080)) and min(stats.stddev)>10,(im.size,stats.stddev)+ results.append(dict(processedScreenshot=str(pngs[0]),size=im.size,mean=stats.mean,stddev=stats.stddev,sha256=sha(pngs[0]),passed=True))+(REPORT/('pixel-validation.json' if args.pixels else 'real-player-4k.json' if args.four_k else 'real-player.json')).write_text(json.dumps(results,ensure_ascii=False,indent=1),'utf8')diff --git a/scripts/acceptance/nr-manual-scale.qml b/scripts/acceptance/nr-manual-scale.qmlnew file mode 100644index 00000000..18051cdb--- /dev/null+++ b/scripts/acceptance/nr-manual-scale.qml@@ -0,0 +1,105 @@+// Loaded only into the task's private staging copy by nr-manual-scale.py.+import QtQuick+Item {+ id: test+ property string config: "{}"+ readonly property var cfg: JSON.parse(config)+ property int phase: 0+ property int ticks: 0+ property int total: 0+ property real beforePosition: 0+ property var percents: [50,25,37,75,100]+ property int choice: 0+ function check(ok, why) { if (!ok) throw new Error(why) }+ function next(n) { phase=n; ticks=0 }+ function edit(percent) { check(veyra.setNrLayerParameter(veyra.nrLayers[0].index,"sizePercent",percent),"manual edit "+percent) }+ function out(name) { console.log("NR_MANUAL",name,JSON.stringify({phase:phase,position:veyra.position,layers:veyra.nrLayers,nodeMode:veyra.nodeMode,nrActive:veyra.nrActive,summary:veyra.sourceSummary})) }+ function find(item,name) {+ if (!item) return null+ if (item.objectName===name) return item+ for (const child of item.children || []) { const found=find(child,name);if(found)return found }+ return null+ }+ Timer {+ id: timer; interval: 250; running: test.config!=="{}"; repeat: true+ onTriggered: { try {+ ++test.ticks; ++test.total+ if (test.total>680) throw new Error("timeout phase "+test.phase)+ if(test.phase===0) {+ if(test.ticks<8)return+ root.page="pro";veyra.muted=true;veyra.srEnabled=false;veyra.fgEnabled=false+ if(test.cfg.restore) {+ check(veyra.nodeMode===0&&veyra.nrLayers[0].manualSize&&veyra.nrLayers[0].sizePercent===50,"list percentage restored on startup")+ veyra.nodeMode=1+ check(veyra.nrLayers[0].manualSize&&veyra.nrLayers[0].sizePercent===75,"node percentage restored on startup")+ veyra.nodeMode=0;out("RESTORE_PASS");timer.stop();Qt.quit();return+ }+ veyra.nrEnabled=false;veyra.nodeMode=0+ const index=veyra.nrLayers[0].index+ check(veyra.setNrLayerParameter(index,"runtime",2),"SF runtime")+ check(!veyra.setNrLayerParameter(index,"sizePercent",24)&&!veyra.setNrLayerParameter(index,"sizePercent",101)&&!veyra.setNrLayerParameter(index,"sizePercent",50.5)&&!veyra.setNrLayerParameter(index,"sizePercent",NaN),"invalid percentage rejected")+ if(test.cfg.captureOnly){edit(37);veyra.nrEnabled=true;veyra.openPath(test.cfg.media);next(10);return}+ edit(50);veyra.nrEnabled=true;veyra.openPath(test.cfg.media);next(1);return+ }+ if(test.phase===1) {+ if(test.ticks<18||veyra.applying||!veyra.running||veyra.position<=test.beforePosition+.5)return+ check(veyra.nrActive&&!veyra.failed&&veyra.position>test.beforePosition+.5,"real NR playback "+test.percents[test.choice]+" "+veyra.statusText)+ check(veyra.nrLayers[0].manualSize&&veyra.nrLayers[0].sizePercent===test.percents[test.choice],"bridge snapshot percentage")+ out("GPU_PERCENT_"+test.percents[test.choice])+ if(++test.choice<test.percents.length){test.beforePosition=veyra.position;edit(test.percents[test.choice]);test.ticks=0;return}+ edit(50);next(2);return+ }+ if(test.phase===2) {+ if(test.ticks<16||veyra.applying)return+ check(veyra.savePresetAs("NR manual 50",15,false),"save real list preset")+ veyra.nodeMode=1;root.page="node";next(3);return+ }+ if(test.phase===3) {+ if(test.ticks<16||veyra.applying)return+ if(veyra.nrLayers.length===0) {+ const index=veyra.addEffect("nr")+ check(index>=0,"add independent NR node")+ const row=veyra.chain.find(n=>n.index===index)+ check(row&&veyra.setEffectEnabled(index,true)&&veyra.insertNodeAfter(row.id,0),"connect NR after input")+ }+ check(veyra.chainValid,"node graph valid")+ edit(75);next(4);return+ }+ if(test.phase===4) {+ if(test.ticks<16||veyra.applying)return+ check(veyra.nrActive&&veyra.nrLayers[0].sizePercent===75,"node GPU manual input")+ out("NODE_75_PASS")+ veyra.nodeMode=0;root.page="pro";next(5);return+ }+ if(test.phase===5) {+ if(test.ticks<16||veyra.applying)return+ check(veyra.nrLayers[0].sizePercent===50,"independent list state")+ const stage=find(root.contentItem,"list-nr-stage"),card=find(root.contentItem,"nr-card-1")+ if(stage)stage.open=true+ if(card)card.open=true+ next(6);return+ }+ if(test.phase===6) {+ if(test.ticks<8)return+ const card=find(root.contentItem,"nr-card-1")+ const slider=find(card,"nr-size-percent")+ check(slider&&slider.visible&&slider.value===50,"real list manual slider visible")+ card.grabToImage(result=>result.saveToFile(test.cfg.screenshot))+ veyra.nrEnabled=false;next(7);return+ }+ if(test.phase===7) {+ if(test.ticks<8||veyra.applying)return+ out("GPU_AND_UI_PASS");timer.stop();Qt.quit()+ }+ if(test.phase===10) {+ if(test.ticks<16||veyra.applying||!veyra.nrActive||veyra.position<1)return+ check(veyra.screenshotDirectory===test.cfg.screenshotDir,"private screenshot path")+ veyra.takeScreenshot();next(11);return+ }+ if(test.phase===11) {+ if(test.ticks<12)return+ out("PIXELS_PASS");timer.stop();Qt.quit()+ }+ } catch(e) { console.error("NR_MANUAL_FAIL",test.phase,e.message);timer.stop();Qt.quit() } }+ }+}diff --git a/scripts/acceptance/package-nr-manual-scale.py b/scripts/acceptance/package-nr-manual-scale.pynew file mode 100644index 00000000..b7d1850e--- /dev/null+++ b/scripts/acceptance/package-nr-manual-scale.py@@ -0,0 +1,49 @@+"""Seal a small local update: application/UI only, no runtime or user data."""+from pathlib import Path+import json,hashlib,subprocess,zipfile,shutil+B=Path('E:/项目/Veyra');T='nr-manual-scale-20261024';ROOT=Path(__file__).resolve().parents[2]+OUT=B/'test-packages'/T;REPORT=B/'reports'/T;BUILD=B/'build/claude-screen-recording-20261022'+head=subprocess.check_output(['git','-C',str(ROOT),'rev-parse','HEAD'],text=True).strip()+assert not subprocess.check_output(['git','-C',str(ROOT),'status','--porcelain']).strip(),'commit the source before sealing'+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+pkg=OUT/'Veyra-2.1.0-nr1-NVIDIA-update';assert not pkg.exists();pkg.mkdir(parents=True)+def copy(src,relative):+ dst=pkg/relative;dst.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(src,dst)+copy(BUILD/'veyra_qml_ui.exe','veyra_qml_ui.exe')+for folder in ['qml','i18n']:+ for p in (ROOT/folder).rglob('*'):+ if p.is_file():copy(p,Path(folder)/p.relative_to(ROOT/folder))+for name in ['NR_MANUAL_SCALE_PLAN_2026-10-24.md','NR_MANUAL_SCALE_REPORT_2026-10-24.md','FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.md']:+ copy(ROOT/'docs'/name,Path('docs')/name)+for name in ['LICENSE','THIRD_PARTY_NOTICES.md']:copy(ROOT/name,name)+note='''# Veyra 2.1.0-nr1 本地小更新(NVIDIA)++这是更新层,需要已有完整的2.1.0 NVIDIA便携包。+关闭播放器,把本目录里的文件复制到原包根目录(veyra_qml_ui.exe所在目录),覆盖同名文件,再启动。+本更新不包含、不替换任何DLL/模型/运行库,不包含用户配置。不要将文件放进额外嵌套目录后直接启动EXE。++- NR内部处理分辨率新增“手动”:25%–100%,1%步进,松开滑条后生效;支持键盘、输入与重置。+- 比例针对该层输入的宽高;50%约为四分之一像素,输出尺寸不变。仅视频预览,图片/视频导出合同不变。+- 列表/节点共用,每层独立,当前手动比例保存在预设/会话中;旧版不识别新手动档,应使用本更新读取。+- 包含当前分支此前的录制、AMD超分关闭和画面旋转修复。Lecram仍暂停。+- 补帧“调度降档”本轮只排查,未改调度代码;详细结论见docs/FG_SCHEDULING_LOG_DIAGNOSIS_2026-10-24.md。+- 本机RTX5070通过1080p/4K真实NR推理、节点、重启恢复与110项QtQuick测试;AMD实卡/HDR/真实采集长期运行未在本轮验收。++内部版本2.1.0-nr1,PE数值版本仍为2.1.0.0。LOCAL_UPDATE.json记录更新层与源码提交;原package-manifest.json只代表原完整包,更新后的EXE/UI以LOCAL_UPDATE.json为准。+源码在本机Veyra工作树;这是本地测试更新,未合main、未推送或公开发布。GPL及第三方声明随更新保留。+'''+(pkg/'README-NR1.zh-CN.md').write_text(note,'utf8')+files=[dict(path=p.relative_to(pkg).as_posix(),bytes=p.stat().st_size,sha256=sha(p)) for p in sorted(pkg.rglob('*')) if p.is_file()]+assert not any(Path(x['path']).suffix.lower() in ['.dll','.onnx','.tflite','.lib','.pdb','.hsaco','.dxil'] for x in files)+manifest=dict(version='2.1.0-nr1-local-update',base='Complete Veyra 2.1.0 NVIDIA portable package',sourceCommit=head,sourceWorktree=str(ROOT),localOnly=True,releaseReady=False,containsRuntime=False,files=files)+(pkg/'LOCAL_UPDATE.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=1),'utf8')+archive=OUT/(pkg.name+'.zip');assert not archive.exists()+with zipfile.ZipFile(archive,'x',zipfile.ZIP_DEFLATED,compresslevel=6) as z:+ for p in pkg.rglob('*'):+ if p.is_file():z.write(p,p.relative_to(pkg).as_posix())+with zipfile.ZipFile(archive) as z:+ assert z.testzip() is None+ for e in files:assert hashlib.sha256(z.read(e['path'])).hexdigest()==e['sha256']+result=dict(sourceCommit=head,package=str(pkg),zip=str(archive),bytes=archive.stat().st_size,sha256=sha(archive),exeSha256=sha(pkg/'veyra_qml_ui.exe'),manifestFiles=len(files),runtimeFiles=0)+(REPORT/'update-package.json').write_text(json.dumps(result,ensure_ascii=False,indent=1),'utf8');print(json.dumps(result,ensure_ascii=False),flush=True)diff --git a/src/engine/EffectChain.cpp b/src/engine/EffectChain.cppindex d0627205..0dad06b7 100644--- a/src/engine/EffectChain.cpp+++ b/src/engine/EffectChain.cpp@@ -553,7 +553,8 @@ ChainValidation compileChainExecutionPlan(const EffectChain& chain, const ChainEconst auto policy = boundedAmd?pipeline::NrSizePolicy::Realtime:request.exportJob ? pipeline::NrSizePolicy::Native : node.nr.sizePolicy;step.processing = pipeline::ResolutionPlan::make(cursor, false, policy,- (request.stillImage || request.exportJob)&&!boundedAmd, 0, request.srTarget).nr;+ (request.stillImage || request.exportJob)&&!boundedAmd, 0, request.srTarget,false,+ currentNrRuntime(node.nr.runtime)==NrRuntime::LmxxfAmd?1080u:0u).nr;}plan.steps[plan.stepCount++] = step;cursor = step.output;diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cppindex d7bdaa54..2c52aadc 100644--- a/src/ui/QmlPlayerBridge.cpp+++ b/src/ui/QmlPlayerBridge.cpp@@ -6039,6 +6039,7 @@ QVariantList QmlPlayerBridge::nrLayers() const {if(node.type!=engine::EffectType::NrEnhance)continue;const auto& n=node.nr;out<<QVariantMap{{"index",int(i)},{"enabled",node.enabled},{"sizePolicy",int(n.sizePolicy)},{"runtime",int(engine::currentNrRuntime(n.runtime))},+ {"manualSize",pipeline::manualNrSizePolicy(n.sizePolicy)},{"sizePercent",int(pipeline::nrSizePercent(n.sizePolicy))},{"intensity",n.model.intensity},{"tone",n.model.tone},{"structure",n.model.structure},{"skin",n.model.skin},{"style",n.model.style},{"autoMask",bool(n.model.autoMask)},{"uiCorrection",bool(n.model.uiCorrection)},{"performance",n.model.performance},{"total",n.residual.total},@@ -6113,13 +6114,20 @@ bool QmlPlayerBridge::setNrLayerParameter(int index,const QString& key,double vaelse if(key=="luminanceRetention")n.residual.correction.lumaKeep=float(value);else if(key=="shadowProtection")n.residual.correction.shadow=float(value);else if(key=="correctionAmount")n.residual.correction.autoAmount=float(value);+ else if(key=="sizePercent"){+ if(value!=std::floor(value)||value<pipeline::kNrMinimumPercent||value>pipeline::kNrMaximumPercent)return false;+ n.sizePolicy=pipeline::nrSizePolicyForPercent(unsigned(value));+ }+ else if(key=="sizePolicy"){+ if(value!=std::floor(value)||value<0||value>int(pipeline::NrSizePolicy::Manual))return false;+ const auto policy=static_cast<pipeline::NrSizePolicy>(int(value));+ if(!pipeline::validNrSizePolicy(policy))return false;+ if(policy==pipeline::NrSizePolicy::Auto){const auto reason=nrAutoSelectionReason(index);if(!reason.isEmpty()){emit notice(reason,true);return false;}}+ n.sizePolicy=policy;+ }else {if(value!=std::floor(value)||value<0||value>6)return false;- if(key=="sizePolicy"){- if(value==6){const auto reason=nrAutoSelectionReason(index);if(!reason.isEmpty()){emit notice(reason,true);return false;}}- n.sizePolicy=static_cast<pipeline::NrSizePolicy>(int(value));- }- else if(key=="style"&&value<=2)n.model.style=int(value);+ if(key=="style"&&value<=2)n.model.style=int(value);else if(key=="autoMask"&&value<=1)n.model.autoMask=int(value);else if(key=="uiCorrection"&&value<=1)n.model.uiCorrection=int(value);else if(key=="performance"&&value<=1&&engine::nrUsesPerformanceModel(n.runtime))n.model.performance=value!=0;diff --git a/tests/qml/quick/tst_components.qml b/tests/qml/quick/tst_components.qmlindex e49113b3..6091550d 100644--- a/tests/qml/quick/tst_components.qml+++ b/tests/qml/quick/tst_components.qml@@ -72,8 +72,9 @@ Item {width: 1480; height: 1500; z: 20property int lastIndex: -1property string lastKey: ""+ property int editCount: 0property var rows: [0,1,2,3].map(i => ({- index: 2*i+1, enabled: true, runtime: 2, sizePolicy: 0, intensity: 1, performance: true,+ index: 2*i+1, enabled: true, runtime: 2, sizePolicy: 0, manualSize: false, sizePercent: 100, intensity: 1, performance: true,tone: 1, structure: 1, skin: -1, style: 0, autoMask: false,uiCorrection: false, total: 1, darken: 1, brighten: 1,color: 1, luminance: 1, temporal: false, antiFlicker: 2,@@ -84,10 +85,13 @@ Item {shadowProtection: 0, correctionAmount: 1}))function edit(nodeIndex,key,amount) {- lastIndex=nodeIndex; lastKey=key+ lastIndex=nodeIndex; lastKey=key; editCount++const next=rows.map(r => Object.assign({},r))if(key==="correctionEnabled"||key==="correctionAuto")amount=Boolean(amount)- next.find(r => r.index===nodeIndex)[key]=amount+ const row=next.find(r => r.index===nodeIndex)+ row[key]=amount+ if(key==="sizePercent") { row.manualSize=true; row.sizePolicy=100+amount }+ if(key==="sizePolicy") { row.manualSize=false; row.sizePercent=100 }rows=next}Repeater {@@ -430,7 +434,7 @@ Item {tryCompare(card,"open",true)const resolution=findChild(card,"nr-resolution")compare(resolution.options.slice(0,6).map(o=>o.label).join(","),"480p,720p,900p,1080p · 默认,1440p,原生")- compare(resolution.options.length,7)+ compare(resolution.options.length,8)compare(resolution.options[6].id,"6")compare(resolution.options[6].disabled,true)pickOption(resolution,optionIndices[i])@@ -451,6 +455,41 @@ Item {}}+ function test_nr_manual_percent_release_keyboard_and_reset() {+ const fixture=createTemporaryObject(nrFixture,root)+ verify(waitForPolish(root.Window.window))+ const card=findChild(fixture,"nr-card-1")+ mouseClick(card,40,24);tryCompare(card,"open",true)+ const select=findChild(card,"nr-resolution")+ const row=findChild(card,"nr-manual-size-row")+ compare(row.visible,false)+ pickOption(select,7)+ tryCompare(row,"visible",true)+ const slider=findChild(card,"nr-size-percent")+ compare(slider.value,100);compare(slider.live,false);compare(slider.stepSize,1)+ const before=fixture.editCount+ const x=slider.trackWidth-1,y=slider.height/2+ mousePress(slider,x,y)+ for(let i=1;i<=8;++i)mouseMove(slider,x-i*slider.trackWidth/12,y)+ wait(100)+ compare(fixture.editCount,before) // GPU size is committed only on release.+ mouseRelease(slider,x-slider.trackWidth*2/3,y)+ verify(fixture.rows[0].sizePercent>=48&&fixture.rows[0].sizePercent<=51)+ const chosen=fixture.rows[0].sizePercent+ compare(fixture.rows[1].manualSize,false)+ keyClick(Qt.Key_Right);compare(fixture.rows[0].sizePercent,chosen+1)+ slider.openEditor()+ const input=findChild(slider,"vslider-editor-input")+ input.text="24";keyClick(Qt.Key_Return);compare(fixture.rows[0].sizePercent,25)+ keyClick(Qt.Key_Left);compare(fixture.rows[0].sizePercent,25)+ slider.openEditor();input.text="75.4";keyClick(Qt.Key_Return)+ compare(fixture.rows[0].sizePercent,75)+ pickOption(select,1);compare(row.visible,false)+ pickOption(select,7);compare(fixture.rows[0].sizePercent,75)+ mouseClick(findChild(slider,"vslider-reset"));compare(fixture.rows[0].sizePercent,100)+ keyClick(Qt.Key_Right);compare(fixture.rows[0].sizePercent,100)+ }+function test_nr_correction_mouse_controls() {const fixture=createTemporaryObject(nrFixture,root)verify(waitForPolish(root.Window.window))diff --git a/tests/unit/NrModelSettingsTests.cpp b/tests/unit/NrModelSettingsTests.cppindex 196853bf..a353ecf6 100644--- a/tests/unit/NrModelSettingsTests.cpp+++ b/tests/unit/NrModelSettingsTests.cpp@@ -94,5 +94,49 @@ int wmain(int argc,wchar_t** argv){auto amdSession=std::make_unique<ChainSession>(ChainSession::initial(mixedAmd));ChainSessionStore amdSessions(out/L"amd-session.v1");auto amdRestored=std::make_unique<ChainSession>();check(amdSessions.save(*amdSession)&&amdSessions.load(*amdRestored)&&*amdSession==*amdRestored,"AMD mixed models survive complete session restore");+ {+ using pipeline::Extent;using pipeline::NrSizePolicy;using pipeline::ResolutionPlan;+ check(int(NrSizePolicy::Auto)==6&&int(NrSizePolicy::Realtime)==0&&int(NrSizePolicy::Native)==1,"manual sizes preserve every existing preset ID");+ bool allSizes=true;+ for(unsigned percent=25;percent<=100;++percent){+ const auto policy=pipeline::nrSizePolicyForPercent(percent);+ const auto plan=ResolutionPlan::make({3840,2160},false,policy,false);+ const Extent expected{percent==100?3840u:(3840u*percent/100)&~1u,percent==100?2160u:(2160u*percent/100)&~1u};+ allSizes&=pipeline::validNrSizePolicy(policy)&&pipeline::nrSizePercent(policy)==percent&&plan.nr==expected&&plan.output==Extent{3840,2160};+ allSizes&=ResolutionPlan::make({3840,2160},false,policy,true).nr==Extent{3840,2160};+ allSizes&=ResolutionPlan::make({1,1},false,policy,false).nr==Extent{1,1};+ }+ check(allSizes,"all 76 percentages change NR dimensions only, keep offline native size and never make zero textures");+ check(!pipeline::validNrSizePolicy(pipeline::nrSizePolicyForPercent(24))&&!pipeline::validNrSizePolicy(pipeline::nrSizePolicyForPercent(101))&&+ !pipeline::validNrSizePolicy(NrSizePolicy(7))&&!pipeline::validNrSizePolicy(NrSizePolicy(124))&&!pipeline::validNrSizePolicy(NrSizePolicy(201)),"invalid manual percentages and reserved policy IDs fail closed");+ check(ResolutionPlan::make({1080,1920},false,pipeline::nrSizePolicyForPercent(50),false).nr==Extent{540,960},"portrait manual scale applies to width and height");+ auto manual=s;manual.nrLayers[0].sizePolicy=pipeline::nrSizePolicyForPercent(50);manual.nrLayers[1].sizePolicy=pipeline::nrSizePolicyForPercent(75);+ EnhancementSettings mr=manual;fromChain(toChain(manual),mr);+ check(mr.nrLayers[0].sizePolicy==manual.nrLayers[0].sizePolicy&&mr.nrLayers[1].sizePolicy==manual.nrLayers[1].sizePolicy,"two manual layers retain independent settings through the shared chain");+ StageRequest preview;preview.width=3840;preview.height=2160;preview.nr=true;pipeline::EnhanceGraphDesc md;describeStages(preview,mr,md);+ check(md.nrLayersExtent==std::vector<Extent>{{1920,1080},{2880,1620}}&&md.workWidth==3840&&md.workHeight==2160&&md.validateFixedExecutionPlan().empty(),"compiled list graph runs independent percentages and retains full output");+ preview.sr=true;preview.width=1920;preview.height=1080;mr.lowLatency=true;+ for(auto& n:mr.nrLayers)n.lowLatencyPairing=true;+ describeStages(preview,mr,md);+ check(md.nrBeforeSr&&md.nrLayersExtent==std::vector<Extent>{{960,540},{1440,810}}&&md.workWidth==3840,"NR-before-SR percentages use the actual source-sized input");+ preview.sr=false;preview.width=3840;preview.height=2160;preview.amdNr=true;preview.nvidiaAdapter=false;mr.nrRuntime=NrRuntime::LmxxfAmd;+ for(auto& n:mr.nrLayers)n.runtime=NrRuntime::LmxxfAmd;+ describeStages(preview,mr,md);+ check(md.nrLayersExtent==std::vector<Extent>{{960,540},{1440,810}}&&md.validateFixedExecutionPlan().empty(),"AMD manual preview percentages stay within its existing model budget");+ preview.exportJob=true;describeStages(preview,mr,md);+ check(md.nrLayersExtent==std::vector<Extent>{{1920,1080},{1920,1080}}&&md.workWidth==3840,"AMD video export preserves its previous bounded model and full-size output");+ mr.nrRuntime=NrRuntime::Ampere;for(auto& n:mr.nrLayers)n.runtime=mr.nrRuntime;preview.amdNr=false;preview.nvidiaAdapter=true;describeStages(preview,mr,md);+ check(md.nrLayersExtent==std::vector<Extent>{{3840,2160},{3840,2160}},"NVIDIA export does not silently inherit preview downsampling");+ PresetLibrary ml(out/L"manual-library.v1");ml.setIncludeBuiltins(false);PresetEntry me;me.name=L"manual percentages";me.chain=toChain(manual);+ const bool saved=ml.load()&&ml.put(me);PresetLibrary mlr(out/L"manual-library.v1");mlr.setIncludeBuiltins(false);+ check(saved&&mlr.load()&&mlr.entries().size()==1&&mlr.entries()[0]==me,"manual percentages survive an actual disk preset reload");+ PresetStore ms(out/L"manual-flat.v1");const bool flatSaved=ms.load()&&ms.put(L"manual",manual)&&ms.setDefault(0);PresetStore msr(out/L"manual-flat.v1");+ check(flatSaved&&msr.load()&&msr.defaultSettings()==manual,"legacy flat store retains each manual layer without a POD schema change");+ auto session=std::make_unique<ChainSession>(ChainSession::initial(manual));session->select(ChainMode::Node);+ auto& config=session->configurations[1];auto doc=std::make_shared<NodeEditorDocument>();doc->nodes=config.chain;+ check(doc->layout.initialize(doc->nodes).accepted,"manual node document initializes");doc->nodes.firstOf(EffectType::NrEnhance)->nr.sizePolicy=pipeline::nrSizePolicyForPercent(37);config.editor=doc;+ ChainSessionStore sc(out/L"manual-session.v1");auto reload=std::make_unique<ChainSession>();+ check(sc.save(*session)&&sc.load(*reload)&&*reload==*session,"List, Nodes and detached node drafts retain independent percentages across disk session restore");+ }std::cout<<"NR model settings failures="<<failures<<std::endl;return failures?1:0;}