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++
Validate motion reprojection in fused NVOF pass
Veyra Goal Agentfb115850ccdb
diff --git a/CMakeLists.txt b/CMakeLists.txtindex d215f83a..de9f51d9 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -432,6 +432,9 @@ if(VEYRA_FFMPEG_ROOT AND EXISTS "${VEYRA_FFMPEG_ROOT}/include/libavformat/avformtarget_compile_definitions(veyra_repair_parameter_tests PRIVATE NOMINMAX WIN32_LEAN_AND_MEAN VEYRA_PROJECT_ROOT="${CMAKE_CURRENT_SOURCE_DIR}")target_link_libraries(veyra_repair_parameter_tests PRIVATE veyra_pipeline veyra_sinks veyra_nvof)add_executable(veyra_repair_fg_tests tests/integration/RepairFgTests.cpp)+ add_executable(veyra_motion_validation_tests tests/integration/MotionValidationTests.cpp)+ target_compile_features(veyra_motion_validation_tests PRIVATE cxx_std_20)+ target_link_libraries(veyra_motion_validation_tests PRIVATE veyra_pipeline)add_executable(veyra_repair_shader_tests tests/integration/RepairShaderTests.cpp)target_compile_features(veyra_repair_shader_tests PRIVATE cxx_std_20)target_link_libraries(veyra_repair_shader_tests PRIVATE veyra_pipeline)diff --git a/docs/REVIEW_MOTION_VALIDATION_2026-09-08.md b/docs/REVIEW_MOTION_VALIDATION_2026-09-08.mdnew file mode 100644index 00000000..288f804b--- /dev/null+++ b/docs/REVIEW_MOTION_VALIDATION_2026-09-08.md@@ -0,0 +1,9 @@+# Fused motion validation review++## Cycles69–70 independent review++review_motion_validation scopedPASS, no introducedP0/P1/P2. Independent preflight71; phase7 logs/delivery/240031138e804d7f84a42a57a2069759/result.json41.996s/75PASS. Initial reviewer environment missingWindowsPowerShellmodulepath/Get-FileHash fixed; first failure retained, not product failure. Motion/repaired residual GPU tests PASS, logs review-motion_validation.out.log and review-repair_shader.out.log. Image29e690f3e6ba4492aab270cbbdefc06825.692s PASS, current protected/outsideerror0/captionfresh28350. Quality review-motion-2041c730446f48f9a4a5f846d13e8074 and legacy045036253b284931b5d5f3a7b4f61d98 bothSR60/NR60/NVOF59/GBV0/failures0,5.4/5.5s; Create0x1Success/SEH0. No speedup claim. All paths under logs/optimization-goal-20260908 unless explicit delivery.++AppD14DFB94A933E1BE85B9972CADB628BC58E320C26D53B4887F2102BFA2E48D46; quality21A265B0645BD8FA5556E527776155FD26AB7F65DF2EBAC9E523CF653D0988F1; motiontestC5F3AE03B74EB56B106C070FD275095811DE0CE18599411B564C1F2B85C25428. Reviewer trackedfingerprinte3db68bd6d230d63b0752d9f5d6fa84be6837252 unchanged. Product export integrity remains unchanged.++Limits: encoded-luma.03/.15 heuristic cannot detect isoluminant mismatch or repetitive wrong matches; shortened/zero motion does not prove safe model history exclusion. Unit matrix currently horizontalpositive/negative/fractional only; next atomic task extends nonzerovertical/top-bottom/cost31-32/intermediateconfidence, then actual occlusion/cut/FG comparisons and A/B bidirectional cost/benefit. Natural footage/Q7/physical acceptance remain pending. Phase7/Goalin_progress; scopedpass only.diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.mdindex fd91db4f..2d23cc51 100644--- a/docs/USER_GUIDE.md+++ b/docs/USER_GUIDE.md@@ -22,7 +22,7 @@4. 专业模式“增强”提供7项NR参数及5项变化量参数。可滚动查看,悬停数值框查看范围;数值框修改后点“应用整套设置”,滑杆采用120毫秒去抖。期望与已应用版本固定显示,真实帧边界整套应用,失败回滚;切换面板会保留草稿并取消尚未发出的延迟提交。参数修改不重新打开视频或归零进度。修改尺寸/光流会有有界资源重建。5. 肤质结构、风格、自动遮罩、画面内UI修正属于实验参数。当前合成样本未观察到肤质/UI修正的像素变化,不能保证实际效果;风格和自动遮罩已观察到变化。6. 预设支持新建、复制当前、重命名、删除、设默认、恢复内建默认,保存在 `runtime_local/user-presets.v1`。配置损坏会保留原文件并报错,不静默覆盖。-7. 光流三档为性能/平衡/质量;界面记录实际应用档。30/50/60模式用于识别内容节奏,不会把源时间轴重采样成指定帧率。静止画面不能确认较低内容帧率。+7. 光流三档为性能/平衡/质量;界面记录实际应用档。共享光流会拒绝指向画面外的位移,并按前后画面的亮度回投误差降低不可靠位移;这是估计校验,不能保证消除遮挡拖影。30/50/60模式用于识别内容节奏,不会把源时间轴重采样成指定帧率。静止画面不能确认较低内容帧率。8. 进度条定位,Space播放/暂停;F11、Alt+Enter、视频区域双击或全屏按钮切换,Esc退出全屏。全屏只展示铺满显示器的视频和字幕,控制条覆盖在底部;鼠标离开控制条并静止约1.6秒后,操作条与鼠标隐藏,移动鼠标会唤回。参数面板在全屏隐藏,退出恢复原窗口与模式。设备丢失会停止并报错,重新打开源恢复,不是无缝恢复。## 图片尺寸与预览缩放diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 0d90bdeb..99dfa073 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -1195,3 +1195,21 @@ Cycle68 adds an unset-by-default diagnostic NR parameter callback (EnhanceGraph.review_nr_temporal_optional final scoped PASS; no introduced P0/P1/P2. Preflight71, phase7 logs/delivery/2b2498a58135471e981779c989390d31/result.json41.739s/75 checks; normal image6508c7ccffcc45c6a46ca158e14fe0d7 exit0/26.855s. Optional R8 image-d5f8d7387035495f95d22bc04d705857 exit1/12.753s andRGBA image-d997436007bd4a3c9214adbd550f0dd8 exit1/12.526s independently reproduce expectation mismatch with debug0. Optional failure is retained; no private resource integration approved. Reviewer actual frame4 protected PNG viewed; callback product-default-disabled and resource lifetime/state transitions verified. Diff fingerprint9bdf08fe0712eb335c4e1f027b450b2a3de0cfd8 unchanged. AppB48EB58A70FCB1B25014AD27688B7A3DA90058DD2BD8A0ED4AC383E57E2D0F1C, imageEXEF574508156F15E51B1E9FB932BBA3F96589E7B8A4B3DCA85DE71D046A3B6F6B0.Existing P2 diagnostic gap found: tests/integration/RepairShaderTests.cpp still uses8 residual constants, actual shader requires24. Current graph image matrix uses24 correctly, but that old standalone harness cannot prove the current contract. Next atomic task fixes and validates this harness, then Q6 adds bounds/photometric motion checks and measuresFG; Q7 and natural comparisons remain open. FullGoal/Phase7in_progress; no practical capture/long-term/distribution acceptance claimed.++## Cycles69–70 - residual harness and fused motion validation++Cycle69 fixes existing P2 RepairShaderTests root constant layout8->24; actual GPU downsample and residual identity at strengths0/1/2 PASS, log shader-cycle69.log (60s watchdog); build-cycle69.log; gate-cycle69.log75PASS. Prior turn classified progress d2921d2.++Cycle70 NvofDensify now uses existing previous/current source-space encoded RGB with raw current->previous vectors. Cost>=32 rejects as before. When validation enabled, out-of-bounds reprojection clears confidence/motion; bilinear previous-luma vs current-luma mismatch smoothsteps trust from error.03 to.15, attenuating motion and existing cost confidence. This is a bounded heuristic, not a probability or safe history-exclusion guarantee. It fuses into existing dispatch (4SRV+2UAV); graph transitions A/B toSRV thenCOMMON after NVOF fence synchronization. No new textures, models, CPU readbacks or source-frame waiting. Default enabled; --legacy-motion is quality-probe-only A/B with distinct configHash and motionValidation0/3 JSON.++Standalone GPU matrix (before product GPU integration): known+2,+2.5,-2.5pixel displacement, high-cost cells, both-side out-of-frame, strong mismatch and partial mismatch. Final motion-shader-final.log: legacy128rejected/896retained; validated416rejected/408retained/200attenuated; errors0. Source geometry analytically known, not inferred fromNR outputs. Build-motion-validation/final/fractional.log exit0.++Actual SR60/NVOF59/NR60 plusGBV: motion-final-158d0996302841c68344adf749bda65f vs motion-final-legacy-af959ca76cb740a19ccada074c5d6a13, failures0. GPU command-list P50 3.7572vs3.8628ms, P95 24.8223vs24.5440ms, duration5.3vs5.5s; these noisy mixed-command measurements do not prove speedup or isolated shader cost. VRAM headroom7882MiB both. Normal image+temporal protection matrix image-e306179d8fa74490a54d50745f69db3a27.397s PASS; protected/outsideerror0 and freshcaption28350 retained. Each invocation<=275s. Export integrity unchanged. Final gate/review pending. Q6 still needs occlusion/scene/FG/natural corpus and A/B bidirectional ROI; Q7 remains pending.++## Cycles69–70 independent review++review_motion_validation scopedPASS, no introducedP0/P1/P2. Independent preflight71; phase7 logs/delivery/240031138e804d7f84a42a57a2069759/result.json41.996s/75PASS. Initial reviewer environment missingWindowsPowerShellmodulepath/Get-FileHash fixed; first failure retained, not product failure. Motion/repaired residual GPU tests PASS, logs review-motion_validation.out.log and review-repair_shader.out.log. Image29e690f3e6ba4492aab270cbbdefc06825.692s PASS, current protected/outsideerror0/captionfresh28350. Quality review-motion-2041c730446f48f9a4a5f846d13e8074 and legacy045036253b284931b5d5f3a7b4f61d98 bothSR60/NR60/NVOF59/GBV0/failures0,5.4/5.5s; Create0x1Success/SEH0. No speedup claim. All paths under logs/optimization-goal-20260908 unless explicit delivery.++AppD14DFB94A933E1BE85B9972CADB628BC58E320C26D53B4887F2102BFA2E48D46; quality21A265B0645BD8FA5556E527776155FD26AB7F65DF2EBAC9E523CF653D0988F1; motiontestC5F3AE03B74EB56B106C070FD275095811DE0CE18599411B564C1F2B85C25428. Reviewer trackedfingerprinte3db68bd6d230d63b0752d9f5d6fa84be6837252 unchanged. Product export integrity remains unchanged.++Limits: encoded-luma.03/.15 heuristic cannot detect isoluminant mismatch or repetitive wrong matches; shortened/zero motion does not prove safe model history exclusion. Unit matrix currently horizontalpositive/negative/fractional only; next atomic task extends nonzerovertical/top-bottom/cost31-32/intermediateconfidence, then actual occlusion/cut/FG comparisons and A/B bidirectional cost/benefit. Natural footage/Q7/physical acceptance remain pending. Phase7/Goalin_progress; scopedpass only.diff --git a/include/veyra/pipeline/EnhanceGraph.h b/include/veyra/pipeline/EnhanceGraph.hindex d843ad1e..4febbd64 100644--- a/include/veyra/pipeline/EnhanceGraph.h+++ b/include/veyra/pipeline/EnhanceGraph.h@@ -58,6 +58,7 @@ struct EnhanceGraphDesc {bool enableSr = false; // upscale source -> work extent (1:1 bypass otherwise)bool enableNr = true;bool enableFg = true;+ bool validateMotion = true; // disable only in isolated legacy A/B diagnosticsbool enableNvofStandalone = false; // run NVOF+densify per frame without FG (quality core)bool noFeatures = false; // VEYRA_NO_FEATURES: NVOF/NGX objects skippedbool noNgx = false; // VEYRA_NO_NGX: core/features skipped, NVOF onlydiff --git a/loop/EVIDENCE.md b/loop/EVIDENCE.mdindex 410f7f68..3d38ba8b 100644--- a/loop/EVIDENCE.md+++ b/loop/EVIDENCE.md@@ -498,3 +498,21 @@ Cycle68 adds an unset-by-default diagnostic NR parameter callback (EnhanceGraph.review_nr_temporal_optional final scoped PASS; no introduced P0/P1/P2. Preflight71, phase7 logs/delivery/2b2498a58135471e981779c989390d31/result.json41.739s/75 checks; normal image6508c7ccffcc45c6a46ca158e14fe0d7 exit0/26.855s. Optional R8 image-d5f8d7387035495f95d22bc04d705857 exit1/12.753s andRGBA image-d997436007bd4a3c9214adbd550f0dd8 exit1/12.526s independently reproduce expectation mismatch with debug0. Optional failure is retained; no private resource integration approved. Reviewer actual frame4 protected PNG viewed; callback product-default-disabled and resource lifetime/state transitions verified. Diff fingerprint9bdf08fe0712eb335c4e1f027b450b2a3de0cfd8 unchanged. AppB48EB58A70FCB1B25014AD27688B7A3DA90058DD2BD8A0ED4AC383E57E2D0F1C, imageEXEF574508156F15E51B1E9FB932BBA3F96589E7B8A4B3DCA85DE71D046A3B6F6B0.Existing P2 diagnostic gap found: tests/integration/RepairShaderTests.cpp still uses8 residual constants, actual shader requires24. Current graph image matrix uses24 correctly, but that old standalone harness cannot prove the current contract. Next atomic task fixes and validates this harness, then Q6 adds bounds/photometric motion checks and measuresFG; Q7 and natural comparisons remain open. FullGoal/Phase7in_progress; no practical capture/long-term/distribution acceptance claimed.++## Cycles69–70 - residual harness and fused motion validation++Cycle69 fixes existing P2 RepairShaderTests root constant layout8->24; actual GPU downsample and residual identity at strengths0/1/2 PASS, log shader-cycle69.log (60s watchdog); build-cycle69.log; gate-cycle69.log75PASS. Prior turn classified progress d2921d2.++Cycle70 NvofDensify now uses existing previous/current source-space encoded RGB with raw current->previous vectors. Cost>=32 rejects as before. When validation enabled, out-of-bounds reprojection clears confidence/motion; bilinear previous-luma vs current-luma mismatch smoothsteps trust from error.03 to.15, attenuating motion and existing cost confidence. This is a bounded heuristic, not a probability or safe history-exclusion guarantee. It fuses into existing dispatch (4SRV+2UAV); graph transitions A/B toSRV thenCOMMON after NVOF fence synchronization. No new textures, models, CPU readbacks or source-frame waiting. Default enabled; --legacy-motion is quality-probe-only A/B with distinct configHash and motionValidation0/3 JSON.++Standalone GPU matrix (before product GPU integration): known+2,+2.5,-2.5pixel displacement, high-cost cells, both-side out-of-frame, strong mismatch and partial mismatch. Final motion-shader-final.log: legacy128rejected/896retained; validated416rejected/408retained/200attenuated; errors0. Source geometry analytically known, not inferred fromNR outputs. Build-motion-validation/final/fractional.log exit0.++Actual SR60/NVOF59/NR60 plusGBV: motion-final-158d0996302841c68344adf749bda65f vs motion-final-legacy-af959ca76cb740a19ccada074c5d6a13, failures0. GPU command-list P50 3.7572vs3.8628ms, P95 24.8223vs24.5440ms, duration5.3vs5.5s; these noisy mixed-command measurements do not prove speedup or isolated shader cost. VRAM headroom7882MiB both. Normal image+temporal protection matrix image-e306179d8fa74490a54d50745f69db3a27.397s PASS; protected/outsideerror0 and freshcaption28350 retained. Each invocation<=275s. Export integrity unchanged. Final gate/review pending. Q6 still needs occlusion/scene/FG/natural corpus and A/B bidirectional ROI; Q7 remains pending.++## Cycles69–70 independent review++review_motion_validation scopedPASS, no introducedP0/P1/P2. Independent preflight71; phase7 logs/delivery/240031138e804d7f84a42a57a2069759/result.json41.996s/75PASS. Initial reviewer environment missingWindowsPowerShellmodulepath/Get-FileHash fixed; first failure retained, not product failure. Motion/repaired residual GPU tests PASS, logs review-motion_validation.out.log and review-repair_shader.out.log. Image29e690f3e6ba4492aab270cbbdefc06825.692s PASS, current protected/outsideerror0/captionfresh28350. Quality review-motion-2041c730446f48f9a4a5f846d13e8074 and legacy045036253b284931b5d5f3a7b4f61d98 bothSR60/NR60/NVOF59/GBV0/failures0,5.4/5.5s; Create0x1Success/SEH0. No speedup claim. All paths under logs/optimization-goal-20260908 unless explicit delivery.++AppD14DFB94A933E1BE85B9972CADB628BC58E320C26D53B4887F2102BFA2E48D46; quality21A265B0645BD8FA5556E527776155FD26AB7F65DF2EBAC9E523CF653D0988F1; motiontestC5F3AE03B74EB56B106C070FD275095811DE0CE18599411B564C1F2B85C25428. Reviewer trackedfingerprinte3db68bd6d230d63b0752d9f5d6fa84be6837252 unchanged. Product export integrity remains unchanged.++Limits: encoded-luma.03/.15 heuristic cannot detect isoluminant mismatch or repetitive wrong matches; shortened/zero motion does not prove safe model history exclusion. Unit matrix currently horizontalpositive/negative/fractional only; next atomic task extends nonzerovertical/top-bottom/cost31-32/intermediateconfidence, then actual occlusion/cut/FG comparisons and A/B bidirectional cost/benefit. Natural footage/Q7/physical acceptance remain pending. Phase7/Goalin_progress; scopedpass only.diff --git a/loop/JOURNAL.md b/loop/JOURNAL.mdindex c3f2090f..cb50bec3 100644--- a/loop/JOURNAL.md+++ b/loop/JOURNAL.md@@ -1497,3 +1497,30 @@ Final wrapper first rerun failed no-project-mutation only: Maker updated WORKLOGreview_nr_temporal_optional final scoped PASS; no introduced P0/P1/P2. Preflight71, phase7 logs/delivery/2b2498a58135471e981779c989390d31/result.json41.739s/75 checks; normal image6508c7ccffcc45c6a46ca158e14fe0d7 exit0/26.855s. Optional R8 image-d5f8d7387035495f95d22bc04d705857 exit1/12.753s andRGBA image-d997436007bd4a3c9214adbd550f0dd8 exit1/12.526s independently reproduce expectation mismatch with debug0. Optional failure is retained; no private resource integration approved. Reviewer actual frame4 protected PNG viewed; callback product-default-disabled and resource lifetime/state transitions verified. Diff fingerprint9bdf08fe0712eb335c4e1f027b450b2a3de0cfd8 unchanged. AppB48EB58A70FCB1B25014AD27688B7A3DA90058DD2BD8A0ED4AC383E57E2D0F1C, imageEXEF574508156F15E51B1E9FB932BBA3F96589E7B8A4B3DCA85DE71D046A3B6F6B0.Existing P2 diagnostic gap found: tests/integration/RepairShaderTests.cpp still uses8 residual constants, actual shader requires24. Current graph image matrix uses24 correctly, but that old standalone harness cannot prove the current contract. Next atomic task fixes and validates this harness, then Q6 adds bounds/photometric motion checks and measuresFG; Q7 and natural comparisons remain open. FullGoal/Phase7in_progress; no practical capture/long-term/distribution acceptance claimed.++## Cycle69 - repair residual diagnostic contract+Previous turn progress d2921d2: dynamic protection evidence and rejected private-resource integration. HEAD clean/noSTOP. Correct old RepairShaderTests root constants8->24, build and actualGPUtest, gate. No product behavior change.++Cycle69 gate75PASS and actual residual GPU identity checks passed. Baseline SR60GBV motion-before-f03d527af5fa4a2fa7aa6e3744cb55f7 failures0,5.0s.+## Cycle70 - fused motion confidence validation+Add source-space bounds and bilinear luma reprojection residual to existing densify pass, using existing A/B textures. Correct obsolete direction/extent comments. Standalone known-vector GPU matrix runs before product integration tests; optional diagnostic legacy path for same-exe A/B. No new textures/models/CPUreadback in product.++## Cycles69–70 - residual harness and fused motion validation++Cycle69 fixes existing P2 RepairShaderTests root constant layout8->24; actual GPU downsample and residual identity at strengths0/1/2 PASS, log shader-cycle69.log (60s watchdog); build-cycle69.log; gate-cycle69.log75PASS. Prior turn classified progress d2921d2.++Cycle70 NvofDensify now uses existing previous/current source-space encoded RGB with raw current->previous vectors. Cost>=32 rejects as before. When validation enabled, out-of-bounds reprojection clears confidence/motion; bilinear previous-luma vs current-luma mismatch smoothsteps trust from error.03 to.15, attenuating motion and existing cost confidence. This is a bounded heuristic, not a probability or safe history-exclusion guarantee. It fuses into existing dispatch (4SRV+2UAV); graph transitions A/B toSRV thenCOMMON after NVOF fence synchronization. No new textures, models, CPU readbacks or source-frame waiting. Default enabled; --legacy-motion is quality-probe-only A/B with distinct configHash and motionValidation0/3 JSON.++Standalone GPU matrix (before product GPU integration): known+2,+2.5,-2.5pixel displacement, high-cost cells, both-side out-of-frame, strong mismatch and partial mismatch. Final motion-shader-final.log: legacy128rejected/896retained; validated416rejected/408retained/200attenuated; errors0. Source geometry analytically known, not inferred fromNR outputs. Build-motion-validation/final/fractional.log exit0.++Actual SR60/NVOF59/NR60 plusGBV: motion-final-158d0996302841c68344adf749bda65f vs motion-final-legacy-af959ca76cb740a19ccada074c5d6a13, failures0. GPU command-list P50 3.7572vs3.8628ms, P95 24.8223vs24.5440ms, duration5.3vs5.5s; these noisy mixed-command measurements do not prove speedup or isolated shader cost. VRAM headroom7882MiB both. Normal image+temporal protection matrix image-e306179d8fa74490a54d50745f69db3a27.397s PASS; protected/outsideerror0 and freshcaption28350 retained. Each invocation<=275s. Export integrity unchanged. Final gate/review pending. Q6 still needs occlusion/scene/FG/natural corpus and A/B bidirectional ROI; Q7 remains pending.++Cycle70 maker wrapper failed git-diff-check only (one trailing space in journal); delivery body ran, no product mutation during gate. Whitespace corrected after process exit. Independent reviewer must run full gate on frozen corrected tree; initial failure retained in gate-motion-validation.log.++## Cycles69–70 independent review++review_motion_validation scopedPASS, no introducedP0/P1/P2. Independent preflight71; phase7 logs/delivery/240031138e804d7f84a42a57a2069759/result.json41.996s/75PASS. Initial reviewer environment missingWindowsPowerShellmodulepath/Get-FileHash fixed; first failure retained, not product failure. Motion/repaired residual GPU tests PASS, logs review-motion_validation.out.log and review-repair_shader.out.log. Image29e690f3e6ba4492aab270cbbdefc06825.692s PASS, current protected/outsideerror0/captionfresh28350. Quality review-motion-2041c730446f48f9a4a5f846d13e8074 and legacy045036253b284931b5d5f3a7b4f61d98 bothSR60/NR60/NVOF59/GBV0/failures0,5.4/5.5s; Create0x1Success/SEH0. No speedup claim. All paths under logs/optimization-goal-20260908 unless explicit delivery.++AppD14DFB94A933E1BE85B9972CADB628BC58E320C26D53B4887F2102BFA2E48D46; quality21A265B0645BD8FA5556E527776155FD26AB7F65DF2EBAC9E523CF653D0988F1; motiontestC5F3AE03B74EB56B106C070FD275095811DE0CE18599411B564C1F2B85C25428. Reviewer trackedfingerprinte3db68bd6d230d63b0752d9f5d6fa84be6837252 unchanged. Product export integrity remains unchanged.++Limits: encoded-luma.03/.15 heuristic cannot detect isoluminant mismatch or repetitive wrong matches; shortened/zero motion does not prove safe model history exclusion. Unit matrix currently horizontalpositive/negative/fractional only; next atomic task extends nonzerovertical/top-bottom/cost31-32/intermediateconfidence, then actual occlusion/cut/FG comparisons and A/B bidirectional cost/benefit. Natural footage/Q7/physical acceptance remain pending. Phase7/Goalin_progress; scopedpass only.diff --git a/loop/STATE.json b/loop/STATE.jsonindex 32c30b0d..4f35c427 100644--- a/loop/STATE.json+++ b/loop/STATE.json@@ -76,19 +76,19 @@}],"cycle": {- "completed": 68,+ "completed": 70,"maximum": 120,"sameFailureAttempts": 0,"maximumSameFailureAttempts": 3,"noProgressCycles": 0,"maximumNoProgressCycles": 5},- "currentTask": "Temporal manual NR protection reviewed PASS; optional resource contract mismatch independently confirmed, not integrated",+ "currentTask": "Fused motion bounds/photometric checks and residual harness repair independently reviewed PASS; Q6 quality evaluation ongoing","lastGate": {"name": "phase7","status": "passed","exitCode": 0,- "evidence": "logs/delivery/2b2498a58135471e981779c989390d31/result.json 41.739s;75checks"+ "evidence": "logs/delivery/240031138e804d7f84a42a57a2069759/result.json 41.996s;75checks"},"lastFailureFingerprint": "","failureLedger": [@@ -107,8 +107,8 @@"Current USB2 1080p50 physical throughput passed; user perceived latency/audio/actual FG display cadence still need confirmation.","Public proprietary runtime distribution rights unresolved; local delivery only."],- "nextAction": "Correct existing RepairShaderTests residual constants8->24 and validate; then Q6 out-of-frame/photometric motion confidence and FG policy, Q7 candidate ROI/natural reconstruction",- "updatedAt": "2026-09-08T10:52:23.421388+00:00",+ "nextAction": "Extend motion GPU matrix to vertical/top-bottom/cost31-32/intermediate confidence; then occlusion/cut/FG corpus and bidirectional A/B ROI, followed by Q7 candidates/natural reconstruction",+ "updatedAt": "2026-09-08T11:08:10.377584+00:00","deliveryPlan": "docs/ACTIVE_DELIVERY_PLAN.md","captureAcceptance": "throughput_short_test_passed_user_latency_audio_pending","testInvocationLimitSeconds": 300,@@ -128,7 +128,8 @@"docs/REVIEW_SR_CONTRACT_2026-09-08.md: independent scopedPASS; SR60a70819e6 actual motion andGBV0, image route/color golden passed","docs/REVIEW_NR_PROTECTION_2026-09-08.md: scopedPASS afterP2syncfix; GPU/presets andactualUI dirty/master-off independently verified","Cycle66 independent scoped PASS: image-e8c7b9377cd94f68bd50fb189bd8b49c 21.916s; feather2/32, disjoint, central tile seams. No product changes.",- "Cycles67-68 independent scoped PASS: temporal image6508c7cc PASS; optional R8d5f8d738/RGBAd9974360 reproduce expected-contract FAIL, no product integration."+ "Cycles67-68 independent scoped PASS: temporal image6508c7cc PASS; optional R8d5f8d738/RGBAd9974360 reproduce expected-contract FAIL, no product integration.",+ "Cycles69-70 independentPASS: motionshader/debug0; repairedresidual24constants; image29e690f3 andSR60A/B GBV0. Natural/FGquality still open."],"reviewBaseCommit": "6f0ebaa687e3966d989bf138c86b6882380f20fb","localDelivery": "capture_fix_candidate_needs_review",@@ -266,11 +267,9 @@"testInvocationLimitSeconds": 300,"productModified": true,"consecutiveBlockedGoalTurns": 0,- "previousGoalTurnClassification": "progress: cycle66 boundary evidence committed3d73860",- "currentGoalTurnClassification": "progress: temporal protection verified; optional resources independently measured and rejected for integration; existing shader harness P2 identified",+ "previousGoalTurnClassification": "progress: d2921d2 temporal protection/private resource decision",+ "currentGoalTurnClassification": "progress: fixed residual harness P2; fused motion bounds/photometric validation implemented and independently tested","controlSynchronizationAuthorization": "2026-09-08 user: 确认,给你全部权限; applies to previously proposed exact two-hash synchronization",- "diagnosticFindings": [- "P2 pre-existing RepairShaderTests.cpp residual constants8 vs24; next atomic repair"- ]+ "diagnosticFindings": []}}diff --git a/shaders/NvofDensify.hlsl b/shaders/NvofDensify.hlslindex 3af6cb0d..4e77b642 100644--- a/shaders/NvofDensify.hlsl+++ b/shaders/NvofDensify.hlsl@@ -1,23 +1,14 @@-// NvofDensify: converts NVOF raw SHORT2 (signed S10.5, int16x2) flow at-// hardware-grid extent into full-working-extent R16G16_FLOAT motion in-// workingExtent pixel units, plus an R8_UNORM confidence derived INVERSELY-// from the NVOF cost (higher cost = less reliable -> lower confidence).-//-// Contract (user directive 2026-09-04 s6):-// - S10.5 -> float is EXACTLY float2(raw) / 32.0 (no grid division).-// - Direction: NVOF outputs current->previous; `negate` is the single-// explicit flip applied to match the DLSSG convention, proven by the-// displacement test matrix (not inferred).-// - Confidence = (255 - cost) / 255: NVIDIA cost rises with unreliability.-// - Cells with cost >= costThreshold have their motion zeroed.-// - Densify replicates each grid cell to its gridSize x gridSize block-// (nearest), matching the official sample's upsampling shader.-+// NVOF current->previous, source-space pixel units. FlowAdapt rescales+// for SR/NR/FG consumers. /32 converts S10.5; grid replication is nearest.+// Cost is a rejection signal, not an absolute probability. Optional spatial+// validation rejects out-of-frame reprojections and gates luma disagreement.Texture2D<int2> rawFlow : register(t0); // grid-extent SHORT2+Texture2D<float4> previousColor : register(t2);+Texture2D<float4> currentColor : register(t3);Texture2D<uint> rawCost : register(t1); // grid-extent cost (0..255, higher = worse)-RWTexture2D<float2> flowOut : register(u0); // working extent, pixels-RWTexture2D<float> confOut : register(u1); // working extent [0,1], INVERSE cost+RWTexture2D<float2> flowOut : register(u0); // source extent, pixels+RWTexture2D<float> confOut : register(u1); // source extent [0,1], cost and reprojectioncbuffer NvofDensifyConstants : register(b0){@@ -28,7 +19,7 @@ cbuffer NvofDensifyConstants : register(b0)uint gridSize; // hardware grid (4 per capability list)uint negate; // 1 = single explicit direction flipuint costThreshold; // cells with cost >= this are zeroed (0..255)- uint pad0;+ uint validationFlags; // bit0 bounds, bit1 photometric; zero only for A/B diagnostics};[numthreads(16, 16, 1)]@@ -42,8 +33,23 @@ void main(uint3 globalId : SV_DispatchThreadID)if (negate != 0) v = -v;const uint cost = rawCost[uint2(gx, gy)];// Higher cost = less reliable: confidence falls as cost rises.- const float confidence = float(255u - min(cost, 255u)) / 255.0;- if (cost >= costThreshold) v = float2(0.0, 0.0);+ float confidence = float(255u - min(cost, 255u)) / 255.0;+ if (cost >= costThreshold) { v = 0; confidence = 0; }+ else if (validationFlags != 0) {+ float2 q=float2(globalId.xy)+v;+ bool outside=any(q<0)||any(q>float2(workingW-1,workingH-1));+ if ((validationFlags&1)!=0 && outside) {v=0;confidence=0;}+ else if ((validationFlags&2)!=0) {+ int2 a=(int2)floor(q);float2 t=frac(q);+ int2 limit=int2(workingW-1,workingH-1);+ float3 top=lerp(previousColor[clamp(a,int2(0,0),limit)].rgb,previousColor[clamp(a+int2(1,0),int2(0,0),limit)].rgb,t.x);+ float3 bottom=lerp(previousColor[clamp(a+int2(0,1),int2(0,0),limit)].rgb,previousColor[clamp(a+int2(1,1),int2(0,0),limit)].rgb,t.x);+ float error=abs(dot(currentColor[globalId.xy].rgb-lerp(top,bottom,t.y),float3(.2126,.7152,.0722)));+ // Allow small quantization/compression/exposure noise; reject large mismatch.+ float trust=1-smoothstep(.03,.15,error);+ v*=trust;confidence*=trust;+ }+ }flowOut[globalId.xy] = v;confOut[globalId.xy] = (cost >= costThreshold) ? 0.0 : confidence;}diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex 1c77e66a..a436b6ea 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -483,7 +483,7 @@ bool EnhanceGraph::createComputePasses()// upload is the proven frame-path ingestion on this system.if (!uploadPass_.loadShader("Nv12Upload.dxil", cs) || !uploadPass_.create(context_.device(), cs, 4, 1, 2)) return false;if (!densifyPass_.loadShader("NvofDensify.dxil", cs) ||- !densifyPass_.create(context_.device(), cs, 6, 2, 2)) return false;+ !densifyPass_.create(context_.device(), cs, 6, 4, 2)) return false;if (!stager_.initialize(context_.device(), 64)) {veyra::log::error("graph", "descriptor stager init failed");return false;@@ -575,7 +575,7 @@ bool EnhanceGraph::createViews()if (viewsTex) stagedSrv(videoFrame_[1].Get(), DXGI_FORMAT_R8G8B8A8_UNORM, blitPass_, 12);// Densify pass views: 0=rawFlow SRV(int2) 1=cost SRV(uint)- // 2=flowOut UAV(float2) 3=confOut UAV(float).+ // 2=previous RGB SRV,3=current RGB SRV;4=flow UAV,5=confidence UAV.{D3D12_SHADER_RESOURCE_VIEW_DESC rf{};rf.Format = DXGI_FORMAT_R16G16_SINT;@@ -595,14 +595,15 @@ bool EnhanceGraph::createViews()rc.Texture2D.PlaneSlice = 0;rc.Texture2D.ResourceMinLODClamp = 0.0f;if (viewsTex) stager_.stageSrv(nvofCostTex_.Get(), &rc, densifyPass_.heap.Get(), 1);+ if(viewsTex){stagedSrv(nvofInA_.Get(),DXGI_FORMAT_B8G8R8A8_UNORM,densifyPass_,2);stagedSrv(nvofInB_.Get(),DXGI_FORMAT_B8G8R8A8_UNORM,densifyPass_,3);}D3D12_UNORDERED_ACCESS_VIEW_DESC uf{};uf.Format = DXGI_FORMAT_R16G16_FLOAT;uf.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D;- context_.device()->CreateUnorderedAccessView(flowTex_.Get(), nullptr, &uf, cpu(densifyPass_, 2));+ context_.device()->CreateUnorderedAccessView(flowTex_.Get(), nullptr, &uf, cpu(densifyPass_, 4));D3D12_UNORDERED_ACCESS_VIEW_DESC uc{};uc.Format = DXGI_FORMAT_R8_UNORM;uc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D;- context_.device()->CreateUnorderedAccessView(confTex_.Get(), nullptr, &uc, cpu(densifyPass_, 3));+ context_.device()->CreateUnorderedAccessView(confTex_.Get(), nullptr, &uc, cpu(densifyPass_, 5));}return true;}@@ -821,7 +822,7 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, FramegpuTimer_.mark(list,GpuStage::Color,true);if (desc_.stageMark) desc_.stageMark("yuv");- // Guidance from original post-SR color BEFORE NR. Queue waits are GPU-side.+ // Guidance from original source-space color before SR/NR. Queue waits are GPU-side.bool haveFlow = false;const bool runMotion = nvofStandalone_ || fgEnabled_ || srEnabled_;if (runMotion && nvof_ && nvof_->initialized()) {@@ -856,11 +857,15 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frametracker_.transition(list,nvofCostTex_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);tracker_.transition(list,flowTex_.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);tracker_.transition(list,confTex_.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);+ tracker_.transition(list,nvofInA_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);+ tracker_.transition(list,nvofInB_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);const float dc[8]={uintBits(rawW_),uintBits(rawH_),uintBits(nvofW_),uintBits(nvofH_),- uintBits(selectedGrid_),uintBits(0),uintBits(32),0};- densifyPass_.bind(list,dc,gpuHandleOf(densifyPass_,0).ptr,gpuHandleOf(densifyPass_,2).ptr);+ uintBits(selectedGrid_),uintBits(0),uintBits(32),uintBits(desc_.validateMotion?3u:0u)};+ densifyPass_.bind(list,dc,gpuHandleOf(densifyPass_,0).ptr,gpuHandleOf(densifyPass_,4).ptr);list->Dispatch((nvofW_+15)/16,(nvofH_+15)/16,1);tracker_.uavBarrier(list,flowTex_.Get());tracker_.uavBarrier(list,confTex_.Get());+ tracker_.transition(list,nvofInA_.Get(),D3D12_RESOURCE_STATE_COMMON);+ tracker_.transition(list,nvofInB_.Get(),D3D12_RESOURCE_STATE_COMMON);tracker_.transition(list,nvofRawTex_.Get(),D3D12_RESOURCE_STATE_COMMON);tracker_.transition(list,nvofCostTex_.Get(),D3D12_RESOURCE_STATE_COMMON);tracker_.transition(list,flowTex_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);diff --git a/tests/integration/MotionValidationTests.cpp b/tests/integration/MotionValidationTests.cppnew file mode 100644index 00000000..5a4b3f13--- /dev/null+++ b/tests/integration/MotionValidationTests.cpp@@ -0,0 +1,52 @@+#include "veyra/pipeline/GpuPassUtils.h"+#include "veyra/gfx/D3D12DeviceContext.h"+#include "veyra/gfx/CommandSlotRing.h"+#include <d3d12sdklayers.h>+#include <bit>+#include <cmath>+#include <cstring>+#include <iostream>+using namespace veyra;using namespace veyra::pipeline;+float half(uint16_t v){int e=(v>>10)&31;float n=e?std::ldexp(1.f+(v&1023)/1024.f,e-15):std::ldexp(float(v&1023),-24);return v&32768?-n:n;}+int main(){+ gfx::D3D12DeviceContext ctx;gfx::CommandSlotRing ring;Status st;gfx::DeviceContextDesc dd;dd.enableDebugLayer=true;+ if(!ctx.initialize(dd,st)||!ring.initialize(ctx.device(),ctx.directQueue(),ctx.fence(),ctx.fenceEvent(),4,st))return 2;+ auto flow=makeTexture(ctx.device(),8,8,DXGI_FORMAT_R16G16_SINT,false),cost=makeTexture(ctx.device(),8,8,DXGI_FORMAT_R8_UINT,false);+ auto previous=makeTexture(ctx.device(),32,32,DXGI_FORMAT_R32G32B32A32_FLOAT,false),current=makeTexture(ctx.device(),32,32,DXGI_FORMAT_R32G32B32A32_FLOAT,false);+ auto output=makeTexture(ctx.device(),32,32,DXGI_FORMAT_R16G16_FLOAT,true),confidence=makeTexture(ctx.device(),32,32,DXGI_FORMAT_R8_UNORM,true);+ if(!flow||!cost||!previous||!current||!output||!confidence)return 2;+ std::vector<ComPtr<ID3D12Resource>> uploads;StateTracker states;uint32_t slot=0;auto* list=ring.acquireNext(slot,st);if(!list)return 2;+ auto upload=[&](ID3D12Resource* tex,unsigned w,unsigned h,unsigned bpp,auto fill){+ unsigned pitch=(w*bpp+255)&~255u;auto data=makeUploadBuffer(ctx.device(),pitch*h);void* ptr=nullptr;if(!data||FAILED(data->Map(0,nullptr,&ptr)))return false;+ memset(ptr,0,pitch*h);for(unsigned y=0;y<h;++y)for(unsigned x=0;x<w;++x)fill(static_cast<uint8_t*>(ptr)+y*pitch+x*bpp,x,y);data->Unmap(0,nullptr);+ states.transition(list,tex,D3D12_RESOURCE_STATE_COPY_DEST);D3D12_TEXTURE_COPY_LOCATION a{},b{};a.pResource=tex;a.Type=D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;b.pResource=data.Get();b.Type=D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;b.PlacedFootprint.Footprint={tex->GetDesc().Format,w,h,1,pitch};list->CopyTextureRegion(&a,0,0,0,&b,nullptr);states.transition(list,tex,D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);uploads.push_back(data);return true;+ };+ if(!upload(flow.Get(),8,8,4,[](uint8_t* p,unsigned,unsigned y){int16_t v[2]={int16_t(y>=6?-80:y>=4?80:64),0};memcpy(p,v,4);})||!upload(cost.Get(),8,8,1,[](uint8_t* p,unsigned x,unsigned){*p=x==3?255:0;})||+ !upload(previous.Get(),32,32,16,[](uint8_t* p,unsigned x,unsigned){float v[4]={x/40.f,x/40.f,x/40.f,1};memcpy(p,v,16);})||+ !upload(current.Get(),32,32,16,[](uint8_t* p,unsigned x,unsigned y){float shift=y>=24?-2.5f:y>=16?2.5f:2.f;float c=(x+shift)/40.f+(y>=8&&y<16?.3f:y>=16&&y<24?.08f:0);float v[4]={c,c,c,1};memcpy(p,v,16);}))return 2;+ if(!ring.submitAndSignal(slot)||!ring.waitIdle())return 2;+ ComputePass pass;std::vector<uint8_t> shader;if(!pass.loadShader("NvofDensify.dxil",shader)||!pass.create(ctx.device(),shader,6,4,2))return 2;+ unsigned index=0;for(auto* r:{flow.Get(),cost.Get(),previous.Get(),current.Get()})makeSrv(ctx.device(),r,r->GetDesc().Format,cpuHandleOf(pass,index++));+ makeUav(ctx.device(),output.Get(),DXGI_FORMAT_R16G16_FLOAT,cpuHandleOf(pass,4));makeUav(ctx.device(),confidence.Get(),DXGI_FORMAT_R8_UNORM,cpuHandleOf(pass,5));+ D3D12_HEAP_PROPERTIES hp{};hp.Type=D3D12_HEAP_TYPE_READBACK;D3D12_RESOURCE_DESC bd{};bd.Dimension=D3D12_RESOURCE_DIMENSION_BUFFER;bd.Width=16384;bd.Height=1;bd.DepthOrArraySize=bd.MipLevels=1;bd.SampleDesc.Count=1;bd.Layout=D3D12_TEXTURE_LAYOUT_ROW_MAJOR;ComPtr<ID3D12Resource> readback;if(FAILED(ctx.device()->CreateCommittedResource(&hp,D3D12_HEAP_FLAG_NONE,&bd,D3D12_RESOURCE_STATE_COPY_DEST,nullptr,IID_PPV_ARGS(&readback))))return 2;+ bool ok=true;+ for(unsigned flags:{0u,3u}){+ list=ring.acquireNext(slot,st);if(!list)return 2;states.transition(list,output.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);states.transition(list,confidence.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);+ float c[8];unsigned values[8]={8,8,32,32,4,0,32,flags};memcpy(c,values,sizeof c);pass.bind(list,c,gpuHandleOf(pass,0).ptr,gpuHandleOf(pass,4).ptr);list->Dispatch(2,2,1);+ auto copy=[&](ID3D12Resource* tex,UINT64 offset){states.uavBarrier(list,tex);states.transition(list,tex,D3D12_RESOURCE_STATE_COPY_SOURCE);D3D12_TEXTURE_COPY_LOCATION a{},b{};a.pResource=tex;a.Type=D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;b.pResource=readback.Get();b.Type=D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;b.PlacedFootprint.Offset=offset;b.PlacedFootprint.Footprint={tex->GetDesc().Format,32,32,1,256};list->CopyTextureRegion(&b,0,0,0,&a,nullptr);};copy(output.Get(),0);copy(confidence.Get(),8192);+ if(!ring.submitAndSignal(slot)||!ring.waitIdle())return 2;void* ptr=nullptr;D3D12_RANGE read{0,16384};if(FAILED(readback->Map(0,&read,&ptr)))return 2;+ unsigned rejected=0,retained=0,attenuated=0;bool passOk=true;+ for(unsigned y=0;y<32;++y)for(unsigned x=0;x<32;++x){auto* p=static_cast<uint8_t*>(ptr);auto* v=reinterpret_cast<uint16_t*>(p+y*256+x*4);float vx=half(v[0]),vy=half(v[1]);unsigned conf=p[8192+y*256+x];+ float expected=y>=24?-2.5f:y>=16?2.5f:2.f;bool outside=x+expected<0||x+expected>31;+ bool reject=(x>=12&&x<16)||(flags&&(outside||(y>=8&&y<16)));bool attenuate=flags&&!reject&&y>=16&&y<24;+ if(reject){++rejected;passOk=passOk&&vx==0&&vy==0&&conf==0;}+ else if(attenuate){++attenuated;passOk=passOk&&vx>0&&vx<expected&&vy==0&&conf>0&&conf<255;}+ else{++retained;passOk=passOk&&vx==expected&&vy==0&&conf==255;}+ }+ D3D12_RANGE written{0,0};readback->Unmap(0,&written);ok=ok&&passOk&&retained>100&&rejected>100&&(!flags||attenuated>100);+ std::cout<<"MOTION_VALIDATION flags="<<flags<<" rejected="<<rejected<<" retained="<<retained<<" attenuated="<<attenuated<<" pass="<<passOk<<std::endl;+ }+ ring.drainQueue();ComPtr<ID3D12InfoQueue> iq;unsigned errors=0;if(FAILED(ctx.device()->QueryInterface(IID_PPV_ARGS(&iq))))return 2;+ for(UINT64 i=0;i<iq->GetNumStoredMessages();++i){SIZE_T n=0;iq->GetMessage(i,nullptr,&n);std::vector<uint8_t> b(n);auto* m=reinterpret_cast<D3D12_MESSAGE*>(b.data());if(FAILED(iq->GetMessage(i,m,&n)))return 2;if(m->Severity<=D3D12_MESSAGE_SEVERITY_ERROR){++errors;std::cerr<<m->pDescription<<std::endl;}}+ std::cout<<"MOTION_DEBUG errors="<<errors<<" pass="<<(ok&&!errors)<<std::endl;return ok&&!errors?0:1;+}diff --git a/tests/integration/RepairShaderTests.cpp b/tests/integration/RepairShaderTests.cppindex 3c840c97..df21d0da 100644--- a/tests/integration/RepairShaderTests.cpp+++ b/tests/integration/RepairShaderTests.cpp@@ -15,7 +15,7 @@ int main(){D3D12_HEAP_PROPERTIES hp{};hp.Type=D3D12_HEAP_TYPE_READBACK;D3D12_RESOURCE_DESC bd{};bd.Dimension=D3D12_RESOURCE_DIMENSION_BUFFER;bd.Width=16*256;bd.Height=1;bd.DepthOrArraySize=1;bd.MipLevels=1;bd.SampleDesc.Count=1;bd.Layout=D3D12_TEXTURE_LAYOUT_ROW_MAJOR;ComPtr<ID3D12Resource> readback;if(FAILED(ctx.device()->CreateCommittedResource(&hp,D3D12_HEAP_FLAG_NONE,&bd,D3D12_RESOURCE_STATE_COPY_DEST,nullptr,IID_PPV_ARGS(&readback))))return 2;ComputePass down,residual;std::vector<uint8_t> cs;- if(!down.loadShader("NrDownsample.dxil",cs)||!down.create(ctx.device(),cs,2,1,1)||!residual.loadShader("NrResidualComposite.dxil",cs)||!residual.create(ctx.device(),cs,4,3,1))return 2;+ if(!down.loadShader("NrDownsample.dxil",cs)||!down.create(ctx.device(),cs,2,1,1)||!residual.loadShader("NrResidualComposite.dxil",cs)||!residual.create(ctx.device(),cs,4,3,1,24))return 2;makeSrv(ctx.device(),base.Get(),DXGI_FORMAT_R32G32B32A32_FLOAT,cpuHandleOf(down,0));makeUav(ctx.device(),low.Get(),DXGI_FORMAT_R32G32B32A32_FLOAT,cpuHandleOf(down,1));makeSrv(ctx.device(),base.Get(),DXGI_FORMAT_R32G32B32A32_FLOAT,cpuHandleOf(residual,0));makeSrv(ctx.device(),low.Get(),DXGI_FORMAT_R32G32B32A32_FLOAT,cpuHandleOf(residual,1));makeSrv(ctx.device(),low.Get(),DXGI_FORMAT_R32G32B32A32_FLOAT,cpuHandleOf(residual,2));makeUav(ctx.device(),result.Get(),DXGI_FORMAT_R32G32B32A32_FLOAT,cpuHandleOf(residual,3));StateTracker states;uint32_t slot;auto* list=ring.acquireNext(slot,status);states.transition(list,base.Get(),D3D12_RESOURCE_STATE_COPY_DEST);@@ -27,7 +27,7 @@ int main(){std::cout<<"area downsample checkerboard mean="<<ok<<std::endl;for(float strength:{0.0f,1.0f,2.0f}){list=ring.acquireNext(slot,status);states.transition(list,low.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);states.transition(list,result.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);- float c[8]={strength,0.5f,1.5f,2,0,0,0,0};residual.bind(list,c,gpuHandleOf(residual,0).ptr,gpuHandleOf(residual,3).ptr);list->Dispatch(1,1,1);states.uavBarrier(list,result.Get());states.transition(list,result.Get(),D3D12_RESOURCE_STATE_COPY_SOURCE);copy(result.Get(),16,16);if(!ring.submitAndSignal(slot)||!ring.waitIdle())return 2;+ float c[24]={strength,0.5f,1.5f,2,0,0,0,0};residual.bind(list,c,gpuHandleOf(residual,0).ptr,gpuHandleOf(residual,3).ptr);list->Dispatch(1,1,1);states.uavBarrier(list,result.Get());states.transition(list,result.Get(),D3D12_RESOURCE_STATE_COPY_SOURCE);copy(result.Get(),16,16);if(!ring.submitAndSignal(slot)||!ring.waitIdle())return 2;readback->Map(0,&range,&data);values=static_cast<float*>(data);bool identity=true;for(int y=0;y<16;++y)for(int x=0;x<16;++x)identity=identity&&values[y*64+x*4]==(((x+y)%2)?0.75f:0.25f);readback->Unmap(0,&written);ok=ok&&identity;std::cout<<"zero residual strength="<<strength<<" base identity="<<identity<<std::endl;}ring.drainQueue();return ok?0:1;diff --git a/tools/quality_probe/main.cpp b/tools/quality_probe/main.cppindex b03efb00..a592b798 100644--- a/tools/quality_probe/main.cpp+++ b/tools/quality_probe/main.cpp@@ -213,13 +213,14 @@ int main(int argc, char** argv)std::string corpusManifest, guidanceMode = "motion", runId = "quality-probe", jsonPath, logPath, inputPath;int durationSeconds = 0;int maxFrames = 60;- bool native = false, diag = false;+ bool native = false, diag = false, legacyMotion = false;std::string dumpPath;CoInitializeEx(nullptr, COINIT_MULTITHREADED);for (int i = 1; i < argc; ++i) {const std::string arg = argv[i];auto value = [&]() -> std::string { return (i + 1 < argc) ? std::string(argv[++i]) : std::string(); };if (arg == "--diag") diag = true;+ else if(arg=="--legacy-motion")legacyMotion=true;else if (arg == "--native") native = true;else if (arg == "--frames") maxFrames = std::atoi(value().c_str());else if (arg == "--dump") dumpPath = value();@@ -292,7 +293,7 @@ int main(int argc, char** argv)const std::string configText = "guidance=" + guidanceMode+ (native ? ";workExtent=native;nrPerFrame=1;fg=0;nvofStandalone=" : ";workExtent=3840x2160;nrPerFrame=1;fg=0;nvofStandalone=")+ (guidanceMode == "motion" || guidanceMode == "motion-depth" || guidanceMode == "auto" ? "1" : "0")- + ";";+ + (legacyMotion?";motionValidation=0;":";motionValidation=3;");const std::string configHash = veyra::sha256Hex(reinterpret_cast<const uint8_t*>(configText.data()), configText.size());@@ -332,7 +333,7 @@ int main(int argc, char** argv)const uint32_t srcW = source.info().width, srcH = source.info().height;if (firstSourceW == 0) { firstSourceW = srcW; firstSourceH = srcH; }- veyra::pipeline::EnhanceGraphDesc gd{};+ veyra::pipeline::EnhanceGraphDesc gd{};gd.validateMotion=!legacyMotion;gd.sourceWidth = srcW;gd.sourceHeight = srcH;gd.workWidth = native ? srcW : 3840; gd.workHeight = native ? srcH : 2160;@@ -440,6 +441,7 @@ int main(int argc, char** argv)j += " \"probe\": \"veyra_quality_probe\",\n";j += std::format(" \"runId\": \"{}\",\n", veyra::harness::util::jsonEscape(runId));j += std::format(" \"guidanceMode\": \"{}\",\n", guidanceMode);+ j += std::format(" \"motionValidation\": {},\n", legacyMotion ? 0 : 3);j += std::format(" \"exeHash\": \"{}\",\n", exeHash.empty() ? "unavailable" : exeHash);j += std::format(" \"inputHash\": \"{}\",\n", inputHash.empty() ? "unavailable" : inputHash);j += std::format(" \"configHash\": \"{}\",\n", configHash);