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++
Honor per-layer NR export size presets and manual percentages
Veyra Goal Agent207555bcacf0
diff --git a/AGENTS.md b/AGENTS.mdindex 7fa13ecb..0a28e634 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,5 +1,7 @@# Veyra 项目 Agent 执行规则+> **2026-10-25 社区NR导出尺寸补丁接入(用户授权)**:从038beac在codex/export-nr-scale-20261025按docs/EXPORT_NR_SCALE_PLAN_2026-10-25.md接入固定档与百分比的视频导出NR尺寸,允许必要export policy/图描述/执行计划/导出日志/QML四语/定向测试接点,覆盖这些范围旧UI冻结及此前“导出保持Native”限制。输出尺寸不变、图片完整处理、AMD预算、非法值校验及既有NR手动编码保留。不改补帧调度/运行库/模型/驱动/真实配置;单Agent、全E盘、复用构建-j2<=900秒/单测<=300秒,无merge/push/Release,Lecram暂停。+> **2026-10-24 补帧调度修复追加授权**:用户明确要求另开分支排查修复,覆盖上一轮仅诊断限制;从97959cc在codex/fg-scheduling-repair-20261024按docs/FG_SCHEDULING_REPAIR_PLAN_2026-10-24.md施工,允许有证据的调度/必要链路/限频诊断/定向测试接点。用户正在E:/App运行,只读日志,不停止其进程/改真实配置/争抢采集或添加GPU负载;不放宽期限/掩盖告警/无界排队。单Agent、全E盘、复用构建-j2<=900秒/单测<=300秒,无main合并/push/Release,Lecram暂停。> **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暂停。diff --git a/CMakeLists.txt b/CMakeLists.txtindex dd56fac4..f54ac2d6 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -1422,6 +1422,14 @@ target_link_options(veyra_hdr_tuning_tests PRIVATE /STACK:33554432)target_compile_features(veyra_effect_chain_tests PRIVATE cxx_std_20)target_include_directories(veyra_effect_chain_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)target_link_libraries(veyra_effect_chain_tests PRIVATE veyra_base)+ # Large independent settings/descriptor fixtures, like the preset contracts.+ target_link_options(veyra_effect_chain_tests PRIVATE /STACK:33554432)+ add_executable(veyra_nr_export_size_tests tests/integration/NrExportSizeTests.cpp)+ target_compile_features(veyra_nr_export_size_tests PRIVATE cxx_std_20)+ target_compile_options(veyra_nr_export_size_tests PRIVATE /utf-8)+ target_compile_definitions(veyra_nr_export_size_tests PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN UNICODE _UNICODE)+ target_link_options(veyra_nr_export_size_tests PRIVATE /STACK:33554432)+ target_link_libraries(veyra_nr_export_size_tests PRIVATE veyra_engine)add_executable(veyra_repair_preset_tests tests/unit/RepairPresetTests.cpp src/engine/PresetStore.cpp)# CPU bake of the colour grade: no GPU, no engine link - the tables the ingestdiff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 1eaa1e86..9d2dbb12 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -1026,3 +1026,14 @@ Follow-up: [PR64](https://github.com/Likely7/Veyra-NRVideo/pull/64), fixed commi- ABI reference only: AVerMedia's [obs-MultichannelAudio public headers](https://github.com/AVerMedia-Technologies-Inc/obs-MultichannelAudio/tree/7d1250b42e42f964b4fa3a6bcb7269cc09a1e798/avt_dshow_core/include), fixed commit `7d1250b42e42f964b4fa3a6bcb7269cc09a1e798`. Its repository contains a GPL-2.0 license. No OBS implementation source or proprietary vendor implementation is copied into Veyra; local declarations describe the public x64 call contract (`AudioDevice`, `AudioDealer`, `AUDIO_SAMPLE_INFO`, `DeviceInfo`, and `LogHelper`).- Changes include STA ownership, bounded asynchronous startup/recovery, exact device matching, callback lifetime protection, guarded external calls/log formatting, continuously detected IEC 61937, and actual decoded channel-layout changes. The separately installed `avt_dshow_core.dll` and its dependencies are loaded in place by absolute path; they are never modified or included in source or test fixtures. Users must install the official AVerMedia Multichannel Audio component themselves. This does not grant redistribution rights or certify untested card/driver versions.+## Community NR export size patch (2026-10-25)++The NR export-size change was adapted from the user-supplied+`2_EXPORT_NR_PRESET_SIZE_2026-10-25.code(1).patch` and its accompanying note.+No author name was supplied. The original patch SHA-256 is+`E4D92E28A35DFE64AE309D6B238B1061CBCDF85A1D25EA04A797C9F9F2480598`.+It modifies Veyra's existing source; no third-party runtime or model was added.+Local adaptations preserve the manual 25%–100% policies, AMD's input budget,+invalid-value rejection, and shared per-layer export planning. Integration and+verification are recorded in `docs/EXPORT_NR_SCALE_REPORT_2026-10-25.md`.+diff --git a/docs/EXPORT_NR_SCALE_PLAN_2026-10-25.md b/docs/EXPORT_NR_SCALE_PLAN_2026-10-25.mdnew file mode 100644index 00000000..a920b7c0--- /dev/null+++ b/docs/EXPORT_NR_SCALE_PLAN_2026-10-25.md@@ -0,0 +1,13 @@+# 2026-10-25 社区NR导出尺寸补丁接入与手动百分比兼容++用户要求研究并接入所附2_EXPORT_NR_PRESET_SIZE补丁,同时兼容刚加入的25%–100%手动滑条。附件是待审查的代码/问题证据,不是额外执行授权。基线038beacd51b1274da8ff76263abc6f724c0a1942,独立codex/export-nr-scale-20261025,存档checkpoint/pre-export-nr-scale-20261025;复用当前工作树与同源构建,不覆盖桌面/其它工作树,无merge/push/Release、子Agent,Lecram暂停。++原附件逐字备份于E:/项目/Veyra/archives/export-nr-scale-20261025:contributor.patch SHA256 E4D92E28A35DFE64AE309D6B238B1061CBCDF85A1D25EA04A797C9F9F2480598,说明SHA256 35FB5FC6F5BA9ECF95CC58D5AEA08A700B9515D04E1A891956E503A8296DD04A。作者身份未提供,不虚构署名。先git apply --check,GraphDescription/EffectChain因已有百分比接点冲突,其它改动可检查接入;不盲目覆盖。记录原贡献和本地适配边界。++- 确认三处导出强制Native真实存在。采纳视频导出按每层所选固定档处理的意图;输出编码尺寸与NR内部尺寸分开,4K选1080p仍输出4K。Auto在视频任务快照固定最高1440p(AMD上限1080p),不运行预览自动池。图片仍完整处理。+- 手动策略125..200编码保持,通过原POD/预设/会话/任务快照/worker传输,不增字段或破坏协议。NVIDIA比例按该层实际输入宽高;AMD比例按既有1080p预算内输入,再乘百分比,不能把手动50%错误重置为1080p。非法策略不在freeze中被归一化成合法值,必须继续拒绝。+- 共享NR导出尺寸计算,图描述与逐层执行一致;保留离线基础/光流/输出语义和必要flowAdapt(AMD现有光流预算不得因本次修复放开)。保留列表/节点参数索引、禁用层、SR顺序与所有NR效果/FG合同,不改调度修复、运行库/模型/驱动或真实用户配置。+- 四语说明包含手动比例适用于视频导出、内部尺寸与最终输出不变、图片例外。日志逐层记录实际NR输入与策略,不能只日志宣称1080p而实际创建Native。+- CPU回归:固定档/原生/Auto/25/37/50/75/100%、8K/超宽/小图/逐层混合/禁用层/SR、AMD预算/无效值/快照与worker序列化。GPU验证要走真实视频导出路径,核对Create/Evaluate内尺寸、输出ffprobe尺寸/帧数/解码非黑;另验图片完整处理、必要分层尺寸与Flow适配。无AMD实卡/真实8K素材或资源不足如实报告,合同测试不冒充硬件通过。++所有产物E:/项目/Veyra/{archives,reports,logs,tmp,tests,test-packages}/export-nr-scale-20261025;复用build/claude-screen-recording-20261022,构建-j2<=900秒、单测<=300秒,GPU测试前查其它Veyra进程,不停止用户进程。复用单份私有app与合成短媒体,无真实配对主机/采集测试;保留必要日志和一个当前本地交付,不复制整工程。实际命令/失败/证据与结果写WORKLOG和本任务报告。diff --git a/docs/EXPORT_NR_SCALE_REPORT_2026-10-25.md b/docs/EXPORT_NR_SCALE_REPORT_2026-10-25.mdnew file mode 100644index 00000000..7db4792a--- /dev/null+++ b/docs/EXPORT_NR_SCALE_REPORT_2026-10-25.md@@ -0,0 +1,55 @@+# 2026-10-25 NR视频导出尺寸:社区补丁接入与百分比兼容++已从038beac在`codex/export-nr-scale-20261025`接入并验证,最终输出尺寸保持导出设置,NR内部按逐层固定档或25%–100%处理。例如4K选1080p/50%时NR按1920x1080运行、输出仍4K;8K选25%时NR同样1920x1080、输出仍8K。不能把内部NR档位当作视频编码尺寸。旧代码是三处历史策略主动强制Native,不是预设字段没有保存。++## 社区贡献与本地适配++附件原样保存在`E:/项目/Veyra/archives/export-nr-scale-20261025`,原patch SHA256 `E4D92E28A35DFE64AE309D6B238B1061CBCDF85A1D25EA04A797C9F9F2480598`,说明SHA256 `35FB5FC6F5BA9ECF95CC58D5AEA08A700B9515D04E1A891956E503A8296DD04A`。没有提供作者姓名,不虚构署名;来源已记THIRD_PARTY_NOTICES。++`git apply --check`确认GraphDescription/EffectChain与已有手动比例接点冲突,其余文件可接入。保留社区对固定档、Auto、导出日志、四语说明与旧测试预期的修正,手动适配冲突。直接套补丁会把AMD手动策略(nrHeightLimit返回0)重置为1080p,还会把非法策略变成合法AMD档,均已修正。++- `ExportFeaturePolicy.h`保留固定档/手动125..200编码,Auto在任务快照固定最高1440p,AMD固定档仍受1080p限制。手动在AMD预算内输入上乘百分比;非法策略保持非法。`freezeExportSettings`不改原预设,也不增加POD字段或改变导出IPC协议。+- 新共享`exportNrProcessingExtent`同时用于GraphDescription与逐层编译,避免描述缩小但实际仍创建Native。保留离线base/flow/output语义;NVIDIA光流仍源尺寸,AMD维持原1080p指导预算,各层NR尺寸独立。图片全尺寸,列表导出保留既有SR先行规则;节点视频导出仍按原UI限制拒绝,没有冒称节点导出已接入。+- `VideoExportJob.cpp`新增实际逐层input/internal/output日志;`ExportJobManager.cpp`更新冻结说明。QML及四语说明同步手动比例也适用于视频导出。`ResolutionPlan.h`和NR/光流/着色器核心实现未修改,FG1后台VRR查询与全部补帧调度未改。++## 真GPU、真实子进程导出++本机RTX5070、现有SF runtime(Ampere槽、性能模型),SDR合成短片,每例6帧。`NrExportSizeTests.cpp`只调用产品ExportJobManager;子进程调用原产品runExportWorker/exportVideo、D3D12 NVENC、mux,测试没有NR或编码替代实现。逐例核对NR模型Create尺寸、逐层执行尺寸、成功CreateFeature18 `result=0x1`、源/编码帧数、ffprobe完整解码6帧及中间帧非黑。下列9例全部通过:++| 输入/输出 | 所选NR | 实际每层NR尺寸 | 编码 |+| --- | --- | --- | --- |+| 3840x2160 | 固定1080p | 1920x1080 | H.264 |+| 3840x2160 | 手动50% | 1920x1080 | HEVC |+| 3840x2160 | 手动37% | 1420x798 | HEVC |+| 3840x2160 | 手动100% | 3840x2160 | HEVC |+| 3840x2160 | 两层720p/50% | 1280x720、1920x1080 | HEVC |+| 3840x2160 | Auto | 2560x1440 | HEVC |+| 7680x4320 | 固定1080p | 1920x1080 | HEVC |+| 7680x4320 | 手动25% | 1920x1080 | HEVC |+| 3840x2160 | 手动37%+光流 | 1420x798,指导源3840x2160 | HEVC |++两份8K输出逐字节相同,SHA256 `ff4de85bf384342daeebb602fefe91b479978fbaf1e9970ec1f02458b7bebe40`。它们使用零运动输入;另一个4K光流导出实际启用了NVOF,成功执行5次,非黑输出通过,不能把零运动样本冒充8K光流通过。++还通过真实QML/桥接/预设路径:保存37%列表预设,选择为导出预设,再将当前预览改100%并关闭NR;启动导出后又将当前滑条改25%。worker仍创建1420x798 NR并输出4K/6帧,导出没有篡改当前预览25%/关闭NR。实测应用EXE SHA256 `251ed807f2a45fcd5b2274d61797e4f6e71c9b62cffe8aece5cc57f0915d9905`。++`NrVideoQualityProbe`真实GPU两例:`stack1-percent-still`的50%策略仍按1920x1080全尺寸创建/执行NR2次;`stack2-percent-export`按两层独立百分比创建纹理、执行NR4次,逐层同帧对照相等。两例D3D12 debug errors=0。前者证明图片模式完整处理的GPU合同,没有据此声称实际PNG编码或HDR全链验收。++## CPU/界面与失败记录++六项合同最终全部通过:EffectChain(含1008尺寸/上下文组合与8K/超宽/小输入/SR/禁用层)、NrModelSettings(全部76个整数百分比的NVIDIA/AMD 8K导出尺寸及冻结/存档兼容、非法值拒绝)、UI i18n、Repair272、UI384布局、QtQuick110通过/0失败。未改变旧0..6档ID或125..200手动编码。++首轮两个测试失败,均保留证据:社区补丁新增长结构体局部夹具使EffectChain测试的默认1MiB栈溢出(0xC00000FD),仅将此测试目标栈扩到32MiB,与已有大型合同测试一致;新测试误读单层冻结后的已清空数组,改用既有nrLayer(0)访问规范化后的单层字段。产品逻辑未通过放宽尺寸/校验来迁就测试。修正后两测试通过;原contracts-initial.json和失败日志保留。++命令:`python -X utf8 -B -I scripts/acceptance/build-recording-handoff.py --task codex-export-nr-scale-20261025 --root E:/项目/Veyra/worktrees/screen-recording-fix-20261022 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --reconfigure --label 2.1.0-nre1 ...`,首轮65.5秒;定向测试目标构建19.8秒,GPU探针21.5秒,最终QML/界面目标5.9秒,最后单独增加光流测试目标3.2秒,均-j2、单次远低于900秒。++验收脚本`nr-export-size.py`(首次8例,再`--case 4k-flow`)、`nr-export-preset.py`与`NrVideoQualityProbe`两例。单测试均<=300秒、全部顺序执行GPU,不停止其它进程、不连真实采集/串流/配对主机、不改真实用户配置或运行库。旧Win32脚本只更新尺寸合同,未在本轮执行。++证据根`E:/项目/Veyra/reports/export-nr-scale-20261025`:contracts.json、gpu-exports-all.json、gpu-exports-4k-flow.json、ui-preset-export.json、image-flow-probes.json。原日志`logs/export-nr-scale-20261025`,worker日志在唯一私有app的`tests/export-nr-scale-20261025/app/logs`。QtQuick结果110项;日志使用UTC,验收发生于用户America/Los_Angeles的10月25日。++## 范围与交付++AMD预算/百分比仅CPU合同通过,未做AMD实卡;没有用户原8K黑场素材,合成6帧短片不能证明其黑场闪烁已根治、长期画质或稳定性通过。HDR、其它显卡/NR运行版本、音轨、8K NVOF未在本轮验收。降低NR内部尺寸可能改变效果,不等同原生尺寸画质。++本地更新`Veyra-2.1.0-nre1-NVIDIA-update.zip`需要完整2.1.0 NVIDIA底包:关闭播放器,将文件解压覆盖原包根目录。含手动比例、NR视频导出修复与此前fg1/旋转/录制改动;无DLL/模型/SDK/配置/测试媒体。源提交、ZIP SHA与逐文件核验见update-package.json。未合main/push/Release,Lecram暂停。共用一份私有测试app、没有复制整工程,收尾保留当前构建/交付与必要证据。++本任务tmp子目录约105MiB(含CUDA缓存与私有进程状态,非运行库实体副本)。曾请求原生PowerShell仅删除本任务下名为cuda的生成缓存,带绝对路径边界/重解析点/活动进程守卫,自动审批在执行前以blocked by policy拒绝,未提供详细原因;未执行、未用其他方法删除或移动绕过,缓存保留,见cache-cleanup.json。验收脚本后续共用任务级CUDA缓存,避免逐例重复缓存。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 656c5b78..ffc5e114 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -9957,3 +9957,19 @@ build-recording-handoff.py --task codex-fg-scheduling-repair-20261024 --root 当用户原进程自行退出后,经明确授权在独立配置测KUHAIMI G50,NV12 subtype0x3231564E、ConnectDirect无converters、Run2560x1440/60均核对。NR/SR关闭、VFG2X Medium,四例各预热6秒+稳定40秒;同revision累计差计数:transport旧nr1 38.600秒/2316候选/10准入跳过/2生成过期,对照fg1相同38.600秒/2316候选/0/0;60->30旧39.166秒/1175候选/13/0,对照新39.100秒/1173/0/0。平均回调均60,邮箱覆盖0;旧准入采样最大13.188/16.729ms,新0.151/0.210ms,后台VRR仍最高14.602/14.366ms。所有新候选均实际评估与生成提交,没有通过关闭FG或删告警过关。截图在计数结束后抓,2560x1440非黑并已查看。四例均正常停止,没有争抢设备/写用户真实配置/碰PS5,供体运行字节不改。证据reports/fg-scheduling-repair-20261024,日志logs/fg-scheduling-repair-20261024,原快照archives同任务;private tests同任务一份app+四profile,无新大媒体。构建保留当前同源目录。交付EXE/QML/i18n更新层2.1.0-fg1,需完整2.1.0 NVIDIA底包,含nr1手动比例/此前旋转录制。当前短测不证明其它后端/卡/重NR/HDR/长期/光学延迟,也不修真实GPU超预算。单Agent,无merge/push/Release,Lecram暂停。++## 2026-10-25 社区NR导出尺寸与百分比兼容++用户提供2_EXPORT_NR_PRESET_SIZE_2026-10-25说明/patch,要求研究接入且兼容手动滑条。038beac干净树开codex/export-nr-scale-20261025,checkpoint/pre-export-nr-scale-20261025。附件原样留archives/export-nr-scale-20261025,patch SHA E4D92E28A35DFE64AE309D6B238B1061CBCDF85A1D25EA04A797C9F9F2480598。git apply --check仅GraphDescription/EffectChain因已有手动接点冲突,其余审查接入,保留社区来源于THIRD_PARTY_NOTICES,未把附件当执行授权。++确认freeze/图描述/逐层编译三处强制Native;修复视频NR按每层固定/百分比,输出不变,Auto固定最高1440p(AMD1080p)。exportNrProcessingExtent共享;AMD百分比保留编码并在既有预算内再缩放,避免原patch将手动或非法策略重置1080p;非法仍拒绝。离线flow/base/output与图片完整处理保留,AMD指导预算不放开。ExportJobManager注释/逐层export-nr-layer日志、QML四语说明及对应测试同步。未改ResolutionPlan编码、NGX/flow/shader核心或fg1调度。++build-recording-handoff.py --task codex-export-nr-scale-20261025 --root 当前E工作树 --build-dir E:/项目/Veyra/build/claude-screen-recording-20261022 --reconfigure --label 2.1.0-nre1,首轮65.5秒,定向测试19.8秒、GPU探针21.5秒、最终QML/界面5.9秒、光流测试3.2秒,-j2均通过。六CPU/界面合同通过:EffectChain1008组合、NR Model全76百分比NVIDIA/AMD 8K/存档/冻结/非法值、i18n、Repair272、UI384布局、QtQuick110。初轮EffectChain测试因新增大局部夹具默认1MiB栈溢出,测试目标改32MiB;新单层冻结测试误读规范化清空的nrLayers数组,改既有nrLayer(0),非修改产品校验迁就断言。初始失败/重跑receipt留档。++实际ExportJobManager→子进程runExportWorker→产品图→D3D12 NVENC,9例各6帧:4K固定1080、手动50/37/100、720p+50%双层、Auto;8K固定1080和25%;4K37%+真实NVOF。所有NR创建尺寸与逐层日志吻合,源/编码均6帧,ffprobe全解码、尺寸保持4K/8K、抽帧非黑。8K两文件完全相同SHA ff4de85bf384342daeebb602fefe91b479978fbaf1e9970ec1f02458b7bebe40。8K零运动输入,不冒充8K NVOF;4K光流用例NVOF实际执行5次。真实QML保存37%预设后改当前100%/关NR,选该导出预设,任务开始又改当前25%,worker仍NR1420x798→4K6帧,预览设置不变。应用SHA251ed807f2a45fcd5b2274d61797e4f6e71c9b62cffe8aece5cc57f0915d9905。++GPU图探针stack1-percent-still/stack2-percent-export各2帧,前者手动50%图片模式仍NR1920x1080全尺寸;后者两层百分比独立纹理/参数/同帧一致,NR执行4次;均debugErrors=0。未将图探针冒充PNG编码或HDR验收。AMD实卡/用户原8K黑场素材/长期/音轨等未验明确记录。必要证据reports/export-nr-scale-20261025、logs同任务、单一tests/app worker日志与短合成媒体;旧90秒1080媒体只读复用。无其它进程竞争,无真实采集/主机/用户配置/运行库/模型/驱动修改。++交付2.1.0-nre1 NVIDIA小更新,需要完整2.1.0底包,含之前手动比例/fg1/旋转录制;只含程序、QML、翻译与说明。源提交/ZIP SHA/最终核验见reports/.../update-package.json与FINAL.json。单Agent,无merge/push/Release,Lecram暂停。++收尾测得本任务tmp约105MiB含CUDA缓存/私有状态。只删本任务cuda目录的原生PowerShell(绝对路径/无reparse/无活动Veyra守卫)被自动审批blocked by policy执行前拒绝,未给细因;无删除发生、无替代工具/移动绕过,cache-cleanup.json如实记受阻。后续nr-export-size脚本改共用任务级CUDA缓存,保留当前验收资料及单一私有app;不改产品代码,无需重跑已过GPU用例。diff --git a/i18n/catalog.json b/i18n/catalog.jsonindex d932c858..e1f552a1 100644--- a/i18n/catalog.json+++ b/i18n/catalog.json@@ -6099,11 +6099,11 @@"ja": "マルチチャンネルのソースをステレオにまとめて出力(ヘッドホン向け)。オフ時はデバイスのチャンネル配置に従います"},{- "zh": "多层 NR 可尝试前层 720p、末层 1080p;三层可尝试 480p / 720p / 1080p。降低前层分辨率会改变画面,导出仍按原生尺寸处理。",+ "zh": "多层 NR 可尝试前层 720p、末层 1080p;三层可尝试 480p / 720p / 1080p。降低前层分辨率会改变画面,视频导出同样按各层所选分辨率处理。","src": "qml/NrLayerEditor.qml",- "zh-TW": "多層 NR 可嘗試前層 720p、末層 1080p;三層可嘗試 480p / 720p / 1080p。降低前層解析度會改變畫面,匯出仍按原生尺寸處理。",- "en": "For multiple NR layers, try 720p first and 1080p last; for three layers, try 480p / 720p / 1080p. Lowering the earlier layers changes the image. Exports still use native dimensions.",- "ja": "複数の NR レイヤーでは前段を 720p、最終段を 1080p に、3 段では 480p / 720p / 1080p にする方法もあります。前段の解像度を下げると映像が変わります。書き出しは引き続きネイティブサイズで処理します。"+ "zh-TW": "多層 NR 可嘗試前層 720p、末層 1080p;三層可嘗試 480p / 720p / 1080p。降低前層解析度會改變畫面,影片匯出同樣依各層所選解析度處理。",+ "en": "For multiple NR layers, try 720p first and 1080p last; for three layers, try 480p / 720p / 1080p. Lowering the earlier layers changes the image. Video export also uses each layer's selected resolution.",+ "ja": "複数の NR レイヤーでは前段を 720p、最終段を 1080p に、3 段では 480p / 720p / 1080p にする方法もあります。前段の解像度を下げると映像が変わります。動画の書き出しも各レイヤーで選択した解像度で処理します。"},{"zh": "夜景或暗部的脸调低",@@ -8668,18 +8668,18 @@"ja": "手動オフセット · ライブ入力時に有効"},{- "zh": "手动比例以最高 1080p 预算内的输入为基准;仅调整视频预览,输出尺寸不变。",+ "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-TW": "手動比例以最高 1080p 預算內的輸入為基準;適用於預覽與影片匯出,輸出尺寸不變。",+ "en": "Manual scale is relative to the input within the 1080p budget. It applies to preview and video export; the output size is unchanged.",+ "ja": "手動倍率は最大1080pの予算内の入力を基準とし、プレビューと動画の書き出しに適用されます。出力サイズは変わりません。"},{- "zh": "手动比例缩放该层输入的宽高;50% 约为四分之一像素。仅调整视频预览,输出尺寸不变。",+ "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-TW": "手動比例縮放該層輸入的寬高;50% 約為四分之一像素。適用於預覽與影片匯出,輸出尺寸不變。",+ "en": "Manual scale changes the width and height of this layer’s input; 50% is about one quarter of the pixels. It applies to preview and video export; the output size is unchanged.",+ "ja": "手動倍率はこのレイヤー入力の幅と高さに適用され、50%では画素数が約4分の1になります。プレビューと動画の書き出しに適用され、出力サイズは変わりません。"},{"zh": "手动添加",@@ -13786,11 +13786,11 @@"ja": "自動ディスプレイ同期"},{- "zh": "自动档在预览中按增强耗时调整 100%–40%;预建实例约增加 1.7GB 显存及半秒启动时间。导出按原生尺寸处理。",+ "zh": "自动档在预览中按增强耗时调整 100%–40%;预建实例约增加 1.7GB 显存及半秒启动时间。视频导出固定按最高 1440p 处理,输出尺寸不变。","src": "qml/NrLayerEditor.qml",- "zh-TW": "自動檔在預覽中依增強耗時調整 100%–40%;預建執行個體約增加 1.7GB 顯示記憶體及半秒啟動時間。匯出依原生尺寸處理。",- "en": "Auto adjusts preview processing from 100% to 40% using enhancement time. Prebuilt instances add about 1.7GB of VRAM and half a second of startup time. Export uses native dimensions.",- "ja": "自動設定は強化処理時間に応じてプレビューを 100%~40% に調整します。事前生成したインスタンスは約 1.7GB の VRAM と約 0.5 秒の起動時間を追加します。書き出しは元の解像度で処理します。"+ "zh-TW": "自動檔在預覽中依增強耗時調整 100%–40%;預建執行個體約增加 1.7GB 顯示記憶體及半秒啟動時間。影片匯出固定依最高 1440p 處理,輸出尺寸不變。",+ "en": "Auto adjusts preview processing from 100% to 40% using enhancement time. Prebuilt instances add about 1.7GB of VRAM and half a second of startup time. Video export uses a fixed maximum of 1440p; the output size is unchanged.",+ "ja": "自動設定は強化処理時間に応じてプレビューを 100%~40% に調整します。事前生成したインスタンスは約 1.7GB の VRAM と約 0.5 秒の起動時間を追加します。動画の書き出しは最大 1440p 固定で処理し、出力サイズは変わりません。"},{"zh": "自动检测实际信号",@@ -17552,11 +17552,11 @@"ja": "プレビューを使用できません"},{- "zh": "预览保留比例且不放大小输入;图片/视频导出仍完整处理。",+ "zh": "预览与视频导出都按所选内部分辨率处理,保留比例且不放大小输入,输出尺寸不变;图片导出仍完整处理。","src": "qml/NrLayerEditor.qml",- "zh-TW": "預覽保留比例且不放大小輸入;圖片/影片匯出仍完整處理。",- "en": "The preview keeps the aspect ratio and does not upscale small inputs; image/video export is still fully processed.",- "ja": "プレビューは縦横比を保ち、小さい入力は拡大しません。画像・動画の書き出しは完全に処理します。"+ "zh-TW": "預覽與影片匯出都依所選內部解析度處理,保留比例且不放大小輸入,輸出尺寸不變;圖片匯出仍完整處理。",+ "en": "Preview and video export both process NR at the selected internal resolution, keeping the aspect ratio without upscaling small inputs; the output size is unchanged. Image export is still fully processed.",+ "ja": "プレビューと動画の書き出しは選択した内部解像度で処理し、縦横比を保ち小さい入力は拡大しません。出力サイズは変わりません。画像の書き出しは完全に処理します。"},{"zh": "预览:SDR 转 HDR 已运行",diff --git a/include/veyra/engine/ExportFeaturePolicy.h b/include/veyra/engine/ExportFeaturePolicy.hindex 0ad93d0c..e2ec7b4e 100644--- a/include/veyra/engine/ExportFeaturePolicy.h+++ b/include/veyra/engine/ExportFeaturePolicy.h@@ -2,12 +2,28 @@#include "veyra/engine/EffectChain.h"namespace veyra::engine {-// The AMD model's admission limit belongs to its INPUT, not the source or-// encoder output. Offline AMD NR uses the largest supported internal extent-// and composes its residual into the original working-resolution image.-constexpr pipeline::NrSizePolicy exportNrSizePolicy(NrRuntime runtime) {- return currentNrRuntime(runtime)==NrRuntime::LmxxfAmd- ? pipeline::NrSizePolicy::Realtime : pipeline::NrSizePolicy::Native;+// Adapted from the user-supplied 2_EXPORT_NR_PRESET_SIZE_2026-10-25 patch;+// manual percentages/invalid-value preservation are local compatibility work.+// Video export runs NR at the same preset extent as the preview and composes+// its residual into the original working-resolution image, so an 8K export+// does not feed the NR model a native 8K frame. Auto timing is preview-only:+// an export snapshot fixes it at 1440p. The AMD model's admission limit+// belongs to its INPUT: presets above 1080p stay bounded at 1080p.+constexpr pipeline::NrSizePolicy exportNrSizePolicy(NrRuntime runtime,pipeline::NrSizePolicy preset) {+ // Invalid settings must reach validation unchanged. Manual percentages+ // retain their encoded value; the extent calculation applies AMD's input+ // budget BEFORE multiplying, just as the preview does.+ if(!pipeline::validNrSizePolicy(preset)||pipeline::manualNrSizePolicy(preset))return preset;+ if(preset==pipeline::NrSizePolicy::Auto)preset=pipeline::NrSizePolicy::P1440;+ if(currentNrRuntime(runtime)==NrRuntime::LmxxfAmd){+ const auto limit=pipeline::nrHeightLimit(preset);+ if(limit==0||limit>1080)return pipeline::NrSizePolicy::Realtime;+ }+ return preset;+}+inline pipeline::Extent exportNrProcessingExtent(pipeline::Extent input,NrRuntime runtime,pipeline::NrSizePolicy preset){+ return pipeline::ResolutionPlan::make(input,false,exportNrSizePolicy(runtime,preset),false,0,+ pipeline::SrTarget::Uhd4K,false,currentNrRuntime(runtime)==NrRuntime::LmxxfAmd?1080u:0u).nr;}inline EnhancementSettings freezeExportSettings(EnhancementSettings settings) {// Preserve invalid counts for the caller's validation; normalization must@@ -15,9 +31,9 @@ inline EnhancementSettings freezeExportSettings(EnhancementSettings settings) {if(settings.nrLayerCount>settings.nrLayers.size()||settings.additionalColorCount>settings.additionalColors.size()||settings.additionalAntiAliasCount>settings.additionalAntiAlias.size()||settings.additionalBeautyCount>settings.additionalBeauty.size())return settings;- settings.nrPolicy=exportNrSizePolicy(settings.nrRuntime);+ settings.nrPolicy=exportNrSizePolicy(settings.nrRuntime,settings.nrPolicy);for(uint32_t i=0;i<settings.nrLayerCount&&i<settings.nrLayers.size();++i)- settings.nrLayers[i].sizePolicy=exportNrSizePolicy(settings.nrLayers[i].runtime);+ settings.nrLayers[i].sizePolicy=exportNrSizePolicy(settings.nrLayers[i].runtime,settings.nrLayers[i].sizePolicy);// The beauty mask view is a diagnostic overlay of the preview, never part of a file.settings.beauty.showMask=false;for(auto& beauty:settings.additionalBeauty)beauty.showMask=false;diff --git a/include/veyra/engine/GraphDescription.h b/include/veyra/engine/GraphDescription.hindex 6e059159..0bce655d 100644--- a/include/veyra/engine/GraphDescription.h+++ b/include/veyra/engine/GraphDescription.h@@ -57,7 +57,7 @@ struct StageRequest {uint32_t fgMultiplier=2;uint32_t width=0,height=0;bool stillImage=false; // image preview/processing: no NR-first order- bool exportJob=false; // native NVIDIA NR, bounded AMD NR, no present-sink FG/NR-first order+ bool exportJob=false; // selected NR size, bounded AMD NR, no present-sink FG/NR-first orderbool nvidiaAdapter=true;bool amdNr=false; // AMD adapter: NR runs on the lmxxf runtime (no NGX)// Raw capture-card or screen frames: nothing compressed for native-size RTX Video SR to repair.@@ -96,9 +96,9 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,constdesc.fixedExecutionPlanError="node NR-before-SR offline execution requires ordered dispatcher";return {};}}- const bool boundedAmd=request.exportJob&&request.amdNr&&+ const bool boundedAmd=request.exportJob&&!request.stillImage&&request.amdNr&¤tNrRuntime(settings.nrRuntime)==NrRuntime::LmxxfAmd;- const auto policy=request.exportJob?exportNrSizePolicy(settings.nrRuntime):settings.nrPolicy;+ const auto policy=request.exportJob?exportNrSizePolicy(settings.nrRuntime,settings.nrPolicy):settings.nrPolicy;if(!pipeline::Extent{request.width,request.height}.valid()||!pipeline::validSrTarget(settings.srTarget)||!pipeline::validNrSizePolicy(policy)){// ResolutionPlan::make throws for these inputs. Report the same@@ -106,9 +106,14 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,constdesc.fixedExecutionPlanError="invalid fixed-plan source extent, SR target or NR size policy";return {};}- const auto plan=pipeline::ResolutionPlan::make({request.width,request.height},request.sr,policy,+ // Preserve the existing offline base/flow/output contract. AMD keeps its+ // existing 1080p guidance budget independently of the selected NR layer.+ auto plan=pipeline::ResolutionPlan::make({request.width,request.height},request.sr,+ boundedAmd?pipeline::NrSizePolicy::Realtime:policy,(request.stillImage||request.exportJob)&&!boundedAmd,settings.revision,settings.srTarget,lowLatency,request.amdNr&¤tNrRuntime(settings.nrRuntime)==NrRuntime::LmxxfAmd?1080u:0u);+ if(request.exportJob&&!request.stillImage)+ plan.nr=exportNrProcessingExtent(plan.base,settings.nrRuntime,policy);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;@@ -185,8 +190,9 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,const// Preserve disabled-stage diagnostic dimensions; these allocate no NR// feature. Active NR extents now come exclusively from the compiled plan.if(!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,+ desc.nrLayersExtent.push_back(request.exportJob&&!request.stillImage?+ exportNrProcessingExtent(plan.base,settings.nrRuntime,size):+ pipeline::ResolutionPlan::make({request.width,request.height},request.sr,size,request.stillImage,settings.revision,settings.srTarget,lowLatency,request.amdNr&¤tNrRuntime(settings.nrRuntime)==NrRuntime::LmxxfAmd?1080u:0u).nr);}diff --git a/qml/Veyra/NrLayerEditor.qml b/qml/Veyra/NrLayerEditor.qmlindex 15263b2b..9df2da6f 100644--- a/qml/Veyra/NrLayerEditor.qml+++ b/qml/Veyra/NrLayerEditor.qml@@ -156,15 +156,15 @@ ColumnLayout {Text {Layout.fillWidth: truevisible: editor.manualSize- text: editor.amdNr ? qsTr("手动比例以最高 1080p 预算内的输入为基准;仅调整视频预览,输出尺寸不变。")- : qsTr("手动比例缩放该层输入的宽高;50% 约为四分之一像素。仅调整视频预览,输出尺寸不变。")+ text: editor.amdNr ? qsTr("手动比例以最高 1080p 预算内的输入为基准;适用于预览与视频导出,输出尺寸不变。")+ : qsTr("手动比例缩放该层输入的宽高;50% 约为四分之一像素。适用于预览与视频导出,输出尺寸不变。")color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11wrapMode: Text.WordWrap}Text {Layout.fillWidth: truevisible: editor.layerData.sizePolicy === 6- text: qsTr("自动档在预览中按增强耗时调整 100%–40%;预建实例约增加 1.7GB 显存及半秒启动时间。导出按原生尺寸处理。") ++ text: qsTr("自动档在预览中按增强耗时调整 100%–40%;预建实例约增加 1.7GB 显存及半秒启动时间。视频导出固定按最高 1440p 处理,输出尺寸不变。") +(veyra.nrAutoStatus.length > 0 ? "\n" + veyra.nrAutoStatus : "")color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11wrapMode: Text.WordWrap@@ -172,7 +172,7 @@ ColumnLayout {Text {Layout.fillWidth: truetext: editor.amdNr ? qsTr("AMD NR 预览与视频导出最高按内部 1080p 处理,视频保持输出尺寸;图片导出仍需符合模型尺寸预算。")- : qsTr("预览保留比例且不放大小输入;图片/视频导出仍完整处理。")+ : qsTr("预览与视频导出都按所选内部分辨率处理,保留比例且不放大小输入,输出尺寸不变;图片导出仍完整处理。")color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11wrapMode: Text.WordWrap}@@ -180,7 +180,7 @@ ColumnLayout {Layout.fillWidth: truevisible: !editor.amdNr && editor.layerCount > 1 &&(!editor.listControls || (veyra.nrLayers.length > 0 && editor.layerData.index === veyra.nrLayers[0].index))- text: qsTr("多层 NR 可尝试前层 720p、末层 1080p;三层可尝试 480p / 720p / 1080p。降低前层分辨率会改变画面,导出仍按原生尺寸处理。")+ text: qsTr("多层 NR 可尝试前层 720p、末层 1080p;三层可尝试 480p / 720p / 1080p。降低前层分辨率会改变画面,视频导出同样按各层所选分辨率处理。")color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 11wrapMode: Text.WordWrap}diff --git a/scripts/acceptance/nr-export-preset.py b/scripts/acceptance/nr-export-preset.pynew file mode 100644index 00000000..a67d9db1--- /dev/null+++ b/scripts/acceptance/nr-export-preset.py@@ -0,0 +1,29 @@+"""Real QML saved-preset -> frozen worker -> encoded video; private state only."""+from pathlib import Path+import json,os,subprocess,hashlib,shutil,re+B=Path('E:/项目/Veyra');T='export-nr-scale-20261025';R=Path(__file__).resolve().parents[2];D=B/'build/claude-screen-recording-20261022';A=B/'tests'/T/'app';P=B/'tests'/T/'ui-profile';L=B/'logs'/T/'ui';TMP=B/'tmp'/T/'ui';O=B/'reports'/T+assert A.exists() and not P.exists()+for p in [P,L,TMP]:p.mkdir(parents=True,exist_ok=True)+def replace(p,data):+ p.parent.mkdir(parents=True,exist_ok=True)+ if p.exists():p.unlink()+ p.write_bytes(data)+replace(A/'veyra_qml_ui.exe',(D/'veyra_qml_ui.exe').read_bytes())+for folder in ['qml','i18n']:+ for p in (R/folder).rglob('*'):+ if p.is_file():replace(A/folder/p.relative_to(R/folder),p.read_bytes())+(P/'qml-preferences.v1.json').write_text(json.dumps(dict(language='zh-CN',autoResume=False,prewarmEnhancement=False)),'utf8')+media=B/'tests'/T/'media/3840x2160-6frames.mp4';out=B/'tests'/T/'ui-preset-37.mp4';assert media.exists() and not out.exists()+main=(R/'qml/Veyra/Main.qml').read_text('utf8');pos=main.rfind('}');loader='\nLoader { source: '+json.dumps(Path(__file__).with_suffix('.qml').as_uri())+'; onLoaded: { item.media='+json.dumps(media.as_posix())+'; item.output='+json.dumps(out.as_posix())+' } }\n'+replace(A/'qml/Veyra/Main.qml',(main[:pos]+loader+main[pos:]).encode('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(P/'AppData'),LOCALAPPDATA=str(P/'LocalAppData'),CUDA_CACHE_PATH=str(TMP/'cuda'),VEYRA_LOG_FILE=str(L/'engine.log'),QML_DISABLE_DISK_CACHE='1',QT_FORCE_STDERR_LOGGING='1')+before=set((A/'logs').glob('export-worker-*.log'));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'+try:+ with (L/'console.log').open('wb') as f:p=subprocess.run([str(A/'veyra_qml_ui.exe'),'--page','pro','--size','1280x800','--data-dir',str(P),'--export-out',str(out),'--exit-after','145000'],cwd=A,env=env,stdout=f,stderr=subprocess.STDOUT,timeout=170)+finally:replace(A/'qml/Veyra/Main.qml',(R/'qml/Veyra/Main.qml').read_bytes())+text=(L/'console.log').read_text('utf8',errors='replace');workers=set((A/'logs').glob('export-worker-*.log'))-before;assert len(workers)==1,workers+worker=next(iter(workers));wt=worker.read_text('utf8',errors='replace');actual=re.findall(r'\[nr-model\].*internal=(\d+)x(\d+)',wt)+probe=json.loads(subprocess.check_output([shutil.which('ffprobe'),'-v','error','-count_frames','-show_streams','-of','json',str(out)],text=True));v=next(x for x in probe['streams'] if x['codec_type']=='video')+passed=p.returncode==0 and 'NR_EXPORT_PRESET_PASS' in text and 'NR_EXPORT_PRESET_FAIL' not in text and actual==[('1420','798')] and v['width']==3840 and v['height']==2160 and int(v['nb_read_frames'])==6 and '[ERROR]' not in wt+result=dict(exit=p.returncode,passed=passed,exeSha256=hashlib.sha256((A/'veyra_qml_ui.exe').read_bytes()).hexdigest(),workerLog=str(worker),nrCreated=actual,output=str(out),outputSize=[v['width'],v['height']],decodedFrames=int(v['nb_read_frames']),log=str(L))+(O/'ui-preset-export.json').write_text(json.dumps(result,ensure_ascii=False,indent=1),'utf8');print(json.dumps(result,ensure_ascii=False),flush=True);assert passed,text[-3500:]diff --git a/scripts/acceptance/nr-export-preset.qml b/scripts/acceptance/nr-export-preset.qmlnew file mode 100644index 00000000..d9cdde53--- /dev/null+++ b/scripts/acceptance/nr-export-preset.qml@@ -0,0 +1,40 @@+import QtQuick+Item {+ id: test+ property string media: ""+ property string output: ""+ property int phase: 0+ property int ticks: 0+ property int total: 0+ function check(ok,why){if(!ok)throw new Error(why)}+ function next(n){phase=n;ticks=0}+ Timer {id:timer;interval:250;repeat:true;running:test.media!==""+ onTriggered:{try{+ ++test.ticks;if(++test.total>520)throw new Error("130 second timeout")+ if(test.phase===0){+ if(test.ticks<8)return+ root.page="pro";veyra.muted=true;veyra.nodeMode=0;veyra.srEnabled=false;veyra.fgEnabled=false;veyra.nrEnabled=true+ const index=veyra.nrLayers[0].index+ check(veyra.setNrLayerParameter(index,"runtime",2),"SF runtime")+ check(veyra.setNrLayerParameter(index,"sizePercent",37),"manual 37%")+ check(veyra.savePresetAs("NR export percent 37",15,false),"save manual preset")+ const preset=veyra.presets.findIndex(x=>x.name==="NR export percent 37");check(preset>=0,"saved preset listed")+ check(veyra.selectExportPreset(preset),"choose independent export preset")+ check(veyra.setNrLayerParameter(index,"sizePercent",100),"different current slider")+ veyra.nrEnabled=false+ veyra.exportCompletionSound=false;veyra.exportHevc=true;veyra.exportSrTargetIndex=-1;veyra.exportRateControl=1;veyra.exportBitrateMbps=24+ veyra.enqueueExportFile(test.media,test.output);next(1)+ }else if(test.phase===1){+ if(veyra.exportReadyCount!==1)return+ veyra.startExport();check(veyra.exportRunning,"worker did not start")+ check(veyra.setNrLayerParameter(veyra.nrLayers[0].index,"sizePercent",25),"edit current preview after freeze")+ next(2)+ }else if(test.phase===2){+ if(veyra.exportRunning)return+ check(veyra.exportItems.filter(x=>x.state==="done").length===1,"export failed: "+veyra.exportStatus)+ check(veyra.nrLayers[0].sizePercent===25&&!veyra.nrEnabled,"export changed current preview settings")+ console.log("NR_EXPORT_PRESET_PASS",veyra.exportPresetName,veyra.exportStatus);timer.stop();Qt.quit()+ }+ }catch(e){console.error("NR_EXPORT_PRESET_FAIL",test.phase,e.message);veyra.cancelExport();timer.stop();Qt.quit()}}+ }+}diff --git a/scripts/acceptance/nr-export-size.py b/scripts/acceptance/nr-export-size.pynew file mode 100644index 00000000..ef27f7a6--- /dev/null+++ b/scripts/acceptance/nr-export-size.py@@ -0,0 +1,49 @@+"""Short real-worker NR export matrix. Immutable runtime donor, all outputs on E:."""+from pathlib import Path+import argparse,json,os,subprocess,hashlib,shutil,re,statistics,time+parser=argparse.ArgumentParser();parser.add_argument('--case',default='all');a=parser.parse_args()+B=Path('E:/项目/Veyra');T='export-nr-scale-20261025';R=Path(__file__).resolve().parents[2];D=B/'build/claude-screen-recording-20261022';A=B/'tests'/T/'app';M=B/'tests'/T/'media';L=B/'logs'/T/'exports';O=B/'reports'/T;TMP=B/'tmp'/T/'exports'+for p in [M,L,O,TMP]:p.mkdir(parents=True,exist_ok=True)+ff=shutil.which('ffmpeg');fp=shutil.which('ffprobe');assert ff and fp+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+def replace(p,data):+ if p.exists():p.unlink()+ p.write_bytes(data)+donor=B/'releases/release-2.1.0-20261019/runtime-base/NVIDIA';dm=json.loads((donor/'package-manifest.json').read_text('utf8'))+if not A.exists():+ for e in dm['files']:+ rel=e['path']+ if rel.startswith('logs/') or any(x.startswith('user-data-') for x in Path(rel).parts):continue+ p=A/rel;p.parent.mkdir(parents=True,exist_ok=True);os.link(donor/rel,p)+ (A/'runtime_local').mkdir(exist_ok=True)+ shutil.copyfile(donor/'package-manifest.json',A/'package-manifest.json')+replace(A/'veyra_nr_export_size_tests.exe',(D/'veyra_nr_export_size_tests.exe').read_bytes())+for e in dm['files']:+ if Path(e['path']).suffix.lower() in ['.dll','.onnx','.tflite','.hsaco','.dxil']:assert sha(A/e['path'])==e['sha256']+cases=[('4k-1080p',3840,2160,'0','h264',[(1920,1080)]),('4k-50pct',3840,2160,'150','hevc',[(1920,1080)]),('4k-37pct',3840,2160,'137','hevc',[(1420,798)]),('4k-100pct',3840,2160,'200','hevc',[(3840,2160)]),('4k-mixed',3840,2160,'3,150','hevc',[(1280,720),(1920,1080)]),('4k-auto',3840,2160,'6','hevc',[(2560,1440)]),('8k-1080p',7680,4320,'0','hevc',[(1920,1080)]),('8k-25pct',7680,4320,'125','hevc',[(1920,1080)])]+cases.append(('4k-flow',3840,2160,'137','hevc',[(1420,798)]))+if a.case!='all':cases=[c for c in cases if c[0]==a.case];assert cases+results=[]+for name,w,h,policies,codec,expected in cases:+ 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 Veyra process is running; do not compete'+ caseTmp=TMP/name;caseTmp.mkdir(exist_ok=True);env={k:v for k,v in os.environ.items() if not k.upper().startswith(('VEYRA_','QT_','QSG_','QML_'))};env.update(TEMP=str(caseTmp),TMP=str(caseTmp),APPDATA=str(caseTmp/'AppData'),LOCALAPPDATA=str(caseTmp/'LocalAppData'),CUDA_CACHE_PATH=str(TMP/'cuda'))+ media=M/(str(w)+'x'+str(h)+'-6frames.mp4')+ if not media.exists():subprocess.run([ff,'-v','error','-f','lavfi','-i',f'testsrc2=size={w}x{h}:rate=30','-frames:v','6','-c:v','libx264','-threads','2','-preset','ultrafast','-crf','18','-pix_fmt','yuv420p',str(media)],env=env,check=True,timeout=180)+ out=B/'tests'/T/(name+'.mp4');assert not out.exists(),out+ log=L/(name+'.log');start=time.monotonic()+ with log.open('wb') as f:p=subprocess.run([str(A/'veyra_nr_export_size_tests.exe'),str(media),str(out),policies,codec,'6']+(['flow'] if name=='4k-flow' else []),cwd=A,env=env,stdout=f,stderr=subprocess.STDOUT,timeout=270)+ text=log.read_text('utf8',errors='replace');worker=next((x[11:] for x in text.splitlines() if x.startswith('WORKER_LOG ')),'');wt=Path(worker).read_text('utf8',errors='replace') if worker else ''+ actual=[tuple(map(int,x)) for x in re.findall(r'\[export-nr-layer\].*?internal=(\d+)x(\d+)',wt)]+ created=[tuple(map(int,x)) for x in re.findall(r'\[nr-model\].*?internal=(\d+)x(\d+)',wt)]+ result=dict(case=name,exit=p.returncode,seconds=round(time.monotonic()-start,3),expected=expected,actual=actual,created=created,log=str(log),workerLog=worker,output=str(out),passed=False)+ if p.returncode==0 and actual==expected and created==expected:+ probe=json.loads(subprocess.check_output([fp,'-v','error','-count_frames','-show_streams','-of','json',str(out)],env=env,text=True));video=next(x for x in probe['streams'] if x['codec_type']=='video')+ raw=subprocess.check_output([ff,'-v','error','-i',str(out),'-vf','select=eq(n\\,3),scale=320:180','-frames:v','1','-pix_fmt','rgb24','-f','rawvideo','-'],env=env,timeout=120)+ assert len(raw)==320*180*3 and statistics.pstdev(raw)>10+ result.update(width=video['width'],height=video['height'],decodedFrames=int(video['nb_read_frames']),codec=video['codec_name'],pixelStddev=statistics.pstdev(raw),outputSha256=sha(out))+ result['passed']=video['width']==w and video['height']==h and int(video['nb_read_frames'])==6 and 'NR_EXPORT_SIZE ok=1' in text and '[ERROR]' not in wt+ results.append(result);(O/(name+'.json')).write_text(json.dumps(result,ensure_ascii=False,indent=1),'utf8');print(json.dumps(result,ensure_ascii=False),flush=True)+ if not result['passed']:print(wt[-3500:],text[-1800:],flush=True);break+(O/('gpu-exports-'+a.case+'.json')).write_text(json.dumps(results,ensure_ascii=False,indent=1),'utf8')+assert all(x['passed'] for x in results),results[-1]diff --git a/scripts/acceptance/package-nr-export-size.py b/scripts/acceptance/package-nr-export-size.pynew file mode 100644index 00000000..d691f00a--- /dev/null+++ b/scripts/acceptance/package-nr-export-size.py@@ -0,0 +1,49 @@+"""Seal local nre1 EXE/UI update. No runtime, model, user configuration or test media."""+from pathlib import Path+import json,subprocess,hashlib,zipfile,shutil+B=Path('E:/项目/Veyra');T='export-nr-scale-20261025';R=Path(__file__).resolve().parents[2];O=B/'reports'/T;D=B/'build/claude-screen-recording-20261022';P=B/'test-packages'/T/'Veyra-2.1.0-nre1-NVIDIA-update'+assert not subprocess.check_output(['git','-C',str(R),'status','--porcelain']).strip(),'commit the verified source first'+head=subprocess.check_output(['git','-C',str(R),'rev-parse','HEAD'],text=True).strip()+assert all(x['exit']==0 for x in json.loads((O/'contracts.json').read_text('utf8')))+for name in ['gpu-exports-all.json','gpu-exports-4k-flow.json']:assert all(x['passed'] for x in json.loads((O/name).read_text('utf8')))+ui=json.loads((O/'ui-preset-export.json').read_text('utf8'));assert ui['passed']+assert all(x['exit']==0 for x in json.loads((O/'image-flow-probes.json').read_text('utf8')))+def sha(p):+ with p.open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()+assert sha(D/'veyra_qml_ui.exe')==ui['exeSha256']+assert not P.exists();P.mkdir(parents=True)+def copy(src,rel):+ dst=P/rel;dst.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(src,dst)+copy(D/'veyra_qml_ui.exe','veyra_qml_ui.exe')+for folder in ['qml','i18n']:+ for p in (R/folder).rglob('*'):+ if p.is_file():copy(p,Path(folder)/p.relative_to(R/folder))+for name in ['EXPORT_NR_SCALE_PLAN_2026-10-25.md','EXPORT_NR_SCALE_REPORT_2026-10-25.md','FG_SCHEDULING_REPAIR_REPORT_2026-10-24.md']:copy(R/'docs'/name,Path('docs')/name)+for name in ['LICENSE','THIRD_PARTY_NOTICES.md']:copy(R/name,name)+note='''# Veyra 2.1.0-nre1 NVIDIA 本地测试更新++需要已有完整2.1.0 NVIDIA便携包。关闭播放器,将本目录文件复制到原包根目录(veyra_qml_ui.exe所在目录),覆盖同名文件,再启动。+本更新仅含EXE、QML、翻译与说明,不含DLL/模型/SDK/日志/用户配置。原package-manifest记录完整底包;更新后程序/UI的身份以LOCAL_UPDATE.json为准。++- 视频导出NR内部处理尺寸遵循每层固定档和手动25%–100%,不再强制原生。50%同时缩放宽高,约为四分之一像素量;最终输出尺寸仍由导出设置决定。+- 例:4K选1080p或50%,NR按1920x1080处理并合成回4K;8K选25%,NR按1920x1080处理并输出8K。+- Auto在视频任务快照中固定最高1440p,AMD保留1080p预算;AMD手动比例先受现有预算限制再缩放。图片仍完整处理。节点视频导出仍维持原有不支持状态,请使用列表预设。+- 导出选择的预设独立于当前预览参数,任务冻结后改滑条不会改变正在导出的任务。降低内部尺寸可能改变NR效果,不能等同原生尺寸画质。+- 包含此前NR手动滑条、fg1后台VRR查询、旋转与录制修复。Lecram暂停。本轮未改补帧调度、NR模型或运行库。+- 本机RTX5070/SF runtime已验证4K/8K合成短片真实导出、每层NR创建尺寸、NVENC编码、输出尺寸/帧数/非黑解码、界面保存37%预设实际导出和图片全尺寸GPU探针。AMD实卡、真实8K黑场素材、HDR、长期画质未在本轮验收;8K短片导出使用零运动输入,另有4K真实NVOF导出用例。++显示版本2.1.0-nre1,PE数值2.1.0.0。隔离分支本地交付,未合main、未push或公开发布。+'''+(P/'README-NRE1.zh-CN.md').write_text(note,'utf8')+files=[dict(path=p.relative_to(P).as_posix(),bytes=p.stat().st_size,sha256=sha(p)) for p in sorted(P.rglob('*')) if p.is_file()]+assert not any(Path(e['path']).suffix.lower() in ['.dll','.onnx','.tflite','.lib','.pdb','.hsaco','.dxil','.log'] for e in files)+(P/'LOCAL_UPDATE.json').write_text(json.dumps(dict(version='2.1.0-nre1-local-update',base='Complete 2.1.0 NVIDIA portable package',sourceCommit=head,sourceWorktree=str(R),localOnly=True,releaseReady=False,containsRuntime=False,files=files),ensure_ascii=False,indent=1),'utf8')+zpath=P.parent/(P.name+'.zip');assert not zpath.exists()+with zipfile.ZipFile(zpath,'x',zipfile.ZIP_DEFLATED,compresslevel=6) as z:+ for p in P.rglob('*'):+ if p.is_file():z.write(p,p.relative_to(P).as_posix())+with zipfile.ZipFile(zpath) 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,zip=str(zpath),bytes=zpath.stat().st_size,sha256=sha(zpath),exeSha256=sha(P/'veyra_qml_ui.exe'),manifestFiles=len(files),runtimeFiles=0)+(O/'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/scripts/acceptance/ui-4k-regression.ps1 b/scripts/acceptance/ui-4k-regression.ps1index 3afe5386..e5b4ba89 100644--- a/scripts/acceptance/ui-4k-regression.ps1+++ b/scripts/acceptance/ui-4k-regression.ps1@@ -51,7 +51,7 @@ try {if($codec -eq 'hevc'){$exportArgs+='--hevc'}Run "export-$codec" "$bin/veyra.exe" $exportArgs$exportLog=Get-Content "$dir/export-$codec.stdout.log" -Raw- Check "native-graph-counts-$codec" ($exportLog -match '\[resolution\] source=3840x2160 base=3840x2160 nr=3840x2160 flow=3840x2160 fg=3840x2160 output=3840x2160' -and $exportLog -match '\[export-counts\] source=12 generated=11 hold=1 output=24 multiplier=2 ') 'actual graph extents and separate source/generated/hold/output counters'+ Check "native-graph-counts-$codec" ($exportLog -match '\[resolution\] source=3840x2160 base=3840x2160 nr=1920x1080 flow=3840x2160 fg=3840x2160 output=3840x2160' -and $exportLog -match '\[export-counts\] source=12 generated=11 hold=1 output=24 multiplier=2 ') 'actual graph extents and separate source/generated/hold/output counters'Run "inspect-$codec" $ffprobe @('-v','error','-count_frames','-show_streams','-of','json',$file)$streams=(Get-Content "$dir/inspect-$codec.stdout.log" -Raw|ConvertFrom-Json).streams$v=@($streams|Where-Object codec_type -eq 'video')[0];$a=@($streams|Where-Object codec_type -eq 'audio')diff --git a/src/engine/EffectChain.cpp b/src/engine/EffectChain.cppindex 0dad06b7..375dadef 100644--- a/src/engine/EffectChain.cpp+++ b/src/engine/EffectChain.cpp@@ -1,4 +1,5 @@#include "veyra/engine/EffectChain.h"+#include "veyra/engine/ExportFeaturePolicy.h"#include <algorithm>#include <cmath>@@ -548,12 +549,10 @@ ChainValidation compileChainExecutionPlan(const EffectChain& chain, const ChainEstep.input = step.processing = step.output = cursor;if (node.type == EffectType::SuperResolution) step.processing = step.output = srExtent;if (node.type == EffectType::NrEnhance) {- const bool boundedAmd=request.exportJob&&request.amdNrExport&&- currentNrRuntime(node.nr.runtime)==NrRuntime::LmxxfAmd;- const 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,false,+ step.processing = request.exportJob&&!request.stillImage?+ exportNrProcessingExtent(cursor,node.nr.runtime,node.nr.sizePolicy):+ pipeline::ResolutionPlan::make(cursor, false, node.nr.sizePolicy,+ request.stillImage, 0, request.srTarget,false,currentNrRuntime(node.nr.runtime)==NrRuntime::LmxxfAmd?1080u:0u).nr;}plan.steps[plan.stepCount++] = step;diff --git a/src/engine/ExportJobManager.cpp b/src/engine/ExportJobManager.cppindex f0343c35..9b348263 100644--- a/src/engine/ExportJobManager.cpp+++ b/src/engine/ExportJobManager.cpp@@ -139,8 +139,9 @@ bool ExportJobManager::start(const std::wstring& input,const std::wstring& outpup_->shared=static_cast<Shared*>(MapViewOfFile(p_->mapping,FILE_MAP_ALL_ACCESS,0,0,sizeof(Shared)));if(!p_->shared)return fail(L"无法映射导出通信资源");if(!std::isfinite(trimStartSeconds)||!std::isfinite(trimEndSeconds)||trimStartSeconds<0||trimEndSeconds<0||(trimEndSeconds>0&&trimEndSeconds<=trimStartSeconds))return fail(L"导出剪辑范围无效");new(p_->shared) Shared{};auto& s=*p_->shared;s.settings=freezeExportSettings(settings);- // Normalize once before crossing processes. Source/encoder size is unchanged;- // only the lmxxf model input has its real 1080p budget.+ // Freeze the selected fixed/manual NR sizes once before crossing processes.+ // Auto becomes a fixed offline size; lmxxf retains its real input budget.+ // Source/encoder size is unchanged.s.chain=toChain(s.settings);fromChain(s.chain,s.settings);s.hevc=hevc;s.maxFrames=maxFrames;s.rateControl=uint32_t(rateControl);s.audioStreamIndex=audioStreamIndex;diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cppindex 87ee3463..d646026c 100644--- a/src/engine/VideoExportJob.cpp+++ b/src/engine/VideoExportJob.cpp@@ -117,6 +117,16 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOptiif(options.nr&&amdNrExport){fgNote=L"AMD NR 使用内部最高 1080p 处理,保留原尺寸合成与导出";veyra::log::info("export-nr",std::format("runtime=lmxxf source={}x{} output={}x{} internal={}x{} layers={}",info.width,info.height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.nrLayersExtent.size()));+ }else if(options.nr&&gd.enableNr){+ // NR follows the preview size preset; its residual is composed at output size.+ veyra::log::info("export-nr",std::format("source={}x{} output={}x{} internal={}x{} layers={}",info.width,info.height,gd.workWidth,gd.workHeight,gd.nrWidth,gd.nrHeight,gd.nrLayersExtent.size()));+ }+ if(options.nr&&gd.fixedExecutionPlan)for(uint32_t i=0;i<gd.fixedExecutionPlan->stepCount;++i){+ const auto& step=gd.fixedExecutionPlan->steps[i];+ if(step.type!=EffectType::NrEnhance)continue;+ veyra::log::info("export-nr-layer",std::format("parameter={} resource={} input={}x{} internal={}x{} output={}x{}",+ step.parameterIndex,step.resourceIndex,step.input.width,step.input.height,+ step.processing.width,step.processing.height,step.output.width,step.output.height));}if(options.sr&&!srAvailable)fgNote+=fgNote.empty()?L"当前显卡不能使用所选超分,本次导出关闭超分":L";当前显卡不能使用所选超分,本次导出关闭超分";if(!nvidiaFeatures&&srAvailable)fgNote+=fgNote.empty()?L"本次导出使用 AMD FSR 超分":L";本次导出使用 AMD FSR 超分";diff --git a/tests/integration/NrExportSizeTests.cpp b/tests/integration/NrExportSizeTests.cppnew file mode 100644index 00000000..801add4f--- /dev/null+++ b/tests/integration/NrExportSizeTests.cpp@@ -0,0 +1,49 @@+// Real process-isolated production export; no test NR or encoder implementation.+#include "veyra/engine/ExportJobManager.h"+#include "veyra/engine/ExportFeaturePolicy.h"+#include "veyra/Log.h"+#include <chrono>+#include <filesystem>+#include <iostream>+#include <sstream>+#include <thread>++int wmain(int argc,wchar_t** argv){+ using namespace veyra;using namespace veyra::engine;+ const HRESULT com=CoInitializeEx(nullptr,COINIT_MULTITHREADED);+ if(argc==3&&std::wstring(argv[1])==L"--export-worker"){+ const int result=runExportWorker(reinterpret_cast<HANDLE>(std::stoull(argv[2])));+ if(SUCCEEDED(com))CoUninitialize();return result;+ }+ if(argc!=6&&argc!=7)return 2; // input, output, policies, codec, max frames, optional flow+ Logger::instance().openFile((std::filesystem::path(argv[2]).wstring()+L".parent.log"));Logger::instance().setConsoleEnabled(false);+ EnhancementSettings settings;settings.nr=true;settings.sr=false;settings.multiplier=1;+ settings.nrRuntime=NrRuntime::Ampere;settings.nrTemporal=false;settings.nrMotion=MotionSource::Zero;+ if(argc==7){if(std::wstring(argv[6])!=L"flow")return 2;settings.nrMotion=MotionSource::OpticalFlow;}+ settings.exportBitrateMbps=24;+ std::wistringstream policies(argv[3]);std::wstring part;+ while(std::getline(policies,part,L',')){+ if(settings.nrLayerCount>=kMaxNrInstances)return 2;+ auto& layer=settings.nrLayers[settings.nrLayerCount++];layer.enabled=true;layer.runtime=NrRuntime::Ampere;+ layer.model.performance=true;layer.temporal=false;layer.sizePolicy=pipeline::NrSizePolicy(std::stoi(part));+ if(!pipeline::validNrSizePolicy(layer.sizePolicy))return 2;+ }+ if(!settings.nrLayerCount)return 2;+ settings.nrPolicy=settings.nrLayers[0].sizePolicy;+ const auto saved=settings;const auto expected=freezeExportSettings(settings);+ const unsigned frames=std::stoul(argv[5]);+ ExportJobManager job;+ if(!job.start(argv[1],argv[2],settings,std::wstring(argv[4])==L"hevc",frames))return 3;+ ExportJobSnapshot state;+ const auto until=std::chrono::steady_clock::now()+std::chrono::seconds(240);+ do{+ state=job.poll();if(!state.active())break;+ std::this_thread::sleep_for(std::chrono::milliseconds(5));+ }while(std::chrono::steady_clock::now()<until);+ const bool ok=state.state==ExportState::Succeeded&&state.frozen==expected&&settings==saved&&+ state.sourceFrames==frames&&state.encoded==frames&&state.generated==0&&std::filesystem::exists(argv[2]);+ std::cout<<"NR_EXPORT_SIZE ok="<<ok<<" state="<<unsigned(state.state)<<" source="<<state.sourceFrames<<" encoded="<<state.encoded<<" generated="<<state.generated<<" frozenPolicy="<<int(state.frozen.nrPolicy)<<" frozenLayers="<<state.frozen.nrLayerCount<<std::endl;+ const auto path=std::filesystem::path(state.workerLog).u8string();std::cout<<"WORKER_LOG "<<std::string(path.begin(),path.end())<<std::endl;+ if(state.active())job.cancel();+ if(SUCCEEDED(com))CoUninitialize();return ok?0:1;+}diff --git a/tests/integration/NrVideoQualityProbe.cpp b/tests/integration/NrVideoQualityProbe.cppindex 19e780bd..90582e3e 100644--- a/tests/integration/NrVideoQualityProbe.cpp+++ b/tests/integration/NrVideoQualityProbe.cpp@@ -73,7 +73,7 @@ int wmain(int argc,wchar_t** argv){bool cycle=false;bool featherStack=false,colorProtected=false,hdrProtected=false,srFirst=false,nrFirst=false;bool referenceOnly=false,referenceOff=false;- bool mixedSizes=false,exportFull=false,stillFull=false;+ bool mixedSizes=false,exportFull=false,stillFull=false,manualSizes=false;if(argc==6&&!videoSr4k){const std::wstring_view option(argv[5]);if(option.size()<6||option.substr(0,5)!=L"stack"||option[5]<L'1'||option[5]>L'4')return 2;@@ -83,6 +83,8 @@ int wmain(int argc,wchar_t** argv){else if(option.substr(6)==L"-sizes-sr-first"){mixedSizes=true;temporal=false;srFirst=true;}else if(option.substr(6)==L"-sizes-export"){mixedSizes=true;temporal=false;exportFull=true;}else if(option.substr(6)==L"-sizes-still"){mixedSizes=true;temporal=false;stillFull=true;}+ else if(option.substr(6)==L"-percent-export"){mixedSizes=true;manualSizes=true;temporal=false;exportFull=true;}+ else if(option.substr(6)==L"-percent-still"){mixedSizes=true;manualSizes=true;temporal=false;stillFull=true;}else if(option.size()==10&&option.substr(6)==L"-raw")temporal=false;else if(option.size()==11&&option.substr(6)==L"-edit")liveEdit=true;else if(option.substr(6)==L"-protected")protectedStack=true;@@ -124,7 +126,8 @@ int wmain(int argc,wchar_t** argv){node.nr.model.intensity=1.f-.2f*float(layer);node.nr.temporal=temporal;node.nr.lowLatencyPairing=nrFirst;if(mixedSizes){const pipeline::NrSizePolicy sizes[]={pipeline::NrSizePolicy::P480,pipeline::NrSizePolicy::P720,- pipeline::NrSizePolicy::P1440,pipeline::NrSizePolicy::Native};node.nr.sizePolicy=sizes[layer];}+ pipeline::NrSizePolicy::P1440,pipeline::NrSizePolicy::Native};+ const unsigned percents[]={50,37,75,100};node.nr.sizePolicy=manualSizes?pipeline::nrSizePolicyForPercent(percents[layer]):sizes[layer];}}engine::EnhancementSettings pending;engine::fromChain(chain,pending);if(protectedStack){pending.protection.enabled=true;pending.protection.featherPixels=12;pending.protection.regions[0]={.25f,.25f,.75f,.75f};}@@ -137,10 +140,26 @@ int wmain(int argc,wchar_t** argv){request.sr=srFirst||nrFirst;request.exportJob=exportFull;request.stillImage=stillFull;engine::describeStages(request,pending,settings);- if(exportFull||stillFull){+ if(stillFull){for(const auto extent:settings.nrLayersExtent)if(extent!=pipeline::Extent{settings.workWidth,settings.workHeight})return 2;- std::cout<<"fullProcessing=1 exportJob="<<exportFull<<" stillImage="<<stillFull<<std::endl;+ std::cout<<"fullProcessing=1 exportJob=0 stillImage=1"<<std::endl;+ }+ if(exportFull){+ // Video export follows each layer's size preset (independent formula) at full+ // output size; at least one reduced layer proves it did not fall back to native.+ const pipeline::Extent work{settings.workWidth,settings.workHeight};+ if(work!=pipeline::Extent{info.width,info.height}||settings.nrLayersExtent.size()!=stackLayers)return 2;+ bool reduced=false;+ for(unsigned layer=0;layer<stackLayers;++layer){+ const auto& nr=chain.nodes[layer].nr;+ const auto expected=pipeline::ResolutionPlan::make(work,false,+ engine::exportNrSizePolicy(nr.runtime,nr.sizePolicy),false).nr;+ if(settings.nrLayersExtent[layer]!=expected)return 2;+ reduced=reduced||expected!=work;+ }+ if(!reduced)return 2;+ std::cout<<"presetProcessing=1 exportJob=1 stillImage=0"<<std::endl;}// The HDR mode requires the caller to supply a genuinely PQ/HLG-tagged fixture.if(hdrProtected){settings.hdrInput=true;settings.hdrOutput=true;}diff --git a/tests/unit/EffectChainTests.cpp b/tests/unit/EffectChainTests.cppindex 78a97b25..30f6ba30 100644--- a/tests/unit/EffectChainTests.cpp+++ b/tests/unit/EffectChainTests.cpp@@ -363,6 +363,8 @@ void testExistingChainContracts() {const NrSizePolicy policies[]={NrSizePolicy::Realtime,NrSizePolicy::Native,NrSizePolicy::P480,NrSizePolicy::P720,NrSizePolicy::P900,NrSizePolicy::P1440,NrSizePolicy::Auto};const unsigned heights[]={1080,2160,480,720,900,1440,1080};+ // Video export follows the fixed preset; Auto is fixed at 1440p offline.+ const unsigned exportHeights[]={1080,2160,480,720,900,1440,1440};for(unsigned i=0;i<7;++i){EnhancementSettings s;s.nr=true;s.nrPolicy=policies[i];auto c=toChain(s);EnhancementSettings restored;fromChain(c,restored);@@ -372,10 +374,30 @@ void testExistingChainContracts() {check(d.nrLayersExtent.size()==1&&d.nrLayersExtent[0].height==heights[i]&&d.workWidth==3840&&d.workHeight==2160,"fixed and Auto fallback policies preserve full output extent");request.exportJob=true;describeStages(request,restored,d);- check(d.nrLayersExtent[0]==Extent{3840,2160}&&!d.nrAutoPoolLayer,"export ignores preview policies and Auto pool");+ check(d.nrLayersExtent[0].height==exportHeights[i]&&d.workWidth==3840&&d.workHeight==2160&&+ d.validateFixedExecutionPlan().empty()&&!d.nrAutoPoolLayer,"export follows the NR size preset at full output extent without the Auto pool");request.exportJob=false;request.stillImage=true;describeStages(request,restored,d);check(d.nrLayersExtent[0]==Extent{3840,2160}&&!d.nrAutoPoolLayer,"image ignores preview policies and Auto pool");}+ {+ // 8K export with a 1080p preset: NR runs at 1920x1080, output stays 7680x4320.+ struct Case{Extent source;NrSizePolicy policy;Extent nr;};+ const Case cases[]={{{7680,4320},NrSizePolicy::Realtime,{1920,1080}},{{7680,4320},NrSizePolicy::P1440,{2560,1440}},+ {{7680,4320},NrSizePolicy::Auto,{2560,1440}},{{7680,4320},NrSizePolicy::Native,{7680,4320}},+ {{3840,1600},NrSizePolicy::Realtime,{1920,800}},{{1280,720},NrSizePolicy::P1440,{1280,720}}};+ for(const auto& k:cases){+ EnhancementSettings e;e.nr=true;e.nrPolicy=k.policy;+ StageRequest r;r.nr=true;r.exportJob=true;r.width=k.source.width;r.height=k.source.height;+ EnhanceGraphDesc d;describeStages(r,e,d);+ check(d.enableNr&&d.nrLayersExtent==std::vector<Extent>{k.nr}&&d.workWidth==k.source.width&&d.workHeight==k.source.height&&+ d.flowWidth==k.source.width&&d.flowHeight==k.source.height&&+ d.validateFixedExecutionPlan().empty()&&e.nrPolicy==k.policy,"video export NR preset extent, output size and saved preset");+ }+ EnhancementSettings amd;amd.nr=true;amd.nrRuntime=NrRuntime::LmxxfAmd;amd.nrPolicy=NrSizePolicy::P720;+ check(freezeExportSettings(amd).nrPolicy==NrSizePolicy::P720,"AMD export keeps presets within its 1080p budget");+ amd.nrPolicy=NrSizePolicy::Auto;+ check(freezeExportSettings(amd).nrPolicy==NrSizePolicy::Realtime,"AMD export bounds Auto at 1080p");+ }EffectChain c;c.nodeCount=4;for(unsigned i=0;i<4;++i){c.nodes[i].type=EffectType::NrEnhance;c.nodes[i].enabled=true;c.nodes[i].nr.sizePolicy=policies[i+2];}@@ -389,8 +411,9 @@ void testExistingChainContracts() {for(auto& node:c.nodes)node.nr.lowLatencyPairing=true;fromChain(c,s);describeStages(request,s,d);check(d.nrLayersExtent.back()==Extent{1920,1080},"NR-first policy never enlarges source input");request.exportJob=true;describeStages(request,s,d);- check(std::all_of(d.nrLayersExtent.begin(),d.nrLayersExtent.end(),[](auto e){return e==Extent{3840,2160};})- &&!d.nrBeforeSr,"export preserves full-size processing in every instance");+ check(d.nrLayersExtent==std::vector<Extent>({{852,480},{1280,720},{1600,900},{2560,1440}})&&+ d.workWidth==3840&&d.workHeight==2160&&!d.nrBeforeSr&&d.validateFixedExecutionPlan().empty(),+ "export keeps each instance's preset size after SR at full output extent");request.exportJob=false;request.stillImage=true;describeStages(request,s,d);check(d.nrLayersExtent.front()==Extent{3840,2160},"still images preserve full processing extent");c.nodes[1].nr.sizePolicy=static_cast<NrSizePolicy>(99);c.nodes[1].enabled=false;@@ -451,7 +474,10 @@ void testExecutionPlans() {auto offline = request; offline.exportJob = true;check(compileChainExecutionPlan(first, offline, plan).accepted &&plan.steps[1].type == EffectType::SuperResolution &&- plan.steps[2].processing == plan.steps[2].input, "offline list stays SR-first with native NR");+ plan.steps[2].output == plan.steps[2].input &&+ plan.steps[2].processing == veyra::pipeline::ResolutionPlan::make(plan.steps[2].input, false,+ exportNrSizePolicy(first.firstOf(EffectType::NrEnhance)->nr.runtime, first.firstOf(EffectType::NrEnhance)->nr.sizePolicy),+ false).nr, "offline list stays SR-first with preset-sized NR");auto still = request; still.stillImage = true;check(compileChainExecutionPlan(first, still, plan).accepted &&plan.steps[1].type == EffectType::SuperResolution &&@@ -570,8 +596,8 @@ void testLegacyPlanDimensions() {// Independent sizing formula. Video SR can also restore at 1:1:// source-size restoration has no resize resource but keeps NR/SR order.const auto oldPlan=veyra::pipeline::ResolutionPlan::make(source,s.sr,- request.exportJob?veyra::pipeline::NrSizePolicy::Native:s.nrPolicy,- request.stillImage||request.exportJob,s.revision,s.srTarget,+ request.exportJob?exportNrSizePolicy(s.nrRuntime,s.nrPolicy):s.nrPolicy,+ request.stillImage,s.revision,s.srTarget,!request.exportJob&&s.lowLatency&&s.nr);const bool nativeVideoSr=s.sr&&!request.stillImage&&s.videoSrQuality>=1&&s.videoSrQuality<=4;const bool oldNrFirst=!request.stillImage&&!request.exportJob&&s.lowLatency&&s.nr&&(oldPlan.srApplied||nativeVideoSr);@@ -624,8 +650,8 @@ void testProductionFixedPlanDescription() {"NR-first fixed plan uses source-space input for all active layers");request.exportJob=true;describeStages(request,s,desc);check(desc.validateFixedExecutionPlan().empty()&&!desc.nrBeforeSr&&- desc.nrLayersExtent==std::vector<Extent>{{3840,2160},{3840,2160}},- "offline description retains native NR and default order");+ desc.nrLayersExtent==std::vector<Extent>{{3840,2160},{1920,1080}},+ "offline description keeps per-layer NR presets and default order");request.exportJob=false;request.nvidiaAdapter=false;describeStages(request,s,desc);check(desc.validateFixedExecutionPlan().empty()&&!desc.enableNr&&!desc.enableSr&&desc.fixedExecutionPlan&&desc.fixedExecutionPlan->resourceCounts[size_t(EffectType::NrEnhance)]==0&&diff --git a/tests/unit/NrModelSettingsTests.cpp b/tests/unit/NrModelSettingsTests.cppindex a353ecf6..30ab06e0 100644--- a/tests/unit/NrModelSettingsTests.cpp+++ b/tests/unit/NrModelSettingsTests.cpp@@ -106,7 +106,7 @@ int wmain(int argc,wchar_t** argv){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(allSizes,"all 76 percentages change NR dimensions only, keep full-resolution mode 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");@@ -124,9 +124,27 @@ int wmain(int argc,wchar_t** argv){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");+ check(md.nrLayersExtent==std::vector<Extent>{{960,540},{1440,810}}&&md.workWidth==3840,"AMD video export retains both manual percentages within the model budget");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");+ check(md.nrLayersExtent==std::vector<Extent>{{1920,1080},{2880,1620}}&&md.flowWidth==3840&&md.flowHeight==2160,"NVIDIA video export honors per-layer manual percentages and keeps offline guidance");+ bool manualExports=true;+ for(unsigned percent=25;percent<=100;++percent){+ auto settings=manual;settings.nrLayerCount=1;settings.nrLayers[0].sizePolicy=pipeline::nrSizePolicyForPercent(percent);+ const auto frozenManual=freezeExportSettings(settings);+ manualExports&=frozenManual.nrLayer(0).sizePolicy==settings.nrLayers[0].sizePolicy&&settings.nrLayers[0].sizePolicy==pipeline::nrSizePolicyForPercent(percent);+ StageRequest job;job.nr=true;job.exportJob=true;job.width=7680;job.height=4320;+ describeStages(job,frozenManual,md);+ const Extent expected{uint32_t(7680*percent/100)&~1u,uint32_t(4320*percent/100)&~1u};+ manualExports&=md.nrLayersExtent==std::vector<Extent>{expected}&&md.workWidth==7680&&md.workHeight==4320&&md.flowWidth==7680&&md.flowHeight==4320&&md.validateFixedExecutionPlan().empty();+ settings.nrRuntime=NrRuntime::LmxxfAmd;settings.nrLayers[0].runtime=NrRuntime::LmxxfAmd;+ job.nvidiaAdapter=false;job.amdNr=true;describeStages(job,settings,md);+ const Extent bounded{uint32_t(1920*percent/100)&~1u,uint32_t(1080*percent/100)&~1u};+ manualExports&=md.nrLayersExtent==std::vector<Extent>{bounded}&&md.flowWidth==1920&&md.flowHeight==1080&&md.workWidth==7680&&md.validateFixedExecutionPlan().empty();+ }+ check(manualExports,"all 76 percentages survive export freeze and size real per-layer plans at 8K, with AMD input budget retained");+ auto invalidManual=manual;invalidManual.nrLayers[0].runtime=NrRuntime::LmxxfAmd;invalidManual.nrLayers[0].sizePolicy=NrSizePolicy(124);+ check(exportNrSizePolicy(NrRuntime::LmxxfAmd,NrSizePolicy(124))==NrSizePolicy(124)&&+ !freezeExportSettings(invalidManual).validate().empty(),"invalid manual export policy cannot be normalized into an admitted AMD preset");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");