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++

phase-3 work: P3.1 phase3 gate fail-closed (spaces-in-path finding, C:\veyra-deps build root)

Veyra Goal Agent39f1c45a7c70
diff --git a/loop/JOURNAL.md b/loop/JOURNAL.md
index 0408a880..57c2f19e 100644
--- a/loop/JOURNAL.md
+++ b/loop/JOURNAL.md
@@ -543,7 +543,12 @@ Result:
### After
-(vcpkg 克隆/引导后台进行中;FFmpeg 首次构建预计数十分钟,完成后填写并继续 P3.2。)
+- 关键事实:**项目路径含空格("Veyra DLSS Video Player")触发 FFmpeg portfile 硬拒绝**("ffmpeg will not build with spaces in the path"),首次在 third_party_local/vcpkg 构建失败(issue_body.md 留档)。
+- 环境适配(不改变产品边界):在无空格路径 `C:\veyra-deps\` 建立第二份固定基线 vcpkg(同 commit 30ef65ca…,downloads 复制复用),以 `--x-manifest-root=<项目>` `--x-install-root=C:\veyra-deps\installed` 重跑 FFmpeg 构建(后台)。third_party_local/vcpkg 保留作 Playbook 契约的仓内基线副本。
+- phase3 gate 已建立(AST-CLEAN)并负向验证 exit 1(缺 src/media、tools/media_probe、YuvToLinearRgb.hlsl 输入);gate 编码 §16 Phase 3 全部门槛(PTS 单调、零回读、有界队列、D3D12VA 共享 device/pixfmt、10 次 seek 无 stale、debug infoqueue)。
+- vcpkg.json 修正为与 Playbook 3.4 逐字一致(去掉我误加的 avfilter)。
+- 失败 fingerprint: ffmpeg|vcpkg install|1|spaces-in-path → 换构建根修复中。
+- 下一唯一动作: FFmpeg 构建完成后 P3.2(veyra_media 软件 decode 基线 + media_probe + 测试片生成)。
---
diff --git a/scripts/gates/phase3.ps1 b/scripts/gates/phase3.ps1
new file mode 100644
index 00000000..2383a408
--- /dev/null
+++ b/scripts/gates/phase3.ps1
@@ -0,0 +1,194 @@
+[CmdletBinding()]
+param([Parameter(Mandatory = $true)][string]$Root)
+
+# Veyra Phase 3 gate: minimal video pipeline (Playbook section 16 Phase 3).
+# Encodes every completion threshold:
+# - vcpkg FFmpeg 9.0.1 dependency present at the pinned install root;
+# - veyra_media builds and a software-decode baseline run (H.264) succeeds
+# with PTS-monotonic statistics from a real JSON summary;
+# - D3D12VA run reports the shared Veyra device and AV_PIX_FMT_D3D12;
+# - normal path performs zero GPU->CPU pixel readbacks (counter in JSON);
+# - seek storm (10 seeks) leaves no stale history (reset counters, hashes);
+# - bounded queues (max depths in JSON within limits);
+# - proprietary paths remain ignored.
+# Fail-closed: missing command/file/field/threshold breach fails.
+
+Set-StrictMode -Version Latest
+$ErrorActionPreference = "Stop"
+
+$failures = New-Object System.Collections.Generic.List[string]
+$checkCount = 0
+
+function Add-GateCheck {
+ param([string]$Name, [bool]$Passed, [string]$Detail)
+ $script:checkCount = $script:checkCount + 1
+ $tag = "FAIL"
+ if ($Passed) { $tag = "PASS" }
+ Write-Host ("[{0}] {1} :: {2}" -f $tag, $Name, $Detail)
+ if (-not $Passed) {
+ $script:failures.Add($Name) | Out-Null
+ }
+}
+
+function Test-GateEnd {
+ if ($script:failures.Count -gt 0) {
+ Write-Host ("VEYRA PHASE 3 GATE FAILED: {0} of {1} checks failed." -f $script:failures.Count, $script:checkCount)
+ Write-Host ("Failed checks: {0}" -f ($script:failures -join ", "))
+ exit 1
+ }
+}
+
+$runId = [guid]::NewGuid().ToString("N")
+$gateStart = Get-Date
+Write-Host ("Phase 3 gate run-id: {0}" -f $runId)
+
+# FFmpeg cannot build under a path containing spaces, so the dependency tree
+# lives at C:\veyra-deps (pinned vcpkg baseline; see JOURNAL).
+$installedRoot = "C:\veyra-deps\installed\x64-windows"
+
+# ---------------------------------------------------------------------------
+# 1. Required project inputs
+# ---------------------------------------------------------------------------
+$requiredInputs = @(
+ "src\media\FFmpegDemuxer.cpp",
+ "src\media\FFmpegVideoDecoder.cpp",
+ "tools\media_probe\main.cpp",
+ "shaders\YuvToLinearRgb.hlsl",
+ "vcpkg.json",
+ "scripts\build.ps1"
+)
+foreach ($relative in $requiredInputs) {
+ $path = Join-Path $Root $relative
+ Add-GateCheck ("input:{0}" -f $relative) (Test-Path -LiteralPath $path -PathType Leaf) "present"
+}
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 2. Dependency presence (FFmpeg 9.0.1 via pinned vcpkg)
+# ---------------------------------------------------------------------------
+$ffmpegLibs = @("avcodec", "avformat", "swscale", "swresample")
+foreach ($lib in $ffmpegLibs) {
+ $dll = Join-Path $installedRoot ("bin\" + $lib + "-9.dll")
+ Add-GateCheck ("ffmpeg:{0}-dll" -f $lib) (Test-Path -LiteralPath $dll -PathType Leaf) ("path={0}" -f $dll)
+}
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 3. Build both configurations
+# ---------------------------------------------------------------------------
+$buildScript = Join-Path $Root "scripts\build.ps1"
+$shell = (Get-Process -Id $PID).Path
+& $shell -NoProfile -ExecutionPolicy Bypass -File $buildScript -Root $Root -Preset x64-debug
+Add-GateCheck "build:x64-debug" ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+& $shell -NoProfile -ExecutionPolicy Bypass -File $buildScript -Root $Root -Preset x64-release
+Add-GateCheck "build:x64-release" ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 4. Test clip presence (H.264) - generated by the media tooling (P3.2)
+# ---------------------------------------------------------------------------
+$testClip = Join-Path $Root "validation\fixed_clips\test_h264_1080p.mp4"
+Add-GateCheck "clip:test-h264" (Test-Path -LiteralPath $testClip -PathType Leaf) ("path={0}" -f $testClip)
+Test-GateEnd
+
+$logDir = Join-Path $Root ("logs\phase3\" + $runId)
+New-Item -ItemType Directory -Force -Path $logDir | Out-Null
+
+# ---------------------------------------------------------------------------
+# 5. Software-decode baseline run (PTS/VFR handling; Playbook 3A)
+# ---------------------------------------------------------------------------
+$probeDebug = Join-Path $Root "out\build\x64-debug\veyra_media_probe.exe"
+$probeRelease = Join-Path $Root "out\build\x64-release\veyra_media_probe.exe"
+Add-GateCheck "probe:exe-debug" (Test-Path -LiteralPath $probeDebug -PathType Leaf) "present"
+Add-GateCheck "probe:exe-release" (Test-Path -LiteralPath $probeRelease -PathType Leaf) "present"
+Test-GateEnd
+
+$swLog = Join-Path $logDir "software-decode.log"
+$swJson = Join-Path $logDir "software-decode.json"
+& $probeRelease --input $testClip --frames 300 --mode software --run-id $runId --log-file $swLog --json-file $swJson
+Add-GateCheck "probe:run-software" ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+Add-GateCheck "probe:json-software" (Test-Path -LiteralPath $swJson -PathType Leaf) "present"
+Test-GateEnd
+
+$sw = $null
+try { $sw = Get-Content -Raw -Encoding UTF8 -LiteralPath $swJson | ConvertFrom-Json }
+catch {
+ Add-GateCheck "probe:json-parse" $false $_.Exception.Message
+ Test-GateEnd
+}
+Add-GateCheck "json:run-id" ([string]$sw.runId -eq $runId) ("actual={0}" -f $sw.runId)
+Add-GateCheck "json:frames-decoded" (([int64]$sw.decode.framesDecoded) -ge 300) ("frames={0}" -f $sw.decode.framesDecoded)
+Add-GateCheck "json:pts-monotonic" ([int64]$sw.decode.ptsNonMonotonicCount -eq 0) ("violations={0}" -f $sw.decode.ptsNonMonotonicCount)
+Add-GateCheck "json:no-pixel-readback" ([int64]$sw.pipeline.gpuReadbackCount -eq 0) ("readbacks={0}" -f $sw.pipeline.gpuReadbackCount)
+Add-GateCheck "json:bounded-queues" (([int64]$sw.pipeline.maxDecodeQueueDepth -le 4) -and ([int64]$sw.pipeline.maxProcessQueueDepth -le 4)) ("decodeMax={0} processMax={1}" -f $sw.pipeline.maxDecodeQueueDepth, $sw.pipeline.maxProcessQueueDepth)
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 6. D3D12VA run (shared device identity; Playbook 3B)
+# ---------------------------------------------------------------------------
+$hwLog = Join-Path $logDir "d3d12va.log"
+$hwJson = Join-Path $logDir "d3d12va.json"
+& $probeRelease --input $testClip --frames 300 --mode d3d12va --run-id $runId --log-file $hwLog --json-file $hwJson
+Add-GateCheck "probe:run-d3d12va" ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+Test-GateEnd
+
+$hw = Get-Content -Raw -Encoding UTF8 -LiteralPath $hwJson | ConvertFrom-Json
+Add-GateCheck "json:hw-shared-device" ([bool]$hw.hwaccel.sharedVeyraDevice -eq $true) ("shared={0} pixFmt={1}" -f $hw.hwaccel.sharedVeyraDevice, $hw.hwaccel.pixelFormat)
+Add-GateCheck "json:hw-pixfmt-d3d12" ([string]$hw.hwaccel.pixelFormat -eq "AV_PIX_FMT_D3D12") ("actual={0}" -f $hw.hwaccel.pixelFormat)
+Add-GateCheck "json:hw-no-readback" ([int64]$hw.pipeline.gpuReadbackCount -eq 0) ("readbacks={0}" -f $hw.pipeline.gpuReadbackCount)
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 7. Seek storm (10 seeks; no stale history)
+# ---------------------------------------------------------------------------
+$seekLog = Join-Path $logDir "seek-storm.log"
+$seekJson = Join-Path $logDir "seek-storm.json"
+& $probeRelease --input $testClip --mode seek-storm --seeks 10 --run-id $runId --log-file $seekLog --json-file $seekJson
+Add-GateCheck "probe:run-seek-storm" ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+Test-GateEnd
+
+$seek = Get-Content -Raw -Encoding UTF8 -LiteralPath $seekJson | ConvertFrom-Json
+Add-GateCheck "json:seek-count" ([int64]$seek.seek.seeksExecuted -eq 10) ("executed={0}" -f $seek.seek.seeksExecuted)
+Add-GateCheck "json:seek-resets" ([int64]$seek.seek.historyResets -ge 10) ("resets={0}" -f $seek.seek.historyResets)
+Add-GateCheck "json:seek-no-stale" ([bool]$seek.seek.staleHistoryDetected -eq $false) ("stale={0}" -f $seek.seek.staleHistoryDetected)
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 8. Debug-run observability (info queue captured, zero errors)
+# ---------------------------------------------------------------------------
+$dbgLog = Join-Path $logDir "debug-run.log"
+$dbgJson = Join-Path $logDir "debug-run.json"
+& $probeDebug --input $testClip --frames 60 --mode software --run-id $runId --log-file $dbgLog --json-file $dbgJson
+Add-GateCheck "probe:run-debug" ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+Test-GateEnd
+$dbg = Get-Content -Raw -Encoding UTF8 -LiteralPath $dbgJson | ConvertFrom-Json
+Add-GateCheck "json:debug-infoqueue-active" ([bool]$dbg.debugInfoQueue.active -eq $true) ("active={0}" -f $dbg.debugInfoQueue.active)
+Add-GateCheck "json:debug-no-errors" ([uint64]$dbg.debugInfoQueue.errorMessages -eq 0) ("errors={0}" -f $dbg.debugInfoQueue.errorMessages)
+Test-GateEnd
+
+# ---------------------------------------------------------------------------
+# 9. Proprietary paths remain ignored (external deps dir is outside the repo)
+# ---------------------------------------------------------------------------
+$ignoreTargets = @(
+ "nvngx_dlssnr.dll",
+ "renodx-dlss5-1.addon64",
+ "runtime_local/.veyra-ignore-probe",
+ "third_party_local/.veyra-ignore-probe",
+ "captures/.veyra-ignore-probe",
+ "logs/.veyra-ignore-probe"
+)
+foreach ($target in $ignoreTargets) {
+ & git -C $Root check-ignore -q --no-index -- $target
+ Add-GateCheck ("git-ignore:{0}" -f $target) ($LASTEXITCODE -eq 0) ("exitCode={0}" -f $LASTEXITCODE)
+}
+$trackedSensitive = @(& git -C $Root ls-files -- "nvngx_dlssnr.dll" "renodx-dlss5-1.addon64" "runtime_local" "third_party_local" "reference_local" "captures" "logs" "vcpkg_installed")
+Add-GateCheck "git-sensitive-untracked" ($trackedSensitive.Count -eq 0) $(if ($trackedSensitive.Count -eq 0) { "none tracked" } else { $trackedSensitive -join ", " })
+
+# ---------------------------------------------------------------------------
+# Result
+# ---------------------------------------------------------------------------
+$elapsed = ((Get-Date) - $gateStart).TotalSeconds
+Write-Host ("Phase 3 gate run-id {0} finished in {1:N1} s; logs: {2}" -f $runId, $elapsed, $logDir)
+Test-GateEnd
+Write-Host ("VEYRA PHASE 3 GATE PASSED: {0} checks (run-id {1})." -f $checkCount, $runId)
+exit 0