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++
fix: preserve user-selected preview FG multiplier
Veyra Goal Agent7a3dfae80947
diff --git a/docs/FG_CADENCE_REPAIR_ACCEPTANCE_2026-09-20.md b/docs/FG_CADENCE_REPAIR_ACCEPTANCE_2026-09-20.mdindex 424d0075..10cd5d16 100644--- a/docs/FG_CADENCE_REPAIR_ACCEPTANCE_2026-09-20.md+++ b/docs/FG_CADENCE_REPAIR_ACCEPTANCE_2026-09-20.md@@ -116,6 +116,22 @@ it must not be used as evidence that fixed 6X was solved.soft drops, while still resetting processing history and invalidating onhard boundaries. Earlier fallback checkpoint: `0050870`.+## Current continuation correction++Automatic multiplier selection has been removed at the user's request. Current+playback preserves the selected multiplier; it may still skip work or expire+generated frames when deadlines cannot be met. Historical adaptive4X results+below describe a superseded implementation, not the current playback policy.++The status-readback experiment88915a3 was reverted as55e0bdd: an early subframe+could read the final status before its producer fence, and Map/Unmap used+different resources. The308.1/s result is withdrawn as optimization evidence.+The restored normal6 run (no fixed-multiplier test override) preserved6X for+30s:294.676 submissions/s in5.274s retained, P99/max16.846/17.259ms,+69 rejected groups, zero retained generated discards. This remains below+fixed6X acceptance. UI/worker tests and restored-content6 exited0; content+test covers producer fences, PTS, resets and dynamic multipliers.+## Measured resultsEach trace is the **final retained window** of a bounded in-memory trace,diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 0f11aff4..f7c34414 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -4946,6 +4946,37 @@ XeSS xess-final2 and xess-final4 ran30s each: lifecycle passed, app submissions6Fixed6X uniform-cadence acceptance remains open. Experimental queue/profile/spacing controls remain opt-in and must not be described as production-ready. No publication, package or shutdown.+### 2026-09-20 continuation: withdraw unsafe status-readback experiment++Reverted 88915a3 as 55e0bdd. Its final-subframe shared status readback was+mapped after only an earlier subframe fence completed; Map does not wait for+the GPU. Map and Unmap also addressed different resources. The prior claim+that 303.7 -> 308.1 submissions/s demonstrated an improvement is withdrawn.+Per-subframe status copies and matching producer fences are restored. The+reported 225/240 generated FPS were recent-window rates, not cumulative rates.++Removed the uncommitted frameId experiment. Its indices went 1..5 then 2..6,+so it was not a valid increasing-frame-ID design. Its 307.309 submissions/s,+P99 16.721ms, max17.174ms, 54 rejected groups are NOT acceptance evidence;+it also inherited the unsafe shared status. No conclusion about all possible+frameId implementations follows. Evidence: tests/fg-cadence-repair-20260920/+frameid-subframe-fixed6{/, .json} under E:/项目/Veyra.++The previous bb91399 last-frame hold experiment fell to approximately72-74+submissions/s and was reverted by dc87a59, restoring303.7/s in the matched+retained window. Retaining a real-frame lease may constrain the two-slot+pool; this is a hypothesis, not proof that the original admission was wrong.+The forced-admission/hold variant's349 submissions mostly repeated frames+(only2 generatedPresented) and is rejected. These failures remain documented+here even though the implementation commits were reverted.++Production still automatically selected a lower multiplier while fixed6 tests+bypassed selection. Removed that production selection to honor the user's+explicit choice; strengthened sustained tests to reject any observed effective+multiplier change. This is a policy correction, not a throughput optimization.+NR work remains unchanged. New output uses the existing E:/项目/Veyra+{build,tests,logs,tmp}/ task paths. Build/regression results follow below.+### Prefix admission promotion and partial acceptanceEnabled measured first-output/whole-group file admission with carried GPUdiff --git a/include/veyra/engine/PreviewFgCapacity.h b/include/veyra/engine/PreviewFgCapacity.hdeleted file mode 100644index 103c7efd..00000000--- a/include/veyra/engine/PreviewFgCapacity.h+++ /dev/null@@ -1,40 +0,0 @@-#pragma once-#include <algorithm>-#include <cmath>-#include <cstdint>-#include <deque>--namespace veyra::engine {-// Real-time preview only. Keep headroom for presentation and scheduling;-// use sustained measured work, never a single late CPU observation.-class PreviewFgCapacity {- struct Cost { double base, perGenerated; };- std::deque<Cost> costs_;- unsigned effective_=0, candidate_=0, confirmations_=0;-public:- void reset(){costs_.clear();effective_=candidate_=confirmations_=0;}- void observe(double whole,double fg,unsigned calls){- if(!calls||!std::isfinite(whole)||!std::isfinite(fg)||fg<=0||whole<fg)return;- costs_.push_back({whole-fg,fg/calls});- if(costs_.size()>60)costs_.pop_front();- }- unsigned select(unsigned requested,double intervalMs){- requested=std::clamp(requested,2u,6u);- if(!effective_)effective_=requested;- effective_=std::min(effective_,requested);- if(costs_.size()<30||!std::isfinite(intervalMs)||intervalMs<=0)return effective_;- double base=0,per=0;- for(auto c:costs_){base+=c.base;per+=c.perGenerated;}- base/=costs_.size();per/=costs_.size();- unsigned target=2;- for(unsigned n=2;n<=requested;++n)- if(base+per*(n-1)<=intervalMs*(n>effective_?.82:.90))target=n;- if(target==effective_){candidate_=target;confirmations_=0;return effective_;}- if(candidate_!=target){candidate_=target;confirmations_=0;}- if(++confirmations_>=(target<effective_?15u:120u)){- effective_=target;confirmations_=0;- }- return effective_;- }-};-}diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cppindex 5ecc15b6..ae836954 100644--- a/src/engine/EngineController.cpp+++ b/src/engine/EngineController.cpp@@ -13,7 +13,6 @@#include "veyra/engine/FrameFlowWindow.h"#include "veyra/engine/LiveFgAdmission.h"#include "veyra/engine/FgRecoveryBudget.h"-#include "veyra/engine/PreviewFgCapacity.h"#include "veyra/engine/LivePairLatency.h"#include "veyra/engine/RealtimePreviewScheduling.h"#include "veyra/engine/CaptureHalfRate.h"@@ -483,7 +482,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,sTimingWindow livePresent{std::chrono::seconds(1)};TimingWindow livePresentGpu{std::chrono::seconds(1)};FgRecoveryBudget fgBudget;uint64_t fgBudgetRevision=options.settings.revision;- PreviewFgCapacity fgCapacity;unsigned previewFgMultiplier=options.fgMultiplier;+ unsigned previewFgMultiplier=options.fgMultiplier;LivePairLatency pairLatency;const bool adaptiveCapturePhase=physicalCapture&&GetEnvironmentVariableW(L"VEYRA_TEST_LEGACY_CAPTURE_PHASE",nullptr,0)==0;int64_t nextFgAdmissionLog=0,nextFgRejectionLog=0;@@ -589,8 +588,6 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,straceFrame(diagnostics::TraceKind::Ready,batch.batch.identity,batch.batch.batchId,std::max(batch.videoFenceValue,batch.genFenceValue),batch.batch.b100ns,invalid,valid,elapsedMs(watch.processStart));if(watch.real)completedProcessing(batch.batch.identity);if(batch.batch.identity.settingsRevision==fgBudgetRevision)fgBudget.complete(watch.gpuExecutionMs,batch.fgEvaluated>0,batch.historyReset||batch.fgRecovery,host100ns(),watch.fgExecutionMs);- if(batch.batch.identity.settingsRevision==fgBudgetRevision&&!batch.historyReset&&!batch.fgRecovery&&watch.gpuExecutionMs&&watch.fgExecutionMs)- fgCapacity.observe(*watch.gpuExecutionMs,*watch.fgExecutionMs,batch.fgEvaluated);if(adaptiveCapturePhase&&watch.captureArrival>0&&valid==batch.fgCandidates&&batch.hasGenerated&&!batch.historyReset&&!batch.fgRecovery&&batch.batch.identity.settingsRevision==fgBudgetRevision&&watch.presentationGeneration==presentationGeneration.load()){@@ -1066,10 +1063,8 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,snextFgAdmissionLog=now+10000000;if(!admitted)nextFgRejectionLog=now+10000000;veyra::log::info("live-fg-admission",std::format("timeline={} revision={} source={} multiplier={} requestedMultiplier={} admitted={} admittedPairs={} rejectedPairs={} remainingDeadlineMs={:.3f} firstDeadlineMs={:.3f} queuedGpuMs={:.3f} predictedMs={:.3f} elapsedMs={:.3f} blitGpuP95Ms={:.3f} presentCpuP95Ms={:.3f} warmingHistory={} (CPU Present is backpressure, not added GPU cost; firstDeadlineMs=-1 when unused)",timeline,batch.identity.settingsRevision,batch.identity.sourceFrameId,previewFgMultiplier,options.fgMultiplier,admitted,fgAdmittedPairs,fgRejectedPairs,double(deadline-now)/10000,firstDeadline?double(firstDeadline-now)/10000:-1,queuedMs,fgBudget.predicted(now,warmingHistory).value_or(-1),elapsed,blit,livePresent.p95(),warmingHistory));};- if(fgBudgetRevision!=options.settings.revision){fgBudget.reset();fgCapacity.reset();pairLatency.reset();fgBudgetRevision=options.settings.revision;}+ if(fgBudgetRevision!=options.settings.revision){fgBudget.reset();pairLatency.reset();fgBudgetRevision=options.settings.revision;}previewFgMultiplier=options.fgMultiplier;- if(!isImage&&!rereadCached&&options.fg&&!presentSinkFrameGeneration(options.settings.frameGenerationBackend)&&!GetEnvironmentVariableW(L"VEYRA_TEST_FIXED_FG_MULTIPLIER",nullptr,0))- previewFgMultiplier=fgCapacity.select(options.fgMultiplier,double(liveSourceInterval100ns(pkt.duration,activeSource->info().averageFps))/10000);{std::lock_guard lock(mutex_);snapshot_.previewFgMultiplier=previewFgMultiplier;}const auto liveInterval=livePhaseInterval100ns(pkt.duration,activeSource->info().averageFps/(isScreen&&halfRate?2:1),isScreen);const auto processingAllowance=isCapture&&options.fg&&!presentSinkFrameGeneration(options.settings.frameGenerationBackend)?diff --git a/tests/integration/FgSustainedTests.cpp b/tests/integration/FgSustainedTests.cppindex b0af5821..70e74412 100644--- a/tests/integration/FgSustainedTests.cpp+++ b/tests/integration/FgSustainedTests.cpp@@ -60,6 +60,10 @@ int wmain(int argc,wchar_t** argv){if(s.failed){std::wcerr<<s.status<<L" / "<<s.backendWarning<<std::endl;ok=false;break;}if(started==Clock::time_point{}&&s.frames>=10)started=Clock::now();if(started!=Clock::time_point{}){+ if(s.previewFgMultiplier!=multiplier){+ std::cerr<<"Requested multiplier changed during playback: "<<s.previewFgMultiplier<<std::endl;+ ok=false;break;+ }const auto elapsed=int(std::chrono::duration_cast<std::chrono::seconds>(Clock::now()-started).count());if(elapsed>=seconds)break;if(elapsed>=15&&!stalled&&!liveProfile){SetEnvironmentVariableW(L"VEYRA_TEST_VIDEO_WORK_MS",L"55");stalled=true;}diff --git a/tests/unit/LiveGpuSchedulerTests.cpp b/tests/unit/LiveGpuSchedulerTests.cppindex 74eb0530..ae47803b 100644--- a/tests/unit/LiveGpuSchedulerTests.cpp+++ b/tests/unit/LiveGpuSchedulerTests.cpp@@ -1,7 +1,6 @@#include "veyra/engine/LiveGpuScheduler.h"#include "veyra/engine/TimingWindow.h"#include "veyra/engine/FgRecoveryBudget.h"-#include "veyra/engine/PreviewFgCapacity.h"#include "veyra/engine/LivePairLatency.h"#include "veyra/engine/PreviewFrameReadiness.h"#include "veyra/engine/PresentationGeometry.h"@@ -11,17 +10,6 @@int main(){using Scheduler=veyra::engine::LiveGpuScheduler;using State=Scheduler::State;int failures=0;auto check=[&](bool pass,const char* text){std::cout<<(pass?"PASS ":"FAIL ")<<text<<'\n';failures+=!pass;};- {- veyra::engine::PreviewFgCapacity capacity;- check(capacity.select(6,16.667)==6,"unknown work preserves requested multiplier");- for(int i=0;i<60;++i){capacity.observe(18,10,5);capacity.select(6,16.667);}- check(capacity.select(6,16.667)==4,"sustained overload retains an evenly spaced sustainable group");- for(int i=0;i<30;++i){capacity.observe(8,4,3);capacity.select(6,16.667);}- check(capacity.select(6,16.667)==4,"brief headroom does not oscillate multiplier");- for(int i=0;i<200;++i){capacity.observe(8,4,3);capacity.select(6,16.667);}- check(capacity.select(6,16.667)==6,"sustained headroom restores requested multiplier");- capacity.reset();check(capacity.select(2,16.667)==2,"reset and 2X request cannot inherit a larger multiplier");- }{using namespace veyra;using R=engine::PreviewFrameReadiness;