Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

release: prepare 0.0.2 portable package and allow runtime DLL replacement

Veyra Goal Agenta69a9df9fb90
diff --git a/.gitignore b/.gitignore
index 79ccf104..e81d30a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
/nvngx_dlssnr.dll
/renodx-dlss5-1.addon64
/runtime_local/
+/runtime/
/third_party_local/
/reference_local/
diff --git a/AGENTS.md b/AGENTS.md
index 9a364b32..5326b9e7 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Veyra 项目 Agent 执行规则
+> 2026-09-11 用户发布与替换决定:0.0.2发布到`Likely7/Veyra-NRVideo`,源码与Release二进制继续分离。用户明确要求去掉运行时校验、允许自行替换DLL:不得用固定哈希、签名或manifest拒绝用户替换的运行时;保留绝对路径加载、API存在性及初始化结果检查,替换不保证ABI/硬件兼容。下文相冲突的启动校验/禁止用户替换要求被本条取代。发布者制作的默认Runtime Pack仍按固定来源、哈希、签名与许可证审计;组件清单供用户查看,不作为软件加载锁。禁止将SDK/运行时/模型提交源码Git的规则不变。
+
> 2026-09-10 用户废弃旧 Loop:`loop/`、`scripts/loop-gate.ps1`、`CONTROL_HASHES.json` 及早期 Phase 排队/控制哈希停工规则全部退出当前执行流程,仅保留作历史记录。不得因旧 Loop 状态、STOP、控制哈希或旧文档顺序阻塞用户明确要求的修复,也不得更新旧清单来制造通过。当前任务以最新用户指令、对应修复计划和 `docs/WORKLOG.md` 为准。构建、针对性回归及必要的 `scripts/gates/delivery.ps1` 直接执行;单次测试最多 300 秒,并非全部测试累计 300 秒。运行时身份、源码/二进制隔离、真实验证与发布授权规则继续生效。
> 2026-09-07 新用户决定:默认明确标注的实时档(4K输入可用1080内部处理),保留原生4K可选;视频导出仍原生4K。不得要求以本机原生4K NR达到60fps作为本次默认档门槛,也不得把实时档冒充native4K。最终统一软件短测为 `scripts/gates/delivery.ps1`(phase5–7本次合同的合并检查),实卡仍由用户验收。其他安全/许可规则不变。
diff --git a/CMakeLists.txt b/CMakeLists.txt
index efb963e0..98b74705 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.24)
-project(veyra VERSION 0.0.1 LANGUAGES CXX)
+project(veyra VERSION 0.0.2 LANGUAGES CXX RC)
# ---------------------------------------------------------------------------
# Veyra cache variables and feature switches (Playbook section 5.1).
@@ -315,6 +315,12 @@ if(VEYRA_NVOF_SDK_ROOT AND EXISTS "${VEYRA_NVOF_SDK_ROOT}/NvOFInterface/nvOptica
target_link_libraries(veyra_nvof_probe PRIVATE veyra_gfx veyra_base)
endif()
+# Resolve FFmpeg before any consumer, including the shared enhancement graph.
+if(VEYRA_FFMPEG_ROOT AND EXISTS "${VEYRA_FFMPEG_ROOT}/include/libavformat/avformat.h")
+ list(APPEND CMAKE_MODULE_PATH "${VEYRA_FFMPEG_ROOT}/share/ffmpeg")
+ find_package(FFMPEG REQUIRED)
+endif()
+
# EnhanceGraph (the real GPU chain) needs the NGX + NVOF backends; wire it
# into veyra_pipeline only when both exist so bare contract builds still work.
if(TARGET veyra_ngx AND TARGET veyra_nvof AND VEYRA_FFMPEG_ROOT)
@@ -332,10 +338,6 @@ endif()
# dependency set from the pinned vcpkg install.
# ---------------------------------------------------------------------------
if(VEYRA_FFMPEG_ROOT AND EXISTS "${VEYRA_FFMPEG_ROOT}/include/libavformat/avformat.h")
- # vcpkg ships FindFFMPEG.cmake under share/ffmpeg; the vcpkg toolchain
- # normally injects it, so point the module path here explicitly.
- list(APPEND CMAKE_MODULE_PATH "${VEYRA_FFMPEG_ROOT}/share/ffmpeg")
- find_package(FFMPEG REQUIRED)
add_library(veyra_media STATIC
src/media/FFmpegDemuxer.cpp
src/media/FFmpegVideoDecoder.cpp
@@ -608,4 +610,6 @@ if(VEYRA_CLIP_TOOLS_ROOT AND EXISTS "${VEYRA_CLIP_TOOLS_ROOT}/include/libavcodec
endif()
# Layered child subtitle windows require a modern-Windows compatibility manifest.
+configure_file(apps/veyra/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/veyra-version.rc @ONLY)
+target_sources(veyra PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/veyra-version.rc)
target_link_options(veyra PRIVATE "/MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/apps/veyra/veyra.manifest")
diff --git a/README.md b/README.md
index 44423ddf..ffee369a 100644
--- a/README.md
+++ b/README.md
@@ -1,118 +1,72 @@
# Veyra
-Windows 本地视频播放器与画面增强工作台。它把视频播放、采集卡预览、图片增强和视频导出放进同一个原生应用:日常模式专注看画面,专业模式集中放增强、补帧、对比、诊断和导出工具。
+[English](README_EN.md) | 简体中文
-Veyra is a native Windows video player and image-enhancement workspace. It combines local playback, capture-card preview, image enhancement, and video export in one application. Daily mode is built for watching; Professional mode exposes enhancement, frame generation, comparison, diagnostics, and export tools.
+Windows 视频播放器与采集卡增强工具。支持视频、图片和采集卡实时预览,可组合使用超分辨率、NR 画面增强与补帧。
-> 这是 `0.0.1` 的早期实验版本。便携包包含经哈希和签名校验的 Runtime Pack,让兼容 RTX 环境可直接启用对应增强;NR 和 DLSSG 属于社区实验运行时,不代表 NVIDIA 官方合作、认证或支持。This is an early experimental build. The portable package includes a hash- and signature-verified Runtime Pack. NR and DLSSG are community-experimental runtimes and do not imply NVIDIA endorsement, certification, or support.
+[下载 0.0.2 免安装版](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.2) · [更新记录](docs/RELEASE_NOTES_0.0.2.md) · [反馈问题](https://github.com/Likely7/Veyra-NRVideo/issues)
-## 功能 / Features
+## 功能
-- 默认日常模式:大画面、底部播放控制、打开媒体、采集卡、音量、字幕和全屏。
-- 专业模式:带展开动画的参数工作台;同一播放会话不中断。
-- H.264 / HEVC 视频、PNG / JPEG 图片、DirectShow / UVC 采集设备。
-- 可选 DLSS SR、RTX Video SR、实验性 NVIDIA NR、NVOF 运动置信度,以及 DLSS / XeSS 补帧后端。
-- 实验性 Intel XeSS 显示补帧 2X,以及 AMD FidelityFX 光流运动估算;XeSS 当前只用于预览。
-- 原图与增强结果的即时对比、分屏拖动、专业模式内的画面缩放和性能诊断。
-- PNG / JPEG 图片导出,D3D12 NVENC H.264 / HEVC 视频导出。
-- Windows 11 Desktop Acrylic 控制面板;视频区域保持不透明,未打开媒体时为纯黑。
-
-- Daily mode by default: a large picture area with playback, media opening, capture, volume, subtitles, and fullscreen controls.
-- Professional mode: an expanding settings workspace without interrupting the current session.
-- H.264 / HEVC video, PNG / JPEG images, and DirectShow / UVC capture devices.
-- Optional DLSS SR, RTX Video SR, experimental NVIDIA NR, NVOF motion confidence, plus DLSS and XeSS frame-generation backends.
-- Experimental Intel XeSS 2X display frame generation and AMD FidelityFX optical-flow estimation; XeSS is currently preview-only.
-- Same-frame comparison, split view, preview zoom in Professional mode, and performance diagnostics.
-- PNG / JPEG image export and D3D12 NVENC H.264 / HEVC video export.
-- Windows 11 Desktop Acrylic for controls; the video area stays opaque and is pure black with no media open.
-
-## 使用方法 / How to use
-
-### 免安装包 / Portable package
+| 功能 | 支持内容 |
+| --- | --- |
+| 播放与采集 | H.264 / HEVC 视频、PNG / JPEG 图片、DirectShow / UVC 采集卡 |
+| 超分辨率 | DLSS SR、RTX Video SR;2K / 4K / 8K 目标,保持画面比例 |
+| NR 增强 | 实验性 NVIDIA NR;实时档与原生档,风格、强度和局部保护调整 |
+| 帧生成 | DLSS 2X / 3X / 4X,实验性 XeSS 2X 预览补帧 |
+| 调整与对比 | 设置实时生效、还原默认、原画对比、分屏、画面缩放 |
+| 导出 | PNG / JPEG 图片,NVENC H.264 / HEVC 视频 |
+| 实时状态 | 源帧处理、有效补帧、呈现提交、链路耗时和软件延迟 |
-1. 下载并解压 `Veyra-0.0.1-win64-portable.zip`。
-2. 双击 `Veyra.exe`。
-3. 在日常模式点击“打开视频 / 图片”或“采集”,然后播放、暂停、调节音量或进入全屏。
-4. 点击“切换专业模式”展开完整面板。这里可以选择增强、超分、补帧、预设、对比和导出。
+日常模式以观看为主;专业模式展开增强参数、诊断和导出工具。切换模式不需要重新打开视频。
-压缩包中的 `runtime_local/nvidia` 包含版本固定的 Runtime Pack。软件会读取 `release-runtime-manifest.json`,校验 DLL 哈希和签名;校验、驱动或硬件不兼容时自动关闭对应增强,基础播放器、采集与导出仍可启动。不要自行替换其中的 DLL,也不要从游戏目录、驱动缓存或未知来源复制文件。
+## 下载与运行
-1. Download and extract `Veyra-0.0.1-win64-portable.zip`.
-2. Run `Veyra.exe`.
-3. In Daily mode, choose Open Video / Image or Capture, then play, pause, adjust volume, or enter fullscreen.
-4. Select Switch to Professional Mode to expand the complete workspace. This is where enhancement, super resolution, frame generation, presets, comparison, and export are configured.
+1. 在 [Releases](https://github.com/Likely7/Veyra-NRVideo/releases) 下载 **Veyra-0.0.2-win64-portable.zip**,不要下载 Source code。
+2. 完整解压到一个可写文件夹,双击 **Veyra.exe**。无需安装 SDK、Python 或开发工具。
+3. 使用当前显卡驱动。要使用 NVIDIA NR、DLSS、RTX Video SR 和 NVENC,需兼容的 NVIDIA RTX 显卡;本版本主要在 RTX 5070 上验证。
-The package includes a version-pinned Runtime Pack in `runtime_local/nvidia`. The release builder generates `release-runtime-manifest.json` and verifies DLL hashes and signatures; NR also validates its pinned identity at startup. If driver, hardware, or initialization compatibility fails, Veyra disables only the affected enhancement while the player, capture, and export paths remain available. Do not replace these DLLs or copy files from games, driver caches, or unknown sources.
+系统要求:Windows 11 x64、DirectX 12。便携包含当前功能所需运行组件,显卡驱动和采集卡驱动由系统提供。8K 超分和原生高分辨率增强需要更多显存,不保证每个组合都能实时运行。
-### 从源码构建 / Build from source
+升级时先退出旧版,解压到新目录。需要保留设置时,复制旧目录下的 `runtime_local/*.v1` 与 `veyra.ini`;不要用旧目录整体覆盖新版运行组件。
-准备 Windows x64、Visual Studio 2022 C++ 工具链、CMake 3.24+、Ninja 和 Windows SDK。NVIDIA 与 FFmpeg 依赖请按各自许可准备在本地,仓库不会自动下载它们。
+## 使用教程
-```powershell
-git clone https://github.com/Likely7/Veyra-DLSS-Video-Player.git
-Set-Location Veyra-DLSS-Video-Player
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\build.ps1 -Root . -Preset x64-release
-.\Veyra.cmd
-```
+### 视频与图片
-Prepare Windows x64, the Visual Studio 2022 C++ toolchain, CMake 3.24+, Ninja, and the Windows SDK. Supply NVIDIA and FFmpeg dependencies locally under their own licenses; this repository does not download them automatically.
+点击底栏“打开”选择文件。底栏提供播放、进度、音量、字幕和全屏;切换到专业模式后,鼠标位于画面上时可用滚轮缩放。
-## 技术路线 / Technical approach
+### 采集卡
-三个输入入口共享同一条 GPU 图,不复制三套增强逻辑:
+1. 连接设备,关闭其他软件对同一采集卡的占用。
+2. 点击“采集”,选择设备、分辨率、帧率、像素格式及音频设备。
+3. 先关闭增强确认基础画面,再按需打开 NR、超分和补帧。同一模式下可优先试 YUY2 / NV12。
+4. 若主机游戏为30fps、采集卡输出60fps,在专业模式的内容节奏中选择60转30;真正60fps内容使用原始采集节奏。
-```text
-视频 / 图片 / 采集卡
- → 颜色与时间戳解析
- → SR(可选)
- → NR(可选)
- → 帧生成(可选)
- → 呈现、图片导出或 NVENC 视频导出
-```
+### 增强与补帧
-The three input modes use one shared GPU graph rather than three separate enhancement implementations:
+专业模式中分别开启 NR、超分和补帧。超分下方选择算法及目标尺寸;补帧页选择 DLSS 或 XeSS 及可用倍率。建议从实时 NR、较低 RTX Video SR 档位和2X补帧开始,结合对比画面与实时状态调整。
-```text
-Video / image / capture card
- → color and timestamp handling
- → optional SR
- → optional NR
- → optional frame generation
- → presentation, image export, or NVENC video export
-```
+处理跟不上时降低画质、倍率或目标尺寸。软件延迟指采集回调到 Present 返回,不包含完整采集卡和屏幕扫描延迟;补帧不能降低游戏输入延迟。
-- Veyra uses C++20, Win32, D3D12, FFmpeg, and Windows media APIs.
-- SR is performed before NR; frame generation is performed after NR. Player subtitles and OSD are composed after frame generation.
-- Capture uses a latest-frame mailbox to limit latency. Frame generation requires the next real source frame; it cannot remove a capture card's inherent delay.
-- Realtime NR can use an explicitly labelled 1080p-class internal working size for 4K input. Native 4K NR remains available but costs substantially more GPU time. Export retains its native-size path.
-- HDMI and ordinary video do not contain game-engine depth, motion vectors, exposure, or HUD-free color. Veyra estimates only what can be derived from pixels and does not claim game-native equivalence.
+### 导出与运行组件
-## 当前边界 / Current limits
+在专业模式选择图片保存或视频导出、格式与输出位置。XeSS 目前仅用于预览;视频导出使用已支持的 DLSS 路径。
-- SDR is the supported delivery path. HDR, AV1 / ProRes export, and VFR-preserving export are not part of this version.
-- Depth is not a shipped default provider. Current motion guidance uses NVOF confidence handling where available.
-- 3X and 4X frame generation are experimental. A selected multiplier does not guarantee that every source-frame pair produces a valid generated frame or that every configuration runs in real time.
-- Actual scanout latency, long-term stability, capture audio behavior, and every GPU / driver combination require further real-device validation.
-- AMD FidelityFX supplies optical-flow estimation only. AMD NR development is on hold. NVIDIA NR, DLSS SR, DLSS frame generation and NVENC require compatible NVIDIA hardware; there is no AMD AMF export backend. XeSS may initialize on other adapters when its runtime and device support it.
-- XeSS 2X diagnostics confirm SDK submissions only. They do not prove scanout frame rate, visual quality, or AMD-GPU compatibility.
-- No NVIDIA runtime, SDK archive, headers, libraries, models, or samples are in this Git repository. The user-authorized Release Runtime Pack is a separate Release-only payload and remains experimental.
+允许自行替换 DLL:退出软件后,NVIDIA 文件放在 `runtime/experimental/`,XeSS / XeLL 放在 `runtime_local/intel/experimental/`,保留文件名。软件不锁定哈希或签名;清单仅记录发布包原件,替换版的接口与硬件兼容性不作保证。卸载整个软件只需退出后删除解压目录。
-## 项目结构 / Project layout
+## 技术路线与边界
-当前修复以最新用户要求、`AGENTS.md`、对应 `docs` 修复方案和 `docs/WORKLOG.md` 为准。早期 `loop/` 状态、控制哈希与 Phase 队列已归档,不再作为开发前置门禁。Current work follows the latest task, `AGENTS.md`, its repair plan and `docs/WORKLOG.md`; the legacy Loop state and control-hash gates are historical only.
+```text
+视频 / 图片 / 采集卡 → 颜色处理 → SR → NR → 帧生成 → 显示 / 导出
+```
-当前修复进度:[FRUC移除与诊断收尾](docs/FRUC_REMOVAL_AND_DIAGNOSTICS_2026-09-11.md)。FRUC 已移除,旧预设迁移、真实产出统计、XeSS切换、受控音频同步和诊断收尾已有软件回归;AMD NR 暂时搁置,实体采集由用户验收。这里的开发改动尚未更新已发布的0.0.1用户包。
+C++20、Win32、D3D12;文件由 FFmpeg 处理,采集使用 DirectShow,视频导出使用 NVENC。各入口共享增强管线,采集保留最新帧,光流提供估算的运动信息。
-FRUC removal, legacy preset migration, completed-output telemetry, XeSS switching, controlled audio synchronization and diagnostic changes have software regression evidence in the linked report. AMD NR is on hold; physical capture acceptance belongs to user testing. These changes have not been published as an update to the 0.0.1 package.
+NR 与 DLSS 帧生成属于 **community experimental / 社区实验集成**,不是 NVIDIA 官方认证或完整游戏原生集成。采集画面没有游戏引擎的原生深度和运动数据,效果可能存在拖影或细节变化。AMD NR 暂未提供;FRUC 已移除;HDR、AV1 / ProRes 导出尚不支持。实卡兼容性与长期稳定性仍需持续验证。
-| Path | Purpose |
-| --- | --- |
-| `apps/veyra` | Win32 application and the two-mode interface |
-| `include/veyra`, `src` | Shared engine, media, GPU, enhancement, and export code |
-| `shaders` | GPU shader sources and build rules |
-| `tests`, `scripts` | Tests, build commands, and local acceptance helpers |
-| `docs` | User guide, architecture notes, work log, and implementation plans |
+## 开发与许可
-## 许可 / License
+[构建说明](docs/BUILD.md) · [组件清单](docs/RUNTIME_COMPONENTS_0.0.2.md) · [第三方许可](THIRD_PARTY_NOTICES.md)
-The repository keeps its existing [GNU GPL v3 license](LICENSE). Third-party notices are in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). This repository license does not grant rights to redistribute NVIDIA SDKs, runtimes, drivers, or other external components.
+源码采用 [GPLv3](LICENSE)。SDK、模型和运行时不进入源码仓库;Release 组件按各自许可与实验发布范围单独提供。
diff --git a/README_EN.md b/README_EN.md
new file mode 100644
index 00000000..022a4bb8
--- /dev/null
+++ b/README_EN.md
@@ -0,0 +1,72 @@
+# Veyra
+
+English | [简体中文](README.md)
+
+A Windows video player and capture-card enhancement tool. Play videos, process images, and preview capture devices with optional super resolution, NR enhancement, and frame generation.
+
+[Download 0.0.2 Portable](https://github.com/Likely7/Veyra-NRVideo/releases/tag/v0.0.2) · [Release Notes](docs/RELEASE_NOTES_0.0.2.md) · [Report an Issue](https://github.com/Likely7/Veyra-NRVideo/issues)
+
+## Features
+
+| Feature | Options |
+| --- | --- |
+| Playback and capture | H.264 / HEVC video, PNG / JPEG images, DirectShow / UVC capture cards |
+| Super resolution | DLSS SR and RTX Video SR; 1440p / 4K / 8K targets with aspect ratio preserved |
+| NR enhancement | Experimental NVIDIA NR; realtime and native modes, style, intensity, and region protection |
+| Frame generation | DLSS 2X / 3X / 4X; experimental XeSS 2X preview |
+| Controls | Live settings, restore defaults, original/processed comparison, split view, preview zoom |
+| Export | PNG / JPEG images; NVENC H.264 / HEVC video |
+| Diagnostics | Completed source/generated frames, presentation submissions, stage timings, software latency |
+
+Daily mode focuses on watching. Professional mode expands the controls, diagnostics, and export tools without reopening the video. The application currently uses a Chinese interface.
+
+## Download and Run
+
+1. Download **Veyra-0.0.2-win64-portable.zip** from [Releases](https://github.com/Likely7/Veyra-NRVideo/releases). The Source code archives are for developers.
+2. Extract the entire archive into a writable directory and run **Veyra.exe**. No SDK, Python, or development tools are needed.
+3. Use a current GPU driver. NVIDIA NR, DLSS, RTX Video SR, and NVENC require compatible NVIDIA RTX hardware; this version was primarily tested on an RTX 5070.
+
+Requirements: Windows 11 x64 and DirectX 12. Required application runtimes are included; GPU and capture-device drivers are supplied by the system. 8K upscaling and native-resolution enhancement need more VRAM and may not run in real time.
+
+To upgrade, close the old version and extract into a new directory. To retain settings, copy the old `runtime_local/*.v1` files and `veyra.ini`. Do not overwrite the new runtime directories with the old ones.
+
+## Quick Guide
+
+### Videos and Images
+
+Choose Open on the bottom bar. Playback, seeking, volume, subtitles, and fullscreen are available there. In Professional mode, use the mouse wheel over the picture to zoom.
+
+### Capture Cards
+
+1. Connect the device and close other applications using the same capture card.
+2. Choose Capture, then select the device, resolution, frame rate, pixel format, and audio input.
+3. Confirm the picture with enhancement disabled, then enable NR, upscaling, or frame generation. Try YUY2 / NV12 when the device offers the same desired mode.
+4. For a 30fps console game carried over 60fps capture, select the 60-to-30 content cadence setting in Professional mode. Keep the original cadence for actual 60fps content.
+
+### Enhancement and Frame Generation
+
+Enable NR, super resolution, and frame generation independently in Professional mode. Select the upscaling method and target size beneath the super-resolution switch. The frame-generation page offers DLSS / XeSS and the supported multipliers.
+
+Start with realtime NR, a lower RTX Video SR quality, and 2X frame generation. Compare the image and watch the diagnostics. Reduce quality, multiplier, or target size if processing falls behind. Software latency measures capture callback to Present return, not complete capture-to-display latency. Frame generation does not reduce game input latency.
+
+### Export and Runtime Replacement
+
+Use Professional mode to save an image or export a video, then choose the format and destination. XeSS is preview-only; supported video frame-generation export uses DLSS.
+
+You may replace DLLs while Veyra is closed. NVIDIA components belong in `runtime/experimental/`; XeSS / XeLL belong in `runtime_local/intel/experimental/`. Keep the filenames. Veyra does not enforce hash or signature locks; manifests describe the shipped files only. Replacement versions may have incompatible APIs or hardware requirements. To uninstall, close Veyra and delete its extracted directory.
+
+## Technical Approach and Limits
+
+```text
+Video / image / capture card -> color handling -> SR -> NR -> frame generation -> display / export
+```
+
+C++20, Win32, and D3D12. FFmpeg handles media files, DirectShow handles capture, and NVENC handles video encoding. Inputs share one enhancement graph; capture retains the latest frame, and optical flow supplies estimated motion.
+
+NR and DLSS frame generation are **community-experimental integrations**, not NVIDIA certification or complete native game integration. Captured pixels lack game-engine depth and motion data; ghosting and altered detail are possible. AMD NR is unavailable, FRUC has been removed, and HDR / AV1 / ProRes export are unsupported. Capture compatibility and long-term stability remain under testing.
+
+## Development and License
+
+[Build Instructions](docs/BUILD.md) · [Runtime Components](docs/RUNTIME_COMPONENTS_0.0.2.md) · [Third-Party Notices](THIRD_PARTY_NOTICES.md)
+
+Source code is licensed under [GPLv3](LICENSE). SDKs, models, and runtimes are excluded from this source repository. Release components retain their separate licenses and experimental distribution boundaries.
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
index 58949ffa..6f0af677 100644
--- a/THIRD_PARTY_NOTICES.md
+++ b/THIRD_PARTY_NOTICES.md
@@ -1,6 +1,6 @@
-# Local development dependencies
+# Third-party dependencies
-NVIDIA DLSS/Optical Flow SDKs and experimental DLSSNR runtime: external local assets, not committed or redistributed. Existing SDK agreements remain applicable. ReShade/RenoDX addon is never loaded by the product.
+NVIDIA SDKs and runtimes are excluded from source control. The publisher-authorized experimental Release package contains only selected runtime DLLs and applicable notices, as documented in `docs/RUNTIME_COMPONENTS_0.0.2.md`. This is not vendor endorsement or a general redistribution grant. ReShade/RenoDX add-ons are not loaded or distributed by the product.
## NVENC API declarations
@@ -8,7 +8,19 @@ Source: https://github.com/FFmpeg/nv-codec-headers ; checkout `eddcea9e27f6b7720
The nvEncodeAPI.h header itself has NVIDIA's permissive MIT-style notice (Copyright 2010–2026 NVIDIA Corporation). Its full notice is retained unmodified in that header. This permits using the declarations without retrieving the full developer-portal sample package; it does not grant rights to distribute NVIDIA driver/runtime binaries. Veyra uses the system NVENC library, never copies it into a package. Implementation is independently authored against these declarations; no competitor/sample implementation copied.
-FFmpeg build: external `C:/veyra-deps/installed/x64-windows`; public distribution requires review of actual configuration and linked components. No license-complete installer has been produced.
+FFmpeg: dynamically linked 9.0.1#1 vcpkg build. The portable package carries five FFmpeg DLLs, the complete copyright/license notices and SPDX provenance. Corresponding upstream source and the vcpkg patch/build recipe are listed in `docs/BUILD.md`. No FFmpeg command-line executable or test-media toolchain is shipped.
+
+## Intel XeSS / XeLL
+
+Official XeSS SDK 3.0.2. Veyra loads `libxess_fg.dll` and `libxell.dll` for experimental preview frame generation. Unmodified binaries may be redistributed under the Intel Simplified Software License; the complete license and `third-party-programs.txt` accompany the package. User DLL replacement is allowed by Veyra without fixed identity locks; compatibility is not guaranteed.
+
+## AMD FidelityFX Optical Flow
+
+FidelityFX SDK 1.1.4, upstream commit `c6efa6bf7f2027b3ec94f28578bb5965eabb9e55`, https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK . The optical-flow and DX12 backend libraries are statically linked. Copyright (C) 2024 Advanced Micro Devices, Inc.; MIT license, reproduced in the package's `licenses/AMD_FIDELITYFX_LICENSE.txt`. This is optical flow, not AMD NR or AMD super resolution.
+
+## Microsoft Visual C++ Runtime
+
+The package includes unmodified x64 `vcruntime140.dll`, `vcruntime140_1.dll`, and `msvcp140.dll` from the Visual Studio 2022 C++ Redistributables directory for FFmpeg and XeSS. These are Microsoft Distributable Code under the [Visual Studio software terms](https://visualstudio.microsoft.com/license-terms/vs2022-ga-diagnosticbuildtools/); Windows system and GPU driver DLLs are not copied. Veyra itself uses the static MSVC runtime.
## Lucide UI icons
diff --git a/apps/veyra/version.rc.in b/apps/veyra/version.rc.in
new file mode 100644
index 00000000..3f305340
--- /dev/null
+++ b/apps/veyra/version.rc.in
@@ -0,0 +1,26 @@
+#include <windows.h>
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
+ PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS 0
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_APP
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "FileDescription", "Veyra Video Player"
+ VALUE "FileVersion", "@PROJECT_VERSION@"
+ VALUE "ProductName", "Veyra"
+ VALUE "ProductVersion", "@PROJECT_VERSION@"
+ VALUE "OriginalFilename", "Veyra.exe"
+ VALUE "LegalCopyright", "Veyra contributors. GPL-3.0."
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 1200
+ END
+END
diff --git a/docs/BUILD.md b/docs/BUILD.md
new file mode 100644
index 00000000..f6084f9e
--- /dev/null
+++ b/docs/BUILD.md
@@ -0,0 +1,57 @@
+# Build / 构建
+
+普通用户下载Release免安装包即可。以下用于开发者构建,不需要把SDK提交到Git。
+
+## Requirements
+
+- Windows 11 x64, Visual Studio 2022 C++ tools, Windows SDK, CMake 3.24+, Ninja.
+- Local FFmpeg development libraries matching avcodec63 / avformat63 / avutil61 / swresample7 / swscale10. Release 0.0.2 uses the vcpkg FFmpeg 9.0.1#1 build (LGPL configuration).
+- NVIDIA DLSS SDK 310.7.0, Optical Flow SDK 5.0.7, RTX Video SDK 1.1.0, and nv-codec-headers. Prepare these under their respective licenses in ignored local directories.
+- Intel XeSS SDK 3.0.2 for the XeSS presenter; AMD FidelityFX SDK 1.1.4 optical-flow/backend static libraries for the AMD flow option.
+- Local NR runtime and NGX project configuration for experimental NR. The source repository intentionally does not contain them.
+
+## Local Build
+
+```powershell
+git clone https://github.com/Likely7/Veyra-NRVideo.git
+cd Veyra-NRVideo
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root . -Preset x64-release
+```
+
+`build.ps1` resolves Visual Studio and CMake, stages the five FFmpeg DLLs, and builds `out/build/x64-release/veyra.exe`. Its default FFmpeg location is `C:/veyra-deps/installed/x64-windows`. Use the CMake cache variables below for other dependency layouts. `-BuildDirectory` selects a separate output directory while an existing build is running.
+
+| CMake variable | Local dependency |
+| --- | --- |
+| `VEYRA_FFMPEG_ROOT` | Prefix with FFmpeg include/lib/bin/share directories |
+| `VEYRA_DLSS_SDK_ROOT` | NVIDIA DLSS SDK, including NGX static shim |
+| `VEYRA_NVOF_SDK_ROOT` | Optical Flow SDK |
+| `VEYRA_XESS_ROOT` | XeSS SDK `inc` directory parent |
+| `VEYRA_FIDELITYFX_ROOT` | FidelityFX SDK `sdk` directory with built static libraries |
+| `VEYRA_ENABLE_EXPERIMENTAL_DLSSNR` | Enable the experimental NGX application targets |
+
+The full player needs the NGX/NVOF and FFmpeg targets; a build with those dependencies absent is not the portable application's equivalent. CMake may disable optional XeSS/AMD flow when their local SDKs are missing. Inspect the configuration and test the actual backends before packaging.
+
+The NGX configuration lives in `runtime_local/config/ngx-local.json` for development. A release places NVIDIA DLLs in `runtime/experimental` and the configuration in `runtime/config`. XeSS DLLs use `runtime_local/intel/experimental` in both layouts. Shader binaries live beside the executable in `shaders`.
+
+## Dependency Sources
+
+Release 0.0.2 includes `Veyra-0.0.2-FFmpeg-source.zip` separately: the patched FFmpeg source, SPDX-verified vcpkg port and patches, notices, and configuration queried from the shipped DLL. It is not needed to run Veyra.
+
+- FFmpeg: https://github.com/FFmpeg/FFmpeg/tree/n9.0.1 ; vcpkg port source recorded in the distributed `licenses/FFMPEG-SPDX.json`.
+- vcpkg FFmpeg port: https://github.com/microsoft/vcpkg/tree/55cd8b8a4f19d8e6ba2ad114c8acacc4af5915a0/ports/ffmpeg . Its patches and the LGPL notices are part of the corresponding-source material.
+- FidelityFX SDK: https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/tree/c6efa6bf7f2027b3ec94f28578bb5965eabb9e55 ; MIT license.
+- XeSS SDK: https://github.com/intel/xess ; Intel Simplified Software License.
+- DLSS SDK: https://github.com/NVIDIA/DLSS ; NVIDIA RTX SDK license.
+- NVIDIA video SDK documentation: https://developer.nvidia.com/rtx-video-sdk . System NVENC/NVOF driver DLLs are not copied into the package.
+
+Veyra and FidelityFX code are compiled into the executable; FFmpeg is dynamically linked. The executable uses the static MSVC runtime; FFmpeg and XeSS use the shipped redistributables `vcruntime140.dll`, `vcruntime140_1.dll`, and `msvcp140.dll`. UCRT, DirectX, and GPU driver components come from Windows and the installed driver.
+
+## Verification and Packaging
+
+Run targeted tests and `scripts/gates/delivery.ps1`; each individual test must stay below300seconds. Physical capture and screen scanout require separate hardware verification. The legacy Loop gate is not part of the current process.
+
+```powershell
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/package-portable.ps1 -Root . -Version 0.0.2 -OutputDirectory out/releases/0.0.2
+```
+
+The packager accepts `-BuildDirectory` for an isolated build, checks the publisher's fixed input files, copies an explicit payload, and emits a ZIP, checksums, and component manifests. It refuses to overwrite an existing candidate. This build-time audit does not restrict user DLL replacement. Do not upload SDK headers, samples, libraries, private media, logs, or development archives with the source.
diff --git a/docs/CAPTURE_LATENCY_AUDIT_2026-09-11.md b/docs/CAPTURE_LATENCY_AUDIT_2026-09-11.md
new file mode 100644
index 00000000..9e28cea1
--- /dev/null
+++ b/docs/CAPTURE_LATENCY_AUDIT_2026-09-11.md
@@ -0,0 +1,76 @@
+# 采集预览延迟排查与修复
+
+日期:2026-09-11。源码基线 `4e2bd73`。本轮由用户反馈 Veyra 采集预览慢于 OBS/PotPlayer 触发。确定缺陷已修复,构建与相关软件回归通过;未测三款软件的同源物理显示延迟。
+
+## 已确认的事实
+
+1. 本机仅发现 OBS 进程,没有正在运行的 Veyra。`logs/veyra-app.log` 已被上一轮软件验收覆盖,不能当作反馈者本次采集的日志。没有抢占 OBS 的采集设备。
+2. 本机 OBS 32.1.2 日志 `C:/Users/123/AppData/Roaming/obs-studio/logs/2026-09-10 21-56-37.txt` 的设备段记录 USB3 Video、1920x1080、60fps、YUY2、`buffering: disabled`、`hardware decode: disabled`。这是本机上次配置,不证明反馈者使用相同配置。YUY2 不需要压缩视频解码,不能由这个 hardware decode 字段推断 CPU 正在解码 H.264。
+3. 核对 OBS 32.1.2 对应提交 `fb4d98bf88fae5fc85cb11fc57f7c5e309282194`:`plugins/win-dshow/win-dshow.cpp` 的 `SetupBuffering` 调用 `obs_source_set_async_unbuffered`;`libobs/obs-source.c` 的非缓冲取帧分支丢弃旧帧、取最新帧直接返回。这里只研究行为,没有复制源码。
+4. Veyra 当前 YUY2/NV12/RGB32 通过 `ConnectDirect` 接自有接收器,回调复制至容量1的 mailbox;接收器没有按参考时钟等待显示。三个 allocator buffer 是内存池请求,不等于固定积压三帧。不能把这项直接说成50ms延迟。
+5. Git 标签 `v0.0.1` 指向 `181a047`,采集仍强制 `RGB32` 并用 DirectShow `RenderStream` 自动接转换器;当前源码的 YUY2 原格式 GPU 转换不在该标签中。发布用户包与本地开发版必须分别判断,不能宣称本地修复已经送达下载用户。实际下载包身份还需反馈者确认。
+
+## 确定缺陷:关闭 FG 仍按源时钟等帧
+
+`EngineController.cpp` 在同一 epoch 只锚定一次 `PresentationScheduler`:
+
+```text
+deadline = 首次回调主机时间 + 当前PTS - 首次PTS + FG主动延迟
+```
+
+FG关闭只把最后一项设为0,仍会按源PTS等待。首帧回调偶发变晚,或设备PTS与主机时钟存在漂移时,后续已经GPU-ready的真实画面会被继续扣留。无补帧的交互预览不需要这种平滑播放时钟。
+
+确定性复现输入:首帧比稳定到达关系晚12ms;第二帧恢复正常,处理3ms。旧策略在第二帧处理完成后仍等待9ms。这个9ms是构造条件下的调度算术,不是实卡测量或对OBS的实际差距。
+
+本次修复:物理采集且FG关闭时按GPU-ready呈现,不再由源PTS增加等待。NR/SR开关不影响此策略。保留源PTS供历史、计数和音频同步;文件播放、无设备节拍的测试文件回放以及FG的连续时间线保留。日志新增 `pacing=capture-ready/source-pts`。没有移除资源fence或改变图处理顺序。
+
+旧测试覆盖缺口:`LivePresentationTimingTests` 中“no-FG never waits”的断言测试的是 `livePairHoldMs`,该函数已不被产品源码调用。它通过不代表当前 `PresentationScheduler` 没有等待。本次新增回归直接覆盖产品使用的调度器,包含旧行为复现、无缓冲、时钟漂移和切回FG。
+
+## 仍需实证的部分
+
+| 位置 | 当前行为及风险 | 下一步 |
+| --- | --- | --- |
+| 显示端 | 3-buffer flip-discard,vsync=false,支持时允许tearing;没有显式使用frame-latency waitable object。Present返回不等于实际扫描,也不能由3-buffer反推固定3帧延迟 | 用PresentMon/ETW区分实际display mode、Present阻塞和提交到扫描;再判断是否接入最大排队1和显示槽位反压,不能只改buffer数 |
+| MJPEG及其他压缩模式 | 仍经DirectShow兼容链转RGB32,自动选择的解码/转换filter可能有额外成本;当前回调计时起点在它们之后 | 下一轮记录实际filter/allocator及帧时间,固定相同分辨率/帧率/格式比较;不得以本机YUY2结果代表所有采集卡 |
+| 普通预览转换 | YUY2先复制mailbox、再复制upload,GPU转linear,再转RGBA8,最后blit;无增强时不运行NR/SR/flow,但仍有共享图转换成本 | 测量各pass与CPU复制,必要时在共享图增加无增强融合输出pass;保留颜色正确性与对比,不复制新播放器 |
+| GPU调度 | 两批in-flight,有界但不等于零等待;输出等fence完成后由CPU推进;约0.2至1ms轮询片段可能增加完成观察延迟;upload复用有fence保护,已完成时直接返回 | 先看readyWait、slotWait、Present及过期帧的同帧轨迹,不能把所有fence调用都说成每帧阻塞 |
+| FG | DLSS使用一源周期的主动时间线偏移,并等待后帧计算插帧;XeSS仍经过这层时间线,SDK内部另有调度,存在重复等待的待测风险 | 单独核对DLSS/XeSS的提交/扫描时序;不在本轮无FG修复中随意取消插帧间距 |
+| 音频 | 采集视频呈现后仅更新共享PTS/host;音频线程跟随视频调节PCM,不主动要求视频等音频 | 修复后由用户检查音画同步;不能把500ms音频容量当成视频固定延迟 |
+
+没有取得PotPlayer内部实现,也未进行三款软件的外部延迟A/B,因此不宣称已经证明PotPlayer最快的内部原因。显卡占用率高低同样不能直接换算延迟。
+
+## 验证与交接
+
+完成门槛:调度缺陷可复现、定向修复、完整构建与相关软件回归、记录物理验收缺口。本轮不更新Release、不push,不重新引入FRUC或AMD NR。
+
+实际执行命令(项目根目录):
+
+```powershell
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root 'C:\Users\123\Desktop\Veyra DLSS Video Player' -Preset x64-release
+./scripts/acceptance/scheduler-short-test.ps1 -Name capture-latency-contract -Exe out/build/x64-release/veyra_repair_contract_tests.exe
+./scripts/acceptance/scheduler-short-test.ps1 -Name capture-latency-timing -Exe out/build/x64-release/veyra_live_timing_tests.exe
+./scripts/acceptance/scheduler-short-test.ps1 -Name capture-latency-live -Exe out/build/x64-release/veyra_live_presentation_tests.exe -TestArgs @('loop/local/fixed_clips/test_av_1080p.mp4','logs/capture-latency-live-20260911')
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/gates/delivery.ps1 -Root 'C:\Users\123\Desktop\Veyra DLSS Video Player'
+```
+
+| 检查 | 结果与日志 |
+| --- | --- |
+| Release完整构建 | exit0,`logs/capture-latency-build-20260911.log` |
+| 合同与新增缺陷复现 | 81项PASS,0.063秒;`logs/scheduler-repair-20260910/capture-latency-contract.result.json`及同名stdout |
+| 采集时序旧合同 | 41项PASS,0.152秒;同目录`capture-latency-timing.result.json`,不把未调用helper的旧断言当产品验证 |
+| 实际RTX引擎回放 | 28项PASS,4.802秒;同目录`capture-latency-live.result.json`;包含NR、DLSS2X/4X、设置、暂停恢复和队列边界 |
+| delivery | 23项PASS,42.907秒;`logs/delivery/1be4f528d272465585c96ada5b9b88e3/result.json` |
+| Git/身份 | `git diff --check`通过;NR DLL指定SHA匹配、Authenticode Valid;没有SDK/runtime进入Git |
+
+RTX真实执行日志 `logs/capture-latency-live-20260911/engine.log`:Feature18 Create `0x1`、非空handle、SEH0;DLSSG Create/Evaluate `0x1`、SEH0。delivery覆盖NR/NVOF、native4K正确性和NVENC,不代表实卡性能。无测试失败;探索过程中几次猜测文件路径不存在,已通过`rg --files`定位实际文件,未作为测试结果。
+
+新应用 `out/build/x64-release/veyra.exe` SHA256:`CDCB2303402438FC208E00B6F9F88708B16249FEB32410FE6E5D484FBBB15747`。修改文件:`PresentationScheduler.h`、`EngineController.cpp`、`RepairContractTests.cpp`、本报告、`WORKLOG.md`、README当前进度入口。没有制作或更新发布包。
+
+验证边界:新增即时策略通过调度器确定性回归;实际引擎测试使用有节拍控制的文件回放,保留其源PTS调度,因此不冒充物理采集即时分支已实卡通过。实体采集、OBS/PotPlayer同源A/B、实际扫描和音画听觉验收均未执行。测试素材位于历史目录不等于运行旧Loop。
+
+下一条实际验收:确认反馈者版本,NR/SR/FG全部关闭、同一采集格式,以屏幕计时器/高速录像比较Veyra、OBS非缓冲、PotPlayer。分别记录软件回调到Present返回与外部可见延迟,不相互替代。之后才用相同输入逐项打开NR/SR/FG。
+
+参考源码:
+
+- https://github.com/obsproject/obs-studio/blob/fb4d98bf88fae5fc85cb11fc57f7c5e309282194/plugins/win-dshow/win-dshow.cpp
+- https://github.com/obsproject/obs-studio/blob/fb4d98bf88fae5fc85cb11fc57f7c5e309282194/libobs/obs-source.c
diff --git a/docs/RELEASE_0.0.2_EXECUTION.md b/docs/RELEASE_0.0.2_EXECUTION.md
new file mode 100644
index 00000000..eedaa7c6
--- /dev/null
+++ b/docs/RELEASE_0.0.2_EXECUTION.md
@@ -0,0 +1,59 @@
+# 0.0.2 发布执行记录
+
+2026-09-11。用户授权把当前源码、0.0.2免安装包和中英文文档发布到 `Likely7/Veyra-NRVideo`,随后明确要求去掉软件运行时校验、允许替换DLL。旧Loop不参与本次流程。
+
+## 交付范围
+
+- 包含此前未推送的采集调度、音频恢复、状态统计、XeSS/AMD光流、UI和FRUC移除提交,以及本次实卡无FG按GPU-ready呈现修复。
+- EXE资源版本0.0.2,新增中英文README、使用教程、构建说明、组件说明和Release Notes。
+- NVIDIA运行目录支持 `runtime/experimental`;XeSS使用 `runtime_local/intel/experimental`。取消XeSS固定哈希/签名门锁,不添加manifest启动检查;NGX诊断不再把替换DLL标成原始固定哈希。
+- XeSS受限加载路径加入EXE目录,以找到随包Microsoft CRT,保留绝对路径、导出函数和初始化结果检查。
+- 软件允许用户替换DLL;发布者仍检查默认发行文件。NVIDIA NGX/驱动内部的加载策略不是Veyra可取消的校验。
+- FFmpeg改为在共享增强库使用前解析,修复全新构建目录缺少头文件路径;build脚本支持独立目录并复制FFmpeg依赖。
+- 打包使用显式文件列表,包含6个增强运行DLL、5个FFmpeg DLL、3个Microsoft CRT DLL、自有shader、许可证和说明。FRUC、AMD NR、深度模型未打包。
+
+## 最终资产
+
+| 文件 | 大小 / SHA256 |
+| --- | --- |
+| Veyra-0.0.2-win64-portable.zip | 185295449 bytes;D1A6D37D61D1E61F8D700EC534DFA718F1909C6781F1AF47F1CFD4955AE4E2C3 |
+| Veyra.exe | A07B73C2CD946AD50FD8516A51DB3B0CD6759945BB85E82D65F0D8CEB18B6170 |
+| Veyra-0.0.2-FFmpeg-source.zip | 23248643 bytes;04842030E474C2F9FBA8326D61DD74427A2F0FFABC3F5D6EFD25C141AFF31F6C |
+
+本机资产目录 `out/releases/0.0.2-final`,各ZIP附独立`.sha256`。包内50个文件,`package-audit.json`在ZIP外。6个默认增强DLL的来源、SHA256、版本和有效签名见 `RUNTIME_COMPONENTS_0.0.2.md` 及包内manifest;manifest不参与用户运行时拒绝判断。
+
+FFmpeg资料包含本机n9.0.1补丁后源码、与所发SPDX匹配的vcpkg port/patch、许可证、逐文件hash,以及直接调用所发DLL查询的编译配置与LGPL版本。没有使用另一个clip-tool构建缓存冒充所发库配置,没有附带NVIDIA SDK。
+
+## 实际验证
+
+所有单次检查均小于300秒。完整源码全新目录构建成功;最终CRT加载修正后增量构建成功。使用RTX5070,驱动32.0.16.1656。
+
+```powershell
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root . -Preset x64-release -BuildDirectory out/build/release-0.0.2-final
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/package-portable.ps1 -Root . -Version 0.0.2 -BuildDirectory out/build/release-0.0.2-final -OutputDirectory out/releases/0.0.2-final
+python scripts/package-ffmpeg-source.py --prefix C:/veyra-deps/installed/x64-windows --vcpkg C:/veyra-deps/vcpkg --source C:/veyra-deps/vcpkg/buildtrees/ffmpeg/src/n9.0.1-1250e74153.clean --output out/releases/0.0.2-final/Veyra-0.0.2-FFmpeg-source.zip
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/acceptance/portable-smoke.ps1 -PackageDirectory "$env:TEMP/Veyra portable 002 final/Veyra-0.0.2-win64-portable" -InputFile loop/local/fixed_clips/test_av_1080p.mp4 -OutputDirectory logs/release-002-portable-verified
+python scripts/acceptance/ui-fg-backends.py "$env:TEMP/Veyra portable 002 final/Veyra-0.0.2-win64-portable/Veyra.exe" --portable
+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/gates/delivery.ps1 -Root . -BuildDirectory out/build/release-0.0.2-final -PlayerExe "$env:TEMP/Veyra portable 002 final/Veyra-0.0.2-win64-portable/Veyra.exe" -PortablePlayer
+```
+
+- CPU契约81项通过:`logs/scheduler-repair-20260910/release002-contract.result.json`。
+- 最终delivery23项通过,42.929秒:`logs/delivery/130f307d2be14370876e63b6a9f1c6f9/result.json`。quality probe使用新构建,播放器/导出使用项目目录外解压的最终EXE;包含NR/NVOF、原生4K正确性、播放/暂停/seek、4K图片保存、H264/HEVC音轨与24帧/120fps短导出及取消检查。
+- 便携测试清空开发PATH、从临时目录启动、临时移走所有manifest:空启动、基础播放、DLSS SR+NR+FG、Video SR+NR+FG四项通过。证据 `logs/release-002-portable-verified/result.json`。增强两项分别记录228/235个源帧、225/232个生成帧,不能用启动过程的这些累计值冒充稳态FPS。
+- NR Feature18、DLSS SR、DLSSG Create返回`0x1`/SEH0;有效执行及GPU计时见对应stdout。保存图像为1080p基线和两张3840x2160增强图,像素标准差均大于74,已排除黑图。
+- 最终XeSS→DLSS→关闭的真实专业面板操作通过,三个窗口尺寸无控件重叠;证据 `logs/continuation-repair-20260910/ui-fg-1789096638666386100/result.json`。XeSS Create/Init成功,未宣称所有设备画质验收。
+- 模块路径证明FFmpeg、NR、DLSS SR/FG来自解压目录。本机VSR由NGX驱动实现,未观察到包内`nvngx_vsr.dll`进入模块列表;其Create成功、GPU SR计时非零。不声称本机实际使用的是包内VSR版本,也不从驱动提取新二进制。
+
+## 失败与修正
+
+1. 常规输出目录链接失败LNK1104:用户正开着旧EXE,保留该进程并改用独立构建目录。
+2. 全新构建FFmpeg头文件缺失:修正CMake依赖解析顺序;最终174目标构建通过。日志 `release-002-build-isolated.log` / `release-002-build-final.log`。
+3. 第一候选包缺少XeSS所需msvcp140/vcruntime140_1:补齐并将EXE目录加入受限依赖查找;最终构建 `logs/release-002-build-portable-crt.log`。
+4. 修改gate时误把quality probe工作目录也切到bin,导致其相对NGX配置找不到:仅便携播放器改变工作目录,保留原probe约定。失败 `logs/delivery/608b8f70c1b045eabf1ca1605b9b2f85`,后续通过不覆盖失败日志。
+5. 便携UI测试环境变量大小写错误已修正。首次VSR模块断言错误要求包内DLL必须映射;核对真实NGX Create/GPU执行及系统模块后,明确允许驱动实现并记录真实来源。失败日志 `logs/release-002-smoke-final.log`,不把错误断言解释成VSR功能失败。
+
+## 源码与验收边界
+
+`git rev-list --objects HEAD`与对象大小/文件名审计未发现SDK、DLL、EXE、LIB、模型或开发压缩包。历史中有已移除的合成测试视频和仅JSON的深度依赖说明,不是SDK或模型。当前源码树无`third_party_local`/`runtime_local`二进制;新增`/runtime/`忽略项。只暂存审核过的源码、脚本与文档;Release资产不进入Git或LFS。
+
+未执行新的实卡同源物理延迟对照、设备拔插/音画验收或长期压力测试;8K、所有显卡/驱动及用户任意替换DLL的兼容性不作通用保证。下一项产品验证由用户进行实卡验收。发布状态以GitHub的v0.0.2标签与Release资产为准,不以本文的本机候选记录冒充上传完成。
diff --git a/docs/RELEASE_NOTES_0.0.2.md b/docs/RELEASE_NOTES_0.0.2.md
new file mode 100644
index 00000000..e7a30cf8
--- /dev/null
+++ b/docs/RELEASE_NOTES_0.0.2.md
@@ -0,0 +1,49 @@
+# Veyra 0.0.2
+
+## 下载与使用
+
+下载 **Veyra-0.0.2-win64-portable.zip**,完整解压,运行 **Veyra.exe**。无需另装SDK或开发工具。支持Windows 11 x64;NVIDIA增强需兼容RTX显卡及驱动,主要验证设备为RTX 5070。
+
+升级请使用新目录。可迁移旧版 `runtime_local/*.v1` 和 `veyra.ini` 设置文件,不要覆盖新版DLL目录。源码压缩包不是可运行软件。
+
+`Veyra-0.0.2-FFmpeg-source.zip` 是开源依赖的源码与构建资料,普通用户无需下载。`.sha256` 文件用于自愿核对下载完整性,不限制软件加载替换后的DLL。
+
+## 本次更新
+
+- 新增 XeSS 2X 预览补帧选择,补齐随包 XeSS / XeLL 运行组件;DLSS仍提供2X/3X/4X。
+- 新增2K、8K超分目标,保留4K和画面比例;增加AMD FidelityFX光流选项,不包含AMD NR。
+- 增加60fps采集按30fps内容处理的选项,在增强前减少重复处理。
+- 改进真实处理产出、有效补帧、呈现提交统计,集中显示软件总延迟和各链路耗时。
+- 采集采用单GPU线程调度、有界队列和过期补帧筛选;输入暂时断流时仍推进已有输出。
+- 修正实卡关闭补帧时不必要的源时钟等待,避免首次回调迟到造成额外显示等待。
+- 改进采集音频漂移补偿、设备恢复和切换淡入淡出;修复文件音频端点断开、暂停与seek恢复。
+- 修复专业面板可见性、紧凑窗口布局、滚动和部分DPI/绘制问题。
+- 移除FRUC后端与组件;旧预设迁移到当前DLSS/XeSS格式。
+- EXE新增0.0.2版本信息;运行组件按目录独立放置。允许用户自行替换DLL,不再使用固定哈希/签名锁;清单记录本次发布原件。
+
+## 边界
+
+NR与DLSS补帧为 **community experimental / 社区实验集成**,不代表NVIDIA官方合作、认证或支持。替换DLL不保证兼容;程序仍检查接口和初始化结果。XeSS仅用于预览,AMD NR、HDR和AV1/ProRes导出未提供。原生高分辨率NR和高倍率补帧仍可能过载,软件计时不等于物理显示延迟。
+
+本地构建和定向软件回归不代表所有显卡、驱动、采集卡及长期稳定性已验收。尚未完成与其他播放器的同源物理延迟对照。
+
+使用教程:[中文](https://github.com/Likely7/Veyra-NRVideo/blob/main/README.md) / [English](https://github.com/Likely7/Veyra-NRVideo/blob/main/README_EN.md)。组件、版本、哈希及卸载方式见包内 `docs/RUNTIME_COMPONENTS_0.0.2.md` 和组件清单。退出后删除解压目录即可卸载。
+
+## English
+
+Download **Veyra-0.0.2-win64-portable.zip**, extract everything, and run **Veyra.exe**. No SDK or development tools are needed. Requires Windows 11 x64; NVIDIA enhancement needs compatible RTX hardware and drivers. The main validation GPU is an RTX 5070. Extract upgrades into a new folder and migrate only your settings, not old runtime directories.
+
+### Changes
+
+- XeSS 2X preview frame generation with bundled XeSS / XeLL runtimes; DLSS retains 2X / 3X / 4X.
+- 1440p and 8K upscaling targets alongside 4K, with aspect ratio preserved; AMD FidelityFX optical flow is available, AMD NR is not.
+- 60-to-30 capture sampling before enhancement for 30fps content transported at 60fps.
+- Completed-output and presentation counters, software latency, and per-stage timing in the status panel.
+- One GPU scheduling owner, bounded queues, obsolete-FG admission checks, and continued completion during input gaps.
+- Removed unnecessary source-clock waiting for physical capture with FG disabled.
+- Capture audio drift correction, endpoint recovery, transition fades, and improved file-audio pause/seek recovery.
+- Professional-panel visibility, compact layout, scrolling, and selected DPI/painting fixes.
+- Removed FRUC and migrated legacy presets to the current DLSS/XeSS format.
+- Versioned 0.0.2 executable and separate runtime directories. User DLL replacement is allowed without hash/signature locks; manifests document the shipped components.
+
+NR and DLSS FG are **community-experimental integrations**, not NVIDIA endorsement, certification, or support. Replacement DLLs may be incompatible. XeSS is preview-only; AMD NR, HDR, and AV1/ProRes export are unavailable. High-resolution/high-multiplier combinations may overload the GPU. Software timing is not physical display latency. Software regression does not establish universal hardware compatibility or long-duration stability.
diff --git a/docs/RUNTIME_COMPONENTS_0.0.2.md b/docs/RUNTIME_COMPONENTS_0.0.2.md
new file mode 100644
index 00000000..0501c8e8
--- /dev/null
+++ b/docs/RUNTIME_COMPONENTS_0.0.2.md
@@ -0,0 +1,43 @@
+# Veyra 0.0.2 Runtime Components
+
+发布包组件清单 / Shipped components. NVIDIA/Intel DLLs are separate Release assets, never source Git content. NR and DLSS FG are community-experimental integrations, not vendor endorsement or certification.
+
+## Locations and Replacement
+
+NVIDIA components: `runtime/experimental/`. XeSS/XeLL: `runtime_local/intel/experimental/`. Exit Veyra before replacing a DLL and preserve its filename. No runtime hash, signature, or manifest lock is enforced. Manifests describe the original package only; users do not need to edit them after replacement. ABI/API and hardware compatibility still determine whether a feature works.
+
+允许自行替换DLL,但替换不代表兼容。出现初始化错误时还原原件或关闭对应增强。清单是发布记录,不是加载锁。退出软件并删除解压目录即可卸载;需要保留设置时先备份`runtime_local`中的设置文件。移除某个增强DLL会使对应功能不可用。
+
+## NVIDIA and Intel
+
+All six publisher-provided files below have valid Authenticode signatures. Names and SHA256 describe the approved files used to build this release. The JSON manifests also record file size, signer, source category, and removability.
+
+| File | Fixed file version | Source / use |
+| --- | --- | --- |
+| nvngx_dlss.dll | 310.7.0.0 | Official DLSS SDK 310.7.0 release runtime; DLSS SR |
+| nvngx_dlssg.dll | 310.7.0.0 | DLSS SDK release runtime; experimental Veyra DLSS FG integration |
+| nvngx_dlssnr.dll | 310.8.0.0 | User-provided pinned experimental NR runtime; 165840496 bytes |
+| nvngx_vsr.dll | 1.6.0.0 | RTX Video SDK 1.1.0; RTX Video SR |
+| libxess_fg.dll | 1.3.1.78 | Official Intel XeSS SDK 3.0.2; preview FG |
+| libxell.dll | 1.3.2.10 | Official Intel XeSS SDK 3.0.2; XeLL timing |
+
+```text
+nvngx_dlss.dll BE6E434A94CA32499515EB62CA0E6C274526055D568D0426E4C652DCDFB6EE6E
+nvngx_dlssg.dll 135EAF0733C1E37381A8C28ABCF7A862404A54132B81787C04E35D09EFC5E36F
+nvngx_dlssnr.dll E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E
+nvngx_vsr.dll C3D88EEA5FF7A548EDEFA66414CF6E77464D0947277C904F324DD23ABF58A1ED
+libxess_fg.dll EC5E0C65E075570C6EDE72618BB666D0BE0C2E10B2EA9762C0FE8CB8E375AB27
+libxell.dll D2030DCD694FDA8F2EC7E044B13E6DB8F0B56D4BA9113A5EFAD334E3F3DED8C7
+```
+
+NVIDIA license files: `licenses/NVIDIA_RTX_SDK_LICENSE.txt`, `NVIDIA_RTX_VIDEO_SDK_LICENSE.pdf`, `NVIDIA_OPTICAL_FLOW_SDK_LICENSE.pdf`. Intel terms: `licenses/INTEL_XESS_LICENSE.txt`, `INTEL_THIRD_PARTY_PROGRAMS.txt`. Experimental NR distribution follows the publisher's explicitly approved Release-only policy; the included official SDK terms are not a claim that the experimental runtime has a general redistribution grant.
+
+## Other Dependencies
+
+- FFmpeg 9.0.1#1: `avcodec-63.dll`, `avformat-63.dll`, `avutil-61.dll`, `swresample-7.dll`, `swscale-10.dll`; LGPL configuration. Full notices and source provenance are in `licenses/FFMPEG-COPYRIGHT.txt`, `FFMPEG-SPDX.json`, and [BUILD.md](BUILD.md).
+- Microsoft `vcruntime140.dll`, `vcruntime140_1.dll`, `msvcp140.dll`: application-local x64 Visual C++ redistributables from the Visual Studio Redistributables directory; needed by FFmpeg and XeSS. Windows11 supplies UCRT.
+- AMD FidelityFX optical flow: linked into Veyra, no AMD runtime DLL or NR model required. MIT terms in `licenses/AMD_FIDELITYFX_LICENSE.txt`.
+- Lucide icon paths: built into Veyra, with ISC/MIT terms in `licenses/LUCIDE-LICENSE.txt`.
+- Own compiled shader files: `shaders/*.dxil`. No local SDK headers or samples are required at runtime.
+
+GPU drivers supply `nvofapi64.dll` and `nvEncodeAPI64.dll`; they are not redistributed. ReShade/RenoDX add-ons, FRUC, SDK archives, development libraries, depth weights, and AMD NR networks are not part of this package.
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 92626f4c..1b84fb79 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -1,5 +1,23 @@
# 2026-09-11 继续修复目标模式执行中
+## 最新交付:0.0.2 便携发布与用户DLL替换
+
+用户授权发布到`Likely7/Veyra-NRVideo`,并要求去掉运行时校验。取消XeSS固定哈希/签名锁、移除诊断中的假定原件hash、支持Release运行目录;绝对路径/API初始化检查保留。发布者默认包仍做来源/身份审计,不向Git提交SDK/runtime。中英文README、教程、Release Notes与组件说明已重写;完整命令、文件范围、失败及验证边界见 [0.0.2执行记录](RELEASE_0.0.2_EXECUTION.md)。
+
+新目录完整构建通过,修复首次配置FFmpeg依赖顺序与便携XeSS CRT查找。最终EXE `A07B73C2CD946AD50FD8516A51DB3B0CD6759945BB85E82D65F0D8CEB18B6170`;CPU81项,最终delivery23项42.929秒,解压后清洁PATH/无manifest的基础与SR+NR+FG两路线、XeSS/DLSS UI切换及非黑4K保存通过。真实Create为`0x1`/SEH0;本机VSR实际走驱动NGX实现,未证明包内VSR DLL被使用。日志`logs/release-002-portable-verified`、`logs/delivery/130f307d2be14370876e63b6a9f1c6f9`。未新增实卡或长期验收。
+
+最终包`out/releases/0.0.2-final/Veyra-0.0.2-win64-portable.zip`为185295449字节,SHA256 `D1A6D37D61D1E61F8D700EC534DFA718F1909C6781F1AF47F1CFD4955AE4E2C3`;另有FFmpeg开源对应资料ZIP与校验文件。源码/历史审计未发现SDK、运行DLL或模型;本次仅上传授权的Release资产。远端提交与发布确认另记实际结果,不以候选构建代替发布。
+
+## 最新任务:采集延迟对照排查
+
+用户反馈采集预览慢于OBS/PotPlayer,重新开启这一范围的排查。基线`4e2bd73`、干净工作区;只发现OBS进程,未抢占设备。本机OBS日志为1080p60/YUY2/缓冲关闭;官方32.1.2源码确认非缓冲取最新帧。`v0.0.1`仍走强制RGB32旧链,不能把本机开发修复当成发布用户已收到。
+
+确定缺陷:物理采集FG关闭仍按首回调锚定的源PTS等待,首帧迟到/时钟漂移能扣留已处理画面。本次改为GPU-ready驱动,保留文件/测试回放及FG节奏;新增策略日志。旧测试仅测产品未调用的`livePairHoldMs`,本次新增直接调度器复现:构造首帧晚12ms/后帧处理3ms会多等9ms,修正后消除该等待;不是实卡测量。
+
+完整命令、修改文件、证据和未测项见 [采集延迟排查](CAPTURE_LATENCY_AUDIT_2026-09-11.md)。构建`logs/capture-latency-build-20260911.log`exit0,81项合同/41项时序/28项实际RTX回放PASS;delivery `1be4f528d272465585c96ada5b9b88e3`23项42.907秒PASS。Feature18 Create与DLSSG Create/Evaluate `0x1`/SEH0。应用SHA `CDCB2303402438FC208E00B6F9F88708B16249FEB32410FE6E5D484FBBB15747`,运行时身份有效,无SDK/runtime提交,无push或Release更新。
+
+显示队列、MJPEG兼容解码和XeSS重复节拍等待仍是待测方向,不宣称是反馈的全部根因;实卡即时分支、同源外部延迟/扫描、音画验收未执行。下一条任务是确认反馈者版本与采集格式,全部增强关闭做三软件同源A/B。下方“性能暂缓”为上一任务范围,不覆盖本次新指令。
+
## 最新交付:FRUC 与诊断收尾完成,等待用户验收
按最新用户六项决定收尾:彻底删除FRUC后端/worker/协议/命令行及旧测试,v8预设显式迁移v4-v7的FRUC和XeSS,打包脚本修复,旧运行DLL/EXE四文件清理。修正之前把暂停恢复/PTS跳变/设置记成切镜或Resize的诊断错误;新增固定8192事件轨迹及覆盖统计,接入现有脱敏诊断预览,不逐帧写磁盘,不改画质/调度和导出检查。
diff --git a/include/veyra/engine/PresentationScheduler.h b/include/veyra/engine/PresentationScheduler.h
index a6aa4778..fce044a7 100644
--- a/include/veyra/engine/PresentationScheduler.h
+++ b/include/veyra/engine/PresentationScheduler.h
@@ -5,13 +5,15 @@ namespace veyra::engine {
// completion must never re-anchor individual pairs. Units are 100 ns.
class PresentationScheduler {
public:
- void reset(uint64_t epoch,int64_t source,int64_t host,int64_t lookahead) {
- epoch_=epoch;source_=source;host_=host;delay_=lookahead;anchored_=true;
+ void reset(uint64_t epoch,int64_t source,int64_t host,int64_t lookahead,bool paceSourcePts=true) {
+ epoch_=epoch;source_=source;host_=host;delay_=lookahead;anchored_=true;paced_=paceSourcePts;
}
bool anchored(uint64_t epoch)const{return anchored_&&epoch==epoch_;}
- int64_t deadline(int64_t pts)const{return host_+(pts-source_)+delay_;}
+ // Unbuffered capture is ready-driven. A late first callback or clock drift
+ // must not turn its source timestamps into a persistent presentation hold.
+ int64_t deadline(int64_t pts)const{return paced_?host_+(pts-source_)+delay_:host_;}
bool expired(int64_t pts,int64_t now,int64_t tolerance)const{return now>deadline(pts)+tolerance;}
private:
- uint64_t epoch_=0;int64_t source_=0,host_=0,delay_=0;bool anchored_=false;
+ uint64_t epoch_=0;int64_t source_=0,host_=0,delay_=0;bool anchored_=false,paced_=true;
};
}
diff --git a/scripts/acceptance/portable-smoke.ps1 b/scripts/acceptance/portable-smoke.ps1
new file mode 100644
index 00000000..aa829086
--- /dev/null
+++ b/scripts/acceptance/portable-smoke.ps1
@@ -0,0 +1,55 @@
+param([Parameter(Mandatory=$true)][string]$PackageDirectory,[Parameter(Mandatory=$true)][string]$InputFile,[Parameter(Mandatory=$true)][string]$OutputDirectory)
+$ErrorActionPreference='Stop'
+$package=(Resolve-Path -LiteralPath $PackageDirectory).Path
+$inputPath=(Resolve-Path -LiteralPath $InputFile).Path
+$output=[IO.Path]::GetFullPath($OutputDirectory)
+[IO.Directory]::CreateDirectory($output)|Out-Null
+$exe=Join-Path $package 'Veyra.exe'
+$savedPath=$env:PATH
+$manifests=@(Get-ChildItem -LiteralPath $package -Filter '*manifest.json' -Recurse -File)
+$results=[Collections.Generic.List[object]]::new()
+try {
+ # Prove the distributed application does not need the publisher manifests.
+ foreach($file in $manifests){Move-Item -LiteralPath $file.FullName -Destination ($file.FullName+'.test-disabled')}
+ $env:PATH="$env:SystemRoot/System32;$env:SystemRoot"
+ foreach($case in @(
+ @{name='empty';args=@('--smoke-empty','--no-nr','--no-sr','--no-fg');modules=@()},
+ @{name='baseline';args=@($inputPath,'--no-nr','--no-sr','--no-fg');modules=@()},
+ @{name='dlss-sr-nr-fg';args=@($inputPath,'--sr','--nr','--fg','--realtime');modules=@('nvngx_dlss.dll','nvngx_dlssnr.dll','nvngx_dlssg.dll')},
+ @{name='video-sr-nr-fg';args=@($inputPath,'--video-sr','1','--nr','--fg','--realtime');modules=@('nvngx_dlssnr.dll','nvngx_dlssg.dll')}
+ )) {
+ $name=$case.name
+ $argv=@($case.args)+@('--smoke-seconds','7')
+ if($name -ne 'empty'){$argv+=@('--smoke-controls','--smoke-save',"$output/$name.jpg")}
+ $p=Start-Process -FilePath $exe -ArgumentList @($argv|ForEach-Object{'"'+$_+'"'}) -WorkingDirectory $env:TEMP -WindowStyle Hidden -PassThru -RedirectStandardOutput "$output/$name.stdout.log" -RedirectStandardError "$output/$name.stderr.log"
+ $handle=$p.Handle
+ $loaded=@{}
+ $timer=[Diagnostics.Stopwatch]::StartNew()
+ while(-not $p.HasExited -and $timer.Elapsed.TotalSeconds -lt 35){
+ try {foreach($module in $p.Modules){$loaded[$module.ModuleName.ToLowerInvariant()]=$module.FileName}} catch {if(-not $p.HasExited){throw}}
+ Start-Sleep -Milliseconds 200
+ $p.Refresh()
+ }
+ if(-not $p.HasExited){Stop-Process -Id $p.Id -Force;throw "$name exceeded 35 seconds"}
+ $p.WaitForExit()
+ if($p.ExitCode -ne 0){throw "$name exit $($p.ExitCode)"}
+ $log=Get-Content -LiteralPath "$output/$name.stdout.log" -Raw
+ if($log -notmatch 'smoke frames=(\d+) generated=(\d+) failed=false'){throw "$name missing successful smoke output"}
+ $frames=[int]$Matches[1];$generated=[int]$Matches[2]
+ if($name -ne 'empty' -and ($frames -le 0 -or !(Test-Path -LiteralPath "$output/$name.jpg"))){throw "$name missing rendered output"}
+ if($case.modules.Count -gt 0 -and $generated -le 0){throw "$name did not generate frames"}
+ if($name -eq 'video-sr-nr-fg'){
+ # NGX may provide VSR from the installed driver instead of nvngx_vsr.dll.
+ if($log -notmatch '\[video-sr\] op=0 result=0x1 seh=0x0' -or $log -notmatch 'gpuSrP95Ms=[1-9]' -or -not $loaded.ContainsKey('_nvngx.dll')){throw 'VSR creation or GPU execution missing'}
+ }
+ foreach($module in @('avcodec-63.dll','avformat-63.dll','avutil-61.dll','swresample-7.dll','swscale-10.dll','vcruntime140.dll')+$case.modules){
+ if(-not $loaded.ContainsKey($module) -or -not $loaded[$module].StartsWith($package+'\',[StringComparison]::OrdinalIgnoreCase)){throw "$name missing app-local module $module ($($loaded[$module]))"}
+ }
+ $results.Add(@{name=$name;exit=$p.ExitCode;frames=$frames;generated=$generated;seconds=$timer.Elapsed.TotalSeconds;modules=$loaded})
+ }
+ @{passed=$true;manifestRequired=$false;exeHash=(Get-FileHash -LiteralPath $exe).Hash;cases=$results}|ConvertTo-Json -Depth 6|Set-Content -LiteralPath "$output/result.json" -Encoding UTF8
+ Write-Output "PASS: $output/result.json"
+} finally {
+ $env:PATH=$savedPath
+ foreach($file in $manifests){$disabled=$file.FullName+'.test-disabled';if(Test-Path -LiteralPath $disabled){Move-Item -LiteralPath $disabled -Destination $file.FullName}}
+}
diff --git a/scripts/acceptance/ui-fg-backends.py b/scripts/acceptance/ui-fg-backends.py
index 340133db..b6b3a1c7 100644
--- a/scripts/acceptance/ui-fg-backends.py
+++ b/scripts/acceptance/ui-fg-backends.py
@@ -18,6 +18,9 @@ if '--worker' not in sys.argv:
subprocess.run(['taskkill.exe', '/PID', str(child.pid), '/T', '/F'], capture_output=True, timeout=5)
sys.exit('FAIL: FG selector test exceeded 90 seconds')
sys.argv.remove('--worker')
+portable = '--portable' in sys.argv
+if portable:
+ sys.argv.remove('--portable')
reject_xess = '--reject-xess' in sys.argv
if reject_xess:
sys.argv.remove('--reject-xess')
@@ -98,7 +101,8 @@ media = pathlib.Path('logs/video-sdk-trial-20260909/known-pan15.mp4').resolve()
out = pathlib.Path('logs/continuation-repair-20260910') / ('ui-fg-' + str(time.time_ns()))
out.mkdir(parents=True)
env = os.environ.copy()
-env['PATH'] = r'C:\veyra-deps\installed\x64-windows\bin;' + env['PATH']
+env['PATH'] = (os.path.join(os.environ['SYSTEMROOT'], 'System32') + ';' + os.environ['SYSTEMROOT']
+ if portable else r'C:\veyra-deps\installed\x64-windows\bin;' + env['PATH'])
env['VEYRA_LOG_FILE'] = str((out / 'app.log').resolve())
if reject_xess:
env['VEYRA_TEST_XESS_INIT_FAILURE'] = '1'
@@ -115,7 +119,8 @@ def log():
with (out / 'stdout.log').open('w') as stdout, (out / 'stderr.log').open('w') as stderr:
process = subprocess.Popen([str(exe), '--smoke-view', 'professional', '--smoke-seconds', '80',
str(media), '--no-nr', '--no-sr', '--fg'],
- stdout=stdout, stderr=stderr, env=env, startupinfo=startup)
+ stdout=stdout, stderr=stderr, env=env, startupinfo=startup,
+ cwd=exe.parent if portable else None)
try:
main = wait_for(lambda: windows(process.pid, 'VeyraApp'))[0]
u.ShowWindow(main, 4)
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 1378cb42..2bb3e179 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -2,6 +2,7 @@
param(
[Parameter(Mandatory = $true)][string]$Root,
[Parameter(Mandatory = $true)][ValidateSet("x64-debug", "x64-release")][string]$Preset,
+ [string]$BuildDirectory,
[switch]$Clean
)
@@ -49,6 +50,7 @@ if (-not (Test-Path -LiteralPath $vcvars -PathType Leaf)) {
}
$buildDir = Join-Path $Root ("out\build\" + $Preset)
+if ($BuildDirectory) { $buildDir = [IO.Path]::GetFullPath($BuildDirectory) }
if ($Clean -and (Test-Path -LiteralPath $buildDir -PathType Container)) {
Remove-Item -LiteralPath $buildDir -Recurse -Force
}
@@ -85,9 +87,9 @@ $batchLines = @(
('call "{0}" >nul 2>&1' -f $vcvars),
('if errorlevel 1 exit /b 4' -f $null),
('cd /d "{0}"' -f $Root),
- ('"{0}" --preset {1}{2}' -f $cmakeExe, $Preset, $configureExtra),
+ ('"{0}" --preset {1} -B "{2}"{3}' -f $cmakeExe, $Preset, $buildDir, $configureExtra),
'if errorlevel 1 exit /b 5',
- ('"{0}" --build --preset {1}' -f $cmakeExe, $Preset),
+ ('"{0}" --build "{1}"' -f $cmakeExe, $buildDir),
'if errorlevel 1 exit /b 6',
'exit /b 0'
)
@@ -95,5 +97,10 @@ Set-Content -LiteralPath $batchFile -Value $batchLines -Encoding ASCII
& cmd.exe /c ('"{0}"' -f $batchFile)
$exitCode = $LASTEXITCODE
+if ($exitCode -eq 0 -and (Test-Path -LiteralPath (Join-Path $buildDir 'veyra.exe'))) {
+ foreach ($name in @('avcodec-63.dll','avformat-63.dll','avutil-61.dll','swresample-7.dll','swscale-10.dll')) {
+ Copy-Item -LiteralPath (Join-Path $ffmpegRoot "bin/$name") -Destination $buildDir
+ }
+}
Write-Host ("build.ps1: preset {0} exitCode={1}" -f $Preset, $exitCode)
exit $exitCode
diff --git a/scripts/gates/delivery.ps1 b/scripts/gates/delivery.ps1
index 86846fb8..ecfc51c3 100644
--- a/scripts/gates/delivery.ps1
+++ b/scripts/gates/delivery.ps1
@@ -1,5 +1,5 @@
[CmdletBinding()]
-param([Parameter(Mandatory=$true)][string]$Root,[switch]$VisiblePlayer)
+param([Parameter(Mandatory=$true)][string]$Root,[switch]$VisiblePlayer,[string]$BuildDirectory,[string]$PlayerExe,[switch]$PortablePlayer)
# User-authorized local software acceptance, <=300s for this entire suite.
# Native-4K realtime60 is NOT asserted: user selected an explicit 1080 working realtime profile.
# Real capture acceptance and proprietary distribution are separate, never synthetic PASS.
@@ -14,6 +14,9 @@ $run=[Guid]::NewGuid().ToString('N')
$dir=Join-Path $Root ('logs/delivery/'+$run)
[IO.Directory]::CreateDirectory($dir)|Out-Null
$bin=Join-Path $Root 'out/build/x64-release'
+if($BuildDirectory){$bin=(Resolve-Path -LiteralPath $BuildDirectory).Path}
+if(-not $PlayerExe){$PlayerExe=Join-Path $bin 'veyra.exe'}
+$PlayerExe=(Resolve-Path -LiteralPath $PlayerExe).Path
$checks=[Collections.Generic.List[object]]::new()
function Check([string]$Name,[bool]$Passed,[string]$Detail){$checks.Add([pscustomobject]@{name=$Name;passed=$Passed;detail=$Detail});if(-not $Passed){throw "$Name : $Detail"}}
function Run([string]$Name,[string]$Exe,[string[]]$Argv,[int]$Limit=30,[int]$ExpectedExit=0){
@@ -22,7 +25,13 @@ function Run([string]$Name,[string]$Exe,[string[]]$Argv,[int]$Limit=30,[int]$Exp
$timeout=[Math]::Min($Limit,$remaining)
$windowStyle='Hidden'
if($VisiblePlayer -and $Argv -contains '--smoke-seconds'){$windowStyle='Normal'}
- $p=Start-Process -FilePath $Exe -ArgumentList @($Argv|ForEach-Object{'"'+$_.Replace('"','\"')+'"'}) -PassThru -WindowStyle $windowStyle -RedirectStandardOutput "$dir/$Name.stdout.log" -RedirectStandardError "$dir/$Name.stderr.log"
+ $savedPath=$env:PATH
+ try {
+ if($PortablePlayer -and $Exe -eq $PlayerExe){$env:PATH="$env:SystemRoot/System32;$env:SystemRoot"}
+ $workingDirectory=$Root
+ if($PortablePlayer -and $Exe -eq $PlayerExe){$workingDirectory=Split-Path $Exe}
+ $p=Start-Process -FilePath $Exe -ArgumentList @($Argv|ForEach-Object{'"'+$_.Replace('"','\"')+'"'}) -WorkingDirectory $workingDirectory -PassThru -WindowStyle $windowStyle -RedirectStandardOutput "$dir/$Name.stdout.log" -RedirectStandardError "$dir/$Name.stderr.log"
+ } finally {$env:PATH=$savedPath}
$processHandle=$p.Handle
if(-not $p.WaitForExit($timeout*1000)){Stop-Process -Id $p.Id -Force;throw "$Name timeout"}
$exitCode=$p.ExitCode;Check "$Name-exit" ($null -ne $exitCode -and $exitCode -eq $ExpectedExit) "exit=$exitCode expected=$ExpectedExit"
@@ -37,21 +46,21 @@ try{
Run quality4k "$bin/veyra_quality_probe.exe" @('--input',$clip4k,'--native','--guidance','motion','--frames','12','--json-file',"$dir/quality4k.json",'--dump',"$dir/enhanced4k.png")
$q4=Get-Content "$dir/quality4k.json" -Raw|ConvertFrom-Json
Check native4k ($q4.failures -eq 0 -and $q4.sourceExtent.width -eq 3840 -and $q4.workingExtent.width -eq 3840 -and $q4.nrEvaluateCount -eq 12) 'native4K correctness only; not a realtime60 claim'
- Run player "$bin/veyra.exe" @($clip4k,'--realtime','--fg','--smoke-seconds','6') 20
+ Run player $PlayerExe @($clip4k,'--realtime','--fg','--smoke-seconds','6') 20
$log=Get-Content "$dir/player.stdout.log" -Raw
Check player-sync ($log -match 'smoke frames=(\d+).*generated=(\d+).*failed=false.*absLatenessP95Ms=([\d.]+)' -and [int]$Matches[1] -gt 60 -and [int]$Matches[2] -gt 0 -and [double]$Matches[3] -le 50) 'real-time profile 4K ingress, generated frames, observed abs lateness P95 <=50ms'
- Run controls "$bin/veyra.exe" @($clip1080,'--realtime','--smoke-seconds','6','--smoke-controls','--smoke-save',"$dir/snapshot.jpg") 20
+ Run controls $PlayerExe @($clip1080,'--realtime','--smoke-seconds','6','--smoke-controls','--smoke-save',"$dir/snapshot.jpg") 20
$controlLog=Get-Content "$dir/controls.stdout.log" -Raw
Check paused-seek ($controlLog -match 'seek done' -and $controlLog -match 'controlsStep=4' -and (Test-Path "$dir/snapshot.jpg")) 'pause / seek while paused / resume / real WIC JPEG'
- Run image "$bin/veyra.exe" @("$dir/enhanced.png",'--smoke-seconds','3') 15
- Run image4k "$bin/veyra.exe" @("$dir/enhanced4k.png",'--realtime','--smoke-seconds','6','--smoke-controls','--smoke-save',"$dir/image4k.jpg") 15
+ Run image $PlayerExe @("$dir/enhanced.png",'--smoke-seconds','3') 15
+ Run image4k $PlayerExe @("$dir/enhanced4k.png",'--realtime','--smoke-seconds','6','--smoke-controls','--smoke-save',"$dir/image4k.jpg") 15
Run inspect-image4k $ffprobe @('-v','error','-show_streams','-of','json',"$dir/image4k.jpg") 10
$img=(Get-Content "$dir/inspect-image4k.stdout.log" -Raw|ConvertFrom-Json).streams[0]
Check native4k-image ($img.width -eq 3840 -and $img.height -eq 2160) 'realtime default must not shrink image export'
foreach($codec in @('h264','hevc')){
$file="$dir/$codec.mp4"
$a=@($clip4k,'--export-out',$file,'--max-frames','12','--fg');if($codec -eq 'hevc'){$a+='--hevc'}
- Run "export-$codec" "$bin/veyra.exe" $a 30
+ Run "export-$codec" $PlayerExe $a 30
Run "inspect-$codec" $ffprobe @('-v','error','-count_frames','-show_streams','-of','json',$file) 10
$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')
@@ -62,10 +71,10 @@ try{
Check "frame-kinds-$codec" ($exportLog -match 'export-counts\] source=12 generated=11 hold=1 output=24 multiplier=2') '12 real + 11 generated + 1 declared CFR tail hold; never count hold as DLSSG'
Check "decode-$codec" ($v.width -eq 3840 -and $v.height -eq 2160 -and $v.codec_name -eq $codec -and [int]$v.nb_read_frames -eq 24 -and $v.avg_frame_rate -eq '120/1' -and [math]::Abs([double]$v.duration-0.2) -lt 0.00001 -and $a.Count -ge 1) 'all short frames decoded; native4K 2X CFR frame count, duration, rate and audio'
}
- Run cancel "$bin/veyra.exe" @($clip4k,'--export-out',"$dir/cancel.mp4",'--cancel-after-ms','3000') 15 3
+ Run cancel $PlayerExe @($clip4k,'--export-out',"$dir/cancel.mp4",'--cancel-after-ms','3000') 15 3
Check cancel-not-success ((-not (Test-Path "$dir/cancel.mp4")) -and (Test-Path "$dir/cancel.mp4.partial")) 'cancel drains with live callback; never promotes incomplete output'
Check test-budget ($timer.Elapsed.TotalSeconds -lt 300) "$($timer.Elapsed.TotalSeconds)s; short validation is not endurance proof"
- $result=[ordered]@{runId=$run;status='software_short_gate_passed';capture='awaiting_user_capture_test';distribution='blocked';seconds=$timer.Elapsed.TotalSeconds;exeHash=(Get-FileHash "$bin/veyra.exe" -Algorithm SHA256).Hash;checks=$checks}
+ $result=[ordered]@{runId=$run;status='software_short_gate_passed';capture='awaiting_user_capture_test';distribution='not_assessed_by_software_gate';seconds=$timer.Elapsed.TotalSeconds;exeHash=(Get-FileHash $PlayerExe -Algorithm SHA256).Hash;checks=$checks}
$result|ConvertTo-Json -Depth 8|Set-Content "$dir/result.json" -Encoding UTF8
Write-Host "DELIVERY SHORT GATE PASS: $dir/result.json";exit 0
}catch{
diff --git a/scripts/package-ffmpeg-source.py b/scripts/package-ffmpeg-source.py
new file mode 100644
index 00000000..4688ffed
--- /dev/null
+++ b/scripts/package-ffmpeg-source.py
@@ -0,0 +1,70 @@
+"""Package the installed LGPL FFmpeg's source, patches and reported configuration."""
+import argparse
+import ctypes
+import hashlib
+import json
+import os
+from pathlib import Path
+import zipfile
+
+parser = argparse.ArgumentParser()
+parser.add_argument('--prefix', type=Path, required=True)
+parser.add_argument('--vcpkg', type=Path, required=True)
+parser.add_argument('--source', type=Path, required=True)
+parser.add_argument('--output', type=Path, required=True)
+args = parser.parse_args()
+if args.output.exists():
+ raise SystemExit('Output exists; choose a new candidate')
+spdx_path = args.prefix / 'share/ffmpeg/vcpkg.spdx.json'
+spdx = json.loads(spdx_path.read_text(encoding='utf-8'))
+port = args.vcpkg / 'ports/ffmpeg'
+for item in spdx['files']:
+ if not item['SPDXID'].startswith('SPDXRef-port-file-'):
+ continue
+ path = port / item['fileName']
+ expected = next(c['checksumValue'] for c in item['checksums'] if c['algorithm'] == 'SHA256')
+ if hashlib.sha256(path.read_bytes()).hexdigest() != expected.lower():
+ raise SystemExit(f'Port provenance mismatch: {path.name}')
+records = []
+with os.add_dll_directory(str((args.prefix / 'bin').resolve())):
+ lib = ctypes.CDLL(str((args.prefix / 'bin/avcodec-63.dll').resolve()))
+ lib.avcodec_configuration.restype = ctypes.c_char_p
+ lib.avcodec_license.restype = ctypes.c_char_p
+ configuration = lib.avcodec_configuration().decode()
+ license_name = lib.avcodec_license().decode()
+if license_name != 'LGPL version 2.1 or later':
+ raise SystemExit(f'Unexpected library license: {license_name}')
+args.output.parent.mkdir(parents=True, exist_ok=True)
+with zipfile.ZipFile(args.output, 'x', compression=zipfile.ZIP_DEFLATED, compresslevel=7) as archive:
+ for base, prefix in ((args.source, 'ffmpeg-patched'), (port, 'vcpkg-port')):
+ for path in sorted(base.rglob('*')):
+ if path.is_file():
+ relative = path.relative_to(base)
+ if path.suffix.lower() in {'.dll', '.exe', '.pdb', '.obj', '.lib'} or '.git' in relative.parts:
+ raise SystemExit(f'Unexpected source payload: {relative}')
+ name = f'{prefix}/{relative.as_posix()}'
+ archive.write(path, name)
+ records.append({'path': name, 'sha256': hashlib.sha256(path.read_bytes()).hexdigest()})
+ archive.write(spdx_path, 'FFMPEG-SPDX.json')
+ archive.write(args.vcpkg / 'LICENSE.txt', 'VCPKG-LICENSE.txt')
+ archive.writestr('binary-configuration.txt', license_name + '\n\n' + configuration + '\n')
+ archive.writestr('source-manifest.json', json.dumps(records, indent=2))
+ archive.writestr('README.txt',
+ 'FFmpeg 9.0.1#1 corresponding-source material for Veyra 0.0.2.\n'
+ 'Not needed to run the application. No NVIDIA SDK or runtime is included.\n'
+ 'ffmpeg-patched is the local vcpkg patched n9.0.1 source tree.\n'
+ 'vcpkg-port contains the build recipe and patches, verified against the shipped SPDX.\n'
+ 'binary-configuration.txt is queried from the actual distributed avcodec DLL,\n'
+ 'not copied from a potentially newer build cache.\n'
+ 'Build using Visual Studio x64 tools and vcpkg FFmpeg 9.0.1#1, selecting features\n'
+ 'to match the recorded configuration (shared LGPL libraries, swscale/swresample,\n'
+ 'no external codec libraries, no CLI programs). See portfile.cmake and build.sh.in.\n'
+ 'The recorded configuration includes original local build paths; adapt paths locally.\n'
+ 'Veyra links dynamically; compatible rebuilt libraries may replace the shipped DLLs.\n'
+ 'Upstream: https://github.com/FFmpeg/FFmpeg/tree/n9.0.1\n'
+ 'Port: https://github.com/microsoft/vcpkg/tree/55cd8b8a4f19d8e6ba2ad114c8acacc4af5915a0/ports/ffmpeg\n')
+digest = hashlib.sha256(args.output.read_bytes()).hexdigest().upper()
+args.output.with_suffix(args.output.suffix + '.sha256').write_text(
+ f'{digest} {args.output.name}\n', encoding='ascii')
+print(json.dumps({'archive': str(args.output), 'sha256': digest, 'files': len(records),
+ 'license': license_name, 'size': args.output.stat().st_size}))
diff --git a/scripts/package-portable.ps1 b/scripts/package-portable.ps1
index d125e10d..ead23b7a 100644
--- a/scripts/package-portable.ps1
+++ b/scripts/package-portable.ps1
@@ -1,69 +1,87 @@
param(
[Parameter(Mandatory = $true)][string]$Root,
- [Parameter(Mandatory = $true)][string]$Version,
- [Parameter(Mandatory = $true)][string]$OutputDirectory
+ [Parameter(Mandatory = $true)][ValidatePattern('^\d+\.\d+\.\d+$')][string]$Version,
+ [Parameter(Mandatory = $true)][string]$OutputDirectory,
+ [string]$BuildDirectory
)
-
$ErrorActionPreference = 'Stop'
-$resolvedRoot = [IO.Path]::GetFullPath($Root)
+$resolvedRoot = (Resolve-Path -LiteralPath $Root).Path
$resolvedOutput = [IO.Path]::GetFullPath($OutputDirectory)
$bin = Join-Path $resolvedRoot 'out/build/x64-release'
-$stage = Join-Path $resolvedOutput ("Veyra-" + $Version + "-win64-portable")
-$archive = $stage + '.zip'
-$runtimeStage = Join-Path $stage 'runtime_local/nvidia'
-$licensesStage = Join-Path $stage 'licenses'
-
-$applicationFiles = @('veyra.exe', 'avcodec-63.dll', 'avformat-63.dll', 'avutil-61.dll', 'swresample-7.dll', 'swscale-10.dll')
-foreach ($file in $applicationFiles) {
- if (-not (Test-Path -LiteralPath (Join-Path $bin $file))) { throw "Missing Release file: $file" }
-}
-
-# Explicit user-authorized Runtime Pack allowlist. No wildcards are permitted.
+if ($BuildDirectory) { $bin = (Resolve-Path -LiteralPath $BuildDirectory).Path }
+$stage = Join-Path $resolvedOutput "Veyra-$Version-win64-portable"
+$archive = "$stage.zip"
+# Preserve existing candidates and their verification evidence.
+if ((Test-Path -LiteralPath $stage) -or (Test-Path -LiteralPath $archive)) { throw 'Output exists; choose a new staging directory.' }
+$applicationFiles = @('veyra.exe','avcodec-63.dll','avformat-63.dll','avutil-61.dll','swresample-7.dll','swscale-10.dll')
+$appVersion = [Diagnostics.FileVersionInfo]::GetVersionInfo((Join-Path $bin 'veyra.exe'))
+if ($appVersion.ProductVersion -ne $Version) { throw "EXE version $($appVersion.ProductVersion) does not match $Version" }
+# Publisher audit only. The application permits users to replace these DLLs.
$runtimeFiles = @(
- @{ Name = 'nvngx_dlss.dll'; Source = (Join-Path $resolvedRoot 'runtime_local/nvidia/nvngx_dlss.dll'); Sha256 = 'BE6E434A94CA32499515EB62CA0E6C274526055D568D0426E4C652DCDFB6EE6E'; Classification = 'official-sdk-runtime'; Experimental = $false },
- @{ Name = 'nvngx_dlssg.dll'; Source = (Join-Path $resolvedRoot 'runtime_local/nvidia/nvngx_dlssg.dll'); Sha256 = '135EAF0733C1E37381A8C28ABCF7A862404A54132B81787C04E35D09EFC5E36F'; Classification = 'community-experimental-runtime'; Experimental = $true },
- @{ Name = 'nvngx_dlssnr.dll'; Source = (Join-Path $resolvedRoot 'runtime_local/nvidia/nvngx_dlssnr.dll'); Sha256 = 'E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E'; Classification = 'community-experimental-runtime'; Experimental = $true },
- @{ Name = 'nvngx_vsr.dll'; Source = (Join-Path $resolvedRoot 'runtime_local/nvidia/nvngx_vsr.dll'); Sha256 = 'C3D88EEA5FF7A548EDEFA66414CF6E77464D0947277C904F324DD23ABF58A1ED'; Classification = 'official-rtx-video-sdk-runtime'; Experimental = $false }
+ @{ Name='nvngx_dlss.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_dlss.dll'; Hash='BE6E434A94CA32499515EB62CA0E6C274526055D568D0426E4C652DCDFB6EE6E'; Category='official-dlss-sdk-310.7.0-rel'; Experimental=$false },
+ @{ Name='nvngx_dlssg.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_dlssg.dll'; Hash='135EAF0733C1E37381A8C28ABCF7A862404A54132B81787C04E35D09EFC5E36F'; Category='pinned-dlss-sdk-310.7.0-rel'; Experimental=$true },
+ @{ Name='nvngx_dlssnr.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_dlssnr.dll'; Hash='E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E'; Category='user-provided-pinned-experimental-runtime'; Experimental=$true },
+ @{ Name='nvngx_vsr.dll'; Folder='runtime/experimental'; Source='runtime_local/nvidia/nvngx_vsr.dll'; Hash='C3D88EEA5FF7A548EDEFA66414CF6E77464D0947277C904F324DD23ABF58A1ED'; Category='official-rtx-video-sdk-1.1.0'; Experimental=$false },
+ @{ Name='libxell.dll'; Folder='runtime_local/intel/experimental'; Source='runtime_local/intel/experimental/libxell.dll'; Hash='D2030DCD694FDA8F2EC7E044B13E6DB8F0B56D4BA9113A5EFAD334E3F3DED8C7'; Category='official-intel-xess-sdk-3.0.2'; Experimental=$true },
+ @{ Name='libxess_fg.dll'; Folder='runtime_local/intel/experimental'; Source='runtime_local/intel/experimental/libxess_fg.dll'; Hash='EC5E0C65E075570C6EDE72618BB666D0BE0C2E10B2EA9762C0FE8CB8E375AB27'; Category='official-intel-xess-sdk-3.0.2'; Experimental=$true }
)
-foreach ($item in $runtimeFiles) {
- if (-not (Test-Path -LiteralPath $item.Source)) { throw "Missing approved runtime: $($item.Name)" }
- if ((Get-FileHash -Algorithm SHA256 -LiteralPath $item.Source).Hash.ToUpperInvariant() -ne $item.Sha256) { throw "Runtime hash mismatch for $($item.Name)" }
- if ((Get-AuthenticodeSignature -LiteralPath $item.Source).Status -ne 'Valid') { throw "Runtime signature is not Valid for $($item.Name)" }
+$records = foreach ($item in $runtimeFiles) {
+ $source = Join-Path $resolvedRoot $item.Source
+ $file = Get-Item -LiteralPath $source
+ $hash = (Get-FileHash -LiteralPath $source -Algorithm SHA256).Hash
+ $sig = Get-AuthenticodeSignature -LiteralPath $source
+ if ($hash -ne $item.Hash -or $sig.Status -ne 'Valid') { throw "Publisher runtime identity rejected: $($item.Name)" }
+ $v = $file.VersionInfo
+ [pscustomobject][ordered]@{name=$item.Name;path="$($item.Folder)/$($item.Name)";size=$file.Length;sha256=$hash;fileVersion="$($v.FileMajorPart).$($v.FileMinorPart).$($v.FileBuildPart).$($v.FilePrivatePart)";authenticode=$sig.Status.ToString();signer=$sig.SignerCertificate.Subject;classification=$item.Category;experimental=$item.Experimental;removable=$true;source=$item.Category}
+}
+$allowed = [Collections.Generic.List[string]]::new()
+function Copy-Payload([string]$Source,[string]$Relative) {
+ $destination = Join-Path $stage $Relative
+ [IO.Directory]::CreateDirectory((Split-Path $destination)) | Out-Null
+ Copy-Item -LiteralPath $Source -Destination $destination
+ $allowed.Add($Relative.Replace('\','/'))
+}
+foreach ($name in $applicationFiles) {
+ $destination = if ($name -eq 'veyra.exe') {'Veyra.exe'} else {$name}
+ Copy-Payload (Join-Path $bin $name) $destination
+}
+$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio/Installer/vswhere.exe'
+$vsRoot = (& $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath) -join ''
+$crt = Get-ChildItem -LiteralPath (Join-Path $vsRoot 'VC/Redist/MSVC') -Directory | Where-Object Name -Match '^\d+\.' | Sort-Object Name -Descending | Select-Object -First 1
+foreach ($name in @('vcruntime140.dll','vcruntime140_1.dll','msvcp140.dll')) {
+ Copy-Payload (Join-Path $crt.FullName "x64/Microsoft.VC143.CRT/$name") $name
+}
+foreach ($name in @('LICENSE','README.md','README_EN.md','THIRD_PARTY_NOTICES.md')) { Copy-Payload (Join-Path $resolvedRoot $name) $name }
+foreach ($name in @('BUILD.md','RUNTIME_COMPONENTS_0.0.2.md')) { Copy-Payload (Join-Path $resolvedRoot "docs/$name") "docs/$name" }
+Copy-Payload (Join-Path $resolvedRoot "docs/RELEASE_NOTES_$Version.md") 'RELEASE_NOTES.md'
+foreach ($shader in Get-ChildItem -LiteralPath (Join-Path $bin 'shaders') -File -Filter '*.dxil') { Copy-Payload $shader.FullName "shaders/$($shader.Name)" }
+Copy-Payload (Join-Path $resolvedRoot 'runtime_local/config/ngx-local.json') 'runtime/config/ngx-local.json'
+Copy-Payload 'C:/veyra-deps/installed/x64-windows/share/ffmpeg/copyright' 'licenses/FFMPEG-COPYRIGHT.txt'
+Copy-Payload 'C:/veyra-deps/installed/x64-windows/share/ffmpeg/vcpkg.spdx.json' 'licenses/FFMPEG-SPDX.json'
+Copy-Payload (Join-Path $resolvedRoot 'assets/icons/lucide/LICENSE') 'licenses/LUCIDE-LICENSE.txt'
+Copy-Payload (Join-Path $resolvedRoot 'third_party_local/nvidia/DLSS_repo/LICENSE.txt') 'licenses/NVIDIA_RTX_SDK_LICENSE.txt'
+Copy-Payload (Join-Path $resolvedRoot 'third_party_local/nvidia/RTX_Video_SDK_1.1.0/NVIDIA_RTX_Video_SDK_License.pdf') 'licenses/NVIDIA_RTX_VIDEO_SDK_LICENSE.pdf'
+Copy-Payload (Join-Path $resolvedRoot 'third_party_local/nvidia/Optical_Flow_SDK_5.0.7/LicenseAgreement.pdf') 'licenses/NVIDIA_OPTICAL_FLOW_SDK_LICENSE.pdf'
+Copy-Payload (Join-Path $resolvedRoot 'third_party_local/intel/xess-3.0.2/LICENSE.txt') 'licenses/INTEL_XESS_LICENSE.txt'
+Copy-Payload (Join-Path $resolvedRoot 'third_party_local/intel/xess-3.0.2/third-party-programs.txt') 'licenses/INTEL_THIRD_PARTY_PROGRAMS.txt'
+Copy-Payload (Join-Path $resolvedRoot 'third_party_local/amd/FidelityFX-SDK/LICENSE.txt') 'licenses/AMD_FIDELITYFX_LICENSE.txt'
+foreach ($item in $runtimeFiles) { Copy-Payload (Join-Path $resolvedRoot $item.Source) "$($item.Folder)/$($item.Name)" }
+foreach ($folder in @('runtime/experimental','runtime_local/intel/experimental')) {
+ $relative = "$folder/release-runtime-manifest.json"
+ [ordered]@{schema=1;package="Veyra $Version";mode='user-authorized-runtime-pack';enforcedAtRuntime=$false;warning='Community experimental integration; not vendor certification or endorsement.';files=@($records | Where-Object {$_.path.StartsWith("$folder/")})} | ConvertTo-Json -Depth 6 | Set-Content -LiteralPath (Join-Path $stage $relative) -Encoding UTF8
+ $allowed.Add($relative)
}
-
-if (Test-Path -LiteralPath $stage) { Remove-Item -LiteralPath $stage -Recurse -Force }
-if (Test-Path -LiteralPath $archive) { Remove-Item -LiteralPath $archive -Force }
-New-Item -ItemType Directory -Path $runtimeStage -Force | Out-Null
-New-Item -ItemType Directory -Path $licensesStage -Force | Out-Null
-New-Item -ItemType Directory -Path (Join-Path $stage 'runtime_local/config') -Force | Out-Null
-
-foreach ($file in $applicationFiles) { Copy-Item -LiteralPath (Join-Path $bin $file) -Destination $stage }
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'LICENSE') -Destination $stage
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'THIRD_PARTY_NOTICES.md') -Destination $stage
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'docs/RELEASE_NOTES_0.0.1.md') -Destination (Join-Path $stage 'RELEASE_NOTES.md')
-Copy-Item -LiteralPath 'C:/veyra-deps/installed/x64-windows/share/ffmpeg/copyright' -Destination (Join-Path $stage 'FFMPEG-COPYRIGHT.txt')
-Copy-Item -LiteralPath (Join-Path $bin 'shaders') -Destination (Join-Path $stage 'shaders') -Recurse
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'runtime_local/config/ngx-local.json') -Destination (Join-Path $stage 'runtime_local/config/ngx-local.json')
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'third_party_local/nvidia/DLSS_repo/LICENSE.txt') -Destination (Join-Path $licensesStage 'NVIDIA_RTX_SDK_LICENSE.txt')
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'third_party_local/nvidia/RTX_Video_SDK_1.1.0/NVIDIA_RTX_Video_SDK_License.pdf') -Destination (Join-Path $licensesStage 'NVIDIA_RTX_VIDEO_SDK_LICENSE.pdf')
-Copy-Item -LiteralPath (Join-Path $resolvedRoot 'third_party_local/nvidia/Optical_Flow_SDK_5.0.7/LicenseAgreement.pdf') -Destination (Join-Path $licensesStage 'NVIDIA_OPTICAL_FLOW_SDK_LICENSE.pdf')
-
-$manifestFiles = foreach ($item in $runtimeFiles) {
- Copy-Item -LiteralPath $item.Source -Destination (Join-Path $runtimeStage $item.Name)
- $file = Get-Item -LiteralPath $item.Source
- $signature = Get-AuthenticodeSignature -LiteralPath $item.Source
- $version = [Diagnostics.FileVersionInfo]::GetVersionInfo($item.Source).FileVersion
- [ordered]@{ name = $item.Name; size = $file.Length; sha256 = $item.Sha256; fileVersion = $version; authenticode = $signature.Status.ToString(); signer = if ($signature.SignerCertificate) { $signature.SignerCertificate.Subject } else { $null }; classification = $item.Classification; experimental = $item.Experimental }
+$payload = @(Get-ChildItem -LiteralPath $stage -Recurse -File)
+$forbidden = '\.(pdb|lib|obj|h|hpp|cpp|c|zip|pth|onnx|log|mp4|partial|addon64)$'
+foreach ($file in $payload) {
+ $relative = $file.FullName.Substring($stage.Length+1).Replace('\','/')
+ if ($relative -notin $allowed -or $relative -match $forbidden -or $relative -match '(^|/)(third_party_local|logs|captures|\.git)/') { throw "Unexpected payload: $relative" }
}
-[ordered]@{ schema = 1; package = "Veyra $Version"; mode = 'user-authorized-runtime-pack'; warning = 'Experimental runtime components are not an NVIDIA official endorsement or support statement.'; files = @($manifestFiles) } | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $runtimeStage 'release-runtime-manifest.json') -Encoding UTF8
-
-@'
-This directory contains the Veyra experimental Runtime Pack selected by the
-publisher. It is not source code and must not be copied into the Veyra Git
-repository. The package checks release-runtime-manifest.json before enabling
-NVIDIA-backed enhancement features.
-'@ | Set-Content -LiteralPath (Join-Path $runtimeStage 'README.txt') -Encoding UTF8
-
+$fileManifest = @($payload | ForEach-Object {[ordered]@{path=$_.FullName.Substring($stage.Length+1).Replace('\','/');size=$_.Length;sha256=(Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash}})
+[ordered]@{schema=1;version=$Version;files=$fileManifest} | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $stage 'package-manifest.json') -Encoding UTF8
Compress-Archive -LiteralPath $stage -DestinationPath $archive -CompressionLevel Optimal
-Get-ChildItem -LiteralPath $stage -Recurse -File | Get-FileHash -Algorithm SHA256 | Select-Object Path, Hash | ConvertTo-Json | Set-Content -LiteralPath ($archive + '.sha256.json') -Encoding UTF8
-Get-FileHash -LiteralPath $archive -Algorithm SHA256 | Format-List
+$archiveHash = (Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash
+"$archiveHash $([IO.Path]::GetFileName($archive))" | Set-Content -LiteralPath "$archive.sha256" -Encoding ASCII
+[ordered]@{archive=$archive;sha256=$archiveHash;files=$payload.Count+1;runtime=$records;forbiddenFiles=0} | ConvertTo-Json -Depth 6 | Set-Content -LiteralPath (Join-Path $resolvedOutput 'package-audit.json') -Encoding UTF8
+Get-Item -LiteralPath $archive | Select-Object FullName,Length
+Write-Output "SHA256 $archiveHash"
diff --git a/src/base/RuntimePaths.cpp b/src/base/RuntimePaths.cpp
index 89e9941a..24ca03e5 100644
--- a/src/base/RuntimePaths.cpp
+++ b/src/base/RuntimePaths.cpp
@@ -32,7 +32,10 @@ std::filesystem::path shaderDirectory()
return applicationRoot() / "shaders";
}
-std::filesystem::path localRuntimeDirectory() { return applicationRoot() / "runtime_local" / "nvidia"; }
+std::filesystem::path localRuntimeDirectory() {
+ const auto root=applicationRoot();
+ return std::filesystem::exists(root/"runtime")?root/"runtime"/"experimental":root/"runtime_local"/"nvidia";
+}
std::filesystem::path localDataDirectory() { return applicationRoot() / "runtime_local"; }
std::filesystem::path logsDirectory() { return applicationRoot() / "logs"; }
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index 1f62161c..9d20e069 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -489,8 +489,11 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){
}
if(isCapture&&!rereadCached&&!liveTimeline.anchored(out.batch.identity.epoch)){
const auto duration100ns=liveSourceInterval100ns(pkt.duration,activeSource->info().averageFps);
- veyra::log::info("capture-timeline",std::format("interval100ns={} packetDurationKnown={} packetDurationPositive={} nominalFps={} FG={}",duration100ns,!pkt.duration.isUnknown(),pkt.duration.num>0,activeSource->info().averageFps,options.fg));
- liveTimeline.reset(out.batch.identity.epoch,out.batch.b100ns,captureArrival,options.fg?duration100ns:0);
+ // File replay has no device pacing and still needs its PTS
+ // clock. Physical capture without FG presents as soon as ready.
+ const bool paceSourcePts=options.fg||!physicalCapture;
+ veyra::log::info("capture-timeline",std::format("interval100ns={} packetDurationKnown={} packetDurationPositive={} nominalFps={} FG={} pacing={}",duration100ns,!pkt.duration.isUnknown(),pkt.duration.num>0,activeSource->info().averageFps,options.fg,paceSourcePts?"source-pts":"capture-ready"));
+ liveTimeline.reset(out.batch.identity.epoch,out.batch.b100ns,captureArrival,options.fg?duration100ns:0,paceSourcePts);
}
if(!audioStarted&&!isImage&&!isCapture&&frames==0){if(audioPipe.open(path)){audioPipe.startThread(&audio,true);audioStarted=true;{std::lock_guard lock(mutex_);snapshot_.audioAvailable=true;}}anchor=Clock::now();anchorMs=lastAudioClockMs=pts;}
auto nowMs=[&](){
diff --git a/src/gfx/XessPresenter.cpp b/src/gfx/XessPresenter.cpp
index b2c9e755..bc900ea5 100644
--- a/src/gfx/XessPresenter.cpp
+++ b/src/gfx/XessPresenter.cpp
@@ -1,7 +1,6 @@
#include "veyra/gfx/XessPresenter.h"
#include "veyra/Log.h"
#include "veyra/RuntimePaths.h"
-#include "veyra/FileIdentity.h"
#ifdef VEYRA_HAS_XESS
#include <xess_fg/xefg_swapchain_d3d12.h>
#include <xell/xell_d3d12.h>
@@ -53,16 +52,11 @@ bool XessPresenter::initialize(ID3D12Device* device,ID3D12CommandQueue* queue,ID
}
#ifdef VEYRA_HAS_XESS
auto& p=*p_;const auto root=runtime::localDataDirectory()/"intel"/"experimental";
- auto load=[&](const wchar_t* name,const char* hash){auto path=std::filesystem::absolute(root/name);
- FileIdentity identity;IdentityError error;
- if(!computeFileIdentity(path.wstring(),identity,error)||!identity.signatureValid||identity.sha256Upper!=hash){
- log::error("xess-fg",std::format("runtime identity rejected {} hash={} signed={} error={}",path.string(),identity.sha256Upper,identity.signatureValid,int(error)));return HMODULE(nullptr);
- }
- log::info("xess-fg",std::format("runtime verified {} sha256={} signed={}",path.string(),identity.sha256Upper,identity.signatureValid));
- auto module=LoadLibraryExW(path.c_str(),nullptr,LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR|LOAD_LIBRARY_SEARCH_SYSTEM32);
+ auto load=[&](const wchar_t* name){auto path=std::filesystem::absolute(root/name);
+ auto module=LoadLibraryExW(path.c_str(),nullptr,LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR|LOAD_LIBRARY_SEARCH_APPLICATION_DIR|LOAD_LIBRARY_SEARCH_SYSTEM32);
log::info("xess-fg",std::format("load {} result={} win32={}",path.string(),module!=nullptr,module?0:GetLastError()));return module;};
- p.llDll=load(L"libxell.dll","D2030DCD694FDA8F2EC7E044B13E6DB8F0B56D4BA9113A5EFAD334E3F3DED8C7");if(!p.llDll)return false;
- p.fgDll=load(L"libxess_fg.dll","EC5E0C65E075570C6EDE72618BB666D0BE0C2E10B2EA9762C0FE8CB8E375AB27");if(!p.fgDll)return false;
+ p.llDll=load(L"libxell.dll");if(!p.llDll)return false;
+ p.fgDll=load(L"libxess_fg.dll");if(!p.fgDll)return false;
#define LOAD(module,name) p.name##Fn=reinterpret_cast<decltype(p.name##Fn)>(GetProcAddress(p.module,#name));if(!p.name##Fn){log::error("xess-fg","missing export " #name);return false;}
LOAD(fgDll,xefgSwapChainD3D12CreateContext)
LOAD(fgDll,xefgSwapChainD3D12GetProperties)
diff --git a/src/ngx/DlssNrRuntimeAdapter.cpp b/src/ngx/DlssNrRuntimeAdapter.cpp
index b6b1df00..b486a054 100644
--- a/src/ngx/DlssNrRuntimeAdapter.cpp
+++ b/src/ngx/DlssNrRuntimeAdapter.cpp
@@ -330,15 +330,11 @@ bool DlssNrRuntimeAdapter::load(const std::wstring& runtimeDir, Status& status)
}
dllPath_ = std::wstring(resolved) + L"\\nvngx_dlssnr.dll";
- // Containment (Playbook 8.2): the canonicalized directory must still be
- // the configured runtime_local/nvidia staging root before any load.
- const std::wstring expectedSuffix = L"\\runtime_local\\nvidia";
- if (dllPath_.size() <= expectedSuffix.size() + wcslen(L"nvngx_dlssnr.dll") ||
- _wcsnicmp(dllPath_.c_str() + dllPath_.size() - (expectedSuffix.size() + wcslen(L"\\nvngx_dlssnr.dll")),
- (std::wstring(expectedSuffix) + L"\\nvngx_dlssnr.dll").c_str(),
- expectedSuffix.size() + wcslen(L"\\nvngx_dlssnr.dll")) != 0) {
+ // Development staging and the explicitly named experimental Release pack.
+ const auto allowed=[&](const wchar_t* suffix){const size_t n=wcslen(suffix);return dllPath_.size()>n&&_wcsicmp(dllPath_.c_str()+dllPath_.size()-n,suffix)==0;};
+ if (!allowed(L"\\runtime_local\\nvidia\\nvngx_dlssnr.dll")&&!allowed(L"\\runtime\\experimental\\nvngx_dlssnr.dll")) {
status = Status::InvalidArgument;
- veyra::log::error("ngx", "nr-adapter: resolved runtime path is outside runtime_local/nvidia; refusing to load");
+ veyra::log::error("ngx", "nr-adapter: resolved runtime path is outside approved staging/experimental directory; refusing to load");
return false;
}
diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cpp
index 55c9e1a2..7d159791 100644
--- a/src/pipeline/EnhanceGraph.cpp
+++ b/src/pipeline/EnhanceGraph.cpp
@@ -84,7 +84,7 @@ bool EnhanceGraph::initialize(const EnhanceGraphDesc& desc)
}
if(!Extent{nrW_,nrH_}.valid()||nrW_>workW_||nrH_>workH_){veyra::log::error("resolution","invalid NR extent");return false;}
if(!Extent{nvofW_,nvofH_}.valid()||nvofW_>srcW_||nvofH_>srcH_){veyra::log::error("resolution","invalid source-space flow extent");return false;}
- diagnostics::DiagnosticEvent initDiagnostic;initDiagnostic.stage="initialize";initDiagnostic.identity={epoch_+1,desc.settingsRevision,0};initDiagnostic.resolution.source={srcW_,srcH_};initDiagnostic.resolution.base=initDiagnostic.resolution.fg=initDiagnostic.resolution.output={workW_,workH_};initDiagnostic.resolution.nr={nrW_,nrH_};initDiagnostic.resolution.flow={nvofW_,nvofH_};initDiagnostic.flowApplied=std::to_string(unsigned(desc.flowQuality));initDiagnostic.runtimeHash="E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E";Logger::diagnosticContext(initDiagnostic);
+ diagnostics::DiagnosticEvent initDiagnostic;initDiagnostic.stage="initialize";initDiagnostic.identity={epoch_+1,desc.settingsRevision,0};initDiagnostic.resolution.source={srcW_,srcH_};initDiagnostic.resolution.base=initDiagnostic.resolution.fg=initDiagnostic.resolution.output={workW_,workH_};initDiagnostic.resolution.nr={nrW_,nrH_};initDiagnostic.resolution.flow={nvofW_,nvofH_};initDiagnostic.flowApplied=std::to_string(unsigned(desc.flowQuality));initDiagnostic.runtimeHash="unverified-user-replaceable";Logger::diagnosticContext(initDiagnostic);
veyra::log::info("resolution",std::format("source={}x{} base={}x{} nr={}x{} flow={}x{} fg={}x{} output={}x{}",srcW_,srcH_,workW_,workH_,nrW_,nrH_,nvofW_,nvofH_,workW_,workH_,workW_,workH_));
srEnabled_ = desc.enableSr && (srcW_ != workW_ || srcH_ != workH_);
nrEnabled_ = desc.enableNr && !desc.noFeatures && !desc.noNgx;
@@ -654,7 +654,7 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frame
out.ptsMs = ptsMs;
if(!sourceFrameId)sourceFrameId=realFrameIndex_+1;
diagnostics::DiagnosticEvent diagnostic;diagnostic.stage="frame";diagnostic.identity={epoch_+uint64_t(reset),desc_.settingsRevision,sourceFrameId};diagnostic.batch=realFrameIndex_+1;
- diagnostic.resolution.source={srcW_,srcH_};diagnostic.resolution.base={workW_,workH_};diagnostic.resolution.nr={nrW_,nrH_};diagnostic.resolution.flow={nvofW_,nvofH_};diagnostic.resolution.fg=diagnostic.resolution.output={workW_,workH_};diagnostic.runtimeHash="E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E";diagnostic.flowApplied=std::to_string(actualFlowPerf());diagnostic.fallbackReason=mvecSource_;Logger::diagnosticContext(diagnostic);
+ diagnostic.resolution.source={srcW_,srcH_};diagnostic.resolution.base={workW_,workH_};diagnostic.resolution.nr={nrW_,nrH_};diagnostic.resolution.flow={nvofW_,nvofH_};diagnostic.resolution.fg=diagnostic.resolution.output={workW_,workH_};diagnostic.runtimeHash="unverified-user-replaceable";diagnostic.flowApplied=std::to_string(actualFlowPerf());diagnostic.fallbackReason=mvecSource_;Logger::diagnosticContext(diagnostic);
static const bool graphOff = GetEnvironmentVariableW(L"VEYRA_GRAPH_OFF", nullptr, 0) != 0;
if (!frame || !initialized_ || !std::isfinite(ptsMs)) return false;
const auto resolved=resolveFrameColor(*frame,color?*color:ColorDescription{});
diff --git a/tests/unit/RepairContractTests.cpp b/tests/unit/RepairContractTests.cpp
index ad3fbc68..b3c3fea4 100644
--- a/tests/unit/RepairContractTests.cpp
+++ b/tests/unit/RepairContractTests.cpp
@@ -77,6 +77,17 @@ int main(){
engine::PresentationScheduler timeline;timeline.reset(3,0,1000000,200000);
check(timeline.deadline(200000)==1400000&&timeline.deadline(400000)==1600000,"live deadlines do not drift with CPU completion");
check(timeline.expired(0,1400000,100000)&&!timeline.anchored(4),"expire generated debt and reject epoch change");
+ // First arrival is 12ms late; the next is on time and GPU work takes 3ms.
+ // The previous no-FG mapping holds an already-ready frame another 9ms.
+ engine::PresentationScheduler captureTimeline;
+ captureTimeline.reset(1,0,1120000,0);
+ constexpr int64_t nextPts=166667,nextReady=1000000+nextPts+30000;
+ check(captureTimeline.deadline(nextPts)-nextReady==90000,"reproduce 9ms no-FG hold after first-callback jitter");
+ captureTimeline.reset(1,0,1120000,0,false);
+ check(captureTimeline.deadline(nextPts)<=nextReady,"unbuffered capture presents ready frame without inherited jitter");
+ check(captureTimeline.deadline(6000600000LL)<=6001030000LL,"unbuffered capture cannot accumulate source-clock drift");
+ captureTimeline.reset(2,0,2000000,166667,true);
+ check(captureTimeline.deadline(166667)==2333334,"switch to FG restores continuous source-PTS pacing and lookahead");
check(!engine::admitLiveFg(1200000,1000000,0,std::nullopt,0),"warmup rejects already-expired FG before evaluate");
check(engine::admitLiveFg(900000,1000000,0,std::nullopt,0),"warmup does not invent a measured completion estimate");
check(!engine::admitLiveFg(900000,1000000,2,30.0,1),"predicted completion beyond deadline skips optional pair");