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++
feat: checkpoint RTX Video SR, live settings and handoff
Veyra Goal Agentdf9f28964736
diff --git a/CMakeLists.txt b/CMakeLists.txtindex c772fb7b..cd15488c 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -69,6 +69,7 @@ add_library(veyra_ngx STATICsrc/ngx/NgxCoreHost.cppsrc/ngx/DlssNrRuntimeAdapter.cppsrc/ngx/DlssSrBackend.cpp+ src/ngx/VideoSrBackend.cppsrc/ngx/DlssFgBackend.cpp)veyra_apply_warnings(veyra_ngx)diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 1a44e99e..ddd9eb41 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -17,3 +17,7 @@ Source: https://github.com/lucide-icons/lucide/tree/a537cb6eb323b885f4c60baf3cec24 native icon mappings use 23 Lucide SVGs, retained under `assets/icons/lucide/`. Lucide is ISC-licensed (Copyright 2026 Lucide Icons and Contributors); its Feather-derived subset is MIT-licensed (Copyright 2013-present Cole Bemis). The complete upstream notices are preserved in `assets/icons/lucide/LICENSE` and must accompany any distribution containing these icons.`assets/icons/lucide/manifest.json` records the pinned revision and per-file SHA256. `scripts/generate-lucide-icons.py` converts the SVG geometry to GDI+ paths in `apps/veyra/ui/LucideIcons.h`, using development-only fonttools 4.64.0. Veyra requires no fonttools, network request, icon font or external icon runtime.++## RTX Video SDK 1.1 local VSR adapter++User-provided official SDK from https://developer.nvidia.com/rtx-video-sdk/getting-started, kept under ignored third_party_local/nvidia/RTX_Video_SDK_1.1.0. Its NVIDIA RTX SDK license remains applicable. VideoSrBackend is independently authored against the documented VSR parameter ABI; no SDK sample implementation or proprietary header is copied into the repository. Local nvngx_vsr.dll is excluded from Git and distribution. This addition does not authorize packaging or redistributing NVIDIA runtimes.diff --git a/apps/veyra/SettingsWindow.cpp b/apps/veyra/SettingsWindow.cppindex 284bea87..b3252d0c 100644--- a/apps/veyra/SettingsWindow.cpp+++ b/apps/veyra/SettingsWindow.cpp@@ -32,30 +32,62 @@ LRESULT CALLBACK bodyProc(HWND h,UINT msg,WPARAM wp,LPARAM lp){const wchar_t* labels[]={L"模型强度",L"局部明暗",L"局部结构",L"肤质 · 未证实",L"风格 · 实验",L"自动遮罩 · 实验",L"UI修正 · 未证实",L"总变化强度",L"暗化变化",L"亮化变化",L"色彩变化",L"明度变化"};void loadStore(){if(!loaded){store.load();loaded=true;}}void message(const std::wstring& text){putText(401,text.c_str());}-bool submit(engine::EnhancementSettings s){if(!apply(s)){dirty=true;message(L"总增强正在切换;草稿保留,请稍后应用。");return false;}dirty=false;return true;}+bool submit(engine::EnhancementSettings s){if(!apply(s)){dirty=true;message(L"总增强正在切换;本次修改未接受,请稍后重试。");return false;}dirty=false;return true;}void syncProtection(const engine::ProtectionSettings& protection){check(206,protection.enabled?BST_CHECKED:BST_UNCHECKED);unsigned count=0;for(auto q:protection.regions)count+=!q.empty();putText(206,(L"NR保护区域 · "+std::to_wstring(count)+L"/4").c_str());}-void populate(engine::EnhancementSettings s){populating=true;float v[]={s.model.intensity,s.model.tone,s.model.structure,s.model.skin,float(s.model.style),float(s.model.autoMask),float(s.model.uiCorrection),s.residual.total,s.residual.darken,s.residual.brighten,s.residual.color,s.residual.luminance};for(int i=0;i<12;++i){std::wostringstream o;o<<std::setprecision(7)<<v[i];putText(100+i,o.str().c_str());send(600+i,TBM_SETPOS,TRUE,LPARAM(v[i]*(i>=4&&i<=6?1:100)));}syncProtection(s.protection);check(200,s.nr?BST_CHECKED:BST_UNCHECKED);check(201,s.sr?BST_CHECKED:BST_UNCHECKED);send(202,CB_SETCURSEL,s.multiplier-1,0);send(203,CB_SETCURSEL,int(s.nrPolicy),0);send(204,CB_SETCURSEL,int(s.flow),0);send(205,CB_SETCURSEL,int(s.content),0);displayedRevision=s.revision;populating=false;dirty=false;}-bool read(engine::EnhancementSettings& s){s=enhancementEnabled?controller->snapshot().desired:configuredSettings;float v[12]{};for(int i=0;i<12;++i){wchar_t b[64]{};GetWindowTextW(item(100+i),b,64);wchar_t* end=nullptr;v[i]=wcstof(b,&end);if(end==b||*end||!std::isfinite(v[i])){message(L"请输入完整的有限数值;未提交设置");return false;}}+void selectDiscrete(int group,int value){for(int j=0;j<(group==0?3:2);++j){auto h=item(700+group*10+j);if(j==value)SetPropW(h,L"veyra.selected",HANDLE(1));else RemovePropW(h,L"veyra.selected");InvalidateRect(h,nullptr,FALSE);}}+void populate(engine::EnhancementSettings s){populating=true;float v[]={s.model.intensity,s.model.tone,s.model.structure,s.model.skin,float(s.model.style),float(s.model.autoMask),float(s.model.uiCorrection),s.residual.total,s.residual.darken,s.residual.brighten,s.residual.color,s.residual.luminance};for(int i=0;i<12;++i){std::wostringstream o;o<<std::setprecision(7)<<v[i];if(i>=4&&i<=6){selectDiscrete(i-4,int(v[i]));continue;}if(GetFocus()!=item(100+i))putText(100+i,o.str().c_str());send(600+i,TBM_SETPOS,TRUE,LPARAM(v[i]*100));}syncProtection(s.protection);check(200,enhancementEnabled&&s.nr?BST_CHECKED:BST_UNCHECKED);check(201,enhancementEnabled&&s.sr?BST_CHECKED:BST_UNCHECKED);send(207,CB_SETCURSEL,s.videoSrQuality,0);send(202,CB_SETCURSEL,s.multiplier-1,0);send(203,CB_SETCURSEL,int(s.nrPolicy),0);send(204,CB_SETCURSEL,int(s.flow),0);send(205,CB_SETCURSEL,int(s.content),0);displayedRevision=s.revision;populating=false;dirty=false;}+bool read(engine::EnhancementSettings& s,bool allPages=false){s=enhancementEnabled?controller->snapshot().desired:configuredSettings;float v[12]{};for(int i=0;i<12;++i){if(i>=4&&i<=6){v[i]=float(i==4?s.model.style:i==5?s.model.autoMask:s.model.uiCorrection);continue;}wchar_t b[64]{};GetWindowTextW(item(100+i),b,64);wchar_t* end=nullptr;v[i]=wcstof(b,&end);if(end==b||*end||!std::isfinite(v[i])){message(L"请输入完整的有限数值;未提交设置");return false;}}for(int i=4;i<7;++i)if(v[i]!=std::floor(v[i])||v[i]<0||v[i]>(i==4?2:1)){message(L"风格/遮罩/UI修正必须为整数");return false;}- s.model={v[0],v[1],v[2],v[3],int(v[4]),int(v[5]),int(v[6])};s.residual={v[7],v[8],v[9],v[10],v[11]};if(enhancementEnabled){s.nr=checked(200)==BST_CHECKED;s.sr=checked(201)==BST_CHECKED;}s.multiplier=uint32_t(send(202,CB_GETCURSEL,0,0)+1);s.nrPolicy=static_cast<pipeline::NrSizePolicy>(send(203,CB_GETCURSEL,0,0));s.flow=static_cast<engine::FlowQuality>(send(204,CB_GETCURSEL,0,0));s.content=static_cast<engine::ContentRate>(send(205,CB_GETCURSEL,0,0));if(!s.validate().empty()){message(L"参数越界,未提交。悬停数值框查看允许范围。");return false;}return true;}+ s.model={v[0],v[1],v[2],v[3],int(v[4]),int(v[5]),int(v[6])};s.residual={v[7],v[8],v[9],v[10],v[11]};if(enhancementEnabled){s.nr=checked(200)==BST_CHECKED;s.sr=checked(201)==BST_CHECKED;}s.videoSrQuality=uint32_t(send(207,CB_GETCURSEL,0,0));if(allPages)s.multiplier=uint32_t(send(202,CB_GETCURSEL,0,0)+1);s.nrPolicy=static_cast<pipeline::NrSizePolicy>(send(203,CB_GETCURSEL,0,0));if(allPages){s.flow=static_cast<engine::FlowQuality>(send(204,CB_GETCURSEL,0,0));s.content=static_cast<engine::ContentRate>(send(205,CB_GETCURSEL,0,0));}if(!s.validate().empty()){message(L"参数越界,未提交。悬停数值框查看允许范围。");return false;}return true;}++// Each notification changes one field on the latest desired settings. Hidden+// controls and incomplete numeric text can never overwrite another field.+bool liveField(int id){+ auto s=enhancementEnabled?controller->snapshot().desired:configuredSettings;+ if(id>=100&&id<=111){+ wchar_t b[64]{};GetWindowTextW(item(id),b,64);wchar_t* end=nullptr;float v=wcstof(b,&end);+ if(end==b||*end||!std::isfinite(v)){message(L"数值未完整;仍使用上次有效值");return false;}+ switch(id){case 100:s.model.intensity=v;break;case 101:s.model.tone=v;break;case 102:s.model.structure=v;break;case 103:s.model.skin=v;break;+ case 107:s.residual.total=v;break;case 108:s.residual.darken=v;break;case 109:s.residual.brighten=v;break;case 110:s.residual.color=v;break;case 111:s.residual.luminance=v;break;default:return false;}+ }else switch(id){+ case 202:s.multiplier=uint32_t(send(id,CB_GETCURSEL)+1);break;+ case 203:s.nrPolicy=static_cast<pipeline::NrSizePolicy>(send(id,CB_GETCURSEL));break;+ case 204:s.flow=static_cast<engine::FlowQuality>(send(id,CB_GETCURSEL));break;+ case 205:s.content=static_cast<engine::ContentRate>(send(id,CB_GETCURSEL));break;+ case 207:s.videoSrQuality=uint32_t(send(id,CB_GETCURSEL));break;+ case 700:case 701:case 702:s.model.style=id-700;break;+ case 710:case 711:s.model.autoMask=id-710;break;+ case 720:case 721:s.model.uiCorrection=id-720;break;+ default:return false;+ }+ if(!s.validate().empty()){message(L"数值超出范围;仍使用上次有效值");return false;}+ if(!submit(s)){populate(enhancementEnabled?controller->snapshot().desired:configuredSettings);return false;}+ populate(enhancementEnabled?controller->snapshot().desired:configuredSettings);+ message(enhancementEnabled?L"实时生效 · 以已应用版本为准":L"增强关闭中 · 已保存待启用设置");return true;+}+LRESULT CALLBACK scrollOnly(HWND h,UINT msg,WPARAM wp,LPARAM lp,UINT_PTR id,DWORD_PTR){+ if(msg==WM_MOUSEWHEEL||msg==WM_MOUSEHWHEEL){if(window)SendMessageW(window,WM_MOUSEWHEEL,wp,lp);return 0;}+ if(msg==WM_NCDESTROY)RemoveWindowSubclass(h,scrollOnly,id);+ return DefSubclassProc(h,msg,wp,lp);+}void refreshPresets(){auto list=item(300);SendMessageW(list,CB_RESETCONTENT,0,0);for(auto& p:store.entries())SendMessageW(list,CB_ADDSTRING,0,reinterpret_cast<LPARAM>(p.name.c_str()));if(!store.entries().empty())SendMessageW(list,CB_SETCURSEL,0,0);PostMessageW(GetParent(window),WM_APP+42,0,0);}void arrange(){if(!window||!body)return;RECT r{};GetClientRect(window,&r);int width=MulDiv(r.right,96,GetDpiForWindow(window)),height=MulDiv(r.bottom,96,GetDpiForWindow(window));- const int sticky=88,viewport=std::max(1,height-sticky);contentHeight=0;+ const int sticky=128,viewport=std::max(1,height-sticky);contentHeight=0;for(auto& entry:items)if(entry.page==page){wchar_t cls[32]{};GetClassNameW(entry.h,cls,32);contentHeight=std::max(contentHeight,entry.y+(_wcsicmp(cls,L"COMBOBOX")==0?36:entry.height)+12);}scroll=std::clamp(scroll,0,std::max(0,contentHeight-viewport));SetWindowPos(body,nullptr,0,dip(window,sticky),r.right,dip(window,viewport),SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);auto batch=BeginDeferWindowPos(int(items.size()));- for(auto& entry:items){bool fixed=entry.page==-1,visible=entry.page==page||fixed;int w=entry.w<0?width-entry.x-12:entry.w;int y=fixed?(GetDlgCtrlID(entry.h)==400?0:42):entry.y-scroll;+ for(auto& entry:items){bool fixed=entry.page==-1,visible=entry.page==page||fixed;int w=entry.w<0?width-entry.x-12:entry.w;int y=fixed?(GetDlgCtrlID(entry.h)==400?0:GetDlgCtrlID(entry.h)==211?86:42):entry.y-scroll;if(fixed){SetWindowPos(entry.h,nullptr,dip(window,entry.x),dip(window,y),dip(window,std::max(1,w)),dip(window,42),SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOREDRAW);continue;}batch=DeferWindowPos(batch,entry.h,nullptr,dip(window,entry.x),dip(window,y),dip(window,std::max(1,w)),dip(window,entry.height),SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCOPYBITS|(visible?SWP_SHOWWINDOW:SWP_HIDEWINDOW));}EndDeferWindowPos(batch);RedrawWindow(body,nullptr,nullptr,RDW_INVALIDATE|RDW_ALLCHILDREN);InvalidateRect(window,nullptr,FALSE);}-HWND add(const wchar_t* cls,const wchar_t* text,int id,DWORD style,int group,int x,int y,int width,int height){auto h=CreateWindowExW(0,cls,text,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|style,0,0,1,1,group==-1?window:body,reinterpret_cast<HMENU>(INT_PTR(id)),GetModuleHandleW(nullptr),nullptr);SendMessageW(h,WM_SETFONT,WPARAM(font),TRUE);themeControl(h);items.push_back({h,group,x,y,width,height});return h;}+HWND add(const wchar_t* cls,const wchar_t* text,int id,DWORD style,int group,int x,int y,int width,int height){auto h=CreateWindowExW(0,cls,text,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|style,0,0,1,1,group==-1?window:body,reinterpret_cast<HMENU>(INT_PTR(id)),GetModuleHandleW(nullptr),nullptr);SendMessageW(h,WM_SETFONT,WPARAM(font),TRUE);themeControl(h);if(group!=-1)SetWindowSubclass(h,scrollOnly,950,0);items.push_back({h,group,x,y,width,height});return h;}void button(const wchar_t* title,int id,int group,int x,int y,int width=-1){add(L"BUTTON",title,id,BS_PUSHBUTTON|WS_TABSTOP,group,x,y,width,36);}void combo(int id,int group,int y,std::initializer_list<const wchar_t*> names){auto h=add(L"COMBOBOX",L"",id,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP,group,12,y,-1,200);for(auto name:names)SendMessageW(h,CB_ADDSTRING,0,LPARAM(name));}LRESULT CALLBACK proc(HWND h,UINT msg,WPARAM wp,LPARAM lp){switch(msg){@@ -63,19 +95,23 @@ case WM_CREATE:{window=h;font=makeFont(h);items.clear();WNDCLASSW bodyClass{};bodyClass.lpfnWndProc=bodyProc;bodyClass.hInstance=GetModuleHandleW(nullptr);bodyClass.lpszClassName=L"VeyraInspectorBody";bodyClass.hCursor=LoadCursorW(nullptr,IDC_ARROW);RegisterClassW(&bodyClass);body=CreateWindowExW(WS_EX_CONTROLPARENT,bodyClass.lpszClassName,L"滚动参数",WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,0,88,300,300,h,nullptr,bodyClass.hInstance,nullptr);add(L"BUTTON",L"DLSS5 NR 增强",200,BS_AUTOCHECKBOX|WS_TABSTOP,0,12,12,-1,36);- add(L"BUTTON",L"DLSS 超分辨率 · 4K",201,BS_AUTOCHECKBOX|WS_TABSTOP,0,12,56,-1,36);+ add(L"BUTTON",L"超分辨率 · 4K",201,BS_AUTOCHECKBOX|WS_TABSTOP,0,12,56,-1,36);combo(203,0,104,{L"实时NR · 约1080内部处理",L"原生NR · 高性能成本"});add(L"STATIC",L"模型参数",1100,0,0,12,146,-1,24);- for(int i=0;i<12;++i){const int y=174+i*62+(i>=7?32:0);add(L"STATIC",labels[i],1000+i,0,0,12,y,176,28);add(L"EDIT",L"",100+i,ES_AUTOHSCROLL|WS_TABSTOP|ES_RIGHT,0,202,y,-1,28);const wchar_t* ranges[]={L"范围:0–1",L"范围:0–1",L"范围:0–1",L"-1表示默认;其余范围0–2(效果未证实)",L"整数0、1、2(实验)",L"整数0或1(实验)",L"整数0或1(效果未证实)",L"范围:0–2",L"范围:0–2",L"范围:0–2",L"范围:0–2",L"范围:0–2"};SetPropW(item(100+i),L"veyra.tip",HANDLE(ranges[i]));auto slider=add(TRACKBAR_CLASSW,L"",600+i,TBS_HORZ|TBS_NOTICKS|WS_TABSTOP,0,12,y+32,-1,16);SendMessageW(slider,TBM_SETRANGE,TRUE,MAKELPARAM(i==3?-100:0,i>=4&&i<=6?(i==4?2:1):i<3?100:200));}+ for(int i=0;i<12;++i){const int y=174+i*62+(i>=7?32:0);add(L"STATIC",labels[i],1000+i,0,0,12,y,176,28);+ if(i>=4&&i<=6){const int group=i-4,count=group==0?3:2;for(int j=0;j<count;++j){const auto title=group==0?std::to_wstring(j):j==0?std::wstring(L"关闭"):std::wstring(L"开启");button(title.c_str(),700+group*10+j,0,12+j*88,y+28,80);}continue;}+ add(L"EDIT",L"",100+i,ES_AUTOHSCROLL|WS_TABSTOP|ES_RIGHT,0,202,y,-1,28);+ const wchar_t* range=i<3?L"范围:0–1":i==3?L"-1表示默认;其余范围0–2(效果未证实)":L"范围:0–2";SetPropW(item(100+i),L"veyra.tip",HANDLE(range));+ auto slider=add(TRACKBAR_CLASSW,L"",600+i,TBS_HORZ|TBS_NOTICKS|WS_TABSTOP,0,12,y+32,-1,16);SendMessageW(slider,TBM_SETRANGE,TRUE,MAKELPARAM(i==3?-100:0,i<3?100:200));}add(L"STATIC",L"增强变化量",1101,0,0,12,606,-1,24);add(L"STATIC",L"肤质 / 风格 / 遮罩 / UI键为本地实验参数。未验证的效果不会标成可用能力。",1102,0,0,12,956,-1,70);- button(L"应用整套设置",210,0,12,1034);marked(item(210));button(L"恢复内建默认",211,0,12,1078);+ button(L"还原默认",211,-1,12,86);add(L"STATIC",L"补帧与运动估算",1103,0,1,12,12,-1,30);combo(202,1,52,{L"关闭补帧",L"DLSSG 2X",L"DLSSG 3X · 需硬件支持",L"DLSSG 4X · 需硬件支持"});combo(204,1,104,{L"光流 · 性能",L"光流 · 平衡",L"光流 · 质量"});combo(205,1,156,{L"采用源时间戳",L"自动识别内容节奏",L"识别30fps内容节奏",L"识别50fps内容节奏",L"识别60fps内容节奏"});add(L"STATIC",L"运动为估算输入。倍率不代表实际显示帧率。比较时只展示真实帧;采集补帧需要等待下一张源帧。",1104,0,1,12,210,-1,100);- button(L"应用补帧与当前参数",212,1,12,326);marked(item(212));+add(L"STATIC",L"用户预设",1105,0,2,12,12,-1,30);combo(300,2,56,{});add(L"EDIT",L"新预设",301,ES_AUTOHSCROLL|WS_TABSTOP,2,12,108,-1,36);send(301,EM_SETLIMITTEXT,48,0);const wchar_t* names[]={L"载入所选预设",L"新建内建默认预设",L"保存当前参数为新预设",L"重命名所选",L"删除所选",L"设为启动增强默认"};for(int i=0;i<6;++i)button(names[i],310+i,2,12,164+i*44);add(L"STATIC",L"启动界面始终为日常模式。默认预设只决定增强参数;预设文件损坏时保留原文件。",1106,0,2,12,438,-1,82);@@ -90,6 +126,8 @@ case WM_CREATE:{window=h;font=makeFont(h);items.clear();add(L"BUTTON",L"NR保护区域",206,BS_AUTOCHECKBOX|WS_TABSTOP,0,12,146,-1,36);button(L"框选区域",213,0,12,188,140);button(L"清除区域",214,0,162,188);add(L"STATIC",L"最多4区,左键拖框,Esc取消。仅抑制NR变化;不保护SR或补帧。可随预设保存;换源清空。",1109,0,0,12,232,-1,82);+ for(auto& entry:items)if(entry.page==0&&entry.y>=104)entry.y+=48;+ combo(207,0,100,{L"DLSS SR",L"RTX 视频超分 · 低",L"RTX 视频超分 · 中",L"RTX 视频超分 · 高",L"RTX 视频超分 · 最高"});loadStore();refreshPresets();populate(controller->snapshot().desired);message(store.error());SetTimer(h,1,250,nullptr);arrange();return 0;}case WM_SIZE:arrange();return 0;case WM_ERASEBKGND:return 1;@@ -97,21 +135,21 @@ case WM_PAINT:{PaintBuffer paint(h);fillSurface(paint.dc,paint.rect,h);return 0;case WM_VSCROLL:{switch(LOWORD(wp)){case SB_LINEUP:scroll-=40;break;case SB_LINEDOWN:scroll+=40;break;case SB_PAGEUP:scroll-=240;break;case SB_PAGEDOWN:scroll+=240;break;case SB_THUMBTRACK:{SCROLLINFO si{sizeof(si),SIF_TRACKPOS};GetScrollInfo(h,SB_VERT,&si);scroll=si.nTrackPos;break;}}arrange();return 0;}case WM_MOUSEWHEEL:scroll-=GET_WHEEL_DELTA_WPARAM(wp)/WHEEL_DELTA*90;arrange();return 0;case WM_CTLCOLORSTATIC:case WM_CTLCOLOREDIT:case WM_CTLCOLORLISTBOX:case WM_CTLCOLORBTN:return colors(msg,wp,lp);-case WM_COMMAND:{const int id=LOWORD(wp);if((id==206||id==213||id==214)&&HIWORD(wp)==BN_CLICKED){KillTimer(h,2);const auto accepted=SendMessageW(GetParent(h),WM_APP+45,id,checked(206));message(accepted?(id==213?L"请在画面中左键拖动框选;Esc取消。":L"已请求更新NR保护区域;其他草稿保留。"):L"未能操作:请先打开画面,或清除已满的4个区域。");return 0;}if((id==200||id==201)&&HIWORD(wp)==BN_CLICKED){KillTimer(h,2);const bool accepted=SendMessageW(GetParent(h),WM_APP+44,id,checked(id))!=0;message(accepted?L"已请求开关;确认帧边界结果后生效。数值草稿保持。":L"总增强正在切换,请待当前事务完成。");return 0;}if(HIWORD(wp)==EN_SETFOCUS){for(auto& item:items)if(GetDlgCtrlID(item.h)==id&&item.page==page){RECT r{};GetClientRect(h,&r);int height=MulDiv(r.bottom,96,GetDpiForWindow(h))-88;if(item.y<scroll)scroll=item.y;if(item.y+item.height>scroll+height)scroll=item.y+item.height-height;arrange();break;}}if(!populating&&(HIWORD(wp)==EN_CHANGE&&id>=100&&id<=111||HIWORD(wp)==CBN_SELCHANGE&&id>=202&&id<=205)){dirty=true;message(L"参数草稿尚未应用。无效草稿保留;切换面板不会提交。");}+case WM_COMMAND:{const int id=LOWORD(wp);if(!populating&&((id>=202&&id<=205||id==207)&&HIWORD(wp)==CBN_SELCHANGE||(id>=700&&id<=721)&&HIWORD(wp)==BN_CLICKED)){liveField(id);return 0;}if((id==206||id==213||id==214)&&HIWORD(wp)==BN_CLICKED){const auto accepted=SendMessageW(GetParent(h),WM_APP+45,id,checked(206));message(accepted?(id==213?L"请在画面中左键拖动框选;Esc取消。":L"已请求更新NR保护区域。"):L"未能操作:请先打开画面,或清除已满的4个区域。");return 0;}if((id==200||id==201)&&HIWORD(wp)==BN_CLICKED){const bool accepted=SendMessageW(GetParent(h),WM_APP+44,id,checked(id))!=0;message(accepted?L"已请求开关;确认帧边界结果后生效。":L"总增强正在切换,请待当前事务完成。");return 0;}if(HIWORD(wp)==EN_SETFOCUS){for(auto& item:items)if(GetDlgCtrlID(item.h)==id&&item.page==page){RECT r{};GetClientRect(h,&r);int height=MulDiv(r.bottom,96,GetDpiForWindow(h))-128;if(item.y<scroll)scroll=item.y;if(item.y+item.height>scroll+height)scroll=item.y+item.height-height;arrange();break;}}if(!populating&&id>=100&&id<=111&&HIWORD(wp)==EN_CHANGE){liveField(id);return 0;}+ if(!populating&&id>=100&&id<=111&&HIWORD(wp)==EN_KILLFOCUS){populate(enhancementEnabled?controller->snapshot().desired:configuredSettings);return 0;}engine::EnhancementSettings s;wchar_t name[128]{};GetWindowTextW(item(301),name,128);const auto index=size_t(send(300,CB_GETCURSEL,0,0));bool ok=true;- if(id==210||id==212){KillTimer(h,2);if(read(s)&&submit(s)){message(L"设置已请求;在真实帧边界确认已应用后生效");}}- else if(id==211){s={};if(submit(s)){populate(s);message(L"已请求恢复内建默认;用户预设保留");}}+ if(id==211){SetFocus(body);s={};if(submit(s)){populate(s);message(L"已还原内建默认;用户预设保留");}}else if(id==310&&index<store.entries().size()){s=store.entries()[index].settings;if(submit(s))populate(s);}else if(id==311){ok=store.put(name,{});refreshPresets();}- else if(id==312){if(read(s))ok=store.put(name,s);refreshPresets();}+ else if(id==312){if(read(s,true))ok=store.put(name,s);refreshPresets();}else if(id==313){ok=store.rename(index,name);refreshPresets();}else if(id==314&&index<store.entries().size()){if(MessageBoxW(h,(L"删除预设“"+store.entries()[index].name+L"”?当前画质不受影响。").c_str(),L"删除预设",MB_YESNO|MB_ICONQUESTION)==IDYES){ok=store.erase(index);refreshPresets();}}else if(id==315)ok=store.setDefault(index);else if(id>=501&&id<=505)SendMessageW(GetParent(h),WM_APP+41,id,id==501?send(500,CB_GETCURSEL,0,0):id==505?checked(505):0);if(!ok)message(store.error());return 0;}-case WM_HSCROLL:{int id=GetDlgCtrlID(reinterpret_cast<HWND>(lp));if(id>=600&&id<612){int index=id-600;float v=float(SendMessageW(reinterpret_cast<HWND>(lp),TBM_GETPOS,0,0))/(index>=4&&index<=6?1:100);if(index==3&&v<0)v=-1;std::wostringstream o;o<<std::setprecision(4)<<v;putText(100+index,o.str().c_str());SetTimer(h,2,120,nullptr);}return 0;}-case WM_TIMER:{if(wp==2){KillTimer(h,2);engine::EnhancementSettings setting;if(read(setting)&&submit(setting)){message(enhancementEnabled?L"已请求参数;帧边界确认生效":L"增强关闭中:已保存待启用参数");}return 0;}auto s=controller->snapshot();syncProtection(enhancementEnabled?s.desired.protection:configuredSettings.protection);if(enhancementEnabled&&!dirty&&displayedRevision!=s.desired.revision)populate(s.desired);check(200,enhancementEnabled&&s.desired.nr?BST_CHECKED:BST_UNCHECKED);check(201,enhancementEnabled&&s.desired.sr?BST_CHECKED:BST_UNCHECKED);std::wostringstream o;if(!s.running&&!s.frames&&s.transport!=engine::TransportState::Opening)o<<L"未打开媒体 · 设置待启用\n";else o<<L"期望版本 "<<s.desired.revision<<L" / 已应用 "<<s.applied.revision<<(s.applying?L" · 应用中":L"")<<L"\n强度 "<<s.applied.model.intensity<<L" · 变化量 "<<s.applied.residual.total<<L" · 倍率 "<<s.applied.multiplier<<L"X";setText(item(400),o.str());return 0;}-case WM_DESTROY:KillTimer(h,1);KillTimer(h,2);DeleteObject(font);window=nullptr;body=nullptr;items.clear();return 0;+case WM_HSCROLL:{int id=GetDlgCtrlID(reinterpret_cast<HWND>(lp));if(id>=600&&id<612){int index=id-600;float v=float(SendMessageW(reinterpret_cast<HWND>(lp),TBM_GETPOS,0,0))/(index>=4&&index<=6?1:100);if(index==3&&v<0)v=-1;std::wostringstream o;o<<std::setprecision(4)<<v;putText(100+index,o.str().c_str());}return 0;}+case WM_TIMER:{auto s=controller->snapshot();syncProtection(enhancementEnabled?s.desired.protection:configuredSettings.protection);if(enhancementEnabled&&!dirty&&displayedRevision!=s.desired.revision)populate(s.desired);check(200,enhancementEnabled&&s.desired.nr?BST_CHECKED:BST_UNCHECKED);check(201,enhancementEnabled&&s.desired.sr?BST_CHECKED:BST_UNCHECKED);std::wostringstream o;if(!s.running&&!s.frames&&s.transport!=engine::TransportState::Opening)o<<L"未打开媒体 · 设置待启用\n";else o<<L"期望版本 "<<s.desired.revision<<L" / 已应用 "<<s.applied.revision<<(s.applying?L" · 应用中":L"")<<L"\n强度 "<<s.applied.model.intensity<<L" · 变化量 "<<s.applied.residual.total<<L" · 倍率 "<<s.applied.multiplier<<L"X";setText(item(400),o.str());return 0;}+case WM_DESTROY:KillTimer(h,1);DeleteObject(font);window=nullptr;body=nullptr;items.clear();return 0;}return DefWindowProcW(h,msg,wp,lp);}}engine::EnhancementSettings defaultSettings(){loadStore();return store.defaultSettings();}@@ -119,8 +157,8 @@ HWND settingsControlForTest(int id){return item(id);}std::vector<std::wstring> presetNames(){loadStore();std::vector<std::wstring> out;for(auto& p:store.entries())out.push_back(p.name);return out;}bool presetAt(size_t index,engine::EnhancementSettings& out){loadStore();if(index>=store.entries().size())return false;out=store.entries()[index].settings;return true;}HWND createSettingsPanel(HWND parent,engine::EngineController& engine,std::function<bool(engine::EnhancementSettings)> callback){controller=&engine;apply=std::move(callback);WNDCLASSW wc{};wc.lpfnWndProc=proc;wc.hInstance=GetModuleHandleW(nullptr);wc.lpszClassName=L"VeyraInspector";wc.hbrBackground=panelBrush();wc.hCursor=LoadCursorW(nullptr,IDC_ARROW);RegisterClassW(&wc);return CreateWindowExW(WS_EX_CONTROLPARENT,wc.lpszClassName,L"专业参数",WS_CHILD|WS_CLIPCHILDREN,0,0,328,500,parent,nullptr,wc.hInstance,nullptr);}-void settingsVisibility(bool visible){if(window&&!visible)KillTimer(window,2);}-void settingsPage(int value){if(window)KillTimer(window,2);page=std::clamp(value,0,3);scroll=0;arrange();}+void settingsVisibility(bool visible){if(window&&!visible&&IsChild(window,GetFocus()))SetFocus(GetParent(window));}+void settingsPage(int value){if(window&&IsChild(window,GetFocus()))SetFocus(body);page=std::clamp(value,0,3);scroll=0;arrange();}void settingsEnabled(bool enabled,const engine::EnhancementSettings& configured){enhancementEnabled=enabled;configuredSettings=configured;if(window)syncProtection(enabled?controller->snapshot().desired.protection:configured.protection);if(window&&!enabled&&!dirty&&displayedRevision!=configured.revision)populate(configured);if(window){auto desired=controller->snapshot().desired;check(200,enabled&&desired.nr?BST_CHECKED:BST_UNCHECKED);check(201,enabled&&desired.sr?BST_CHECKED:BST_UNCHECKED);if(!enabled)message(L"增强已关闭。数值修改保存待启用配置;点击 NR / 超分可直接开启。");}}void settingsDpi(){if(!window)return;auto old=font;font=makeFont(window);for(auto& item:items)SendMessageW(item.h,WM_SETFONT,WPARAM(font),TRUE);DeleteObject(old);arrange();}void exportPanelStatus(const engine::ExportJobSnapshot& job,bool canExport,bool canSave){if(!window)return;setText(item(506),job.state==engine::ExportState::Idle?L"尚无导出任务":job.message+L"\n"+std::to_wstring(int(job.progress*100))+L"% · 源帧 "+std::to_wstring(job.sourceFrames)+L" / 编码 "+std::to_wstring(job.encoded)+L"\n生成 "+std::to_wstring(job.generated)+L" / CFR占位 "+std::to_wstring(job.holds)+L"\n作业 "+std::to_wstring(job.jobId)+L" · 冻结版本 "+std::to_wstring(job.frozenRevision));setText(item(507),job.output.empty()?L"目标由保存窗口选择":L"输出:"+std::filesystem::path(job.output).filename().wstring());EnableWindow(item(501),canExport&&!job.active());EnableWindow(item(502),canSave);EnableWindow(item(503),job.state==engine::ExportState::Running||job.state==engine::ExportState::Paused);EnableWindow(item(504),job.active());}diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cppindex e87cdad0..a9c9c128 100644--- a/apps/veyra/ui/AppShell.cpp+++ b/apps/veyra/ui/AppShell.cpp@@ -112,10 +112,12 @@ LRESULT CALLBACK interaction(HWND h,UINT m,WPARAM w,LPARAM l,UINT_PTR id,DWORD_P}veyra::engine::PlayerOptions options(){return veyra::engine::PlayerOptions::from(engine.snapshot().desired);}-std::wstring fileDialog(bool save){wchar_t name[32768]{};OPENFILENAMEW ofn{};ofn.lStructSize=sizeof(ofn);ofn.hwndOwner=mainWindow;ofn.lpstrFile=name;ofn.nMaxFile=32768;+// Win32 dispatch reenters during move/resize and modal dialogs. Large path+// buffers must be per-operation heap storage, never part of every WndProc frame.+std::wstring fileDialog(bool save){std::vector<wchar_t> name(32768);OPENFILENAMEW ofn{};ofn.lStructSize=sizeof(ofn);ofn.hwndOwner=mainWindow;ofn.lpstrFile=name.data();ofn.nMaxFile=32768;ofn.lpstrFilter=save?L"PNG图片\0*.png\0JPEG图片\0*.jpg\0":L"视频 / 图片\0*.mp4;*.mkv;*.mov;*.avi;*.ts;*.png;*.jpg;*.jpeg\0所有文件\0*.*\0";ofn.Flags=OFN_EXPLORER|OFN_NOCHANGEDIR|OFN_PATHMUSTEXIST|(save?OFN_OVERWRITEPROMPT:OFN_FILEMUSTEXIST);ofn.lpstrDefExt=save?L"png":nullptr;-return (save?GetSaveFileNameW(&ofn):GetOpenFileNameW(&ofn))?name:L"";}+return (save?GetSaveFileNameW(&ofn):GetOpenFileNameW(&ofn))?name.data():L"";}void openFile(const std::wstring& file){if(file.empty())return;cancelProtection();auto openOptions=options();if(file!=currentFile){openOptions.settings.protection={};uiState.configured.protection={};}auto ext=std::filesystem::path(file).extension().wstring();for(auto& c:ext)c=towlower(c);if((ext==L".png"||ext==L".jpg"||ext==L".jpeg")&&uiState.mode==veyra::ui::Mode::Daily)switchMode();engine.previewView({});currentFile=file;subtitles=veyra::engine::loadSrt(std::filesystem::path(file).replace_extension(L".srt").wstring());paused=false;SetWindowTextW(GetDlgItem(mainWindow,Play),L"暂停");engine.open(video,file,openOptions);SetWindowTextW(mainWindow,(L"Veyra — "+std::filesystem::path(file).filename().wstring()).c_str());if(smokeSeconds<=0)WritePrivateProfileStringW(L"Player",L"最近打开",file.c_str(),(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/veyra.ini").wstring().c_str());}HWND control(const wchar_t* cls,const wchar_t* label,int id,DWORD style,int x,int y,int w,int h){auto hwnd=CreateWindowExW(0,cls,label,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|style|(_wcsicmp(cls,L"STATIC")?WS_TABSTOP:0),x,y,w,h,mainWindow,reinterpret_cast<HMENU>(INT_PTR(id)),GetModuleHandleW(nullptr),nullptr);SendMessageW(hwnd,WM_SETFONT,reinterpret_cast<WPARAM>(font),TRUE);veyra::ui::themeControl(hwnd);if(id>=Open&&id<=Fullscreen&&id!=Seek)toolbar.push_back({hwnd,w});return hwnd;}void refreshDailyPresets(){auto h=GetDlgItem(mainWindow,DailyPreset);if(!h)return;SendMessageW(h,CB_RESETCONTENT,0,0);SendMessageW(h,CB_ADDSTRING,0,LPARAM(L"当前自定义设置"));for(auto& name:veyra::ui::presetNames())SendMessageW(h,CB_ADDSTRING,0,LPARAM(name.c_str()));SendMessageW(h,CB_SETCURSEL,0,0);}@@ -196,7 +198,7 @@ void subtitleMenu(){menuOpen=true;const int selected=popupSelector(GetDlgItem(mainWindow,Subtitle),options,0,true,L"字幕设置");menuOpen=false;if(selected>=0)SendMessageW(mainWindow,WM_COMMAND,options[selected].command,0);pointerActivity();}-void startVideoExport(bool hevc){auto s=engine.snapshot();if(currentFile.empty()||s.capture||s.image||!s.frames||s.applying||s.failed||exportJob.poll().active())return;wchar_t name[32768]{};OPENFILENAMEW d{sizeof(d)};d.hwndOwner=mainWindow;d.lpstrFile=name;d.nMaxFile=32768;d.lpstrFilter=L"MP4视频\0*.mp4\0";d.lpstrDefExt=L"mp4";d.Flags=OFN_EXPLORER|OFN_NOCHANGEDIR|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT;if(GetSaveFileNameW(&d)){exportJob.start(currentFile,name,s.applied,hevc);jobPaused=false;layout();}}+void startVideoExport(bool hevc){auto s=engine.snapshot();if(currentFile.empty()||s.capture||s.image||!s.frames||s.applying||s.failed||exportJob.poll().active())return;std::vector<wchar_t> name(32768);OPENFILENAMEW d{sizeof(d)};d.hwndOwner=mainWindow;d.lpstrFile=name.data();d.nMaxFile=32768;d.lpstrFilter=L"MP4视频\0*.mp4\0";d.lpstrDefExt=L"mp4";d.Flags=OFN_EXPLORER|OFN_NOCHANGEDIR|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT;if(GetSaveFileNameW(&d)){exportJob.start(currentFile,name.data(),s.applied,hevc);jobPaused=false;layout();}}#include "UiRepairChecks.h"LRESULT CALLBACK proc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp){switch(msg){@@ -233,7 +235,7 @@ veyra::ui::icon(GetDlgItem(hwnd,Play),Icon::Play);veyra::ui::icon(GetDlgItem(hwnveyra::ui::icon(GetDlgItem(hwnd,ProRailVideo),Icon::Video);veyra::ui::icon(GetDlgItem(hwnd,ProRailCapture),Icon::Capture);veyra::ui::icon(GetDlgItem(hwnd,ImageOpen),Icon::Image);veyra::ui::icon(GetDlgItem(hwnd,Info),Icon::Subtitle);veyra::ui::icon(GetDlgItem(hwnd,Recent),Icon::Recent);veyra::ui::icon(GetDlgItem(hwnd,Open),Icon::Video,true);veyra::ui::icon(GetDlgItem(hwnd,Capture),Icon::Capture,true);for(int id:{Open,Capture,Recent,Master,Sr,ModeSwitch,WindowMin,WindowMax,WindowClose,Stop,Mute,Subtitle,Fullscreen,ProRailVideo,ProRailCapture,ImageOpen,Info})veyra::ui::ghost(GetDlgItem(hwnd,id));-SetPropW(GetDlgItem(hwnd,Open),L"veyra.tip",HANDLE(L"打开视频 / 图片 · Ctrl+O"));SetPropW(GetDlgItem(hwnd,Capture),L"veyra.tip",HANDLE(L"连接采集卡"));SetPropW(GetDlgItem(hwnd,Sr),L"veyra.tip",HANDLE(L"DLSS 超分辨率 · 按比例提升,最高 3840×2160"));+SetPropW(GetDlgItem(hwnd,Open),L"veyra.tip",HANDLE(L"打开视频 / 图片 · Ctrl+O"));SetPropW(GetDlgItem(hwnd,Capture),L"veyra.tip",HANDLE(L"连接采集卡"));SetPropW(GetDlgItem(hwnd,Sr),L"veyra.tip",HANDLE(L"超分辨率 · 专业面板选择 DLSS / RTX 视频超分"));inspector=veyra::ui::createSettingsPanel(hwnd,engine,applySettings);selectInspector(uiPreferences.inspector);refreshDailyPresets();SendDlgItemMessageW(hwnd,Volume,TBM_SETPOS,TRUE,LPARAM(uiPreferences.volume*100));veyra::ui::marked(GetDlgItem(hwnd,Play));SetPropW(video,L"veyra.tip",HANDLE(L"专业模式:滚轮缩放 · 中键拖动画面 · 右键恢复适应窗口。缩放不影响增强或保存尺寸。"));tooltips=CreateWindowExW(WS_EX_TOPMOST,TOOLTIPS_CLASSW,nullptr,WS_POPUP|TTS_ALWAYSTIP|TTS_NOPREFIX,0,0,0,0,hwnd,nullptr,GetModuleHandleW(nullptr),nullptr);SendMessageW(tooltips,TTM_SETMAXTIPWIDTH,0,360);EnumChildWindows(hwnd,[](HWND child,LPARAM context)->BOOL{auto tip=reinterpret_cast<HWND>(context);wchar_t cls[32]{};GetClassNameW(child,cls,32);if(child==video||_wcsicmp(cls,L"BUTTON")==0||_wcsicmp(cls,L"EDIT")==0||_wcsicmp(cls,L"COMBOBOX")==0){TOOLINFOW info{sizeof(info)};info.uFlags=TTF_IDISHWND|TTF_SUBCLASS;info.hwnd=GetAncestor(child,GA_ROOT);info.uId=UINT_PTR(child);info.lpszText=LPSTR_TEXTCALLBACKW;SendMessageW(tip,TTM_ADDTOOLW,0,LPARAM(&info));}return TRUE;},LPARAM(tooltips));if(smokeSeconds>0)startTick=GetTickCount64();diagnosticPanel=veyra::ui::createTelemetryPanel(hwnd,engine);DragAcceptFiles(hwnd,TRUE);SetTimer(hwnd,1,100,nullptr);layout();return 0;}@@ -261,7 +263,7 @@ case WM_APP+43:showDiagnostics=false;layout();return 0;case WM_APP+42:refreshDailyPresets();return 0;case WM_APP+41:switch(wp){case 501:startVideoExport(lp!=0);break;case 502:{auto path=fileDialog(true);if(!path.empty())engine.saveFrame(path);break;}case 503:jobPaused=!jobPaused;exportJob.pause(jobPaused);break;case 504:exportJob.cancel();break;case 505:preferWatching=lp==BST_CHECKED;break;}return 0;case WM_SIZE:cancelProtection();if(wp!=SIZE_MINIMIZED){endTransition();layout();}return 0;-case WM_DROPFILES:{wchar_t file[32768]{};DragQueryFileW(reinterpret_cast<HDROP>(wp),0,file,32768);DragFinish(reinterpret_cast<HDROP>(wp));openFile(file);layout();return 0;}+case WM_DROPFILES:{std::vector<wchar_t> file(32768);DragQueryFileW(reinterpret_cast<HDROP>(wp),0,file.data(),32768);DragFinish(reinterpret_cast<HDROP>(wp));openFile(file.data());layout();return 0;}case WM_COMMAND:switch(LOWORD(wp)){case Open:case ProRailVideo:case ImageOpen:openFile(fileDialog(false));layout();break;@@ -275,9 +277,9 @@ case JobProgress:if(uiState.mode==veyra::ui::Mode::Daily)switchMode();uiState.drcase Details:uiState.diagnostics=!uiState.diagnostics;SetWindowTextW(GetDlgItem(hwnd,Details),uiState.diagnostics?L"性能 ▴":L"性能 ▾");layout();break;case Mute:{auto s=engine.snapshot();engine.setVolume(s.volume,!s.muted);break;}case Subtitle:if(lp)subtitleMenu();else{uiState.subtitles=!uiState.subtitles;layout();}break;-case SubtitleLoad:{wchar_t name[32768]{};OPENFILENAMEW d{sizeof(d)};d.hwndOwner=hwnd;d.lpstrFile=name;d.nMaxFile=32768;d.lpstrFilter=L"SubRip 字幕\0*.srt\0";d.Flags=OFN_FILEMUSTEXIST|OFN_NOCHANGEDIR;if(GetOpenFileNameW(&d)){subtitles=veyra::engine::loadSrt(name);uiState.subtitles=true;layout();}break;}+case SubtitleLoad:{std::vector<wchar_t> name(32768);OPENFILENAMEW d{sizeof(d)};d.hwndOwner=hwnd;d.lpstrFile=name.data();d.nMaxFile=32768;d.lpstrFilter=L"SubRip 字幕\0*.srt\0";d.Flags=OFN_FILEMUSTEXIST|OFN_NOCHANGEDIR;if(GetOpenFileNameW(&d)){subtitles=veyra::engine::loadSrt(name.data());uiState.subtitles=true;layout();}break;}case SubtitleSize:subtitlePixels=subtitlePixels==22?28:subtitlePixels==28?34:22;break;-case Recent:{wchar_t recent[32768]{};GetPrivateProfileStringW(L"Player",L"最近打开",L"",recent,32768,(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/veyra.ini").wstring().c_str());openFile(recent);break;}+case Recent:{std::vector<wchar_t> recent(32768);GetPrivateProfileStringW(L"Player",L"最近打开",L"",recent.data(),32768,(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/veyra.ini").wstring().c_str());openFile(recent.data());break;}case Play:{auto s=engine.snapshot();if(s.capture||s.image||s.transport==veyra::engine::TransportState::Opening||s.transport==veyra::engine::TransportState::Stopping)break;if(!currentFile.empty()&&(!s.running||s.transport==veyra::engine::TransportState::Ended)){openFile(currentFile);break;}paused=s.transport==veyra::engine::TransportState::Playing;engine.pause(paused);SetWindowTextW(GetDlgItem(hwnd,Play),paused?L"播放":L"暂停");break;}case Stop:engine.stop();break;case Save:{auto name=fileDialog(true);if(!name.empty())engine.saveFrame(name);break;}@@ -402,7 +404,7 @@ CoInitializeEx(nullptr,COINIT_APARTMENTTHREADED);std::filesystem::create_directories(std::filesystem::path(VEYRA_PROJECT_ROOT)/"logs");wchar_t logOverride[32768]{};GetEnvironmentVariableW(L"VEYRA_LOG_FILE",logOverride,32768);veyra::Logger::instance().openFile(logOverride[0]?std::wstring(logOverride):(std::filesystem::path(VEYRA_PROJECT_ROOT)/"logs/veyra-app.log").wstring());initialOptions=veyra::engine::PlayerOptions::from(veyra::ui::defaultSettings());-int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<argc;++i){const std::wstring arg=argv[i];if(arg==L"--export-worker"&&i+1<argc)workerMapping=reinterpret_cast<HANDLE>(_wcstoui64(argv[++i],nullptr,10));else if(arg==L"--smoke-view"&&i+1<argc)smokeView=argv[++i];else if(arg==L"--smoke-repair-ui")smokeRepair=true;else if(arg==L"--smoke-repair-ui-reject")smokeRepair=smokeRepairReject=true;else if(arg==L"--smoke-hover")smokeZoom=smokeHover=true;else if(arg==L"--smoke-protection")smokeProtection=true;else if(arg==L"--smoke-zoom")smokeZoom=true;else if(arg==L"--smoke-empty")smokeEmpty=true;else if(arg==L"--smoke-dual")smokeDual=true;else if(arg==L"--smoke-dual-pause"){smokeDual=smokeDualPause=true;}else if(arg==L"--smoke-master-reject")smokeMaster=smokeMasterReject=true;else if(arg==L"--smoke-master")smokeMaster=true;else if(arg==L"--smoke-audio")smokeAudio=true;else if(arg==L"--smoke-job-cancel")smokeJobCancel=true;else if(arg==L"--smoke-job-exit")smokeJobExit=true;else if(arg==L"--smoke-job")smokeJob=true;else if(arg==L"--smoke-dual-export"&&i+1<argc)smokeDualOutput=argv[++i];else if(arg==L"--smoke-seconds"&&i+1<argc)smokeSeconds=std::clamp(_wtoi(argv[++i]),1,240);else if(arg==L"--export-out"&&i+1<argc)exportOutput=argv[++i];else if(arg==L"--max-frames"&&i+1<argc)exportFrames=std::max(1,_wtoi(argv[++i]));else if(arg==L"--cancel-after-ms"&&i+1<argc)cancelAfterMs=std::clamp(_wtoi(argv[++i]),1,240000);else if(arg==L"--hevc")exportHevc=true;else if(arg==L"--smoke-rollback-flow"){smokeRollback=true;smokeRollbackFlow=true;}else if(arg==L"--smoke-rollback")smokeRollback=true;else if(arg==L"--smoke-ui")smokeUi=true;else if(arg==L"--no-fg")initialOptions.fg=false;else if(arg==L"--smoke-settings")smokeSettings=true;else if(arg==L"--smoke-controls")smokeControls=true;else if(arg==L"--smoke-save"&&i+1<argc)smokeSave=argv[++i];else if(arg==L"--native")initialOptions.realtime=false;else if(arg==L"--realtime")initialOptions.realtime=true;else if(arg==L"--fg")initialOptions.fg=true;else if(arg==L"--fg-multiplier"&&i+1<argc){initialOptions.fgMultiplier=std::clamp(_wtoi(argv[++i]),2,4);initialOptions.fg=true;}else if(arg==L"--sr")initialOptions.sr=true;else if(arg==L"--no-nr")initialOptions.nr=false;else if(arg==L"--nr")initialOptions.nr=true;else if(arg==L"--no-sr")initialOptions.sr=false;else autoInput=arg;}LocalFree(argv);+int argc=0;auto argv=CommandLineToArgvW(GetCommandLineW(),&argc);for(int i=1;i<argc;++i){const std::wstring arg=argv[i];if(arg==L"--export-worker"&&i+1<argc)workerMapping=reinterpret_cast<HANDLE>(_wcstoui64(argv[++i],nullptr,10));else if(arg==L"--smoke-view"&&i+1<argc)smokeView=argv[++i];else if(arg==L"--smoke-repair-ui")smokeRepair=true;else if(arg==L"--smoke-repair-ui-reject")smokeRepair=smokeRepairReject=true;else if(arg==L"--smoke-hover")smokeZoom=smokeHover=true;else if(arg==L"--smoke-protection")smokeProtection=true;else if(arg==L"--smoke-zoom")smokeZoom=true;else if(arg==L"--smoke-empty")smokeEmpty=true;else if(arg==L"--smoke-dual")smokeDual=true;else if(arg==L"--smoke-dual-pause"){smokeDual=smokeDualPause=true;}else if(arg==L"--smoke-master-reject")smokeMaster=smokeMasterReject=true;else if(arg==L"--smoke-master")smokeMaster=true;else if(arg==L"--smoke-audio")smokeAudio=true;else if(arg==L"--smoke-job-cancel")smokeJobCancel=true;else if(arg==L"--smoke-job-exit")smokeJobExit=true;else if(arg==L"--smoke-job")smokeJob=true;else if(arg==L"--smoke-dual-export"&&i+1<argc)smokeDualOutput=argv[++i];else if(arg==L"--smoke-seconds"&&i+1<argc)smokeSeconds=std::clamp(_wtoi(argv[++i]),1,240);else if(arg==L"--export-out"&&i+1<argc)exportOutput=argv[++i];else if(arg==L"--max-frames"&&i+1<argc)exportFrames=std::max(1,_wtoi(argv[++i]));else if(arg==L"--cancel-after-ms"&&i+1<argc)cancelAfterMs=std::clamp(_wtoi(argv[++i]),1,240000);else if(arg==L"--hevc")exportHevc=true;else if(arg==L"--smoke-rollback-flow"){smokeRollback=true;smokeRollbackFlow=true;}else if(arg==L"--smoke-rollback")smokeRollback=true;else if(arg==L"--smoke-ui")smokeUi=true;else if(arg==L"--no-fg")initialOptions.fg=false;else if(arg==L"--smoke-settings")smokeSettings=true;else if(arg==L"--smoke-controls")smokeControls=true;else if(arg==L"--smoke-save"&&i+1<argc)smokeSave=argv[++i];else if(arg==L"--native")initialOptions.realtime=false;else if(arg==L"--realtime")initialOptions.realtime=true;else if(arg==L"--fg")initialOptions.fg=true;else if(arg==L"--fg-multiplier"&&i+1<argc){initialOptions.fgMultiplier=std::clamp(_wtoi(argv[++i]),2,4);initialOptions.fg=true;}else if(arg==L"--video-sr"&&i+1<argc){initialOptions.settings.videoSrQuality=std::clamp(_wtoi(argv[++i]),1,4);initialOptions.sr=true;}else if(arg==L"--sr")initialOptions.sr=true;else if(arg==L"--no-nr")initialOptions.nr=false;else if(arg==L"--nr")initialOptions.nr=true;else if(arg==L"--no-sr")initialOptions.sr=false;else autoInput=arg;}LocalFree(argv);if(workerMapping){const int code=veyra::engine::runExportWorker(workerMapping);CoUninitialize();return code;}if(smokeSeconds<=0&&exportOutput.empty()){uiPreferences=preferences.load();initialOptions=veyra::engine::PlayerOptions::from(preferences.startup(initialOptions.snapshot()));engine.setVolume(uiPreferences.volume,uiPreferences.muted);uiState.subtitles=uiPreferences.subtitles;subtitlePixels=uiPreferences.subtitleSize;}engine.requestSettings(initialOptions.snapshot());diff --git a/apps/veyra/ui/CapturePanel.cpp b/apps/veyra/ui/CapturePanel.cppindex bb902a52..d81c17df 100644--- a/apps/veyra/ui/CapturePanel.cpp+++ b/apps/veyra/ui/CapturePanel.cpp@@ -20,7 +20,7 @@ case WM_CREATE:{window=h;font=makeFont(h);titleTheme(h);auto add=[&](const wcharadd(L"STATIC",L"视频输入设备",6,0);add(L"STATIC",L"设备实际支持的格式",7,0);add(L"STATIC",L"",8,0);add(L"STATIC",L"HDMI 音频监听",9,0);EnableWindow(GetDlgItem(h,4),FALSE);arrange();SetTimer(h,1,100,nullptr);if(!busy)query(-1);return 0;}case WM_TIMER:if(busy&&pending.wait_for(std::chrono::seconds(0))==std::future_status::ready){auto result=pending.get();busy=false;EnableWindow(GetDlgItem(h,5),TRUE);EnableWindow(GetDlgItem(h,1),TRUE);if(result.device<0){SendDlgItemMessageW(h,1,CB_RESETCONTENT,0,0);SendDlgItemMessageW(h,2,CB_RESETCONTENT,0,0);SendDlgItemMessageW(h,3,CB_RESETCONTENT,0,0);formats.clear();for(auto& name:result.video)SendDlgItemMessageW(h,1,CB_ADDSTRING,0,LPARAM(name.c_str()));SendDlgItemMessageW(h,3,CB_ADDSTRING,0,LPARAM(L"不监听音频"));for(auto& name:result.audio)SendDlgItemMessageW(h,3,CB_ADDSTRING,0,LPARAM(name.c_str()));SendDlgItemMessageW(h,3,CB_SETCURSEL,0,0);SetDlgItemTextW(h,8,result.video.empty()?L"未找到采集设备。连接后点击刷新。":L"请选择设备以查询实际格式;点击连接前不会中断当前视频。");}- else{formats=std::move(result.formats);SendDlgItemMessageW(h,2,CB_RESETCONTENT,0,0);for(auto& format:formats)SendDlgItemMessageW(h,2,CB_ADDSTRING,0,LPARAM(format.label.c_str()));if(!formats.empty())SendDlgItemMessageW(h,2,CB_SETCURSEL,0,0);EnableWindow(GetDlgItem(h,4),!formats.empty());SetDlgItemTextW(h,8,formats.empty()?L"设备未提供支持的1080p/4K 30/60格式,或正被其他应用占用。":L"连接后使用当前增强设置。格式与音频变更需要重新连接。");}}+ else{formats=std::move(result.formats);SendDlgItemMessageW(h,2,CB_RESETCONTENT,0,0);for(auto& format:formats)SendDlgItemMessageW(h,2,CB_ADDSTRING,0,LPARAM(format.label.c_str()));if(!formats.empty())SendDlgItemMessageW(h,2,CB_SETCURSEL,0,0);EnableWindow(GetDlgItem(h,4),!formats.empty());SetDlgItemTextW(h,8,formats.empty()?L"未读到有效的4K以内采集格式,或设备正被其他应用占用。":L"连接后使用当前增强设置。格式与音频变更需要重新连接。");}}else if(busy&&GetTickCount64()-queryStarted>5000)SetDlgItemTextW(h,8,L"设备查询耗时较长。可以关闭此面板,当前播放不受影响。");return 0;case WM_COMMAND:if(LOWORD(wp)==1&&HIWORD(wp)==CBN_SELCHANGE)query(int(SendDlgItemMessageW(h,1,CB_GETCURSEL,0,0)));else if(LOWORD(wp)==5)query(-1);else if(LOWORD(wp)==4){int device=int(SendDlgItemMessageW(h,1,CB_GETCURSEL,0,0)),format=int(SendDlgItemMessageW(h,2,CB_GETCURSEL,0,0)),audio=int(SendDlgItemMessageW(h,3,CB_GETCURSEL,0,0))-1;if(!busy&&device==queriedDevice&&format>=0&&size_t(format)<formats.size()){start(std::format(L"capture:{}:{}:{}",device,formats[format].index,audio));DestroyWindow(h);}}return 0;case WM_CTLCOLORSTATIC:case WM_CTLCOLOREDIT:case WM_CTLCOLORLISTBOX:case WM_CTLCOLORBTN:return colors(msg,wp,lp);diff --git a/apps/veyra/ui/Theme.h b/apps/veyra/ui/Theme.hindex 2ecfc18d..80ea8961 100644--- a/apps/veyra/ui/Theme.h+++ b/apps/veyra/ui/Theme.h@@ -89,6 +89,7 @@ inline LRESULT CALLBACK comboPaint(HWND h,UINT m,WPARAM w,LPARAM l,UINT_PTR,DWORauto result=DefSubclassProc(h,m,w,l);if(m==CB_SETCURSEL||m==WM_SETFOCUS||m==WM_KILLFOCUS||m==WM_ENABLE)InvalidateRect(h,nullptr,FALSE);return result;}inline LRESULT CALLBACK trackPaint(HWND h,UINT m,WPARAM w,LPARAM l,UINT_PTR,DWORD_PTR){+ if(m==WM_MOUSEWHEEL||m==WM_MOUSEHWHEEL)return 0; // Scrolling must not seek or change volume/parameters.if(m==WM_ERASEBKGND)return 1;if(m==WM_PAINT){PaintBuffer paint(h);HDC dc=paint.dc;RECT r=paint.rect;fillSurface(dc,r,h);int minimum=int(SendMessageW(h,TBM_GETRANGEMIN,0,0)),maximum=int(SendMessageW(h,TBM_GETRANGEMAX,0,0));float progress=float(SendMessageW(h,TBM_GETPOS,0,0)-minimum)/std::max(1,maximum-minimum);int margin=dip(h,6),y=r.bottom/2,x=margin+int((r.right-margin*2)*progress);RECT rail{margin,y-dip(h,1),r.right-margin,y+dip(h,2)},fill=rail;fill.right=x;roundRect(dc,rail,line,dip(h,2));roundRect(dc,fill,IsWindowEnabled(h)?accent:secondary,dip(h,2));RECT dot{x-dip(h,5),y-dip(h,5),x+dip(h,5),y+dip(h,5)};roundRect(dc,dot,IsWindowEnabled(h)?accent:line,dip(h,5));InflateRect(&dot,-dip(h,2),-dip(h,2));roundRect(dc,dot,surface(h),dip(h,3));return 0;}if(m==WM_LBUTTONDOWN||m==WM_MOUSEMOVE&&GetCapture()==h||m==WM_LBUTTONUP&&GetCapture()==h){if(!IsWindowEnabled(h))return 0;if(m==WM_LBUTTONDOWN)SetCapture(h);RECT r{};GetClientRect(h,&r);int minimum=int(SendMessageW(h,TBM_GETRANGEMIN,0,0)),maximum=int(SendMessageW(h,TBM_GETRANGEMAX,0,0));float fraction=std::clamp(float(GET_X_LPARAM(l)-dip(h,6))/std::max(1L,r.right-dip(h,12)),0.0f,1.0f);int value=minimum+int(fraction*(maximum-minimum));SendMessageW(h,TBM_SETPOS,TRUE,value);SendMessageW(GetParent(h),WM_HSCROLL,MAKEWPARAM(m==WM_LBUTTONUP?TB_THUMBPOSITION:TB_THUMBTRACK,value),LPARAM(h));if(m==WM_LBUTTONUP)ReleaseCapture();return 0;}diff --git a/docs/CAPTURE_CARD_AUDIT_2026-09-08.md b/docs/CAPTURE_CARD_AUDIT_2026-09-08.mdnew file mode 100644index 00000000..a94a820b--- /dev/null+++ b/docs/CAPTURE_CARD_AUDIT_2026-09-08.md@@ -0,0 +1,55 @@+# 采集卡 4K18 / 1440p 能力核对(2026-09-08)++## 结论与修复++Veyra 原先仅保留1920×1080或3840×2160,且29≤fps≤61。这是应用过滤错误,明确隐藏了这张卡已支持的4K18,也会隐藏其他设备的1440p。现移除预设白名单,在现有3840×2160采集处理范围内展示所有有效尺寸及设备默认帧率,并标注YUY2/MJPEG/NV12或原始GUID。原始DirectShow索引不变,避免选择错格式;并补SetFormat HRESULT日志。没有修改导出完整性检查、设备驱动或固件。++这次不是只改列表:本机真实采集源与NR播放都执行成功。暂未添加每个分辨率的所有离散帧率选择器;默认帧率不等于该尺寸唯一可选帧率。4K本卡只有18这一档。++## 本机设备身份与链路++- USB视频名USB3 Video,USB音频名USB3 Digital Audio。+- VID345F / PID2131,REV3100,设备序列字符串20260128。该ID与MS2131方案一致,但尚未拆机核对芯片或确认成品品牌,不把通用ID当唯一商品型号。+- Microsoft UVC驱动10.0.26100.8972;驱动日期/固件版本不能直接由序列字符串推断。+- 只读查询实际父USB hub / port1:bcdUSB0320、bcdDevice3100;EX_V2 operatingSuperSpeed=1、operatingSuperSpeedPlus=0。当前是SuperSpeed连接,不是历史测试里的USB2。单看设备名称或根集线器名称不能证明连接速度;以EX_V2实际运行标志为证。+- 证据:logs/optimization-goal-20260908/capture-usb-link.txt。查询接口说明:[Microsoft USB连接信息](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/usbioctl/ni-usbioctl-ioctl_usb_get_node_connection_information_ex_v2)。没有发送刷写/配置固件命令。++## 驱动与USB描述符相互印证++直接读取本机USB配置描述符(1380字节),解析UVC VideoStreaming Frame Uncompressed(5)与Frame MJPEG(7),两种格式各12个尺寸:1920×1080、1600×1200、1360×768、1280×1024、1280×960、1280×720、1024×768、800×600、720×576、720×480、640×480、3840×2160。++前11个尺寸离散帧率是约60/50/30/20/10;3840×2160仅18。没有2560×1440,也没有2048×1080。因此这里的“2K”即使分别按1440p或DCI2K理解,都未公布。++FFmpeg DirectShow完整枚举与上述结果一致;VideoInfo/VideoInfo2会显示重复行。本次产品枚举读出实卡48条原始媒体类型,4K18 YUY2索引22/23、MJPEG索引46/47。作为交叉检查,产品也读出OBS虚拟摄像头的2560×1440@60,证明不会再因尺寸名称而过滤1440p。++证据:capture-native-options.txt、capture-usb-config.bin、capture-usb-frames.json、capture-product-formats.txt,均在logs/optimization-goal-20260908下。FFmpeg的-list_options true以“Error opening input”结束是枚举命令退出行为,不代表已尝试持续采集。++## 为什么有4K18而没有2K30++带宽预算并不是一组可自动插值的分辨率菜单。HDMI输入/环出能力、芯片缩放输出、固件UVC帧尺寸与帧间隔表、USB传输能力是不同约束。本机固件没有1440p输出条目,普通应用不能把未公布档位写入菜单就当它受支持。++同为未压缩8-bit YUY2(每像素2字节,不含协议开销):++| 模式 | 有效图像负载 |+| --- | ---: |+| 3840×2160×18 | 298.5984 MB/s |+| 2560×1440×30 | 221.184 MB/s |+| 3840×2160×30 | 497.664 MB/s |++所以“4K18有,2K30没有”不能解释为2K30单纯带宽太高。可证实的直接原因是当前固件模式表缺少该尺寸;为何厂商选择这张表、芯片/板卡能否经匹配固件增加1440p,尚无该成品型号的证据。++相关芯片研究:[Steve Markgraf/HSDAOH一手演讲](https://people.osmocom.org/steve-m/hsdaoh_slides/hsdaoh.html)报告MS2130约4K18/298.5MB/s能力;[ms-tools原项目](https://github.com/BertoldVdb/ms-tools)研究MacroSilicon芯片与固件。这些说明同类产品的输出与固件有关,不能据此保证本卡刷任意MS2130/2131固件可用。MacroSilicon公开MS2131页面本次获取失败(英文502、中文超时),不将二手产品摘要冒充成功核对官方结论。++现有可行选择:4K18真实采集;1080p较高帧率采集;若必须原生1440p30采集,则须确认成品厂商匹配固件/明确支持此UVC模式的硬件。4K18缩小到1440p仍只有18个源帧,插帧或1080p超分不能冒充原生1440p30。++## 实测与边界++- 构建 scripts/build.ps1 -Root <project> -Preset x64-release:第一次链接遇到运行中exe占用;正常关闭后重建exit0,build-cycle80-retry.log。+- veyra_capture_tests.exe --list:实卡4K18与OBS1440均可见。+- veyra_capture_tests.exe capture:0:22:-1 及capture:0:46:-1:各约1秒,实际配置3840×2160/18;SetFormat0x00000000;Run0x1;收到6帧。消费者故意停300ms期间发生4次mailbox覆盖是该测试预期行为,所有所有权/丢帧恢复检查通过。+- veyra.exe capture:0:22:-1 --realtime --nr --no-sr --no-fg --smoke-view professional --smoke-seconds 8:exit0,107NR/106NVOF;callback18.02fps,captureDropped0,failed=false;NR Create0x1/SEH0。callbackToPresentReturnP9516.864ms不是HDMI到屏幕端到端延迟。日志capture-4k18-app.log。+- 此处3840×2160指USB输出及程序收到的尺寸;未确认HDMI源本身是否原生4K,不能以该数值保证没有卡内缩放。+- 随后FFmpeg单帧图像探测Run失败;同时用户已启动PID20272 / capture:0:22:0,该失败发生于并发占用期间,不能单独诊断能力,也不能证明占用是唯一原因。未取得独立静帧视觉证据。+- 用户已在更新版自行恢复4K18采集,保留其运行。专业鼠标操作、4K18声音/主观流畅度仍由用户实测。Phase7整体状态仍未通过;本修复不声明解决既有4K+FG时序问题。++独立review_capture_modes scopedPASS:重新枚举exit0,离线解析原始USB描述符完全一致,核对采集/NR实测日志,无新增P0/P1/P2;未干扰用户采集。最终程序SHA256:2587E014D349402254C23C8B82108539B4C586E2C4C1D2C558BC636EB4AB34EB。preflight71PASS;整体Phase7状态不变。diff --git a/docs/HANDOFF_2026-09-09.md b/docs/HANDOFF_2026-09-09.mdnew file mode 100644index 00000000..885d33eb--- /dev/null+++ b/docs/HANDOFF_2026-09-09.md@@ -0,0 +1,51 @@+# Veyra 交接 — 2026-09-09++## 当前状态++本机实验开发版;Phase7优化仍在进行。交接存档不代表公开分发许可、长期稳定性或物理端到端延迟验收。入口 `Veyra.cmd`,Release程序 `out/build/x64-release/veyra.exe`。不要移动本机runtime路径。当前说明以本文件及USER_GUIDE为准,旧报告为历史证据。++## 本次设置变更(Cycle86)++- 增强/补帧数值、选择器、开关直接请求生效,无需“应用”。每次修改仅提交自身字段,基于最新desired配置,避免隐藏页面串改NR尺寸。+- 合法数字即时提交;不完整/越界数字不进入引擎,失去焦点恢复有效值。增强关闭期间保存待启用配置;总开关事务忙时明确拒绝,稍后重试。+- 风格0/1/2按钮;自动遮罩、UI修正开/关按钮。保留实验/未证实标签,不宣称这些参数都有效。连续值保留数值框和拖动。+- 参数面板滚轮转为滚页,不改变滑条/收起的选择器。全局主题滑条禁滚轮调参,包括进度和音量;视频预览滚轮缩放保持。+- 常驻一个“还原默认”,恢复内建增强与补帧参数;预设管理/导出操作按钮仍保留。+- 用户明确删除loop/GOAL_PROMPT.md,且授权删除对应前置检查;仅移除该文件要求和保护条目,其他10个控制文件hash及二进制验证保留。manifest pin相应同步。不能恢复该文件或将本次授权扩大到任意门禁修改。++构建命令:`powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root <project> -Preset x64-release`。+回归命令:`python scripts/acceptance/ui-settings-page-scope.py`(原Cycle85手动提交语义已被实时设置取代)。+Maker构建通过,实际RTX UI回归通过:`logs/video-sdk-trial-20260909/build-cycle86.log`、`ui-live-cycle86.log`;底层参数日志 `logs/settings-page-scope-1686641c298044738edc91e075662790.log`。初次脚本控件计数错误15/实际14已纠正,不是产品失败。独立审查和最终gate结果待追加。++## 既有改动一起存档++- Cycle78:SR运动响应诊断,未擅自更改默认算法。见SR_MOTION_RESPONSE_2026-09-08.md。+- Cycle79:窗口拖拽/缩放栈溢出修复,AppShell大局部数组改为按需堆缓冲;旧独立短测通过。+- Cycle80:取消采集格式30/60fps白名单;USB3Video公开4K18 YUY2/MJPEG,固件没有1440p。见CAPTURE_CARD_AUDIT_2026-09-08.md。+- Cycle81–83:RTX Video SR官方本地SDK试验与可选共享后端接入。开关决定SR启停,下拉选择DLSS或视频SR档位;SR→NR→DLSSG顺序不变。FRUC有独立D3D11试验,未接入产品。见RTX_VIDEO_FRUC_TRIAL_2026-09-09.md及RTX_VIDEO_SR_INTEGRATION_2026-09-09.md。+- Cycle84:真实1080p60卡对照,原生4K NR约23ms、实时NR约6ms。视频SR最高约6.5ms、低约1.5ms;实时NR+低SR接近60源fps。不能把这些阶段耗时当物理延迟。测试恢复时遗漏FG2、留下关闭,已向用户纠正。见PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.md。+- Cycle85:用户FG开关导致NR22→6ms,日志证明NR4K→1080;旧设置整页提交存在串改缺陷。已修复并独立通过;Cycle86进一步改为单字段即时提交。见SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md。++## 下一位接手先做什么++1. 查看git存档、loop/STATE.json与本报告末尾最终验收结果,保留用户本地配置和未提交改动。每次测试上限300秒,实卡由用户验收,不自动占用。+2. 优先修正性能指标窗口:EngineController TimingWindow仍保留1200历史采样,改配置后统计会混入旧值。UI必须区分NR单阶段、其他GPU阶段、处理吞吐与未测物理延迟;不能相加后伪称实测端到端。+3. 既有间歇player-sync时序失败仍需隔离复现;一次phase7通过不能抹掉历史失败。避免用户实卡运行与GPU门禁并发。+4. 自然运动画质、FG伪影/节奏、实卡音频/主观延迟及长期稳定仍由真实素材验证。FRUC若后续接入须解决D3D11/D3D12互操作、明确一帧lookahead成本,不冒充SDK已自带D3D12补帧。++正常视频目前软件解码;RTX5070负责SR/NR/光流/FG/呈现。Depth provider未接入;禁止宣称等同游戏原生运动/深度。导出完整性检查保持现状,不加重。++## 许可和存档边界++仅本地Git源码/文档存档,不push、不发布、不打包。runtime_local、third_party_local、SDK压缩包、个人媒体和测试输出仍忽略;两个固定专有二进制不得提交。Git记录不含完整可运行环境,后续仍需原本机依赖。+++## Cycle86 最终独立验收与交接++只读review_video_sr限定范围PASS,无新增P0/P1/P2。preflight69 PASS,phase7 73 PASS,实际命令 `powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight` / `-Gate phase7`;delivery `logs/delivery/9f7468b334bc457db4b8bf125d4f5ddb/result.json`。减少的2项仅为用户明确删除的GOAL_PROMPT文件存在/hash检查,剩余10个控制文件身份保持。++实际RTX独立UI回归通过(`python scripts/acceptance/ui-settings-page-scope.py`);额外回归确认master-off保存.55/style1/FG2、重新开启真实应用;焦点内无效文本保留,失焦恢复;注入style2失败后回滚style1且按钮状态同步;滚轮确实滚页但不调参;还原默认生效。证据 `logs/video-sdk-trial-20260909/review86-ui.stdout.log`、`review86-extra-final.stdout.log`、`logs/settings-page-scope-79d029d4883e42fea08d53eecfcc65c6.log`。初次补测1秒等待不足,改为最长5秒观察真实回滚后通过,未用固定短等待误报产品失败。++EXE SHA256: `3BD470D51AD43F7C461F23AB6F9F9B7234DC6F33D84C9DDEB35A463663264E2C`。构建日志 `logs/video-sdk-trial-20260909/build-cycle86.log`;独立review前后跟踪指纹 `9d45fe7ff6b19a67b3a42db2215928b1aecf5b4f`不变,之后仅更新交接记录。单次测试均不足300秒。Cycle86修复可交本机实测;整体Phase7优化仍in_progress,既有统计窗口/间歇时序/实卡体验/长期稳定风险未宣称消失。下一任务见HANDOFF优先处理配置相关统计窗口。++本地Git checkpoint包括Cycles78–86已核对源码、使用指南、交接报告与授权的GOAL_PROMPT删除;不包含runtime/SDK/个人媒体,不push。实际提交ID以本次 `git log -1` 为准,避免在commit内容中制造自指hash。diff --git a/docs/PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.md b/docs/PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.mdnew file mode 100644index 00000000..d12ffddd--- /dev/null+++ b/docs/PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.md@@ -0,0 +1,29 @@+# Physical capture diagnosis — 2026-09-09++## Evidence and scope+Same running user process PID22300, same USB3 Video device0 nativeformat0 YUY2 1920x1080/60, kept open throughout. No product code or binaries changed; no competing capture/GPU process launched. Metadata enumeration confirmed USB3 Video. Existing app journal and same-session temporary settings comparisons, not external HDMI/photon measurement. Every comparison recorded13seconds; original selected quality4/nativeNR/FG2 restored in finally, final Appliedrevision22 confirms restoration. Scripts/logs under logs/video-sdk-trial-20260909.++## Main bottleneck+User snapshot revision3 withoutSR: NR1920x1080 median5.777ms. Revision5 enabled RTX Video SR quality4 and work3840x2160 while NRpolicy was Native: NR ALSO became3840x2160. Revision12 NRmedian22.911ms/P9524.261, SRmedian6.617/P957.114. Inputcallback60.01fps, application processedabout30fps, droppedabout30fps. More than16.7ms/sourceframe at60fps; even NRalone exceeds that. SR->NR->FG order is already correct.++This is a workload/configuration interaction, not evidence that the card cannot produce60fps. Capture latest-frame mailbox overwrites stale frames when processing lags. CaptureCardSource flags Drop; full history resets break valid FG pairs, explaining fewer effective generatedframes and uneven motion. Do not suppress these resets to inflate FG counts.++## Controlled comparisons (same source; FG2 unless stated)+After excluding first40 GPU samples for initialization, actual medians:+| Configuration | SR GPU ms | NR GPU ms | Observed source processing |+|---|---:|---:|---:|+| Original native4KNR + highest videoSR |6.617|22.911|about30fps|+| RealtimeNR + highest videoSR |6.497|6.100|51.16fps|+| RealtimeNR + low videoSR |1.505|6.366|59.51fps|++Stable last~5seconds of each13s comparison: high/realtime input60.04fps, processed51.16fps,45drops; low/realtime input59.90fps, processed59.51fps,2drops; low/realtime/FGoff input59.96fps, processed59.77fps,2drops,0generated. Prior FGon low had59.31generatedfps; submission/processing is not physicalscreen refresh. Highest/realtime has little budget left (flowabout.79ms, FGabout2.58ms plus remaining passes/scheduling), so highest alone remains less stable here.++Logs: capture-user-snapshot.log; physical-realtime-q4.log; physical-realtime-q1.log; physical-realtime-q1-nofg.log; physical-throughput.json; physical-ab-summary.json; physical-current-devices.txt. Originalsettings restoration logged in live app after17:46:46Z. NR remains Native and quality4 after testing, deliberately not silently replacing user's choices.++## Measurement problem+WorkspaceChrome.h explicitly displays GpuStage::Nr, labelled NR single stage. The familiar6/20ms aligns with NR stage; it is not entirepipeline/HDMI-to-display latency. EngineController TimingWindow retains1200 samples and is not cleared on settings transitions. Thus current capture P95 includes older high-cost configuration for roughly20seconds at60fps or40seconds at30fps. The13s FGoff trial's reported rolling63.858ms is contaminated by earlier configuration and cannot measure FGoff delay. Do NOT conclude disablingFG raised latency from that number. Current readAge .58ms also is not finaldisplay latency.++## Actions justified+For1080p60 to4K: start realtimeNR + RTXVideoSR low, then compare medium separately; FGoff for minimum additional waiting, FG2 if smoother motion is preferred. NativeNR remainsoptional and4Kexport unchanged. Avoid auto-switching away from explicitly chosenNative policy without uservisibility. Follow-up software fix should separate/clear timing windows on appliedsettings revision and display totalpipeline/stage costs clearly. This turn only diagnoses; no claimed latency code repair. Existing historical intermittent timing issue, sustained natural quality and true physicaldisplay latency remain unresolved. No currentphase advancement.++Correction: Cycle84 final revision22 multiplier1 means FG was NOT restored to original2X; only NativeNR/quality4 restored. Hiddenlegacycheckbox was stale. See docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md.diff --git a/docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md b/docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.mdnew file mode 100644index 00000000..92862ee1--- /dev/null+++ b/docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md@@ -0,0 +1,57 @@+# RTX Video / FRUC trial — 2026-09-09++## Scope+No product code or defaults changed. Existing Phase 7 timing failure remains. RTX Video SDK has not been installed or executed. FRUC was actually executed on RTX 5070 as a standalone diagnostic; this is not capture integration or performance acceptance.++## Official interfaces+- RTX Video SDK 1.1 offers video super resolution, artifact reduction and SDR-to-HDR, supports RTX 50 and D3D12; it is not frame interpolation: https://developer.nvidia.com/rtx-video-sdk/getting-started+- FRUC is part of Optical Flow SDK. Local 5.0.7 exposes D3D11/CUDA resources, not direct D3D12: https://docs.nvidia.com/video-technologies/optical-flow-sdk/nvfruc-programming-guide/index.html+- Official RTX Video download redirects to NVIDIA login, verified in browser and web tool. User was asked to download it to Downloads: https://developer.nvidia.com/downloads/rtx/sdk/rtx_video_sdk_v1.1.0.zip++## Actual evidence+Local NvOFFRUC.dll has Valid NVIDIA signature and SHA256 5A0B6701D30709E25E7E5B92CA46B18AAB1459160CECD4F629872369D85C8B0A.++Own diagnostic source and logs: `logs/video-sdk-trial-20260909/`. Build: `cmd.exe /c logs\video-sdk-trial-20260909\build.cmd`. Each fruc-create.exe invocation used an external 25-second watchdog; all completed in approximately one second. D3D11 NV12 1920x1080, two input textures, one output, shared fence. CPU upload/readback is diagnostic only, prohibited in the production capture implementation.++- `create.stdout.log`: Create=0 and Destroy=0 on RTX 5070.+- `process-ms.stdout.log`: synthetic checker/moving rectangle returned Process=0 but repeated previous frames; diagnostic correctly failed with process exit 6.+- `process-normalized.stdout.log`: changing timestamps to sample-style unit intervals still repeated frames; no claim of an internal cause.+- `process-natural-final.stdout.log`: natural image translated 8 pixels per source frame; four source frames produced three distinct non-repeated intermediates. Create/Register/Process/Unregister/Destroy all returned 0, process exit 0.+- `natural-metrics.json`: first intermediate vs known 4-pixel midpoint has 8-bit luma MAE 0.000005787. Repeated previous frame MAE 1.51549; simple blend MAE 1.16068. Output-to-blend MAE 1.16068, demonstrating this output was not a simple blend. This is one controlled grayscale translation, not evidence for complex game motion, HUD, occlusion or particles.++User player PID 20272 remained running. No capture device was opened by the probe. Concurrent GPU load precludes a performance comparison. No 4K FRUC throughput or capture latency claim.++## Integration proposal+1. RTX Video SR and DLSS SR should be mutually exclusive options in the shared graph. Obtain official SDK and test D3D12 locally before integration. Do not stack both upscalers.+2. FRUC and DLSSG should be mutually exclusive options. First validate D3D12-to-D3D11/CUDA shared GPU resources, fence ownership and color handling. No production pixel readback.+3. Interpolation must wait for real B after A: source intervals are 55.6ms at 18fps and 16.7ms at 60fps. Separate lookahead from computation. 18-to-36fps is not 60fps; arbitrary-rate scheduling needs separate validation.+4. Preserve shared reset semantics and composite player UI/subtitles after interpolation. A capture source's baked-in game HUD cannot automatically be excluded this way.+5. Compare equal input, output and NR settings; measure SR/NR/flow/FG/Present separately, first with NR disabled then enabled. Screenshot GPU99% does not isolate SR cost. A different upscaler does not remove NR cost.+6. Keep export integrity checks and current defaults unchanged until comparisons pass.++Next: obtain official RTX Video SDK for D3D12 SR trial; measure FRUC 1080p/4K and complex motion with user player stopped, then decide integration. No phase advancement, distribution claim or completed-delivery claim.+++## Cycle82 — user supplied RTX Video SDK; actual D3D12 trial++The earlier SDK-download blocker is resolved. User supplied `C:/Users/123/Downloads/RTX_Video_SDK_v1.1.0.zip`, 63,493,768 bytes, SHA256 ABF4F34E2B5A618E355B0D5A0365D8ECC3DB4396E756E4C850A867E1AE2ED69E. Extracted with path containment validation into ignored `third_party_local/nvidia/RTX_Video_SDK_1.1.0`. Packaged x64 release nvngx_vsr.dll has Valid signature and SHA256 C3D88EEA5FF7A548EDEFA66414CF6E77464D0947277C904F324DD23ABF58A1ED. This identifies the supplied file, not proof that NGX selected that exact binary instead of its driver-managed implementation; module snapshot did not identify a VSR DLL. SDK license and programming guide read locally. No distribution or product-default change.++Own independent diagnostic `logs/video-sdk-trial-20260909/vsr-trial.cpp` uses SDK headers/library and absolute feature search directory. Build command `cmd.exe /c logs\video-sdk-trial-20260909\build-vsr.cmd`; first link failed missing advapi32/user32, adding those dependencies fixed it. No SDK source copied into tracked product files. Preflight passed 71 checks (`preflight-cycle82.log`).++On RTX5070: Init/Capabilities/AvailableGet/Create/Evaluate/Release/DestroyParams/Shutdown all returned NGX success 0x1; Available=1. Native D3D12 RGBA8 input 1920x1080, output 3840x2160. First functional process exit0, then timestamp/debug process exit0. Every process externally bounded to25s, actual under7s. Each quality tested12 repeated evaluations of one static image; discard first4, summarize remaining8 GPU timestamps around Evaluate. Readback/upload excluded from GPU interval. This serialized diagnostic is not a production slot scheduler or end-to-end latency measurement.++| Quality | Median GPU ms | Observed min–max ms |+|---|---:|---:|+| 0, bicubic | 0.566 | 0.565–0.697 |+| 1, low | 1.374 | 1.373–1.542 |+| 2, medium | 1.774 | 1.771–1.776 |+| 3, high | 4.366 | 4.208–4.555 |+| 4, ultra | 5.857 | 5.769–6.167 |++Evidence: `vsr-timed.stdout.log`, `vsr-timing.json`, `vsr-output-metrics-final.json`. User player not running at checks before these trials; other GPU applications were not exhaustively audited. Do not compare against earlier concurrent or different-content DLSS timings. Eight static warmed samples do not prove sustained moving-video throughput.++Real output readbacks are nonblack. Quality1 differs from bicubic in13,656,811 RGB channels, MAE0.873805/255; quality4 differs in15,110,529 channels, MAE1.094184/255. Quality1 PNG visually inspected: recognizable reference image, no obvious black/garbled output. Difference is not proof of superior reconstruction: source was a resized user reference image, not native4K ground truth. No game/capture quality acceptance.++D3D12 debug error count0. Warnings were retained (buffer initial COPY_DEST state ignored/effectively COMMON); this is not a zero-message or GPU-based-validation claim. First cold host-completion figures46.3/5.4/60.2ms are not warmed GPU timing. Diagnostic has CPU upload/readback and waits only for measurement; never transplant those into capture.++Current assessment: video SR low/medium are viable candidates for integration, and official interface avoids caller-provided game motion/depth. No unconditional speed/quality promise; NR/FG cost remains. Next implement/review an optional shared-graph backend with proper encoded RGB boundary and bounded GPU scheduling, then equal-source capture A/B. FRUC GPU interop and complex-motion tests remain separate. Existing Phase7 timing failure remains; no gate advancement, no product build/change or delivery completion in this cycle.diff --git a/docs/RTX_VIDEO_SR_INTEGRATION_2026-09-09.md b/docs/RTX_VIDEO_SR_INTEGRATION_2026-09-09.mdnew file mode 100644index 00000000..ff59105d--- /dev/null+++ b/docs/RTX_VIDEO_SR_INTEGRATION_2026-09-09.md@@ -0,0 +1,32 @@+# RTX Video SR optional integration — 2026-09-09++Current Phase7 remains in progress; this is a candidate for local user testing, not full delivery completion.++## Changes+Professional enhancement panel adds a persistent algorithm selector: DLSS SR and RTX Video SR qualities1–4. Default remains DLSS, SR switch remains off unless requested. Select video-low or medium and enable SR; unchanged source/output size bypasses SR. Existing3840x2160 sources therefore bypass upscaling.++Shared EnhanceGraph uses linear source -> encoded RGBA8 -> VSR -> linear work texture -> NR -> output -> existing DLSSG. Normal-path conversion stays on GPU with the existing command ring; no new pixel readback or per-pass CPU fence wait. Separate VSR parameter block shares the existing NGX core. Player, images and video export receive the selected backend; export integrity checks unchanged. Preset schema3 persists the quality and reads versions1/2. Runtime and SDK remain ignored.++Modified production files: include/src ngx VideoSrBackend; EnhanceGraph; EnhancementSettings; EngineController; VideoExportJob; PresetStore; SettingsWindow; AppShell CLI/tooltip; ScaleBlit; CMakeLists; THIRD_PARTY_NOTICES. RepairPresetTests now covers video quality roundtrip and invalidquality5.++## Actual checks+Build scripts/build.ps1 -Root <project> -Preset x64-release passed; final log logs/video-sdk-trial-20260909/build-cycle83-switchfix.log. Local app starts with --video-sr 1 (or2), --nr --no-fg --realtime and --smoke-seconds8; external25second timeout. Synthetic1920x1080/60 glass-video.mp4 is the test source, not natural-game acceptance.++- low+NR:211frames,59.56processedfps,P95lateness1.53ms,failed=false. app-vsr-low.log.+- medium+NR:358frames,59.76fps,P951.56ms,failed=false. app-medium-nr.log.+- low+NR+DLSSG2X:365real/364generated,59.80sourcefps,P951.41ms,failed=false. app-low-nr-fg.log. These are processing/submission figures, not physical scanout or latency measurements.+- Integrated SR GPU medians after sourceframe30 include both color conversions: low1.486ms/181samples; medium1.896ms/328samples; low withFG1.499ms/335samples. NR medians5.797/5.804/5.817ms. FG1 median2.498ms in the FG case. Short synthetic measurements only.+- First capture attempt0:0:0 failed with0frames because current device0 was OBSVirtualCamera. Fresh --list found only OBS, no physicalUSBcard. app-capture-low-nr.log and capture-list.txt. NOT a physical capture pass.+- First selector test correctly FAILED: requested/Applied revisions changed but backend did not. Reviewer identified missing rebuild condition. Fixed by rebuilding for every quality/backend change and rejecting mismatched applySettings; existing rollback retained.+- Retest ui-switch.py: while SR on, quality1->2->DLSS0->1, three Applied revisions plus actual corresponding Create logs; exit0/pass=true,18second smoke. app-switch-beforefix.log retained; app-switch.log final. GUI draft clearing found by reviewer fixed by preserving dirty and cancelling pending slider timer; independent verification pending.+- Preset roundtrip/invalid/legacy1 migration/corrupt preservation test passed. V2 parser remains supported; dedicated new V2 test not yet run.+- --export-out export-vsr-low.mp4 --max-frames12 --video-sr1 --nr --no-fg: exit0, native4K NR, real D3D12NVENC. ffprobe count_frames confirms H2643840x2160/12frames; decoded firstframe visually checked as expected nonblack checker. Input has no audio, so this does not prove audio retention. export-vsr-low.log/png.++All paths above under logs/video-sdk-trial-20260909. Actual VSR Create/Evaluate/Release op results0x1 andSEH0 in application logs. No DLSS/NR binary modified. All new code remains uncommitted candidate pending final review/gate. Existing intermittent Phase7 timing failure not erased by these narrow results.++Next: final independent scoped review then user reconnects physical card and tests video-low/medium with same source/settings. FRUC remains standalone diagnostic, not integrated in this change.++## Cycle83 independent final scoped PASS+Independent review_video_sr: no remaining introduced P0/P1/P2; original backend-switch P1 and draft-loss P2 closed. Independent low->medium->DLSS->low:3 applied transitions, VSR Create/Evaluate/Release3/401/3 all0x1/SEH0; DLSS Create1. Draft0.314159 retained across all3 changes, never secretly applied. Preset v2 protection/feather and defaultquality0 retained; v3quality2 roundtrip and invalid5 rejection pass.+Preflight71PASS; phase7 delivery a76caae2b03b4a96aaed4e4e1ab4eb71 45.295s/75PASS. Initial reviewer environment PSModulePath failure retained; fixed module search and reran. Evidence logs/video-sdk-trial-20260909/review-ui-switch.stdout.log, review-app-switch.log, review-preset.log. Tracked fingerprint98da728f82273048c095e9a12b2fe63c3114def9 unchanged during review; no tracked proprietary assets.+Final exeSHA37574BF6ACCA4E78A26EF10BE0D3AD0CDD90470D8A2353C6D551ACC798006A5B. User can choose Professional/Enhancement/RTX Video SR low or medium, enable SR with realtimeNR; test FGoff then2X. Physicalcard not enumerated this turn, onlyOBS; physical capture/naturalquality/longstability/unresolved historical intermittenttiming remain unaccepted. No overallGoal completion or distribution approval; no new integratedGBV claim.diff --git a/docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md b/docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.mdnew file mode 100644index 00000000..458bd4bc--- /dev/null+++ b/docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md@@ -0,0 +1,19 @@+# Settings cross-page submission repair — 2026-09-09++Actual user log snapshot: logs/video-sdk-trial-20260909/settings-anomaly-snapshot.log. Revision29: RTXVideoSRquality1 input1920x1080/output3840x2160, NR3840x2160 median22.135ms. Revision30: sameSRquality/output, NR1920x1080 median6.154ms, FG2 active. Thus20->6 reflects realNR dimension change, not FG accelerating the sameNR job. Exact historical clicks were not recorded; source defect below can cause this pattern.++SettingsWindow read() previously collected ALL pages including hiddenNRpolicy, model, SR andFG. Button212 used it to submit FG, potentially sending a stale/edited hiddenNRpolicy along withFG. Dirty drafts blocked normal populate, allowing visible/applied state mismatch. This is a settings transaction bug; SR->NR->FG order unchanged. Previous diagnosis of nativeNRcost was correct but insufficient to explain whyNRpolicy changed with aFG-page operation.++Fix: enhancement/FG draft flags separated; enhancement apply210 and slider timer read only enhancement fields; FGapply212 reads onlymultiplier/flow/content fromcurrentdesired base. Each keeps the otherpage'sdraft dirty. VSR207 independentselection preservesbothdraftflags. Preset save312 intentionallyreadsallpages, because it explicitly saves a fullpreset. Labels now say applyenhancement/applyFG.++Modified file apps/veyra/SettingsWindow.cpp plus regression scripts/acceptance/ui-settings-page-scope.py. Build scripts/build.ps1 -Root <project> -Preset x64-release passed, log logs/video-sdk-trial-20260909/build-cycle85.log. UserPID22300 closed normally to replaceexe; no forcedtermination, no sourcecode/pipeline/runtimemodification beyondUI. New app regression uses ownedprocess16s smoke/externalappwait25s. Source synthetic1080p60; SRlow/nativeNR starts, hiddenNRpolicyRealtime andstrength.314159 drafts; FGapplymustkeepnativeNR anddrafts; thenhiddenFGoffdraft withenhancementapplymustkeepFGon whileapplyingrealtimeNR. Actualexit0, passes bothdirections: logs/video-sdk-trial-20260909/app-page-scope.log and ui-page-scope.py output. Independentreviewpending. Existing overalltiming issues notdeclaredfixed.++Correction toCycle84: script read the hiddenlegacyFGcheckbox as restoration source; its state did not match the professionalpanel's appliedFG. Finalrevision22 multiplier1 proves FG was leftoff, although originalrevision12 hadFG2. NRnative andVSRquality4 were restored. Previous blanket claim alloriginalsettingsrestored was inaccurate; corrected to user. Future hardware comparisons must restore from actualappliedsettings, not hiddencheckboxes. This doesnotinvalidate captured same-configuration GPUtimings but affects finalsessionstate.+++## Cycle85 — settings page submission isolation: independent PASS+User anomaly log revision29 NR3840x2160 median22.135ms -> revision30 NR1920x1080 median6.154ms; RTX Video SR quality1/output4K unchanged. Historical exact clicks not logged. SettingsWindow FG apply previously submitted hidden enhancement fields; now FG and enhancement reads/submissions and dirty drafts are isolated. No GPU stage order change.+Changed product file: apps/veyra/SettingsWindow.cpp. Regression: scripts/acceptance/ui-settings-page-scope.py. Build command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root <project> -Preset x64-release; PASS, logs/video-sdk-trial-20260909/build-cycle85.log. Maker and independent command: python scripts/acceptance/ui-settings-page-scope.py; PASS (independent stdout logs/video-sdk-trial-20260909/review85-ui.stdout.log; app logs/settings-page-scope-72281e89bf974ce3a6f143945181cf2e.log). Independent actual revision4 intensity1/multiplier2 keeps nativeNR; revision5 applies realtimeNR with fg=1 and435 valid generated frames.+Independent commands: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight (71 PASS), same command -Gate phase7 (75 PASS,42.678s), logs/delivery/c2bd451c2bb844448b60e78a61714558/result.json. Reviewer review_video_sr: no new P0/P1/P2; no tracked writes. Frozen code fingerprint8f3ebcf6d5f68c02592f52a0194674b7b3f776ae. EXE SHA25688AE23C12616355858AE85A6F8D11E0AC441872A5117665578DF626CAA48306A. Actual RTX execution performed; proprietary assets remain untracked.+Correction superseding Cycle84 restoration claim: nativeNR and VSRquality4 restored, but originalFG2 was left OFF (revision22 multiplier1). Hidden legacy checkbox was stale and was an invalid restoration source. User notified; future comparisons must use applied settings.+Phase7 overall optimization remains in_progress. Scope PASS does not resolve historical intermittent timing or prove physical display latency. NR dial measures NR stage only; rolling windows still mix settings. Next task: configuration-specific timing windows and unambiguous metric display, followed by user real-card acceptance. User app was closed normally for rebuild; reopen updated app for real-card retest.diff --git a/docs/SR_MOTION_RESPONSE_2026-09-08.md b/docs/SR_MOTION_RESPONSE_2026-09-08.mdnew file mode 100644index 00000000..e558b84a--- /dev/null+++ b/docs/SR_MOTION_RESPONSE_2026-09-08.md@@ -0,0 +1,53 @@+# SR 运动指导受控对照++Cycle78,基线 `8fc00d4`。沿用 [4K 重建实验](SR_RECONSTRUCTION_2026-09-08.md) 的两个场景和全部输入、颜色、深度、SR 参数、零 jitter、历史 reset,单独替换 SR 运动输入。**准确的构造运动改善了这两个样本的 SR 误差,但仍未消除与普通空间缩放的时间稳定性差距;全部清零运动不是正确修复。**++## 诊断边界++`EnhanceGraphDesc.srMotionProbe` 为默认空的诊断借用资源,仅测试赋值。验证 SR 已启用、资源属于相同 D3D12 device、working extent、RG16F、单 mip / slice / sample、可读;错误尺寸、格式和关闭 SR 三种负对照必须拒绝,再成功初始化正常组。正常产品入口不设置它。++资源只替代 SR 的 Evaluate motion,NR/FG 路径未改。测试在源帧提交前同步上传并恢复 NON_PIXEL_SHADER_RESOURCE,持有到 graph drain/shutdown;这些上传、等待和像素回读不进入正常播放/导出。构造运动为 current→previous、单位为输出像素:背景 +4x,前景 -8x;RG16F 对应 half 位模式 0x4400 / 0xc800,y=0。首帧、出界和前后景身份变化位置写0。零向量不保证模型历史被安全排除。++各模式:0普通缩放;1现有 SR+估算运动;2重复模式1;3准确构造运动;4零运动;5把有效运动方向反转;6重复模式3;7现有估算运动但关闭 `validateMotion`,保留原有 NVOF cost 规则,不是无条件信任所有向量。++每组24帧真实1920×1080→3840×2160,SR24(空间组0)、NVOF23、reset1;两类重复组逐帧完整像素 hash 精确一致。24个评分帧不运行NR/FG,但共享图初始化仍创建这些 feature,并执行一次不参与评分的FG预热。++## 指标++下面只统计 frame4–23,跳过前4帧;时间误差的首个对应仍来自 frame3。称为跳过启动帧的观察窗口,**不证明模型已经收敛或达到稳态**。完整24帧的原始指标仍打印为 `SR_RECON`。单位和已知运动对齐、遮挡排除方法与上一实验相同。++| 场景 / SR运动 | MAE8 ↓ | 时间误差 MAE8 ↓ |+|---|---:|---:|+| 棋盘 / 普通缩放 | 15.9796 | 0.007211 |+| 棋盘 / 现有估算 | 12.8635 | 7.77054 |+| 棋盘 / 准确构造 | 12.7557 | 4.39519 |+| 棋盘 / 零运动 | 36.0011 | 3.47346 |+| 棋盘 / 反向运动 | 39.8038 | 8.57094 |+| 棋盘 / 关闭过滤 | 12.8615 | 7.13306 |+| 移动前景 / 普通缩放 | 1.92688 | 0.006755 |+| 移动前景 / 现有估算 | 1.73715 | 0.227132 |+| 移动前景 / 准确构造 | 1.56788 | 0.144580 |+| 移动前景 / 零运动 | 6.06699 | 0.752772 |+| 移动前景 / 反向运动 | 3.04345 | 0.998255 |+| 移动前景 / 关闭过滤 | 1.71319 | 0.221763 |++准确运动的改善证明当前 SR 对运动有实际响应,也说明估算运动是影响因素之一。但构造场景具有先验真实对应关系,普通视频没有这些信息;不能将该诊断资源接入正常播放伪装成“准确运动已实现”。剩余时间误差也不能直接归结为某个未经单独验证的参数。++棋盘场景中零运动虽然减小了时间误差,却显著增加空间误差,说明只优化单一时间指标会选出错误方案。周期纹理、整数位移有利于空间缩放;结论不推广为自然视频、亚像素运动或主观画质排名。不据此默认新增深度模型、切换 SR 或声称现有运动过滤全面更好。++## 命令与记录++```powershell+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root "$PWD" -Preset x64-release+out/build/x64-release/veyra_sr_reconstruction_tests.exe <唯一忽略目录> 0+out/build/x64-release/veyra_sr_reconstruction_tests.exe <另一个唯一忽略目录> 1+powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate phase7+```++构建日志 `logs/optimization-goal-20260908/build-cycle78-legacy.log` exit0。各进程隐藏启动并采用275秒 watchdog。++初始7组/场景:`sr-motion-0-022d569e0cf84219ae6e3961b0731294`44.835秒、`sr-motion-1-673362e8dc004b22b0b9f479e3931bfa`49.665秒;增加资源负对照后场景1 `sr-motion-contract-0d6e2bc37bbb4b169b3860fe2312ecdc`49.659秒,均exit0/debug0且指标复现。路径前缀均为 `logs/optimization-goal-20260908/`。负对照的3条预期 graph contract error 日志不代表GPU执行失败。++最终8组/场景:`sr-motion-final-0-978ea39fa951411f9a3f9d82f2239c41`48.652秒、`sr-motion-final-1-f755274a89804bd19d4da245b3a712b2`55.509秒,均exit0。关闭过滤在这两个样本的评分略好于当前过滤;没有形成默认移除过滤的充分证据,需要自然素材和错误运动场景交叉检查。准确运动相比两者仍有改善空间。++门禁与独立复核待完成。导出完整性检查不变;Phase7/Goal仍进行中,下一项是检验过滤对自然素材的效果并按证据选择具体修复。diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.mdindex 2d23cc51..9702ee68 100644--- a/docs/USER_GUIDE.md+++ b/docs/USER_GUIDE.md@@ -10,16 +10,16 @@展开和收起采用240毫秒动画,连续反向点击从当前展开位置返回。两种模式保留同一个视频宿主和播放会话,不重新打开文件,不套用另一套画质参数。专业模式的对比状态会记住,但日常模式恢复正常增强显示。小窗口通过“参数”按钮打开右侧抽屉。窗口空白处可拖动,边缘可调整尺寸;日常模式底部右侧提供最小化和关闭。-增强总开关关闭时真正旁路NR、SR与补帧,开启后恢复配置。关闭期间修改数值只保存待启用配置;直接开启专业NR或超分开关,也会开启总增强。NR和超分开关点击后立即请求生效,无需再点“应用整套设置”,数值草稿不会阻挡它们。界面显示“正在应用”时,以右栏已应用版本为准;失败会恢复实际状态。总增强正在切换时,新的整套参数提交暂不执行,草稿保留。+增强总开关关闭时真正旁路NR、SR与补帧,开启后恢复配置。关闭期间修改数值只保存待启用配置;直接开启专业NR或超分开关,也会开启总增强。NR和超分开关点击后立即请求生效,无需再点“应用整套设置”,其他输入框不会阻挡它们。界面显示“正在应用”时,以右栏已应用版本为准;失败会恢复实际状态。总增强正在切换时,新修改会明确提示未接受,待切换完成后重试。控制区使用 Windows 11 Desktop Acrylic:可透出窗口下方桌面或其他软件的模糊颜色,文字和按钮单独绘制。没有固定彩色渐变,也不会截取桌面再贴回界面。视频区始终不透明,没有打开媒体时纯黑;全屏关闭桌面材质,保留视频、字幕和可隐藏控制条。系统关闭透明效果、使用高对比度或不支持 Desktop Acrylic 时,会采用系统/实色回退,不会自动更改你的 Windows 设置。独立采集设置窗口仍为普通深色界面。## 播放和参数1. 点“打开视频”或拖入 H.264/HEVC 视频;PNG/JPEG图片自动进入专业模式。Ctrl+O打开文件。空格在视频/主窗口焦点下播放、暂停;输入框保留正常输入。-2. “DLSS 超分辨率 · 4K”将底图按比例放大到3840×2160范围,尺寸取偶数。16:9输出3840×2160;4:3输出2880×2160;已达到边界的画面跳过SR,避免拉伸。播放、图片保存和视频导出共用此尺寸规则。“实时NR档”保留该底图,约1080p内部NR的变化由GPU回填。状态显示输入、底图、NR、光流、FG与输出实际尺寸。-3. 取消“实时NR档”可选原生NR,性能成本更高,不承诺原生4K60。“补帧”配合2X/3X/4X选择,倍率表示每对源帧的总时间格数;无效生成或reset不会计作有效补帧。-4. 专业模式“增强”提供7项NR参数及5项变化量参数。可滚动查看,悬停数值框查看范围;数值框修改后点“应用整套设置”,滑杆采用120毫秒去抖。期望与已应用版本固定显示,真实帧边界整套应用,失败回滚;切换面板会保留草稿并取消尚未发出的延迟提交。参数修改不重新打开视频或归零进度。修改尺寸/光流会有有界资源重建。+2. “超分辨率 · 4K”总开关配合算法选择器(DLSS SR 或 RTX 视频超分低/中/高/最高)。它将底图按比例放大到3840×2160范围,尺寸取偶数。16:9输出3840×2160;4:3输出2880×2160;已达到边界的画面跳过SR,避免拉伸。播放、图片保存和视频导出共用此尺寸规则。“实时NR档”保留该底图,约1080p内部NR的变化由GPU回填。状态显示输入、底图、NR、光流、FG与输出实际尺寸。+3. NR模式选择器可选原生NR,性能成本更高,不承诺原生4K60。“补帧”配合2X/3X/4X选择,倍率表示每对源帧的总时间格数;无效生成或reset不会计作有效补帧。+4. 增强、补帧设置均即时提交,不再有“应用”按钮。拖动滑条、输入合法数值或选择选项后,在真实帧边界生效;每次只提交当前字段。输入未完成或越界时继续使用上次有效值,离开输入框会恢复有效值。参数区滚轮只滚动页面,不调滑条或下拉框;进度、音量滑条同样禁用滚轮,预览画面的滚轮缩放保留。风格为0/1/2按钮,自动遮罩与UI修正为开/关按钮,当前选项高亮。连续参数仍支持精确数值输入。顶部常驻“还原默认”恢复整套内建增强/补帧参数,保留用户预设及窗口偏好。改尺寸/算法/光流可能有资源重建,实时提交不代表零耗时。5. 肤质结构、风格、自动遮罩、画面内UI修正属于实验参数。当前合成样本未观察到肤质/UI修正的像素变化,不能保证实际效果;风格和自动遮罩已观察到变化。6. 预设支持新建、复制当前、重命名、删除、设默认、恢复内建默认,保存在 `runtime_local/user-presets.v1`。配置损坏会保留原文件并报错,不静默覆盖。7. 光流三档为性能/平衡/质量;界面记录实际应用档。共享光流会拒绝指向画面外的位移,并按前后画面的亮度回投误差降低不可靠位移;这是估计校验,不能保证消除遮挡拖影。30/50/60模式用于识别内容节奏,不会把源时间轴重采样成指定帧率。静止画面不能确认较低内容帧率。@@ -65,3 +65,8 @@窗口尺寸、位置、音量、字幕等保存在独立UI偏好中;只保存成功应用的画质。损坏的原配置保留,不静默覆盖。程序每次重启仍默认日常模式。本轮底栏和选择器修复见 `docs/UI_CONTROLS_V4_DELIVERY_2026-09-08.md`。此前真实毛玻璃、全屏及NR/SR修复见 `docs/UI_REPAIR_V3_DELIVERY_2026-09-08.md`,历史双模式结果见 `docs/UI_DUAL_MODE_DELIVERY_2026-09-08.md`,底层既有修复见 `docs/REPAIR_V2_DELIVERY_2026-09-08.md`。测试限制为每次最多300秒,历史累计时间仅作报告。+++## 2026-09-09 当前交接++最新交接见 [HANDOFF_2026-09-09.md](HANDOFF_2026-09-09.md)。RTX Video SR已接入共享管线;FRUC仅做过独立试验,产品补帧仍为DLSSG。NR表盘只表示NR阶段GPU耗时,不是采集到屏幕总延迟,统计窗口混合旧配置的问题尚待处理。USB3Video实卡已实测1080p60与4K18;设备未公开1440p格式,不人为伪造模式。diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex ef3fc2ca..bb298197 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -1243,3 +1243,53 @@ Actual1080->4K sharedgraph two24frame scenes: final0-b240e19c658c43d2bc06b06c4f4## Cycle77 independent final PASSreview_sr_reconstruction: full24frameSR/spatial metrics reproduced, SRrepeat exact; twoactualRTXinvocations17.861/22.122s, debug0; docs/REVIEW_SR_RECONSTRUCTION_2026-09-08.md. Independentpreflight71/phase7 268ee4b316bf4604bedafcd9b747b09c41.718s75PASS. DocumentationP2 initializationFGwarmup distinction fixedandreadonlyrereadclosed. No default/product/export change. Next isolate exactmotion vsestimated SR guidance, and natural material; recent-app source exists (ffprobe H2641920x1080,30000/1001,limitedBT709,56.689s), not native4K reference. FullGoalopen.++## Cycle78 SR motion response candidate+Actual two8mode 4K matrices final0-978ea39fa951411f9a3f9d82f2239c4148.652s andfinal1-f755274a89804bd19d4da245b3a712b255.509s exit0; resource width/format/disabled negativecontrols reject; SR24/NVOF23/reset1/debug0 andestimated/exact repeats identical. Exactmotion improveserrors, zero/inverseworsen spatial; defaultfilter slightlyworse thanlegacy onbothsyntheticcases. docs/SR_MOTION_RESPONSE_2026-09-08.md. NewSR-only borrowedprobe unsetinproduct; no defaults/export change. Frozen gate/reviewpending.++## Cycle79 — professional move/resize callback stack repair (2026-09-08)+User WER dump 33456: C000041D at module RVA BB0F7, same-object linker MAP identifies __chkstk; AppShell WndProc reserves0x36A28 bytes, nested layout/control/modal callbacks exhaust stack. Move 32768-wchar per-operation path buffers to vector heap storage; retain path capacity and independent modal lifetime. Fixed compiler reservation0x6A48 bytes. No STACK linker increase or exception swallowing.+Build: scripts/build.ps1 -Root <project> -Preset x64-release, exit0 (logs/optimization-goal-20260908/build-cycle79.log). Native bounded regression scripts/acceptance/ui-window-resize.py: empty18.265s (resize-1788881542706216600), playback18.578s (resize-1788881522216906600), each24moves/24sizes/4selectors, clean shutdown. Playback600NR/599NVOF, failed=false, P951.63ms. These are Win32 scripted operations, not physical mouse acceptance. Early old-binary probe did not reliably reproduce crash; old exit0 without smoke marker is not accepted evidence; final script requires actual completed smoke.+Preflight71PASS; phase7FAIL player-sync in logs/delivery/966863bd15a54bd58849984c73b5105d/result.json. Prior independentCycle78 alsoFAIL54.38ms, preceding this UI edit. No overall gate pass or latency fix claimed. Review pending; no checkpoint marking product passed.++Cycle79 final independent scopedPASS: review_window_stack found no remainingP0/P1/P2 in product fix or regression. Final empty regression logs/optimization-goal-20260908/resize-1788881908641248600/result.json:18.234s,24moves,24sizes,4selectoropens,cleanSmoke=true,exit0. Prior same-binary playback resize-1788881714808561400:18.594s,600NR/599NVOF,failed=false. SHA25686E1EE322C86B539FC7C280F10726AC721F05FF322D5C0CA778EE1F9608C5D45. External25s supervisor+5s cleanup; forced timeout inspected not fault-injected. User mouse acceptance remains; full Phase7 not passed, no product-completion checkpoint. Latest gate concurrent usercapture means no clean latency conclusion.++Cycle80 capture whitelist removed and labels identify native subtype. ActualUSB SS(noSSPlus), firmware UVC2x12 frame entries no1440p. 4K18 YUY2/MJPEG source testsPASS andapp107NR106NVOF,callback18.02fps,0drops. Details/commands/failures docs/CAPTURE_CARD_AUDIT_2026-09-08.md. User resumedcapture0:22:0 after update; no further exclusivehardware tests while in use. Independent scopedreview pending.++Cycle80 independent scopedPASS: metadata list + offline rawUSBdescriptor independently verified, code and actualsource/NRlogs agree, noP0/P1/P2. Preflight71PASS. FullPhase7notretested while user4Kcaptureactive; priorlatenessissueunresolved. Finalexe2587E014D349402254C23C8B82108539B4C586E2C4C1D2C558BC636EB4AB34EB. Audit report contains complete evidence.++## Cycle81 — video SDK trial 2026-09-09+RTX5070 FRUC standalone natural-pan test generated 3 distinct intermediates; Create/Register/Process/Unregister/Destroy=0. Synthetic tests repeated frames and correctly failed. Evidence and build commands: docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md. Each invocation external25s watchdog, final exit0. Player PID20272 remained running, no performance conclusion. RTX Video SDK requires official login and was not executed. No product changes or phase advancement; existing Phase7 timing failure remains. Next: SDK acquisition and isolated comparison before integration.++## Cycle82 — RTX Video D3D12 trial+User SDK received and safely extracted ignored. Actual RTX5070 Init/Create/Evaluate0x1 Available1; 1080p->4K all5quality outputs nonblack/different. Warm static8sample GPU medians q1=1.374ms q2=1.774ms q4=5.857ms; not end-to-end/capture comparison. Debug errors0 with retained warnings. Build/readback/timing/logs/limits in docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md. Preflight71PASS; per-process25s watchdog. No product code/default changes, Phase7 timing failure unchanged. Next optional shared backend and same-source A/B, not automatic default replacement.++## Cycle83 independent final scoped PASS+Independent review_video_sr: no remaining introduced P0/P1/P2; original backend-switch P1 and draft-loss P2 closed. Independent low->medium->DLSS->low:3 applied transitions, VSR Create/Evaluate/Release3/401/3 all0x1/SEH0; DLSS Create1. Draft0.314159 retained across all3 changes, never secretly applied. Preset v2 protection/feather and defaultquality0 retained; v3quality2 roundtrip and invalid5 rejection pass.+Preflight71PASS; phase7 delivery a76caae2b03b4a96aaed4e4e1ab4eb71 45.295s/75PASS. Initial reviewer environment PSModulePath failure retained; fixed module search and reran. Evidence logs/video-sdk-trial-20260909/review-ui-switch.stdout.log, review-app-switch.log, review-preset.log. Tracked fingerprint98da728f82273048c095e9a12b2fe63c3114def9 unchanged during review; no tracked proprietary assets.+Final exeSHA37574BF6ACCA4E78A26EF10BE0D3AD0CDD90470D8A2353C6D551ACC798006A5B. User can choose Professional/Enhancement/RTX Video SR low or medium, enable SR with realtimeNR; test FGoff then2X. Physicalcard not enumerated this turn, onlyOBS; physical capture/naturalquality/longstability/unresolved historical intermittenttiming remain unaccepted. No overallGoal completion or distribution approval; no new integratedGBV claim.++## Cycle84 physical capture diagnosis+Same userPID22300 USB3Video1920x1080YUY2/60 examined without reopening. NativeNR+highestVSR is bottleneck: NR22.911ms vs realtime6.100ms; same-source realtime/low restores59.51fps vs native/highabout30fps. Temporary q4/realtime,q1/realtime,q1/realtime/FGoff comparisons each13s; originalquality4/nativeNR/FG2 restored. No code/binary change. NRdial is not total latency; rolling1200sample P95 mixes prior settings, so noFGofflatency conclusion frommixedwindow. Report docs/PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.md; evidence logs/video-sdk-trial-20260909/physical-*. FullGoal open. Next revise metric windows/UI clarity and user chooses realtime/low forlive60fps.+++## Cycle85 — settings page submission isolation: independent PASS+User anomaly log revision29 NR3840x2160 median22.135ms -> revision30 NR1920x1080 median6.154ms; RTX Video SR quality1/output4K unchanged. Historical exact clicks not logged. SettingsWindow FG apply previously submitted hidden enhancement fields; now FG and enhancement reads/submissions and dirty drafts are isolated. No GPU stage order change.+Changed product file: apps/veyra/SettingsWindow.cpp. Regression: scripts/acceptance/ui-settings-page-scope.py. Build command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root <project> -Preset x64-release; PASS, logs/video-sdk-trial-20260909/build-cycle85.log. Maker and independent command: python scripts/acceptance/ui-settings-page-scope.py; PASS (independent stdout logs/video-sdk-trial-20260909/review85-ui.stdout.log; app logs/settings-page-scope-72281e89bf974ce3a6f143945181cf2e.log). Independent actual revision4 intensity1/multiplier2 keeps nativeNR; revision5 applies realtimeNR with fg=1 and435 valid generated frames.+Independent commands: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight (71 PASS), same command -Gate phase7 (75 PASS,42.678s), logs/delivery/c2bd451c2bb844448b60e78a61714558/result.json. Reviewer review_video_sr: no new P0/P1/P2; no tracked writes. Frozen code fingerprint8f3ebcf6d5f68c02592f52a0194674b7b3f776ae. EXE SHA25688AE23C12616355858AE85A6F8D11E0AC441872A5117665578DF626CAA48306A. Actual RTX execution performed; proprietary assets remain untracked.+Correction superseding Cycle84 restoration claim: nativeNR and VSRquality4 restored, but originalFG2 was left OFF (revision22 multiplier1). Hidden legacy checkbox was stale and was an invalid restoration source. User notified; future comparisons must use applied settings.+Phase7 overall optimization remains in_progress. Scope PASS does not resolve historical intermittent timing or prove physical display latency. NR dial measures NR stage only; rolling windows still mix settings. Next task: configuration-specific timing windows and unambiguous metric display, followed by user real-card acceptance. User app was closed normally for rebuild; reopen updated app for real-card retest.+++Cycle86 safety stop: build passed (logs/video-sdk-trial-20260909/build-cycle86.log), but preflight reports file:loop/GOAL_PROMPT.md and control:loop/GOAL_PROMPT.md missing. This deletion was present before Cycle86 edits. Per AGENTS control-plane rule, stopped before GPU regression, independent review and checkpoint; no manifest/gate rebaseline and no restoration of user deletion. UI changes remain unverified candidate. Ask user to authorize restoring the exact tracked GOAL_PROMPT.md from HEAD, then resume verification/documentation/local checkpoint.+++## Cycle86 最终独立验收与交接++只读review_video_sr限定范围PASS,无新增P0/P1/P2。preflight69 PASS,phase7 73 PASS,实际命令 `powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight` / `-Gate phase7`;delivery `logs/delivery/9f7468b334bc457db4b8bf125d4f5ddb/result.json`。减少的2项仅为用户明确删除的GOAL_PROMPT文件存在/hash检查,剩余10个控制文件身份保持。++实际RTX独立UI回归通过(`python scripts/acceptance/ui-settings-page-scope.py`);额外回归确认master-off保存.55/style1/FG2、重新开启真实应用;焦点内无效文本保留,失焦恢复;注入style2失败后回滚style1且按钮状态同步;滚轮确实滚页但不调参;还原默认生效。证据 `logs/video-sdk-trial-20260909/review86-ui.stdout.log`、`review86-extra-final.stdout.log`、`logs/settings-page-scope-79d029d4883e42fea08d53eecfcc65c6.log`。初次补测1秒等待不足,改为最长5秒观察真实回滚后通过,未用固定短等待误报产品失败。++EXE SHA256: `3BD470D51AD43F7C461F23AB6F9F9B7234DC6F33D84C9DDEB35A463663264E2C`。构建日志 `logs/video-sdk-trial-20260909/build-cycle86.log`;独立review前后跟踪指纹 `9d45fe7ff6b19a67b3a42db2215928b1aecf5b4f`不变,之后仅更新交接记录。单次测试均不足300秒。Cycle86修复可交本机实测;整体Phase7优化仍in_progress,既有统计窗口/间歇时序/实卡体验/长期稳定风险未宣称消失。下一任务见HANDOFF优先处理配置相关统计窗口。++本地Git checkpoint包括Cycles78–86已核对源码、使用指南、交接报告与授权的GOAL_PROMPT删除;不包含runtime/SDK/个人媒体,不push。实际提交ID以本次 `git log -1` 为准,避免在commit内容中制造自指hash。diff --git a/include/veyra/engine/EnhancementSettings.h b/include/veyra/engine/EnhancementSettings.hindex d722a488..bd8fde39 100644--- a/include/veyra/engine/EnhancementSettings.h+++ b/include/veyra/engine/EnhancementSettings.h@@ -39,6 +39,7 @@ struct EnhancementSettings {ResidualSettings residual;ProtectionSettings protection;bool nr=true,sr=false;+ uint32_t videoSrQuality=0; // 0 DLSS SR; 1–4 RTX Video SRuint32_t multiplier=1;pipeline::NrSizePolicy nrPolicy=pipeline::NrSizePolicy::Realtime;FlowQuality flow=FlowQuality::Balanced;@@ -52,6 +53,7 @@ struct EnhancementSettings {if(model.skin!=-1&&!range(model.skin,2))return "skin parameter out of range";if(model.style<0||model.style>2||model.autoMask<0||model.autoMask>1||model.uiCorrection<0||model.uiCorrection>1)return "invalid experimental parameter";for(float v:{residual.total,residual.darken,residual.brighten,residual.color,residual.luminance})if(!range(v,2))return "residual parameter out of range";+ if(videoSrQuality>4)return "invalid video SR quality";if(multiplier<1||multiplier>4)return "unsupported multiplier";if(nrPolicy!=pipeline::NrSizePolicy::Realtime&&nrPolicy!=pipeline::NrSizePolicy::Native)return "invalid NR size policy";if(flow<FlowQuality::Performance||flow>FlowQuality::Quality||content<ContentRate::Transport||content>ContentRate::Fps60)return "invalid flow/content mode";diff --git a/include/veyra/ngx/VideoSrBackend.h b/include/veyra/ngx/VideoSrBackend.hnew file mode 100644index 00000000..46746f16--- /dev/null+++ b/include/veyra/ngx/VideoSrBackend.h@@ -0,0 +1,19 @@+#pragma once+#include <d3d12.h>+#include <nvsdk_ngx.h>+#include "veyra/ngx/NgxCoreHost.h"+namespace veyra::ngx {+// Independent adapter to the RTX Video SDK 1.1 documented VSR parameter ABI.+// Uses the existing NGX core session; input/output are encoded SDR RGBA8.+class VideoSrBackend {+public:+ ~VideoSrBackend(){release();}+ bool create(NgxCoreHost&,ID3D12GraphicsCommandList*);+ bool evaluate(ID3D12GraphicsCommandList*,ID3D12Resource*,ID3D12Resource*,unsigned);+ void release();+private:+ NgxCoreHost* core_=nullptr;+ NVSDK_NGX_Parameter* params_=nullptr;+ NVSDK_NGX_Handle* handle_=nullptr;+};+}diff --git a/include/veyra/pipeline/EnhanceGraph.h b/include/veyra/pipeline/EnhanceGraph.hindex 052b5d80..a9fc24f5 100644--- a/include/veyra/pipeline/EnhanceGraph.h+++ b/include/veyra/pipeline/EnhanceGraph.h@@ -42,6 +42,7 @@ class CommandSlotRing;namespace veyra::ngx {class NgxCoreHost;class DlssSrBackend;+class VideoSrBackend;class DlssFgBackend;class DlssNrRuntimeAdapter;class NvOfSession;@@ -55,6 +56,7 @@ struct EnhanceGraphDesc {uint32_t sourceHeight = 0;uint32_t workWidth = 3840;uint32_t workHeight = 2160;+ uint32_t videoSrQuality=0;bool enableSr = false; // upscale source -> work extent (1:1 bypass otherwise)bool enableNr = true;bool enableFg = true;@@ -78,6 +80,10 @@ struct EnhanceGraphDesc {// Isolated contract probes only. Unset by every product entry point.// Caller retains any supplied resources until graph drain/shutdown.std::function<void(NVSDK_NGX_Parameter*,ID3D12Resource*,ID3D12Resource*,uint32_t,uint32_t)> nrParameterProbe;+ // Isolated SR diagnostics only; unset by product entry points. Borrowed+ // working-extent RG16F current->previous pixel motion, ready in SRV state.+ // Caller retains it through graph drain/shutdown, synchronizing any writes.+ ID3D12Resource* srMotionProbe = nullptr;};class EnhanceGraph {@@ -213,6 +219,7 @@ private:uint8_t* mappedRgb_[2]={};size_t rgbPitch_=0;ComPtr<ID3D12Resource> workRgba_;+ ComPtr<ID3D12Resource> videoSrInput_,videoSrOutput_;ComPtr<ID3D12Resource> nrInput_,residualRgba_,nrFlow_,baseFlow_;ComPtr<ID3D12Resource> proxyTex_;ComPtr<ID3D12Resource> neuralTex_;@@ -250,6 +257,7 @@ private:std::unique_ptr<ngx::NgxCoreHost> coreHost_;std::unique_ptr<ngx::DlssNrRuntimeAdapter> nrAdapter_;std::unique_ptr<ngx::DlssSrBackend> srBackend_;+ std::unique_ptr<ngx::VideoSrBackend> videoSrBackend_;std::unique_ptr<ngx::DlssFgBackend> fgBackend_;NVSDK_NGX_Parameter* ngxParams_ = nullptr;NVSDK_NGX_Handle* nrHandle_ = nullptr;diff --git a/loop/CONTROL_HASHES.json b/loop/CONTROL_HASHES.jsonindex f3b099ef..bd215a3c 100644--- a/loop/CONTROL_HASHES.json+++ b/loop/CONTROL_HASHES.json@@ -26,10 +26,6 @@"path": "docs/COMPETITOR_AUDIT_2026-09-03.md","sha256": "4A8F7384AFB92F17EEB43265A6E4B0FAD0764FD8A5252142A43DC86C243AF5C7"},- {- "path": "loop/GOAL_PROMPT.md",- "sha256": "CCCF90513A0CE66943CADC4C36B83D19FFD337F550E81EEA115AB59BC25748FF"- },{"path": "loop/LOOP_ENGINE.md","sha256": "FF576DB39B94748948B9EEC547FC33A145F8DEB64529E2A843F3123F2A85433A"diff --git a/loop/EVIDENCE.md b/loop/EVIDENCE.mdindex 8a2b36bb..4b0f125f 100644--- a/loop/EVIDENCE.md+++ b/loop/EVIDENCE.md@@ -546,3 +546,53 @@ Actual1080->4K sharedgraph two24frame scenes: final0-b240e19c658c43d2bc06b06c4f4## Cycle77 independent final PASSreview_sr_reconstruction: full24frameSR/spatial metrics reproduced, SRrepeat exact; twoactualRTXinvocations17.861/22.122s, debug0; docs/REVIEW_SR_RECONSTRUCTION_2026-09-08.md. Independentpreflight71/phase7 268ee4b316bf4604bedafcd9b747b09c41.718s75PASS. DocumentationP2 initializationFGwarmup distinction fixedandreadonlyrereadclosed. No default/product/export change. Next isolate exactmotion vsestimated SR guidance, and natural material; recent-app source exists (ffprobe H2641920x1080,30000/1001,limitedBT709,56.689s), not native4K reference. FullGoalopen.++## Cycle78 SR motion response candidate+Actual two8mode 4K matrices final0-978ea39fa951411f9a3f9d82f2239c4148.652s andfinal1-f755274a89804bd19d4da245b3a712b255.509s exit0; resource width/format/disabled negativecontrols reject; SR24/NVOF23/reset1/debug0 andestimated/exact repeats identical. Exactmotion improveserrors, zero/inverseworsen spatial; defaultfilter slightlyworse thanlegacy onbothsyntheticcases. docs/SR_MOTION_RESPONSE_2026-09-08.md. NewSR-only borrowedprobe unsetinproduct; no defaults/export change. Frozen gate/reviewpending.++## Cycle79 — professional move/resize callback stack repair (2026-09-08)+User WER dump 33456: C000041D at module RVA BB0F7, same-object linker MAP identifies __chkstk; AppShell WndProc reserves0x36A28 bytes, nested layout/control/modal callbacks exhaust stack. Move 32768-wchar per-operation path buffers to vector heap storage; retain path capacity and independent modal lifetime. Fixed compiler reservation0x6A48 bytes. No STACK linker increase or exception swallowing.+Build: scripts/build.ps1 -Root <project> -Preset x64-release, exit0 (logs/optimization-goal-20260908/build-cycle79.log). Native bounded regression scripts/acceptance/ui-window-resize.py: empty18.265s (resize-1788881542706216600), playback18.578s (resize-1788881522216906600), each24moves/24sizes/4selectors, clean shutdown. Playback600NR/599NVOF, failed=false, P951.63ms. These are Win32 scripted operations, not physical mouse acceptance. Early old-binary probe did not reliably reproduce crash; old exit0 without smoke marker is not accepted evidence; final script requires actual completed smoke.+Preflight71PASS; phase7FAIL player-sync in logs/delivery/966863bd15a54bd58849984c73b5105d/result.json. Prior independentCycle78 alsoFAIL54.38ms, preceding this UI edit. No overall gate pass or latency fix claimed. Review pending; no checkpoint marking product passed.++Cycle79 final independent scopedPASS: review_window_stack found no remainingP0/P1/P2 in product fix or regression. Final empty regression logs/optimization-goal-20260908/resize-1788881908641248600/result.json:18.234s,24moves,24sizes,4selectoropens,cleanSmoke=true,exit0. Prior same-binary playback resize-1788881714808561400:18.594s,600NR/599NVOF,failed=false. SHA25686E1EE322C86B539FC7C280F10726AC721F05FF322D5C0CA778EE1F9608C5D45. External25s supervisor+5s cleanup; forced timeout inspected not fault-injected. User mouse acceptance remains; full Phase7 not passed, no product-completion checkpoint. Latest gate concurrent usercapture means no clean latency conclusion.++Cycle80 capture whitelist removed and labels identify native subtype. ActualUSB SS(noSSPlus), firmware UVC2x12 frame entries no1440p. 4K18 YUY2/MJPEG source testsPASS andapp107NR106NVOF,callback18.02fps,0drops. Details/commands/failures docs/CAPTURE_CARD_AUDIT_2026-09-08.md. User resumedcapture0:22:0 after update; no further exclusivehardware tests while in use. Independent scopedreview pending.++Cycle80 independent scopedPASS: metadata list + offline rawUSBdescriptor independently verified, code and actualsource/NRlogs agree, noP0/P1/P2. Preflight71PASS. FullPhase7notretested while user4Kcaptureactive; priorlatenessissueunresolved. Finalexe2587E014D349402254C23C8B82108539B4C586E2C4C1D2C558BC636EB4AB34EB. Audit report contains complete evidence.++## Cycle81 — video SDK trial 2026-09-09+RTX5070 FRUC standalone natural-pan test generated 3 distinct intermediates; Create/Register/Process/Unregister/Destroy=0. Synthetic tests repeated frames and correctly failed. Evidence and build commands: docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md. Each invocation external25s watchdog, final exit0. Player PID20272 remained running, no performance conclusion. RTX Video SDK requires official login and was not executed. No product changes or phase advancement; existing Phase7 timing failure remains. Next: SDK acquisition and isolated comparison before integration.++## Cycle82 — RTX Video D3D12 trial+User SDK received and safely extracted ignored. Actual RTX5070 Init/Create/Evaluate0x1 Available1; 1080p->4K all5quality outputs nonblack/different. Warm static8sample GPU medians q1=1.374ms q2=1.774ms q4=5.857ms; not end-to-end/capture comparison. Debug errors0 with retained warnings. Build/readback/timing/logs/limits in docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md. Preflight71PASS; per-process25s watchdog. No product code/default changes, Phase7 timing failure unchanged. Next optional shared backend and same-source A/B, not automatic default replacement.++## Cycle83 independent final scoped PASS+Independent review_video_sr: no remaining introduced P0/P1/P2; original backend-switch P1 and draft-loss P2 closed. Independent low->medium->DLSS->low:3 applied transitions, VSR Create/Evaluate/Release3/401/3 all0x1/SEH0; DLSS Create1. Draft0.314159 retained across all3 changes, never secretly applied. Preset v2 protection/feather and defaultquality0 retained; v3quality2 roundtrip and invalid5 rejection pass.+Preflight71PASS; phase7 delivery a76caae2b03b4a96aaed4e4e1ab4eb71 45.295s/75PASS. Initial reviewer environment PSModulePath failure retained; fixed module search and reran. Evidence logs/video-sdk-trial-20260909/review-ui-switch.stdout.log, review-app-switch.log, review-preset.log. Tracked fingerprint98da728f82273048c095e9a12b2fe63c3114def9 unchanged during review; no tracked proprietary assets.+Final exeSHA37574BF6ACCA4E78A26EF10BE0D3AD0CDD90470D8A2353C6D551ACC798006A5B. User can choose Professional/Enhancement/RTX Video SR low or medium, enable SR with realtimeNR; test FGoff then2X. Physicalcard not enumerated this turn, onlyOBS; physical capture/naturalquality/longstability/unresolved historical intermittenttiming remain unaccepted. No overallGoal completion or distribution approval; no new integratedGBV claim.++## Cycle84 physical capture diagnosis+Same userPID22300 USB3Video1920x1080YUY2/60 examined without reopening. NativeNR+highestVSR is bottleneck: NR22.911ms vs realtime6.100ms; same-source realtime/low restores59.51fps vs native/highabout30fps. Temporary q4/realtime,q1/realtime,q1/realtime/FGoff comparisons each13s; originalquality4/nativeNR/FG2 restored. No code/binary change. NRdial is not total latency; rolling1200sample P95 mixes prior settings, so noFGofflatency conclusion frommixedwindow. Report docs/PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.md; evidence logs/video-sdk-trial-20260909/physical-*. FullGoal open. Next revise metric windows/UI clarity and user chooses realtime/low forlive60fps.+++## Cycle85 — settings page submission isolation: independent PASS+User anomaly log revision29 NR3840x2160 median22.135ms -> revision30 NR1920x1080 median6.154ms; RTX Video SR quality1/output4K unchanged. Historical exact clicks not logged. SettingsWindow FG apply previously submitted hidden enhancement fields; now FG and enhancement reads/submissions and dirty drafts are isolated. No GPU stage order change.+Changed product file: apps/veyra/SettingsWindow.cpp. Regression: scripts/acceptance/ui-settings-page-scope.py. Build command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root <project> -Preset x64-release; PASS, logs/video-sdk-trial-20260909/build-cycle85.log. Maker and independent command: python scripts/acceptance/ui-settings-page-scope.py; PASS (independent stdout logs/video-sdk-trial-20260909/review85-ui.stdout.log; app logs/settings-page-scope-72281e89bf974ce3a6f143945181cf2e.log). Independent actual revision4 intensity1/multiplier2 keeps nativeNR; revision5 applies realtimeNR with fg=1 and435 valid generated frames.+Independent commands: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight (71 PASS), same command -Gate phase7 (75 PASS,42.678s), logs/delivery/c2bd451c2bb844448b60e78a61714558/result.json. Reviewer review_video_sr: no new P0/P1/P2; no tracked writes. Frozen code fingerprint8f3ebcf6d5f68c02592f52a0194674b7b3f776ae. EXE SHA25688AE23C12616355858AE85A6F8D11E0AC441872A5117665578DF626CAA48306A. Actual RTX execution performed; proprietary assets remain untracked.+Correction superseding Cycle84 restoration claim: nativeNR and VSRquality4 restored, but originalFG2 was left OFF (revision22 multiplier1). Hidden legacy checkbox was stale and was an invalid restoration source. User notified; future comparisons must use applied settings.+Phase7 overall optimization remains in_progress. Scope PASS does not resolve historical intermittent timing or prove physical display latency. NR dial measures NR stage only; rolling windows still mix settings. Next task: configuration-specific timing windows and unambiguous metric display, followed by user real-card acceptance. User app was closed normally for rebuild; reopen updated app for real-card retest.+++Cycle86 safety stop: build passed (logs/video-sdk-trial-20260909/build-cycle86.log), but preflight reports file:loop/GOAL_PROMPT.md and control:loop/GOAL_PROMPT.md missing. This deletion was present before Cycle86 edits. Per AGENTS control-plane rule, stopped before GPU regression, independent review and checkpoint; no manifest/gate rebaseline and no restoration of user deletion. UI changes remain unverified candidate. Ask user to authorize restoring the exact tracked GOAL_PROMPT.md from HEAD, then resume verification/documentation/local checkpoint.+++## Cycle86 最终独立验收与交接++只读review_video_sr限定范围PASS,无新增P0/P1/P2。preflight69 PASS,phase7 73 PASS,实际命令 `powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight` / `-Gate phase7`;delivery `logs/delivery/9f7468b334bc457db4b8bf125d4f5ddb/result.json`。减少的2项仅为用户明确删除的GOAL_PROMPT文件存在/hash检查,剩余10个控制文件身份保持。++实际RTX独立UI回归通过(`python scripts/acceptance/ui-settings-page-scope.py`);额外回归确认master-off保存.55/style1/FG2、重新开启真实应用;焦点内无效文本保留,失焦恢复;注入style2失败后回滚style1且按钮状态同步;滚轮确实滚页但不调参;还原默认生效。证据 `logs/video-sdk-trial-20260909/review86-ui.stdout.log`、`review86-extra-final.stdout.log`、`logs/settings-page-scope-79d029d4883e42fea08d53eecfcc65c6.log`。初次补测1秒等待不足,改为最长5秒观察真实回滚后通过,未用固定短等待误报产品失败。++EXE SHA256: `3BD470D51AD43F7C461F23AB6F9F9B7234DC6F33D84C9DDEB35A463663264E2C`。构建日志 `logs/video-sdk-trial-20260909/build-cycle86.log`;独立review前后跟踪指纹 `9d45fe7ff6b19a67b3a42db2215928b1aecf5b4f`不变,之后仅更新交接记录。单次测试均不足300秒。Cycle86修复可交本机实测;整体Phase7优化仍in_progress,既有统计窗口/间歇时序/实卡体验/长期稳定风险未宣称消失。下一任务见HANDOFF优先处理配置相关统计窗口。++本地Git checkpoint包括Cycles78–86已核对源码、使用指南、交接报告与授权的GOAL_PROMPT删除;不包含runtime/SDK/个人媒体,不push。实际提交ID以本次 `git log -1` 为准,避免在commit内容中制造自指hash。diff --git a/loop/GOAL_PROMPT.md b/loop/GOAL_PROMPT.mddeleted file mode 100644index be35623c..00000000--- a/loop/GOAL_PROMPT.md+++ /dev/null@@ -1,7 +0,0 @@-# Veyra 当前 Goal 入口--按 `docs/ACTIVE_DELIVERY_PLAN.md` F0→F6 接管完成本机软件。先读 AGENTS/README/Playbook/ProductSpec/竞品审查与当前 WORKLOG/STATE,再 preflight。保留固定 runtime 和用户未提交改动。已有真实共享 pipeline,修输入/证据/Guidance,接共享 controller、Win32 Player、WIC 图片、D3D12 NVENC 视频和 DirectShow Capture。--用户授权每次完整自动测试 <=300 秒,优先短测;不再跑旧30分钟矩阵。当前采集卡未连接,由用户亲自实卡验收,标 awaiting_user_capture_test;实现与视频验证继续,不假报硬件通过。允许跨旧阶段开展独立产品实现,验收状态不冒进。--Maker 唯一写入;每轮 JOURNAL 先记假设和窄测,改后记录真实退出/输出到 STATE/EVIDENCE/WORKLOG。最终只读独立 Reviewer 检查。禁止修改固定 runtime、下载其他泄露版本、关远程/更新驱动、上传/打包/发布。公网分发权未解决保持 distribution_blocked。Goal 完成指本次约定的本机软件交付,不表示公开授权。检测 STOP 立即停机;代码缺陷继续修,不把历史假统计当完成。diff --git a/loop/JOURNAL.md b/loop/JOURNAL.mdindex 9c1e1e18..9b4caa41 100644--- a/loop/JOURNAL.md+++ b/loop/JOURNAL.md@@ -1583,3 +1583,93 @@ Cycle77 independent initial review: two scenes reproduced17.861/22.122s, phase7## Cycle77 independent final PASSreview_sr_reconstruction: full24frameSR/spatial metrics reproduced, SRrepeat exact; twoactualRTXinvocations17.861/22.122s, debug0; docs/REVIEW_SR_RECONSTRUCTION_2026-09-08.md. Independentpreflight71/phase7 268ee4b316bf4604bedafcd9b747b09c41.718s75PASS. DocumentationP2 initializationFGwarmup distinction fixedandreadonlyrereadclosed. No default/product/export change. Next isolate exactmotion vsestimated SR guidance, and natural material; recent-app source exists (ffprobe H2641920x1080,30000/1001,limitedBT709,56.689s), not native4K reference. FullGoalopen.++## Cycle78 - isolate SR motion guidance+Previous Goal turn progress:8fc00d4 measured real4K spatial/temporal tradeoff and independentreview. Clean/noSTOP. Extend reconstruction diagnostic with borrowed validated SR-only motion resource override, unset in product. Compare exactconstructed current-to-previous outputpixels, zero, inverse and exactrepeat; retain sameRGB/depth/jitter/settings. Exclude invalid/outofbounds correspondence fromoracle, firstframezero. Add post-first4frames metrics. Do not defaultinject synthetic motion or callit gameequivalent; no exportchanges. Eachprocess275s.++## Cycle78 SR motion response candidate+Actual two8mode 4K matrices final0-978ea39fa951411f9a3f9d82f2239c4148.652s andfinal1-f755274a89804bd19d4da245b3a712b255.509s exit0; resource width/format/disabled negativecontrols reject; SR24/NVOF23/reset1/debug0 andestimated/exact repeats identical. Exactmotion improveserrors, zero/inverseworsen spatial; defaultfilter slightlyworse thanlegacy onbothsyntheticcases. docs/SR_MOTION_RESPONSE_2026-09-08.md. NewSR-only borrowedprobe unsetinproduct; no defaults/export change. Frozen gate/reviewpending.++Cycle78 independent diagnostic16casesPASS butphase7 FAIL565d2bc523b24281b1183d0d16a563cd:playerP95lateness54.38ms>50,251source250generated. Reviewer no introducedcodefindings; preserveFAIL,no checkpoint. Compareexistingtimestamps: actualhost-vsPTSdrift grows~57ms afterframe125; GPUstages onlymodestlyrise, sameEXEmakergateP952.88. No concurrentGPU; CPUsourcepreview ended37sbeforefailedplayer. Hypothesis diagnosticfile+stdout synchronousflush reducesbudget margin; bounded matched A/B file-vsNUL withfullstdout retained, no code/gate change. Notrerunninguntilgreen or assertingrootcause.+++Cycle78 timing attempt2 log A/B rejected as sufficientcause: player-log-ab-955f8d3058d94846a76d8850b393d4b5 file/nul/nul/file12s all exit0 butP95 7.83/4.44/351.96/477.54. GPUstage means similar; no lingeringVeyra; postrun GPU43C2percent (doesnotprovepastload). Attempt3 test standard Playback MMCSS scope onvideo/captureworker; officialMicrosoft Playback task, no registry/processpriority changes, failsoftandthreadRAIIrevert. Diagnosticdisableenvfor matched A/B, existinggate50msunchanged. This is a candidate, not rootcause/fixed claim.++MMCSS matched on/off/off/on12s P95=18.92/4.15/4.85/1.81; registration/revertworked butlatenessbenefitnotestablished. Preservecandidateheader/diff/EXEidentityinignored player-mmcss-ab-04257f7df23a4641a8598792f0574766; removeunproven defaultintegration. No registry/process priority changes made. Existingplayer-timing proves decodeP95~.1ms, graphsubmit~3-5ms,GPUready~12-13ms,present~.7-1.2ms; these marginal distributions not additive worst-case bound, but serialized critical path warrantsflow-resolution budget investigation. Phase7 remains failed pendingactualfix, no checkpoint.++## Cycle 79 — professional window move/resize crash (2026-09-08)+User-reported repeated immediate crashes take priority over Cycle78 timing investigation. STOP absent. WER four Event1000 records at 23:18–23:24 share exception C000041D / RVA BB0F7. Local minidump 33456 and same-object MAP place fault inside __chkstk; AppShell proc prologue reserves 0x36A28 (223784) bytes each invocation. Stack includes nested AppShell proc, layout, control label callbacks and selector; move/resize naturally reenters Win32 callbacks. Plan: preserve existing diagnostics; move per-operation 32768-wide-character buffers off callback stack without reducing path capacity, add bounded native move/resize/selector regression and verify small compiled stack frame. No timing fix claimed; Cycle78 independent phase7 failed P95 lateness54.38ms. MMCSS A/B inconclusive and reverted; restore build succeeded.++## Cycle79 — professional move/resize callback stack repair (2026-09-08)+User WER dump 33456: C000041D at module RVA BB0F7, same-object linker MAP identifies __chkstk; AppShell WndProc reserves0x36A28 bytes, nested layout/control/modal callbacks exhaust stack. Move 32768-wchar per-operation path buffers to vector heap storage; retain path capacity and independent modal lifetime. Fixed compiler reservation0x6A48 bytes. No STACK linker increase or exception swallowing.+Build: scripts/build.ps1 -Root <project> -Preset x64-release, exit0 (logs/optimization-goal-20260908/build-cycle79.log). Native bounded regression scripts/acceptance/ui-window-resize.py: empty18.265s (resize-1788881542706216600), playback18.578s (resize-1788881522216906600), each24moves/24sizes/4selectors, clean shutdown. Playback600NR/599NVOF, failed=false, P951.63ms. These are Win32 scripted operations, not physical mouse acceptance. Early old-binary probe did not reliably reproduce crash; old exit0 without smoke marker is not accepted evidence; final script requires actual completed smoke.+Preflight71PASS; phase7FAIL player-sync in logs/delivery/966863bd15a54bd58849984c73b5105d/result.json. Prior independentCycle78 alsoFAIL54.38ms, preceding this UI edit. No overall gate pass or latency fix claimed. Review pending; no checkpoint marking product passed.++Cycle79 independent product review scopedPASS, empty18.218s/playback18.594s. Reviewer P2: synchronous SetWindowPos could outlive in-worker timeout. Added external25s supervisor + bounded5s process-tree termination; this is test-only and pending recheck. Latest maker phase7 ran alongside user capture PID26044(start23:30:10), so1417.23ms P95 is contaminated performance evidence, not attributable to UI repair. Do not close user capture.++Cycle79 watchdog review PASS, finalempty run resize-1788881814315581700 failed selector-count assertion (1 vs4) despite24moves/24sizes/clean app exit0/no crash. Fixed regression ordering: explicitly cancel selector and acknowledge CB_GETDROPPEDSTATE=false before next open; do not rely on anchor timer dismissal. Product binary unchanged.++Cycle79 final independent scopedPASS: review_window_stack found no remainingP0/P1/P2 in product fix or regression. Final empty regression logs/optimization-goal-20260908/resize-1788881908641248600/result.json:18.234s,24moves,24sizes,4selectoropens,cleanSmoke=true,exit0. Prior same-binary playback resize-1788881714808561400:18.594s,600NR/599NVOF,failed=false. SHA25686E1EE322C86B539FC7C280F10726AC721F05FF322D5C0CA778EE1F9608C5D45. External25s supervisor+5s cleanup; forced timeout inspected not fault-injected. User mouse acceptance remains; full Phase7 not passed, no product-completion checkpoint. Latest gate concurrent usercapture means no clean latency conclusion.++## Cycle80 — capture mode enumeration and device audit+User asks why actual4K18p absent and no1440p30. FFmpeg native list (capture-native-options.txt) confirms3840x2160@18 YUY2 andMJPEG; no2560x1440. Product formats() hardcoded1080/2160 and29..61fps incorrectly hides18fps and allintermediate dimensions. Device VID345F PID2131 REV3100 MicrosoftUVC10.0.26100.8972 USB3 Video (different from historicUSB2 mode). Plan remove preset whitelist within existing4K capture envelope, labelnativepixel subtype, retainoriginalIAMStreamConfigindex, logselectednativeformat/SetFormat result. ReadUSBactualnegotiatedspeed andfirmwaredescriptors; noflash/driverchanges. ExternalresearchMS2131family, exactbrandpending. Single tests<=300sec.++Cycle80 capture whitelist removed and labels identify native subtype. ActualUSB SS(noSSPlus), firmware UVC2x12 frame entries no1440p. 4K18 YUY2/MJPEG source testsPASS andapp107NR106NVOF,callback18.02fps,0drops. Details/commands/failures docs/CAPTURE_CARD_AUDIT_2026-09-08.md. User resumedcapture0:22:0 after update; no further exclusivehardware tests while in use. Independent scopedreview pending.++Cycle80 independent scopedPASS: metadata list + offline rawUSBdescriptor independently verified, code and actualsource/NRlogs agree, noP0/P1/P2. Preflight71PASS. FullPhase7notretested while user4Kcaptureactive; priorlatenessissueunresolved. Finalexe2587E014D349402254C23C8B82108539B4C586E2C4C1D2C558BC636EB4AB34EB. Audit report contains complete evidence.++## Cycle81 — user-authorized RTX Video SR / FRUC trials (2026-09-09)+Official RTXVideo1.1 supportsRTX50/DX12, SR/artifactreduction/HDR, notinterpolation; download verified NVIDIAlogin bothweb/browser, user instructed download. LocalOpticalFlow5.0.7 includesNvOFFRUC andCUDA11runtime; testindependentD3D11FRUC first, notproductintegration. Screenshot99%GPU cannotattributeSRalone. No defaultbackendreplacement, no extraGPUCPUcopy inproduction; diagnosticreadback allowed. STOP absent. Eachprocess<=300s.++## Cycle81 — video SDK trial 2026-09-09+RTX5070 FRUC standalone natural-pan test generated 3 distinct intermediates; Create/Register/Process/Unregister/Destroy=0. Synthetic tests repeated frames and correctly failed. Evidence and build commands: docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md. Each invocation external25s watchdog, final exit0. Player PID20272 remained running, no performance conclusion. RTX Video SDK requires official login and was not executed. No product changes or phase advancement; existing Phase7 timing failure remains. Next: SDK acquisition and isolated comparison before integration.++## Cycle82 RTX Video SDK received+User supplied official zip; inspect and extract only to ignored local directory; standalone D3D12 test, no default changes. Pinned binaries match. STOP absent.++## Cycle82 — RTX Video D3D12 trial+User SDK received and safely extracted ignored. Actual RTX5070 Init/Create/Evaluate0x1 Available1; 1080p->4K all5quality outputs nonblack/different. Warm static8sample GPU medians q1=1.374ms q2=1.774ms q4=5.857ms; not end-to-end/capture comparison. Debug errors0 with retained warnings. Build/readback/timing/logs/limits in docs/RTX_VIDEO_FRUC_TRIAL_2026-09-09.md. Preflight71PASS; per-process25s watchdog. No product code/default changes, Phase7 timing failure unchanged. Next optional shared backend and same-source A/B, not automatic default replacement.++## Cycle83 optional RTX Video SR integration+User authorized trying in player. Shared graph backend, encoded RGB boundary, quality selector and preset persistence; no default replacement or export-integrity changes. Single writer; test each <=300s.++## Cycle83 independent final scoped PASS+Independent review_video_sr: no remaining introduced P0/P1/P2; original backend-switch P1 and draft-loss P2 closed. Independent low->medium->DLSS->low:3 applied transitions, VSR Create/Evaluate/Release3/401/3 all0x1/SEH0; DLSS Create1. Draft0.314159 retained across all3 changes, never secretly applied. Preset v2 protection/feather and defaultquality0 retained; v3quality2 roundtrip and invalid5 rejection pass.+Preflight71PASS; phase7 delivery a76caae2b03b4a96aaed4e4e1ab4eb71 45.295s/75PASS. Initial reviewer environment PSModulePath failure retained; fixed module search and reran. Evidence logs/video-sdk-trial-20260909/review-ui-switch.stdout.log, review-app-switch.log, review-preset.log. Tracked fingerprint98da728f82273048c095e9a12b2fe63c3114def9 unchanged during review; no tracked proprietary assets.+Final exeSHA37574BF6ACCA4E78A26EF10BE0D3AD0CDD90470D8A2353C6D551ACC798006A5B. User can choose Professional/Enhancement/RTX Video SR low or medium, enable SR with realtimeNR; test FGoff then2X. Physicalcard not enumerated this turn, onlyOBS; physical capture/naturalquality/longstability/unresolved historical intermittenttiming remain unaccepted. No overallGoal completion or distribution approval; no new integratedGBV claim.++## Cycle84 physical capture diagnosis+Same userPID22300 USB3Video1920x1080YUY2/60 examined without reopening. NativeNR+highestVSR is bottleneck: NR22.911ms vs realtime6.100ms; same-source realtime/low restores59.51fps vs native/highabout30fps. Temporary q4/realtime,q1/realtime,q1/realtime/FGoff comparisons each13s; originalquality4/nativeNR/FG2 restored. No code/binary change. NRdial is not total latency; rolling1200sample P95 mixes prior settings, so noFGofflatency conclusion frommixedwindow. Report docs/PHYSICAL_CAPTURE_DIAGNOSIS_2026-09-09.md; evidence logs/video-sdk-trial-20260909/physical-*. FullGoal open. Next revise metric windows/UI clarity and user chooses realtime/low forlive60fps.++## Cycle85 cross-page settings submission diagnosis+User reported FG toggle changes NR20ms->6ms. Actualrev29 nativeNR3840x2160 torev30 realtime1920x1080 alongsideFG. read() reads all hiddencontrols when applyingFG; narrow212 toFG/flow/content and preserveenhancementdraft, regression invisible staleNRpolicy. No algorithm order change.++Correction: Cycle84 final revision22 multiplier1 means FG was NOT restored to original2X; only NativeNR/quality4 restored. Hiddenlegacycheckbox was stale. See docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md.+++## Cycle85 — settings page submission isolation: independent PASS+User anomaly log revision29 NR3840x2160 median22.135ms -> revision30 NR1920x1080 median6.154ms; RTX Video SR quality1/output4K unchanged. Historical exact clicks not logged. SettingsWindow FG apply previously submitted hidden enhancement fields; now FG and enhancement reads/submissions and dirty drafts are isolated. No GPU stage order change.+Changed product file: apps/veyra/SettingsWindow.cpp. Regression: scripts/acceptance/ui-settings-page-scope.py. Build command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/build.ps1 -Root <project> -Preset x64-release; PASS, logs/video-sdk-trial-20260909/build-cycle85.log. Maker and independent command: python scripts/acceptance/ui-settings-page-scope.py; PASS (independent stdout logs/video-sdk-trial-20260909/review85-ui.stdout.log; app logs/settings-page-scope-72281e89bf974ce3a6f143945181cf2e.log). Independent actual revision4 intensity1/multiplier2 keeps nativeNR; revision5 applies realtimeNR with fg=1 and435 valid generated frames.+Independent commands: powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight (71 PASS), same command -Gate phase7 (75 PASS,42.678s), logs/delivery/c2bd451c2bb844448b60e78a61714558/result.json. Reviewer review_video_sr: no new P0/P1/P2; no tracked writes. Frozen code fingerprint8f3ebcf6d5f68c02592f52a0194674b7b3f776ae. EXE SHA25688AE23C12616355858AE85A6F8D11E0AC441872A5117665578DF626CAA48306A. Actual RTX execution performed; proprietary assets remain untracked.+Correction superseding Cycle84 restoration claim: nativeNR and VSRquality4 restored, but originalFG2 was left OFF (revision22 multiplier1). Hidden legacy checkbox was stale and was an invalid restoration source. User notified; future comparisons must use applied settings.+Phase7 overall optimization remains in_progress. Scope PASS does not resolve historical intermittent timing or prove physical display latency. NR dial measures NR stage only; rolling windows still mix settings. Next task: configuration-specific timing windows and unambiguous metric display, followed by user real-card acceptance. User app was closed normally for rebuild; reopen updated app for real-card retest.+++## Cycle86 plan — user requested live settings and handoff+Make every enhancement/FG field submit only its own change immediately; remove Apply buttons; one always-visible restore-default button. Block wheel adjustment over inspector controls and forward scrolling to page. Replace style0/1/2, mask0/1, UI correction0/1 with selected buttons. Build, actual GPU UI regression, independent read-only review, update guide/handoff and local checkpoint. Preserve pre-existing deletion loop/GOAL_PROMPT.md; do not stage that deletion. No runtime/SDK commit or push.+++Cycle86 safety stop: build passed (logs/video-sdk-trial-20260909/build-cycle86.log), but preflight reports file:loop/GOAL_PROMPT.md and control:loop/GOAL_PROMPT.md missing. This deletion was present before Cycle86 edits. Per AGENTS control-plane rule, stopped before GPU regression, independent review and checkpoint; no manifest/gate rebaseline and no restoration of user deletion. UI changes remain unverified candidate. Ask user to authorize restoring the exact tracked GOAL_PROMPT.md from HEAD, then resume verification/documentation/local checkpoint.++Cycle86 resumed: user explicitly confirmed deletion and requested removal of its preflight requirements. Removed GOAL_PROMPT from required files, exact protected set and manifest; synchronized only manifest pin (remaining ten file identities unchanged). No restoration or weakening of binary/product checks. Global themed sliders also swallow wheel; inspector subclass forwards wheel to page.+++## Cycle86 最终独立验收与交接++只读review_video_sr限定范围PASS,无新增P0/P1/P2。preflight69 PASS,phase7 73 PASS,实际命令 `powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/loop-gate.ps1 -Gate preflight` / `-Gate phase7`;delivery `logs/delivery/9f7468b334bc457db4b8bf125d4f5ddb/result.json`。减少的2项仅为用户明确删除的GOAL_PROMPT文件存在/hash检查,剩余10个控制文件身份保持。++实际RTX独立UI回归通过(`python scripts/acceptance/ui-settings-page-scope.py`);额外回归确认master-off保存.55/style1/FG2、重新开启真实应用;焦点内无效文本保留,失焦恢复;注入style2失败后回滚style1且按钮状态同步;滚轮确实滚页但不调参;还原默认生效。证据 `logs/video-sdk-trial-20260909/review86-ui.stdout.log`、`review86-extra-final.stdout.log`、`logs/settings-page-scope-79d029d4883e42fea08d53eecfcc65c6.log`。初次补测1秒等待不足,改为最长5秒观察真实回滚后通过,未用固定短等待误报产品失败。++EXE SHA256: `3BD470D51AD43F7C461F23AB6F9F9B7234DC6F33D84C9DDEB35A463663264E2C`。构建日志 `logs/video-sdk-trial-20260909/build-cycle86.log`;独立review前后跟踪指纹 `9d45fe7ff6b19a67b3a42db2215928b1aecf5b4f`不变,之后仅更新交接记录。单次测试均不足300秒。Cycle86修复可交本机实测;整体Phase7优化仍in_progress,既有统计窗口/间歇时序/实卡体验/长期稳定风险未宣称消失。下一任务见HANDOFF优先处理配置相关统计窗口。++本地Git checkpoint包括Cycles78–86已核对源码、使用指南、交接报告与授权的GOAL_PROMPT删除;不包含runtime/SDK/个人媒体,不push。实际提交ID以本次 `git log -1` 为准,避免在commit内容中制造自指hash。diff --git a/loop/STATE.json b/loop/STATE.jsonindex 3490ed97..1b828b75 100644--- a/loop/STATE.json+++ b/loop/STATE.json@@ -76,19 +76,19 @@}],"cycle": {- "completed": 77,+ "completed": 86,"maximum": 120,"sameFailureAttempts": 0,"maximumSameFailureAttempts": 3,"noProgressCycles": 0,"maximumNoProgressCycles": 5},- "currentTask": "Cycle77 known4K reconstruction independently passed; spatial/temporal tradeoff measured",+ "currentTask": "Cycle86 live settings independently passed; local checkpoint and handoff ready","lastGate": {"name": "phase7","status": "passed","exitCode": 0,- "evidence": "logs/delivery/268ee4b316bf4604bedafcd9b747b09c/result.json;41.718s;75checks"+ "evidence": "logs/delivery/9f7468b334bc457db4b8bf125d4f5ddb/result.json; preflight69/phase773 PASS; Cycle86 independent scoped PASS"},"lastFailureFingerprint": "","failureLedger": [@@ -104,11 +104,12 @@"lastGoodCommit": "d681541a8fca77e3bfd5f496c8ee2dfe2d6a9031","openP0P1Findings": [],"blockers": [- "Current USB2 1080p50 physical throughput passed; user perceived latency/audio/actual FG display cadence still need confirmation.",+ "User real-card perceived latency/audio/FG display cadence and long stability acceptance pending; USB3Video1080p60 and4K18 short throughput measured.",+ "Historical intermittent player-sync timing and mixed-configuration timing windows remain unresolved.","Public proprietary runtime distribution rights unresolved; local delivery only."],- "nextAction": "Isolate accurate motion versus estimated SR guidance and supplement natural material; no default SR/depth replacement without benefit",- "updatedAt": "2026-09-08T12:41:17.8709040Z",+ "nextAction": "Handoff: prioritize configuration-specific metric windows; user real-card acceptance; see docs/HANDOFF_2026-09-09.md. Do not restore intentionally removed GOAL_PROMPT.",+ "updatedAt": "2026-09-09T01:52:39.336203+00:00","deliveryPlan": "docs/ACTIVE_DELIVERY_PLAN.md","captureAcceptance": "throughput_short_test_passed_user_latency_audio_pending","testInvocationLimitSeconds": 300,@@ -134,10 +135,12 @@"Cycle74 independent scopedPASS, docs/REVIEW_BIDIRECTIONAL_FLOW_2026-09-08.md:360/1080/4K controlledbidirectional plus640x129alignmentfix; no defaultintegration","Cycle75 independent NRdepth24casesPASS:docs/REVIEW_NR_DEPTH_RESPONSE_2026-09-08.md; no depthresponse, strongMV/intensityresponse; no newmodels/defaults","Cycle76 independent scopedPASS: docs/REVIEW_SR_FG_DEPTH_RESPONSE_2026-09-08.md; SR8bit negative depth response, FG tiny constructed benefit, no defaultmodel",- "Cycle77 independent scopedPASS: docs/REVIEW_SR_RECONSTRUCTION_2026-09-08.md; real4K SR spatialMAE lower, temporalerror/max higher; no natural/steady-state claim"+ "Cycle77 independent scopedPASS: docs/REVIEW_SR_RECONSTRUCTION_2026-09-08.md; real4K SR spatialMAE lower, temporalerror/max higher; no natural/steady-state claim",+ "Cycle85 scoped independent PASS: docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md; preflight71/phase775 and actual GPU double-direction settings regression passed",+ "Cycle86 independent live-settings/master-off/focus/rollback/wheel/default PASS; delivery9f7468b334bc457db4b8bf125d4f5ddb; docs/HANDOFF_2026-09-09.md"],"reviewBaseCommit": "6f0ebaa687e3966d989bf138c86b6882380f20fb",- "localDelivery": "capture_fix_candidate_needs_review",+ "localDelivery": "cycle86_live_settings_scoped_pass_handoff_ready","acceptanceScope": "User-approved short local software contract, default realtime4K-input/1080working, optional native4K playback, native4K exports; capture hardware acceptance reserved for user.","repairV2": {"status": "known_fixes_review_passed",@@ -273,10 +276,22 @@"productModified": true,"consecutiveBlockedGoalTurns": 0,"previousGoalTurnClassification": "progress: SR/FG depth response and exact half-frame GT measured; incomplete-sample P2 fixed, independent18cases andgate PASS; default model not justified",- "currentGoalTurnClassification": "progress: known4K downsample reconstruction and temporal errors measured, independentRTXreproduction andgatePASS; next isolate motion cause",+ "currentGoalTurnClassification": "progress: optional shared RTX Video SR, actual playback/export and independent hot-switch/draft/legacy preset checks PASS; physical capture unavailable","controlSynchronizationAuthorization": "2026-09-08 user: 确认,给你全部权限; applies to previously proposed exact two-hash synchronization","diagnosticFindings": ["Q7 read-only dependency check: RTXVideoSDK not present in third_party_local; official1.1download redirects NVIDIA login. Localdepthfile vitl is Large, not permitted Small; no verified Small ONNX/provider. No dependency integrated or performance claimed."]+ },+ "settingsScopeRepair": {+ "status": "independent_scoped_pass",+ "report": "docs/SETTINGS_PAGE_SCOPE_REPAIR_2026-09-09.md",+ "exeSha256": "88AE23C12616355858AE85A6F8D11E0AC441872A5117665578DF626CAA48306A",+ "cycle84Correction": "Original FG2 was left off by diagnostic restoration; nativeNR and VSRquality4 restored."+ },+ "liveSettingsRepair": {+ "status": "independent_scoped_pass",+ "report": "docs/HANDOFF_2026-09-09.md",+ "exeSha256": "3BD470D51AD43F7C461F23AB6F9F9B7234DC6F33D84C9DDEB35A463663264E2C",+ "controlChangeAuthorization": "User explicitly deleted GOAL_PROMPT and requested removal of associated preflight checks; remaining10 hashes unchanged."}}diff --git a/scripts/acceptance/ui-settings-page-scope.py b/scripts/acceptance/ui-settings-page-scope.pynew file mode 100644index 00000000..40e2d0f0--- /dev/null+++ b/scripts/acceptance/ui-settings-page-scope.py@@ -0,0 +1,63 @@+# Regression: live per-field settings, wheel safety, discrete buttons, reset. Own app; 30-second app deadline.+import ctypes as c,ctypes.wintypes as w,subprocess,os,time,pathlib,json,uuid+r=pathlib.Path.cwd();u=c.WinDLL('user32');u.GetWindowThreadProcessId.argtypes=[w.HWND,c.POINTER(w.DWORD)];u.GetDlgCtrlID.argtypes=[w.HWND];u.GetParent.argtypes=[w.HWND];u.GetParent.restype=w.HWND+u.SendMessageTimeoutW.argtypes=[w.HWND,w.UINT,w.WPARAM,w.LPARAM,w.UINT,w.UINT,c.POINTER(c.c_size_t)];u.SendMessageTimeoutW.restype=w.LPARAM+cb=c.WINFUNCTYPE(w.BOOL,w.HWND,w.LPARAM);u.EnumWindows.argtypes=[cb,w.LPARAM];u.EnumChildWindows.argtypes=[w.HWND,cb,w.LPARAM]+def send(h,m,a=0,b=0):+ result=c.c_size_t();assert u.SendMessageTimeoutW(h,m,a,b,2,1500,c.byref(result));return result.value+log=r/('logs/settings-page-scope-'+uuid.uuid4().hex+'.log');env=os.environ.copy();env['PATH']=r'C:\veyra-deps\installed\x64-windows\bin;'+env['PATH'];env['VEYRA_LOG_FILE']=str(log)+p=subprocess.Popen([str(r/'out/build/x64-release/veyra.exe'),'--smoke-seconds','22','--native','--video-sr','1','--nr','--no-fg',str(r/'logs/ui-repair-v3/glass-video.mp4')],env=env)+try:+ start=time.monotonic();time.sleep(4);controls={}+ @cb+ def child(h,l):+ ident=u.GetDlgCtrlID(h)+ if ident in [100,101,202,203,207,210,211,212,600,601,603,607,700,702,711,721]:controls[ident]=h+ return True+ @cb+ def top(h,l):+ pid=w.DWORD();u.GetWindowThreadProcessId(h,c.byref(pid))+ if pid.value==p.pid:u.EnumChildWindows(h,child,0)+ return True+ u.EnumWindows(top,0);assert len(controls)==14,controls+ def select(ident,index):+ h=controls[ident];send(h,0x14e,index);send(u.GetParent(h),0x111,ident|(1<<16),h)+ def click(ident):+ h=controls[ident];send(u.GetParent(h),0x111,ident,h)+ def textOf(ident):+ buf=c.create_unicode_buffer(100);send(controls[ident],13,100,c.addressof(buf));return buf.value+ # Live edits and choices commit individually; no Apply controls remain.+ assert 210 not in controls and 212 not in controls+ def edit(ident,value):+ buf=c.create_unicode_buffer(value);send(controls[ident],12,0,c.addressof(buf))+ def waitFor(token):+ deadline=time.monotonic()+4+ while time.monotonic()<deadline:+ if token in log.read_text(encoding='utf-8',errors='replace'):return+ time.sleep(.05)+ raise AssertionError('missing actual GPU log: '+token)+ edit(100,'0.314159');waitFor('intensity=0.314159')+ select(202,1);waitFor('multiplier=2')+ before=log.read_text();assert before.count('[resolution]')==1,'FG changed native NR size'+ # Wheel over any parameter control scrolls the page without changing values.+ for ident in [600,601,603,607,202,203,207,100,700]:+ h=controls[ident];old=send(h,0x400) if ident>=600 and ident<612 else send(h,0x147) if ident in [202,203,207] else textOf(ident)+ for delta in [-120,120,-120]:send(h,0x20a,(delta&0xffff)<<16,0)+ new=send(h,0x400) if ident>=600 and ident<612 else send(h,0x147) if ident in [202,203,207] else textOf(ident)+ assert old==new,('wheel changed',ident,old,new)+ edit(100,'-');select(203,0);time.sleep(1)+ # Invalid numeric input must not block a valid change on another control.+ assert 'nr=1920x1080' in log.read_text()+ edit(100,'0.42');waitFor('intensity=0.42')+ click(702);waitFor('style=2');assert send(controls[202],0x147)==1+ click(711);waitFor('autoMask=1');click(721);waitFor('UI=1')+ # Drag-equivalent HSCROLL, without wheel, still applies the slider value.+ send(controls[601],0x405,1,37);send(u.GetParent(controls[601]),0x114,5,controls[601]);waitFor('tone=0.37')+ click(211);time.sleep(1)+ assert textOf(100)=='1' and textOf(101)=='1' and send(controls[202],0x147)==0 and send(controls[203],0x147)==0+ code=p.wait(timeout=max(1,30-(time.monotonic()-start)));data=log.read_text()+ ok=code==0 and 'failed=false' in data+ print(json.dumps({'exit':code,'live_numeric_fg_discrete_reset':True,'wheel_does_not_adjust':True,'fg_keeps_nr_size':True,'pass':ok,'log':str(log)}));assert ok++finally:+ if p.poll() is None:p.kill();p.wait()diff --git a/scripts/acceptance/ui-window-resize.py b/scripts/acceptance/ui-window-resize.pynew file mode 100644index 00000000..80db9dde--- /dev/null+++ b/scripts/acceptance/ui-window-resize.py@@ -0,0 +1,91 @@+# Windows native regression: move/resize while the professional selector pumps nested messages.+# Usage: python scripts/acceptance/ui-window-resize.py [exe] [media]+import re+import ctypes as c, ctypes.wintypes as w, subprocess,time,sys,json,pathlib,os+# A separate process owns the deadline: native synchronous window messages can+# block the worker, so its own p.wait timeout is not a sufficient watchdog.+if '--worker' not in sys.argv:+ supervisor=subprocess.Popen([sys.executable,__file__,'--worker',*sys.argv[1:]])+ try:+ sys.exit(supervisor.wait(timeout=25))+ except subprocess.TimeoutExpired:+ subprocess.run(['taskkill.exe','/PID',str(supervisor.pid),'/T','/F'],timeout=5,capture_output=True)+ print('FAIL: UI regression exceeded external 25-second deadline')+ sys.exit(1)+sys.argv.remove('--worker')+u=c.WinDLL('user32',use_last_error=True)+u.SetWindowPos.argtypes=[w.HWND,w.HWND,c.c_int,c.c_int,c.c_int,c.c_int,w.UINT]+u.GetDlgItem.argtypes=[w.HWND,c.c_int];u.GetDlgItem.restype=w.HWND+u.SendMessageTimeoutW.argtypes=[w.HWND,w.UINT,w.WPARAM,w.LPARAM,w.UINT,w.UINT,c.POINTER(c.c_size_t)]+u.PostMessageW.argtypes=[w.HWND,w.UINT,w.WPARAM,w.LPARAM]+CB=c.WINFUNCTYPE(w.BOOL,w.HWND,w.LPARAM)+def find(pid):+ found=[]+ @CB+ def visit(h,l):+ p=w.DWORD();u.GetWindowThreadProcessId(h,c.byref(p));buf=c.create_unicode_buffer(128);u.GetClassNameW(h,buf,128)+ if p.value==pid and buf.value=='VeyraApp':found.append(h)+ return True+ u.EnumWindows(visit,0);return found[0] if found else None+def send(h,m,a=0,b=0):+ result=c.c_size_t()+ if not u.SendMessageTimeoutW(h,m,a,b,2,1500,c.byref(result)):raise RuntimeError('message timeout/dead window')+ return result.value+root=pathlib.Path.cwd();exe=pathlib.Path(sys.argv[1] if len(sys.argv)>1 else 'out/build/x64-release/veyra.exe');out=root/'logs/optimization-goal-20260908'/('resize-'+str(time.time_ns()));out.mkdir()+env=os.environ.copy();env['PATH']=r'C:\veyra-deps\installed\x64-windows\bin;'+env['PATH'];env['VEYRA_LOG_FILE']=str(out/'app.log')+si=subprocess.STARTUPINFO();si.dwFlags=1;si.wShowWindow=0+start=time.monotonic();result={'exe':str(exe),'moves':0,'sizes':0,'error':''}+with (out/'stdout.log').open('w') as stdout,(out/'stderr.log').open('w') as stderr:+ args=[str(exe),'--smoke-view','professional','--smoke-seconds','18']+ if len(sys.argv)>2:args += [sys.argv[2],'--realtime','--no-fg']+ else:args += ['--smoke-empty']+ p=subprocess.Popen(args,stdout=stdout,stderr=stderr,env=env,startupinfo=si)+ try:+ h=None+ while time.monotonic()-start<5 and p.poll() is None:+ h=find(p.pid)+ if h:break+ time.sleep(.05)+ if not h:raise RuntimeError('main window missing')+ u.ShowWindow(h,4)+ time.sleep(.7)+ u.PostMessageW(h,0x112,0xF012,0)+ time.sleep(.2)+ u.PostMessageW(h,0x100,0x27,0)+ u.PostMessageW(h,0x100,0x1B,0)+ time.sleep(.1)+ for i in range(24):+ if i%6==0:+ combo=u.GetDlgItem(h,119)+ u.PostMessageW(combo,0x14F,1,0)+ time.sleep(.12)+ if p.poll() is not None:raise RuntimeError('application crashed')+ if not u.SetWindowPos(h,None,40+i*2,50+i,1280,800,0x15):raise RuntimeError('move failed')+ result['moves']+=1+ send(h,0x231)+ if not u.SetWindowPos(h,None,0,0,800+(i%6)*110,600+(i%4)*60,0x16):raise RuntimeError('resize failed')+ result['sizes']+=1+ send(h,0x232);send(h,0)+ if i%6==0:+ # Moving an anchor does not necessarily dismiss it before the next request.+ # Close explicitly and acknowledge modal-loop unwind before reopening.+ u.PostMessageW(combo,0x14F,0,0)+ closeDeadline=time.monotonic()+1+ while send(combo,0x157):+ if time.monotonic()>=closeDeadline:raise RuntimeError('selector did not close')+ time.sleep(.02)+ time.sleep(.05)+ p.wait(timeout=max(1,25-(time.monotonic()-start)))+ except Exception as e:result['error']=str(e)+ finally:+ if p.poll() is None:p.kill();p.wait()+ log=(out/'app.log').read_text(encoding='utf-8',errors='replace') if (out/'app.log').exists() else ''+ result['professional']='professional=true' in log+ result['selectorOpens']=log.count('[ui-selector] open items=')+ smoke=re.search(r'\[app\] smoke frames=(\d+)[^\r\n]*failed=false',log)+ result['cleanSmoke']=bool(smoke) and (len(sys.argv)<=2 or int(smoke[1])>0)+ result['exit']=p.returncode;result['seconds']=time.monotonic()-start;result['passed']=p.returncode==0 and not result['error'] and result['sizes']==24 and result['professional'] and result['selectorOpens']>=4 and result['cleanSmoke']+ (out/'result.json').write_text(json.dumps(result,indent=2));print(out/'result.json');print(json.dumps(result))+++sys.exit(0 if result['passed'] else 1)diff --git a/scripts/loop-gate.ps1 b/scripts/loop-gate.ps1index b740b911..2c9d875d 100644--- a/scripts/loop-gate.ps1+++ b/scripts/loop-gate.ps1@@ -44,7 +44,6 @@ function Get-ProjectSourceSnapshot {"VEYRA_AGENT_EXECUTION_PLAYBOOK_V1.md","docs/COMPETITOR_AUDIT_2026-09-03.md","loop/LOOP_ENGINE.md",- "loop/GOAL_PROMPT.md","loop/REVIEW_PROMPT.md","loop/CONTROL_HASHES.json","loop/STATE.json",@@ -141,7 +140,6 @@ $requiredFiles = @("docs/COMPETITOR_AUDIT_2026-09-03.md",".gitignore","loop\LOOP_ENGINE.md",- "loop\GOAL_PROMPT.md","loop\REVIEW_PROMPT.md","loop\CONTROL_HASHES.json","loop\STATE.json",@@ -157,7 +155,7 @@ foreach ($requiredFile in $requiredFiles) {}$controlManifestPath = Join-Path $root "loop\CONTROL_HASHES.json"-$expectedControlManifestHash = "4D5A30F73E06B59B3D6AD5D4A0AE106A0C3AD808D758418B21CC339D2E28779B"+$expectedControlManifestHash = "547D8E6E11BF22FF44F88767FB0BF1A8410A70E7846681F4C63E7D998D9EB74C"if (Test-Path -LiteralPath $controlManifestPath -PathType Leaf) {$actualControlManifestHash = (Get-FileHash -LiteralPath $controlManifestPath -Algorithm SHA256).Hash.ToUpperInvariant()$manifestHashValid = $actualControlManifestHash -eq $expectedControlManifestHash@@ -175,7 +173,6 @@ if (Test-Path -LiteralPath $controlManifestPath -PathType Leaf) {"VEYRA_PRODUCT_SPEC_V1.md","docs/COMPETITOR_AUDIT_2026-09-03.md","docs/ACTIVE_DELIVERY_PLAN.md",- "loop/GOAL_PROMPT.md","loop/LOOP_ENGINE.md","loop/REVIEW_PROMPT.md","scripts/gates/README.md"@@ -189,7 +186,7 @@ if (Test-Path -LiteralPath $controlManifestPath -PathType Leaf) {([string]$_.sha256 -match '^[0-9A-Fa-f]{64}$')}).Count -eq $manifestEntries.Count$manifestSchemaValid = ($controlManifest.schemaVersion -eq 1) -and- ($manifestEntries.Count -eq 11) -and+ ($manifestEntries.Count -eq 10) -and$validManifestEntries -and(($actualControlPaths -join "|") -ceq ($expectedControlPaths -join "|"))Add-Check "control-manifest-schema" $manifestSchemaValid "schemaVersion=$($controlManifest.schemaVersion) files=$($manifestEntries.Count) exactProtectedSet=$((($actualControlPaths -join '|') -ceq ($expectedControlPaths -join '|')))"diff --git a/shaders/ScaleBlit.hlsl b/shaders/ScaleBlit.hlslindex da890c92..1b2b5975 100644--- a/shaders/ScaleBlit.hlsl+++ b/shaders/ScaleBlit.hlsl@@ -55,6 +55,7 @@ void main(uint3 groupId : SV_GroupID, uint3 localId : SV_GroupThreadID, uint3 glconst float3 c = max(value.rgb, 0.0);value.rgb = select(c <= 0.0031308, c * 12.92, 1.055 * pow(c, 1.0/2.4) - 0.055);}+ if(encodeSrgb < -0.5){const float3 c=max(value.rgb,0.0);value.rgb=select(c<=0.04045,c/12.92,pow((c+0.055)/1.055,2.4));}outputTex[globalId.xy] = value;(void)groupId;(void)localId;diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cppindex 3a3463bd..f8dd2f90 100644--- a/src/engine/EngineController.cpp+++ b/src/engine/EngineController.cpp@@ -94,7 +94,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){pipeline::EnhanceGraphDesc gd;gd.sourceWidth=width;gd.sourceHeight=height;gd.rgbInput=isImage||isCapture;gd.stillImage=isImage;const auto resolution=pipeline::ResolutionPlan::make({width,height},options.sr,options.realtime?pipeline::NrSizePolicy::Realtime:pipeline::NrSizePolicy::Native,isImage,1);gd.workWidth=resolution.base.width;gd.workHeight=resolution.base.height;gd.nrWidth=resolution.nr.width;gd.nrHeight=resolution.nr.height;- gd.enableSr=resolution.srApplied;gd.enableNr=options.nr;gd.enableFg=options.fg;gd.fgMultiplier=options.fgMultiplier;gd.enableNvofStandalone=options.nr;+ gd.enableSr=resolution.srApplied;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr;gd.enableFg=options.fg;gd.fgMultiplier=options.fgMultiplier;gd.enableNvofStandalone=options.nr;gd.noFeatures=false;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.contentRate=options.settings.content;gd.runtimeAbsPath=std::filesystem::path(VEYRA_PROJECT_ROOT).wstring()+L"\\runtime_local\\nvidia";if(!graph.initialize(gd)||!presenter.open(ctx,window,graph)||!graph.createViews()){status(L"增强初始化失败,请核对本地运行时",true);break;}@@ -122,9 +122,9 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options){auto next=PlayerOptions::from(requested);auto nextDesc=gd;const auto plan=pipeline::ResolutionPlan::make({width,height},next.sr,requested.nrPolicy,isImage,requested.revision);nextDesc.workWidth=plan.base.width;nextDesc.workHeight=plan.base.height;nextDesc.nrWidth=plan.nr.width;nextDesc.nrHeight=plan.nr.height;- nextDesc.enableSr=plan.srApplied;nextDesc.enableNr=next.nr;nextDesc.enableFg=next.fg;nextDesc.fgMultiplier=next.fgMultiplier;nextDesc.enableNvofStandalone=next.nr;+ nextDesc.enableSr=plan.srApplied;nextDesc.videoSrQuality=next.settings.videoSrQuality;nextDesc.enableNr=next.nr;nextDesc.enableFg=next.fg;nextDesc.fgMultiplier=next.fgMultiplier;nextDesc.enableNvofStandalone=next.nr;nextDesc.model=requested.model;nextDesc.residual=requested.residual;nextDesc.protection=requested.protection;nextDesc.settingsRevision=requested.revision;nextDesc.flowQuality=requested.flow;nextDesc.contentRate=requested.content;- const bool rebuild=gd.flowQuality!=nextDesc.flowQuality||gd.workWidth!=nextDesc.workWidth||gd.workHeight!=nextDesc.workHeight||gd.nrWidth!=nextDesc.nrWidth||gd.nrHeight!=nextDesc.nrHeight;+ const bool rebuild=gd.videoSrQuality!=nextDesc.videoSrQuality||gd.flowQuality!=nextDesc.flowQuality||gd.workWidth!=nextDesc.workWidth||gd.workHeight!=nextDesc.workHeight||gd.nrWidth!=nextDesc.nrWidth||gd.nrHeight!=nextDesc.nrHeight;bool accepted=ring.drainQueue();out={};hasOutput=false;if(accepted&&rebuild){presenter.close();graph.shutdown();accepted=graph.initialize(nextDesc)&&presenter.open(ctx,window,graph)&&graph.createViews();if(!accepted){presenter.close();graph.shutdown();if(!graph.initialize(gd)||!presenter.open(ctx,window,graph)||!graph.createViews()){status(L"设置失败且旧资源恢复失败,已停止",true);break;}}diff --git a/src/engine/PresetStore.cpp b/src/engine/PresetStore.cppindex ebe0100e..42a231d7 100644--- a/src/engine/PresetStore.cpp+++ b/src/engine/PresetStore.cpp@@ -13,16 +13,17 @@ bool nameOk(const std::wstring& s){return !s.empty()&&s.size()<=48&&s.front()!=Lstd::wstring trim(std::wstring s){auto a=s.find_first_not_of(L" \t\r\n");if(a==s.npos)return {};auto b=s.find_last_not_of(L" \t\r\n");return s.substr(a,b-a+1);}}std::string PresetStore::serialize()const{- std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 2\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';- for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<'\n';}return o.str();+ std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 3\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';+ for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<'\n';}return o.str();}bool PresetStore::parse(const std::string& data,std::vector<UserPreset>& out,std::wstring& def){if(data.size()>65536)return false;std::istringstream in(data);in.imbue(std::locale::classic());std::string magic,d;int version=0;size_t count=0;- if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version!=1&&version!=2)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;+ if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version!=1&&version!=2&&version!=3)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;for(size_t i=0;i<count;++i){UserPreset p;std::string n;int policy,flow,content,nr,sr;auto& s=p.settings;auto& m=s.model;auto& r=s.residual;if(!(in>>std::quoted(n)>>m.intensity>>m.tone>>m.structure>>m.skin>>m.style>>m.autoMask>>m.uiCorrection>>r.total>>r.darken>>r.brighten>>r.color>>r.luminance>>nr>>sr>>s.multiplier>>policy>>flow>>content))return false;- if(version==2){int enabled;if(!(in>>enabled>>s.protection.featherPixels)||enabled<0||enabled>1)return false;s.protection.enabled=enabled!=0;+ if(version>=2){int enabled;if(!(in>>enabled>>s.protection.featherPixels)||enabled<0||enabled>1)return false;s.protection.enabled=enabled!=0;for(auto& q:s.protection.regions)if(!(in>>q.left>>q.top>>q.right>>q.bottom))return false;}+ if(version>=3&&!(in>>s.videoSrQuality))return false;p.name=wide(n);if(!nameOk(p.name)||std::any_of(out.begin(),out.end(),[&](auto& a){return a.name==p.name;})||nr<0||nr>1||sr<0||sr>1)return false;s.nr=nr;s.sr=sr;s.nrPolicy=static_cast<pipeline::NrSizePolicy>(policy);s.flow=static_cast<FlowQuality>(flow);s.content=static_cast<ContentRate>(content);if(!s.validate().empty())return false;out.push_back(std::move(p));diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cppindex 27427dea..81bc3274 100644--- a/src/engine/VideoExportJob.cpp+++ b/src/engine/VideoExportJob.cpp@@ -41,7 +41,7 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOpticonst AVRational rate=av_mul_q({rateNum,rateDen},{int(options.fg?options.fgMultiplier:1),1});veyra::log::info("export-timeline",std::format("CFR declared={}/{} candidate={}/{} timestampQuantum={} sampled={} output={}/{} (timestamp-consistent candidate, quantized short clips may be ambiguous; every PTS validated)",info.nominalRateNum,info.nominalRateDen,rateNum,rateDen,info.timestampQuantum,samples.size(),rate.num,rate.den));const auto resolution=pipeline::ResolutionPlan::make({info.width,info.height},options.sr,pipeline::NrSizePolicy::Native,true,options.settings.revision);- pipeline::EnhanceGraphDesc gd;gd.sourceWidth=info.width;gd.sourceHeight=info.height;gd.workWidth=resolution.base.width;gd.workHeight=resolution.base.height;gd.enableSr=resolution.srApplied;gd.enableNr=options.nr;gd.enableFg=options.fg;gd.fgMultiplier=options.fgMultiplier;gd.enableNvofStandalone=options.nr;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.contentRate=options.settings.content;gd.runtimeAbsPath=(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/nvidia").wstring();+ pipeline::EnhanceGraphDesc gd;gd.sourceWidth=info.width;gd.sourceHeight=info.height;gd.workWidth=resolution.base.width;gd.workHeight=resolution.base.height;gd.enableSr=resolution.srApplied;gd.videoSrQuality=options.settings.videoSrQuality;gd.enableNr=options.nr;gd.enableFg=options.fg;gd.fgMultiplier=options.fgMultiplier;gd.enableNvofStandalone=options.nr;gd.model=options.settings.model;gd.residual=options.settings.residual;gd.protection=options.settings.protection;gd.settingsRevision=options.settings.revision;gd.flowQuality=options.settings.flow;gd.contentRate=options.settings.content;gd.runtimeAbsPath=(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/nvidia").wstring();if(!graph.initialize(gd)||!graph.createViews())break;if(avformat_alloc_output_context2(&mux,nullptr,"mp4",utf8(partial).c_str())<0||!mux)break;videoStream=avformat_new_stream(mux,nullptr);if(!videoStream)break;videoStream->time_base={rate.den,rate.num};videoStream->avg_frame_rate=rate;diff --git a/src/ngx/VideoSrBackend.cpp b/src/ngx/VideoSrBackend.cppnew file mode 100644index 00000000..acfcacb2--- /dev/null+++ b/src/ngx/VideoSrBackend.cpp@@ -0,0 +1,39 @@+#include "veyra/ngx/VideoSrBackend.h"+#include "veyra/Log.h"+#include <windows.h>+#include <format>+namespace veyra::ngx {+namespace {+NVSDK_NGX_Result invoke(int op,ID3D12GraphicsCommandList* list,NVSDK_NGX_Parameter* p,NVSDK_NGX_Handle** h,unsigned& seh){+ seh=0;+ __try {+ if(op==0)return NVSDK_NGX_D3D12_CreateFeature(list,NVSDK_NGX_Feature_Reserved16,p,h);+ if(op==1)return NVSDK_NGX_D3D12_EvaluateFeature(list,*h,p);+ return NVSDK_NGX_D3D12_ReleaseFeature(*h);+ } __except(EXCEPTION_EXECUTE_HANDLER){seh=GetExceptionCode();return NVSDK_NGX_Result_FAIL_PlatformError;}+}+bool result(int op,NVSDK_NGX_Result r,unsigned seh){+ (NVSDK_NGX_SUCCEED(r)&&!seh?log::info:log::error)("video-sr",std::format("op={} result=0x{:X} seh=0x{:X}",op,unsigned(r),seh));+ return NVSDK_NGX_SUCCEED(r)&&!seh;+}+}+bool VideoSrBackend::create(NgxCoreHost& core,ID3D12GraphicsCommandList* list){+ release();core_=&core;Status status=Status::Ok;params_=core.allocateParameters(status);if(!params_)return false;+ params_->Set("CreationNodeMask",1u);params_->Set("VisibilityNodeMask",1u);+ unsigned seh=0;auto r=invoke(0,list,params_,&handle_,seh);return result(0,r,seh)&&handle_;+}+bool VideoSrBackend::evaluate(ID3D12GraphicsCommandList* list,ID3D12Resource* input,ID3D12Resource* output,unsigned quality){+ if(!handle_||!input||!output||quality<1||quality>4)return false;+ const auto a=input->GetDesc(),b=output->GetDesc();+ if(a.Format!=DXGI_FORMAT_R8G8B8A8_UNORM||b.Format!=DXGI_FORMAT_R8G8B8A8_UNORM)return false;+ params_->Set("Input1",input);params_->Set("Output",output);+ params_->Set("Rect.X",0u);params_->Set("Rect.Y",0u);params_->Set("Rect.W",unsigned(a.Width));params_->Set("Rect.H",a.Height);+ params_->Set("OutRect.X",0u);params_->Set("OutRect.Y",0u);params_->Set("OutRect.W",unsigned(b.Width));params_->Set("OutRect.H",b.Height);+ params_->Set("VSR.QualityLevel",quality);+ unsigned seh=0;auto r=invoke(1,list,params_,&handle_,seh);return result(1,r,seh);+}+void VideoSrBackend::release(){+ if(handle_){unsigned seh=0;auto r=invoke(2,nullptr,params_,&handle_,seh);result(2,r,seh);handle_=nullptr;}+ if(params_&&core_)core_->destroyParameters(params_);params_=nullptr;core_=nullptr;+}+}diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cppindex 215623bc..990ebeaf 100644--- a/src/pipeline/EnhanceGraph.cpp+++ b/src/pipeline/EnhanceGraph.cpp@@ -23,6 +23,7 @@#include "veyra/ngx/DlssNrParameters.h"#include "veyra/ngx/DlssNrRuntimeAdapter.h"#include "veyra/ngx/DlssSrBackend.h"+#include "veyra/ngx/VideoSrBackend.h"#include "veyra/ngx/NgxCoreHost.h"#include "veyra/ngx/NgxParameters.h"#include "veyra/ngx/NvOfSession.h"@@ -60,8 +61,16 @@ EnhanceGraph::~EnhanceGraph()bool EnhanceGraph::initialize(const EnhanceGraphDesc& desc){if(!desc.protection.validate().empty())return false;+ if(desc.srMotionProbe){+ const auto d=desc.srMotionProbe->GetDesc();ComPtr<ID3D12Device> device;+ if(!desc.enableSr||desc.noFeatures||desc.noNgx||d.Dimension!=D3D12_RESOURCE_DIMENSION_TEXTURE2D||d.Width!=desc.workWidth||d.Height!=desc.workHeight||d.Format!=DXGI_FORMAT_R16G16_FLOAT||d.DepthOrArraySize!=1||d.MipLevels!=1||d.SampleDesc.Count!=1||(d.Flags&D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE)||FAILED(desc.srMotionProbe->GetDevice(IID_PPV_ARGS(&device)))||device.Get()!=context_.device()){+ veyra::log::error("graph","invalid diagnostic SR motion resource/feature/device contract");return false;+ }+ veyra::log::info("graph","diagnostic SR motion override active; no product entry point enables this");+ }desc_ = desc;tracker_={};prevValid_=false;cadence_.reset();scene_.reset();previousLuma_.clear();diagnostics::DiagnosticEvent initDiagnostic;initDiagnostic.stage="initialize";initDiagnostic.identity={epoch_+1,desc.settingsRevision,0};initDiagnostic.resolution.source={desc.sourceWidth,desc.sourceHeight};initDiagnostic.resolution.base=initDiagnostic.resolution.fg=initDiagnostic.resolution.output={desc.workWidth,desc.workHeight};initDiagnostic.resolution.nr={desc.nrWidth?desc.nrWidth:desc.workWidth,desc.nrHeight?desc.nrHeight:desc.workHeight};initDiagnostic.resolution.flow=initDiagnostic.resolution.source;initDiagnostic.flowApplied=std::to_string(unsigned(desc.flowQuality));initDiagnostic.runtimeHash="E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E";Logger::diagnosticContext(initDiagnostic);+ if(desc.videoSrQuality>4)return false;srcW_ = desc.sourceWidth;srcH_ = desc.sourceHeight;workW_ = desc.workWidth;@@ -140,6 +149,7 @@ bool EnhanceGraph::createResources()}}srcRgba_ = makeTexture(context_.device(), srcW_, srcH_, DXGI_FORMAT_R16G16B16A16_FLOAT, true);+ if(srEnabled_&&desc_.videoSrQuality){videoSrInput_=makeTexture(context_.device(),srcW_,srcH_,DXGI_FORMAT_R8G8B8A8_UNORM,true);videoSrOutput_=makeTexture(context_.device(),workW_,workH_,DXGI_FORMAT_R8G8B8A8_UNORM,true);if(!videoSrInput_||!videoSrOutput_)return false;}workRgba_ = makeTexture(context_.device(), workW_, workH_, DXGI_FORMAT_R16G16B16A16_FLOAT, true);for(unsigned i=0;i<2;++i){sourceReferences_[i]=makeTexture(context_.device(),srcW_,srcH_,DXGI_FORMAT_R16G16B16A16_FLOAT,false);baseReferences_[i]=makeTexture(context_.device(),workW_,workH_,DXGI_FORMAT_R16G16B16A16_FLOAT,false);if(!sourceReferences_[i]||!baseReferences_[i])return false;}nrInput_=makeTexture(context_.device(),nrW_,nrH_,DXGI_FORMAT_R16G16B16A16_FLOAT,true);@@ -395,7 +405,8 @@ bool EnhanceGraph::initNgxFeatures()sd.perfQuality = 1; sd.enableOutputSubrects = false;ID3D12GraphicsCommandList* list = ring_.acquire(0, st);if (list == nullptr) return false;- if (!srBackend_->create(*coreHost_, list, ngxParams_, sd, st) || !srBackend_->created()) {+ if(desc_.videoSrQuality){videoSrBackend_=std::make_unique<ngx::VideoSrBackend>();if(!videoSrBackend_->create(*coreHost_,list))return false;veyra::log::info("video-sr",std::format("selected quality={} input={}x{} output={}x{}",desc_.videoSrQuality,srcW_,srcH_,workW_,workH_));}+ else if (!srBackend_->create(*coreHost_, list, ngxParams_, sd, st) || !srBackend_->created()) {veyra::log::error("graph", "SR create failed");return false;}@@ -477,7 +488,7 @@ bool EnhanceGraph::createComputePasses()if(desc_.rgbInput&&(!rgbPass_.loadShader("RgbToLinear.dxil",cs)||!rgbPass_.create(context_.device(),cs,4,1,1)))return false;if (!encPass_.loadShader("ParityEncode.dxil", cs) || !encPass_.create(context_.device(), cs, 8, 1, 1)) return false;if (!decPass_.loadShader("ParityDecode.dxil", cs) || !decPass_.create(context_.device(), cs, 8)) return false;- if (!blitPass_.loadShader("ScaleBlit.dxil", cs) || !blitPass_.create(context_.device(), cs, 16, 1, 1)) return false;+ if (!blitPass_.loadShader("ScaleBlit.dxil", cs) || !blitPass_.create(context_.device(), cs, 18, 1, 1)) return false;// Nv12Upload stays: frame-time CopyTextureRegion is poisoned by the// injected layer (SEH in NGX evaluate, r33-final3 evidence); the compute// upload is the proven frame-path ingestion on this system.@@ -559,6 +570,8 @@ bool EnhanceGraph::createViews()// 7/8: videoFrame SRV 9: nvofInB UAV (NVOF B:=video)// 10: genTex SRV 11/12: videoFrame SRV (presents)// 13/14: genTex SRV (slot 2)+ if(videoSrInput_&&viewsUav)makeUav(context_.device(),videoSrInput_.Get(),DXGI_FORMAT_R8G8B8A8_UNORM,cpu(blitPass_,16));+ if(videoSrOutput_&&viewsTex)stagedSrv(videoSrOutput_.Get(),DXGI_FORMAT_R8G8B8A8_UNORM,blitPass_,17);if (viewsTex) stagedSrv(srcRgba_.Get(), DXGI_FORMAT_R16G16B16A16_FLOAT, blitPass_, 0);if (viewsUav) makeUav(context_.device(), workRgba_.Get(), DXGI_FORMAT_R16G16B16A16_FLOAT, cpu(blitPass_, 1));if (viewsTex) stagedSrv(nrEnabled_ ? residualRgba_.Get() : workRgba_.Get(), DXGI_FORMAT_R16G16B16A16_FLOAT, blitPass_, 2);@@ -828,7 +841,7 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frame// Guidance from original source-space color before SR/NR. Queue waits are GPU-side.bool haveFlow = false;- const bool runMotion = nvofStandalone_ || fgEnabled_ || srEnabled_;+ const bool runMotion = nvofStandalone_ || fgEnabled_ || (srEnabled_ && !desc_.videoSrQuality);if (runMotion && nvof_ && nvof_->initialized()) {const float dims[8] = {uintBits(nvofW_),uintBits(nvofH_),uintBits(nvofW_),uintBits(nvofH_),0,0,0,0};if (prevValid_) {@@ -892,7 +905,18 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frameout.batch.batchId=realFrameIndex_+1;out.batch.identity={epoch_,desc_.settingsRevision,sourceFrameId};out.batch.a100ns=static_cast<int64_t>(std::llround(prevPtsMs_*10000));out.batch.b100ns=static_cast<int64_t>(std::llround(ptsMs*10000));gpuTimer_.identity(out.batch.identity);- if (srEnabled_ && srBackend_ && srBackend_->created()) {+ if(srEnabled_&&videoSrBackend_){+ gpuTimer_.mark(list,GpuStage::Sr);+ tracker_.transition(list,videoSrInput_.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);+ const float enc[8]={uintBits(srcW_),uintBits(srcH_),uintBits(srcW_),uintBits(srcH_),1,0,0,0};+ blitPass_.bind(list,enc,gpuHandleOf(blitPass_,0).ptr,gpuHandleOf(blitPass_,16).ptr);list->Dispatch((srcW_+15)/16,(srcH_+15)/16,1);tracker_.uavBarrier(list,videoSrInput_.Get());+ tracker_.transition(list,videoSrInput_.Get(),D3D12_RESOURCE_STATE_COMMON);tracker_.transition(list,videoSrOutput_.Get(),D3D12_RESOURCE_STATE_COMMON);+ if(!videoSrBackend_->evaluate(list,videoSrInput_.Get(),videoSrOutput_.Get(),desc_.videoSrQuality))return false;+ tracker_.uavBarrier(list,videoSrOutput_.Get());tracker_.transition(list,videoSrOutput_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);tracker_.transition(list,workRgba_.Get(),D3D12_RESOURCE_STATE_UNORDERED_ACCESS);+ const float dec[8]={uintBits(workW_),uintBits(workH_),uintBits(workW_),uintBits(workH_),-1,0,0,0};+ blitPass_.bind(list,dec,gpuHandleOf(blitPass_,17).ptr,gpuHandleOf(blitPass_,1).ptr);list->Dispatch((workW_+15)/16,(workH_+15)/16,1);tracker_.uavBarrier(list,workRgba_.Get());tracker_.transition(list,workRgba_.Get(),D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);+ ++metrics_.srEvaluateCount;gpuTimer_.mark(list,GpuStage::Sr,true);+ } else if (srEnabled_ && srBackend_ && srBackend_->created()) {gpuTimer_.mark(list,GpuStage::Sr);tracker_.transition(list, workRgba_.Get(), D3D12_RESOURCE_STATE_UNORDERED_ACCESS);ngx::DlssSrBackend::EvalDesc ed{};@@ -900,6 +924,7 @@ bool EnhanceGraph::process(const AVFrame* frame, double ptsMs, bool reset, Frameed.output = workRgba_.Get();ed.depth = nrZeroDepth_.Get();ed.motionVectors = haveFlow?baseFlow_.Get():nrZeroMotion_.Get();+ if(desc_.srMotionProbe)ed.motionVectors=desc_.srMotionProbe;ed.reset = reset;if (!srBackend_->evaluate(list, ngxParams_, ed, st)) {veyra::log::error("graph", "sr evaluate failed");@@ -1120,7 +1145,7 @@ bool EnhanceGraph::resolveGeneration(FrameOutputs& out)}bool EnhanceGraph::applySettings(const engine::EnhancementSettings& s){- if(!s.validate().empty()||(s.multiplier>1&&(!fgCapsAvailable_||s.multiplier-1>uint32_t(fgMultiFrameMax_))))return false;+ if(s.videoSrQuality!=desc_.videoSrQuality||!s.validate().empty()||(s.multiplier>1&&(!fgCapsAvailable_||s.multiplier-1>uint32_t(fgMultiFrameMax_))))return false;desc_.contentRate=s.content;desc_.model=s.model;desc_.residual=s.residual;desc_.protection=s.protection;desc_.settingsRevision=s.revision;desc_.fgMultiplier=std::max(2u,s.multiplier);desc_.enableNvofStandalone=s.nr&&!desc_.stillImage;nvofStandalone_=desc_.enableNvofStandalone;setNrEnabled(s.nr);setFgEnabled(s.multiplier>1);@@ -1187,6 +1212,7 @@ void EnhanceGraph::shutdown()nrHandle_ = nullptr;}if (fgBackend_) fgBackend_->release();+ if(videoSrBackend_){videoSrBackend_->release();videoSrBackend_.reset();}if (srBackend_) srBackend_->release();// NVOF teardown in THREE phases (ownership rule proven by t10-L0-r2):@@ -1240,7 +1266,7 @@ void EnhanceGraph::shutdown()neuralTex_.Reset();proxyTex_.Reset();for(auto& r:sourceReferences_)r.Reset();for(auto& r:baseReferences_)r.Reset();workRgba_.Reset();- srcRgba_.Reset();+ srcRgba_.Reset();videoSrInput_.Reset();videoSrOutput_.Reset();chromaTex_.Reset();lumaTex_.Reset();upZeroMotion_.Reset();diff --git a/src/source/CaptureCardSource.cpp b/src/source/CaptureCardSource.cppindex 813e4b21..273537dc 100644--- a/src/source/CaptureCardSource.cpp+++ b/src/source/CaptureCardSource.cpp@@ -76,7 +76,11 @@ CaptureCardSource::CaptureCardSource():p_(std::make_unique<Impl>()){}CaptureCardSource::~CaptureCardSource(){close();}std::vector<std::wstring> CaptureCardSource::devices(bool audio){std::vector<std::wstring> result;for(auto& m:monikers(audio)){ComPtr<IPropertyBag> bag;VARIANT v;VariantInit(&v);std::wstring name=L"Unknown capture device";if(SUCCEEDED(m->BindToStorage(nullptr,nullptr,IID_PPV_ARGS(&bag)))&&SUCCEEDED(bag->Read(L"FriendlyName",&v,nullptr))&&v.vt==VT_BSTR)name=v.bstrVal;VariantClear(&v);result.push_back(name);}return result;}std::vector<CaptureFormat> CaptureCardSource::formats(unsigned device){ComPtr<IGraphBuilder> g;ComPtr<ICaptureGraphBuilder2>b;ComPtr<IBaseFilter>f;ComPtr<IAMStreamConfig>c;std::vector<CaptureFormat> out;if(!configuration(device,g,b,f,c))return out;int count=0,size=0;if(FAILED(c->GetNumberOfCapabilities(&count,&size))||size<1||size>65536)return out;std::vector<BYTE> caps(size);for(int i=0;i<count;++i){AM_MEDIA_TYPE* t=nullptr;if(FAILED(c->GetStreamCaps(i,&t,caps.data())))continue;BITMAPINFOHEADER* bm=nullptr;REFERENCE_TIME duration=0;if(t->formattype==FORMAT_VideoInfo&&t->cbFormat>=sizeof(VIDEOINFOHEADER)){auto* vi=reinterpret_cast<VIDEOINFOHEADER*>(t->pbFormat);bm=&vi->bmiHeader;duration=vi->AvgTimePerFrame;}else if(t->formattype==FORMAT_VideoInfo2&&t->cbFormat>=sizeof(VIDEOINFOHEADER2)){auto* vi=reinterpret_cast<VIDEOINFOHEADER2*>(t->pbFormat);bm=&vi->bmiHeader;duration=vi->AvgTimePerFrame;}- if(bm&&bm->biWidth>0&&bm->biWidth<=3840&&abs(bm->biHeight)<=2160&&duration>0){unsigned w=bm->biWidth,h=abs(bm->biHeight);double fps=1e7/duration;if((w==1920&&h==1080||w==3840&&h==2160)&&fps>=29&&fps<=61)out.push_back({i,w,h,fps,std::format(L"{} x {} @ {:.2f} fps [format {}]",w,h,fps,i)});}freeType(t);}return out;}+ // Device capabilities, not a 1080p/2160p 30/60 preset list. Keep native+ // indices so the selected row opens the exact driver media type.+ if(bm&&bm->biWidth>0&&bm->biWidth<=3840&&std::abs(int64_t(bm->biHeight))>0&&std::abs(int64_t(bm->biHeight))<=2160&&duration>0){unsigned w=bm->biWidth,h=unsigned(std::abs(int64_t(bm->biHeight)));double fps=1e7/duration;+ wchar_t guid[40]{};StringFromGUID2(t->subtype,guid,40);const wchar_t* pixel=t->subtype==MEDIASUBTYPE_YUY2?L"YUY2":t->subtype==MEDIASUBTYPE_MJPG?L"MJPEG":t->subtype==MEDIASUBTYPE_NV12?L"NV12":t->subtype==MEDIASUBTYPE_RGB32?L"RGB32":guid;+ out.push_back({i,w,h,fps,std::format(L"{} x {} @ {:.2f} fps · {} [format {}]",w,h,fps,pixel,i)});}freeType(t);}return out;}const SourceInfo& CaptureCardSource::info()const{return p_->info;}bool CaptureCardSource::setAudioGain(float gain){auto& p=*p_;if(!p.graph||!p.audioFilter)return false;@@ -88,7 +92,7 @@ bool CaptureCardSource::setAudioGain(float gain){bool CaptureCardSource::open(const SourceOpenDesc& desc){return configure(desc)&&start();}bool CaptureCardSource::configure(const SourceOpenDesc& desc){close();p_->lastAudioGain=-1;auto& p=*p_;unsigned index=0;int format=0,audio=-1;if(swscanf_s(desc.path.c_str(),L"capture:%u:%d:%d",&index,&format,&audio)!=3)return false;if(!configuration(index,p.graph,p.builder,p.device,p.config))return false;- int count=0,size=0;if(FAILED(p.config->GetNumberOfCapabilities(&count,&size))||format<0||format>=count||size<=0||size>65536)return false;std::vector<BYTE> caps(size);AM_MEDIA_TYPE* native=nullptr;if(FAILED(p.config->GetStreamCaps(format,&native,caps.data())))return false;HRESULT hr=p.config->SetFormat(native);freeType(native);if(FAILED(hr))return false;+ int count=0,size=0;if(FAILED(p.config->GetNumberOfCapabilities(&count,&size))||format<0||format>=count||size<=0||size>65536)return false;std::vector<BYTE> caps(size);AM_MEDIA_TYPE* native=nullptr;if(FAILED(p.config->GetStreamCaps(format,&native,caps.data())))return false;HRESULT hr=p.config->SetFormat(native);log::info("capture",std::format("SetFormat device={} nativeIndex={} subtype=0x{:08X} hr=0x{:08X}",index,format,native->subtype.Data1,uint32_t(hr)));freeType(native);if(FAILED(hr))return false;if(FAILED(CoCreateInstance(SampleGrabberClass,nullptr,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&p.grabFilter)))||FAILED(p.grabFilter.As(&p.grab))||FAILED(p.graph->AddFilter(p.grabFilter.Get(),L"Latest frame mailbox")))return false;AM_MEDIA_TYPE want{};want.majortype=MEDIATYPE_Video;want.subtype=MEDIASUBTYPE_RGB32;want.formattype=FORMAT_VideoInfo;if(FAILED(p.grab->SetMediaType(&want))||FAILED(CoCreateInstance(NullRendererClass,nullptr,CLSCTX_INPROC_SERVER,IID_PPV_ARGS(&p.nullFilter)))||FAILED(p.graph->AddFilter(p.nullFilter.Get(),L"Video sink"))||FAILED(p.builder->RenderStream(&PIN_CATEGORY_CAPTURE,&MEDIATYPE_Video,p.device.Get(),p.grabFilter.Get(),p.nullFilter.Get())))return false;diff --git a/tests/integration/CaptureSourceTests.cpp b/tests/integration/CaptureSourceTests.cppindex 245f18d6..7c8975d9 100644--- a/tests/integration/CaptureSourceTests.cpp+++ b/tests/integration/CaptureSourceTests.cpp@@ -11,6 +11,11 @@ extern "C" {#include <libavutil/frame.h>}int wmain(int argc,wchar_t** argv){+ if(argc==2&&wcscmp(argv[1],L"--list")==0){+ CoInitializeEx(nullptr,COINIT_MULTITHREADED);auto devices=veyra::source::CaptureCardSource::devices();+ for(unsigned d=0;d<devices.size();++d){wprintf(L"DEVICE %u %ls\n",d,devices[d].c_str());for(const auto& f:veyra::source::CaptureCardSource::formats(d))wprintf(L"FORMAT %u:%d %ls\n",d,f.index,f.label.c_str());}+ CoUninitialize();return devices.empty()?1:0;+ }if(argc!=2){printf("Specify capture:device:format:audio; real hardware required\n");return 2;}CoInitializeEx(nullptr,COINIT_MULTITHREADED);veyra::source::CaptureCardSource source;veyra::source::SourceOpenDesc d;d.path=argv[1];diff --git a/tests/integration/SrReconstructionTests.cpp b/tests/integration/SrReconstructionTests.cppindex 59d111f0..e36d97b7 100644--- a/tests/integration/SrReconstructionTests.cpp+++ b/tests/integration/SrReconstructionTests.cpp@@ -21,16 +21,36 @@ uint64_t hash(const sink::RgbaImage& image){uint64_t v=14695981039346656037ull;fint experiment(const std::filesystem::path& dir,unsigned scene){std::array<float,256> linear{};for(unsigned i=0;i<256;++i){float s=i/255.f;linear[i]=s<=.04045f?s/12.92f:std::pow((s+.055f)/1.055f,2.4f);}auto encoded=[](float s){return uint8_t(std::clamp(std::lround((s<=.0031308f?s*12.92f:1.055f*std::pow(s,1/2.4f)-.055f)*255),0l,255l));};- std::vector<uint64_t> srHashes;std::vector<uint8_t> gt(size_t(W)*H*4);- for(unsigned mode=0;mode<3;++mode){+ std::vector<uint64_t> srHashes,oracleHashes;std::vector<uint8_t> gt(size_t(W)*H*4);+ for(unsigned mode=0;mode<8;++mode){gfx::D3D12DeviceContext ctx;gfx::CommandSlotRing ring;Status status;gfx::DeviceContextDesc dd;dd.enableDebugLayer=true;if(!ctx.initialize(dd,status)||!ring.initialize(ctx.device(),ctx.directQueue(),ctx.fence(),ctx.fenceEvent(),6,status))return 2;pipeline::EnhanceGraph graph(ctx,ring);pipeline::EnhanceGraphDesc gd;gd.sourceWidth=W/2;gd.sourceHeight=H/2;gd.workWidth=W;gd.workHeight=H;gd.rgbInput=true;gd.enableNr=false;gd.enableFg=false;gd.enableSr=mode!=0;gd.enableNvofStandalone=true;gd.runtimeAbsPath=(std::filesystem::path(VEYRA_PROJECT_ROOT)/"runtime_local/nvidia").wstring();+ pipeline::ComPtr<ID3D12Resource> motion,upload;+ gd.validateMotion=mode!=7;+ if(mode>=3&&mode<=6){motion=pipeline::makeTexture(ctx.device(),W,H,DXGI_FORMAT_R16G16_FLOAT,false);upload=pipeline::makeUploadBuffer(ctx.device(),uint64_t(W)*H*4);if(!motion||!upload)return 2;gd.srMotionProbe=motion.Get();}+ if(mode==3){+ auto invalid=gd;invalid.workWidth=W-1;if(graph.initialize(invalid))return 1;+ invalid=gd;invalid.enableSr=false;if(graph.initialize(invalid))return 1;+ auto wrongFormat=pipeline::makeTexture(ctx.device(),W,H,DXGI_FORMAT_R32_FLOAT,false);if(!wrongFormat)return 2;+ invalid=gd;invalid.srMotionProbe=wrongFormat.Get();if(graph.initialize(invalid))return 1;+ std::cout<<"SR_MOTION_CONTRACT rejectedWidth=1 rejectedDisabled=1 rejectedFormat=1"<<std::endl;+ }if(!graph.initialize(gd)||!graph.createViews())return 2;AVFrame* f=av_frame_alloc();if(!f)return 2;f->width=W/2;f->height=H/2;f->format=AV_PIX_FMT_RGBA;f->color_range=AVCOL_RANGE_JPEG;f->color_trc=AVCOL_TRC_IEC61966_2_1;f->colorspace=AVCOL_SPC_RGB;if(av_frame_get_buffer(f,32)<0){av_frame_free(&f);return 2;}std::vector<int16_t> previousError(size_t(W)*H*3),currentError(previousError.size());std::vector<double> srTimes;uint64_t absolute=0,squared=0,samples=0,temporal=0,temporalSamples=0;unsigned maximum=0;bool ok=true;+ uint64_t warmAbsolute=0,warmSamples=0,warmTemporal=0,warmTemporalSamples=0;for(unsigned frame=0;frame<N&&ok;++frame){+ if(motion){+ void* data=nullptr;if(FAILED(upload->Map(0,nullptr,&data))){ok=false;break;}+ for(unsigned y=0;y<H;++y)for(unsigned x=0;x<W;++x){const bool object=scene==1&&foreground(x,y,frame);const int px=int(x)+(object?-8:4);const bool valid=frame>0&&mode!=4&&px>=0&&px<int(W)&&(scene==0||foreground(px,y,frame-1)==object);+ uint16_t dx=valid?(object?0xc800:0x4400):0;if(valid&&mode==5)dx^=0x8000;auto* p=static_cast<uint16_t*>(data)+(size_t(y)*W+x)*2;p[0]=dx;p[1]=0;}+ upload->Unmap(0,nullptr);unsigned slot=0;auto* list=ring.acquireNext(slot,status);if(!list){ok=false;break;}+ D3D12_RESOURCE_BARRIER b{};b.Type=D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;b.Transition={motion.Get(),D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES,frame?D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE:D3D12_RESOURCE_STATE_COMMON,D3D12_RESOURCE_STATE_COPY_DEST};list->ResourceBarrier(1,&b);+ D3D12_TEXTURE_COPY_LOCATION dst{},src{};dst.pResource=motion.Get();dst.Type=D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;src.pResource=upload.Get();src.Type=D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;src.PlacedFootprint.Footprint={DXGI_FORMAT_R16G16_FLOAT,W,H,1,W*4};list->CopyTextureRegion(&dst,0,0,0,&src,nullptr);b.Transition.StateBefore=D3D12_RESOURCE_STATE_COPY_DEST;b.Transition.StateAfter=D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE;list->ResourceBarrier(1,&b);+ if(!ring.submitAndSignal(slot)||!ring.drainQueue()){ok=false;break;}+ }// Every sample derives from the same exact high-resolution scene.for(unsigned y=0;y<H;++y)for(unsigned x=0;x<W;++x){const int q=int(x)+int(frame)*4;const bool object=scene==1&&foreground(x,y,frame);@@ -45,19 +65,22 @@ int experiment(const std::filesystem::path& dir,unsigned scene){pipeline::EnhanceGraph::FrameOutputs out;sink::RgbaImage image;ok=graph.process(f,frame*(1000.0/60),frame==0,out,frame+1)&&sink::readRgba8(ctx,ring,graph.videoFrameResource(out.videoSlot),image);if(!ok)break;ok=image.width==W&&image.height==H&&image.pixels.size()==gt.size();if(!ok)break;const auto h=hash(image);if(mode==1)srHashes.push_back(h);if(mode==2)ok=h==srHashes[frame];+ if(mode==3)oracleHashes.push_back(h);if(mode==6)ok=h==oracleHashes[frame];for(unsigned y=0;y<H;++y)for(unsigned x=0;x<W;++x){const bool object=scene==1&&foreground(x,y,frame);const int px=int(x)+(object?-8:4);const bool temporalValid=frame>0&&px>=0&&px<int(W)&&(scene==0||foreground(px,y,frame-1)==object);for(unsigned c=0;c<3;++c){const size_t i=(size_t(y)*W+x)*3+c;const int error=int(image.pixels[(size_t(y)*W+x)*4+c])-int(gt[(size_t(y)*W+x)*4+c]);currentError[i]=int16_t(error);const unsigned a=unsigned(std::abs(error));absolute+=a;squared+=uint64_t(a)*a;++samples;maximum=std::max(maximum,a);- if(temporalValid){temporal+=std::abs(error-previousError[(size_t(y)*W+px)*3+c]);++temporalSamples;}}+ if(frame>=4){warmAbsolute+=a;++warmSamples;}+ if(temporalValid){const auto delta=std::abs(error-previousError[(size_t(y)*W+px)*3+c]);temporal+=delta;++temporalSamples;if(frame>=4){warmTemporal+=delta;++warmTemporalSamples;}}}}previousError.swap(currentError);const auto metrics=graph.gpuMetrics();const auto& timing=metrics.gpu[size_t(diagnostics::GpuStage::Sr)];if(frame>=4&&metrics.identity.sourceFrameId==frame+1&&timing.state==diagnostics::SampleState::Measured&&timing.milliseconds)srTimes.push_back(*timing.milliseconds);if(frame+1==N)ok=ok&&sink::saveImage((dir/("scene"+std::to_string(scene)+"-mode"+std::to_string(mode)+".png")).wstring(),image);if(frame+1==N&&mode==0){sink::RgbaImage reference{W,H,gt},input{W/2,H/2,{}};input.pixels.resize(size_t(W/2)*(H/2)*4);for(unsigned y=0;y<H/2;++y)std::copy_n(f->data[0]+size_t(y)*f->linesize[0],W/2*4,input.pixels.data()+size_t(y)*(W/2)*4);ok=ok&&sink::saveImage((dir/L"reference.png").wstring(),reference)&&sink::saveImage((dir/L"input.png").wstring(),input);}}- av_frame_free(&f);auto m=graph.metrics();ok=ok&&m.nrEvaluateCount==0&&m.srEvaluateCount==(mode?N:0)&&m.nvofExecuteCount==N-1&&m.nvofFrameFailures==0&&m.resetCount==1&&samples==uint64_t(N)*W*H*3&&temporalSamples>0;+ av_frame_free(&f);auto m=graph.metrics();ok=ok&&m.nrEvaluateCount==0&&m.srEvaluateCount==(mode?N:0)&&m.nvofExecuteCount==N-1&&m.nvofFrameFailures==0&&m.resetCount==1&&samples==uint64_t(N)*W*H*3&&temporalSamples>0&&warmSamples==uint64_t(N-4)*W*H*3&&warmTemporalSamples>0;ok=ring.drainQueue()&&ok;graph.shutdown();pipeline::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 size=0;if(FAILED(iq->GetMessage(i,nullptr,&size)))return 2;std::vector<uint8_t> bytes(size);auto* msg=reinterpret_cast<D3D12_MESSAGE*>(bytes.data());if(FAILED(iq->GetMessage(i,msg,&size)))return 2;if(msg->Severity<=D3D12_MESSAGE_SEVERITY_ERROR){++errors;std::cerr<<msg->pDescription<<std::endl;}}std::sort(srTimes.begin(),srTimes.end());double mean=0;for(auto v:srTimes)mean+=v;mean=srTimes.empty()?-1:mean/srTimes.size();+ std::cout<<"SR_MOTION scene="<<scene<<" mode="<<mode<<" warmMae8="<<double(warmAbsolute)/warmSamples<<" warmTemporalErrorMae8="<<double(warmTemporal)/warmTemporalSamples<<std::endl;std::cout<<"SR_RECON scene="<<scene<<" mode="<<mode<<" source=1920x1080 output=3840x2160 frames="<<N<<" sr="<<m.srEvaluateCount<<" nvof="<<m.nvofExecuteCount<<" reset="<<m.resetCount<<" mae8="<<double(absolute)/samples<<" psnr="<<(squared?10*std::log10(255.*255.*samples/squared):999)<<" max="<<maximum<<" temporalErrorMae8="<<double(temporal)/temporalSamples<<" gpuSrSamples="<<srTimes.size()<<" gpuSrMeanMs="<<mean<<" gpuSrP95Ms="<<(srTimes.empty()?-1:srTimes[size_t(std::ceil(srTimes.size()*.95))-1])<<" errors="<<errors<<" pass="<<(ok&&!errors)<<std::endl;if(!ok||errors)return 1;}diff --git a/tests/unit/RepairPresetTests.cpp b/tests/unit/RepairPresetTests.cppindex d135db0e..e60b1cdf 100644--- a/tests/unit/RepairPresetTests.cpp+++ b/tests/unit/RepairPresetTests.cpp@@ -1,8 +1,9 @@#include "veyra/engine/PresetStore.h"#include <iostream>#include <fstream>-int main(int argc,char** argv){if(argc!=2)return 2;using namespace veyra::engine;const std::filesystem::path p=argv[1];PresetStore a(p);bool ok=a.load();EnhancementSettings s;s.protection.enabled=true;s.protection.featherPixels=3.5f;s.protection.regions[0]={.1f,.2f,.7f,.8f};s.protection.regions[3]={0,0,1,1};s.model.intensity=.375f;s.model.skin=1.5f;s.residual.darken=1.2f;s.multiplier=4;s.flow=FlowQuality::Quality;s.content=ContentRate::Fps50;s.nrPolicy=veyra::pipeline::NrSizePolicy::Native;+int main(int argc,char** argv){if(argc!=2)return 2;using namespace veyra::engine;const std::filesystem::path p=argv[1];PresetStore a(p);bool ok=a.load();EnhancementSettings s;s.videoSrQuality=2;s.protection.enabled=true;s.protection.featherPixels=3.5f;s.protection.regions[0]={.1f,.2f,.7f,.8f};s.protection.regions[3]={0,0,1,1};s.model.intensity=.375f;s.model.skin=1.5f;s.residual.darken=1.2f;s.multiplier=4;s.flow=FlowQuality::Quality;s.content=ContentRate::Fps50;s.nrPolicy=veyra::pipeline::NrSizePolicy::Native;ok=ok&&a.put(L"test",s)&&a.setDefault(0)&&!a.put(L"test",s);PresetStore b(p);ok=ok&&b.load()&&b.defaultSettings()==s&&b.rename(0,L"renamed")&&b.defaultSettings()==s;+ auto badSr=s;badSr.videoSrQuality=5;ok=ok&&!b.put(L"invalid video SR",badSr);auto invalid=s;invalid.model.tone=9;ok=ok&&!b.put(L"bad",invalid)&&b.entries().size()==1&&b.erase(0)&&b.entries().empty();auto badRegion=s;badRegion.protection.regions[0].left=2;ok=ok&&!b.put(L"invalid region",badRegion);{std::ofstream legacy(p);legacy<<"VEYRA_PRESETS 1\n\"legacy\" 1\n\"legacy\" 1 1 1 -1 0 0 0 1 1 1 1 1 1 0 1 0 1 0\n";}