Skip to content

Commit 1f525bf

Browse files
committed
Merge validated CI simplification and v0.4.3 release into main
2 parents 6bf6ffb + 9bca69b commit 1f525bf

17 files changed

Lines changed: 818 additions & 58 deletions

‎.github/workflows/build-windows.yml‎

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Build Windows x64
33
on:
44
workflow_call:
55
inputs:
6+
run_core:
7+
description: Run independent CPU and WARP core regression
8+
required: false
9+
default: true
10+
type: boolean
611
expected_tag:
712
description: Exact release tag; empty for build-only validation
813
required: false
@@ -46,45 +51,30 @@ jobs:
4651
run: ./tools/setup-build-tools.ps1
4752
- name: Prepare pinned RenoDX host and dependencies
4853
run: ./tools/setup-host.ps1
49-
- name: Prepare pinned offline CPython 3.12.14 x64
50-
id: offline-python
54+
- name: Build clean Publishing Release x64
5155
run: |
52-
$python = ./tools/offline/setup-python.ps1
53-
"python=$python" >> $env:GITHUB_OUTPUT
54-
- name: Build Release x64
55-
run: ./tools/build.ps1 -ToolRoot .local/shader-tools -Configuration Release
56-
- name: Build E0 Replay backend
57-
run: ./tools/offline/build.ps1 -Backend replay -OutputDirectory tmp/offline/ci-replay-build
58-
- name: Run offline Python contracts and real WARP Replay tests
59-
env:
60-
NR_NEXUS_PYTHON: ${{ steps.offline-python.outputs.python }}
56+
if (Test-Path -LiteralPath build) { throw 'Publishing requires a fresh build directory.' }
57+
./tools/build.ps1 -ToolRoot .local/shader-tools -Configuration Release
58+
- name: Run independent core regression
59+
if: ${{ inputs.run_core }}
6160
run: |
62-
pwsh -NoProfile -File tools/offline/test.ps1 -PythonPath "$env:NR_NEXUS_PYTHON" -TestSet all -ReplayBackendExe tmp/offline/ci-replay-build/offline_replay_tests.exe -Adapter warp *>&1 | Tee-Object -FilePath tmp/offline/ci-python-tests.log
63-
exit $LASTEXITCODE
64-
- name: Upload offline WARP results and failure logs
65-
if: ${{ always() }}
61+
./tests/run-ci-evidence-tests.ps1
62+
./tests/run-ci-publishing-tests.ps1
63+
./tools/ci-core.ps1 -OutputDirectory tmp/ci-tests/core
64+
- name: Upload core results and failure logs
65+
if: ${{ always() && inputs.run_core }}
6666
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
6767
with:
68-
name: offline-warp-${{ github.run_attempt }}
69-
path: tmp/offline/
68+
name: core-regression-${{ github.run_attempt }}
69+
path: tmp/ci-tests/
7070
if-no-files-found: warn
7171
retention-days: 14
72-
- name: Check repeated compiler environment initialization
73-
run: ./tests/run-build-environment-tests.ps1
74-
- name: Run focused tests with WARP
75-
run: ./tools/run-tests.ps1 -Suite all -SoftwareOnly -OutputDirectory tmp/ci-tests
76-
- name: Validate packaging gates
77-
run: ./tests/run-package-tests.ps1
78-
- name: Validate publication failure and retry boundaries without publishing
79-
run: |
80-
./tests/run-release-notes-tests.ps1
81-
./tests/run-release-tests.ps1
82-
- name: Package and verify versioned plugin archive
72+
- name: Verify Publishing isolation and package
8373
id: package
8474
env:
8575
EXPECTED_TAG: ${{ inputs.expected_tag }}
8676
run: |
87-
$package = ./tools/package.ps1 -ExpectedTag $env:EXPECTED_TAG
77+
$package = ./tools/check-publishing.ps1 -ExpectedTag $env:EXPECTED_TAG
8878
"artifact_name=windows-x64-$env:GITHUB_RUN_ATTEMPT" >> $env:GITHUB_OUTPUT
8979
"archive_name=$([IO.Path]::GetFileName($package.ArchivePath))" >> $env:GITHUB_OUTPUT
9080
- name: Upload installable archive and checksum

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,31 @@ on:
99

1010
permissions:
1111
contents: read
12+
actions: read
1213

1314
concurrency:
1415
group: ci-${{ github.event.pull_request.number || github.ref }}
1516
cancel-in-progress: true
1617

1718
jobs:
19+
evidence:
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
outputs:
23+
run_core: ${{ steps.evidence.outputs.run_core }}
24+
steps:
25+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
28+
- name: Resolve exact-tree core evidence
29+
id: evidence
30+
shell: pwsh
31+
env:
32+
GH_TOKEN: ${{ github.token }}
33+
run: ./tools/ci-evidence.ps1 -Mode Branch
1834
windows:
35+
needs: evidence
36+
if: ${{ needs.evidence.outputs.run_core == 'true' }}
1937
uses: ./.github/workflows/build-windows.yml
38+
with:
39+
run_core: true

‎.github/workflows/release.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,30 @@ on:
66

77
permissions:
88
contents: read
9+
actions: read
910

1011
concurrency:
1112
group: release-${{ github.ref }}
1213
cancel-in-progress: false
1314

1415
jobs:
16+
evidence:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
steps:
20+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21+
with:
22+
persist-credentials: false
23+
- name: Require exact-tree branch core evidence
24+
shell: pwsh
25+
env:
26+
GH_TOKEN: ${{ github.token }}
27+
run: ./tools/ci-evidence.ps1 -Mode Release
1528
build:
29+
needs: evidence
1630
uses: ./.github/workflows/build-windows.yml
1731
with:
32+
run_core: false
1833
expected_tag: ${{ github.ref_name }}
1934
publish:
2035
needs: build

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Runtime DLL、模型和游戏资源另行获取。
212212

213213
[version.h](version.h) 定义插件版本,Git Commit 标识源码。`dev.N` 和可选的 `rc.N` 为预发布版本;
214214
安装以[最新正式版](https://github.com/williamstosh/DLSS5-NR-Nexus/releases/latest)为准;较早正式版与预发布的功能变化统一查阅 [Release Notes](https://github.com/williamstosh/RenoDX-DLSSNR-Nexus/releases)。
215-
[CI](.github/workflows/ci.yml) 构建源码,版本 Tag 触发[发布工作流](.github/workflows/release.yml)。
215+
[CI](.github/workflows/ci.yml) 对开发分支执行干净构建和核心回归;`main` 仅在完整源码树(含依赖锁和工作流)一致且已有成功核心记录时复用结果。版本 Tag 触发[发布工作流](.github/workflows/release.yml),核验同身份核心证据后重新构建,并检查版本、开发诊断隔离、安装包及 SHA-256。
216216
日常提交和 Actions artifacts 是开发构建。从 v0.2.1 起,Windows ZIP 附带 **NR-Nexus-Guide.html 离线玩家手册**:解压后双击,即可在浏览器阅读完整中英文 README 与指南,无需联网或 Markdown 阅读器。手册内嵌配图,游戏画面采用已审核的 SDR 静态预览;在线交互对比、下载和外部参考链接需要网络。原 README、玩家指南、配图和许可文件仍保留。已发布的 v0.2.0 安装包不变。
217217

218218
<a id="zh-sources"></a>
@@ -457,8 +457,8 @@ DLLs, models and game assets are obtained separately.
457457
[version.h](version.h) defines the add-on version; Git commits identify the source.
458458
`dev.N` and optional `rc.N` identify pre-releases. Use the [latest stable release](https://github.com/williamstosh/DLSS5-NR-Nexus/releases/latest) for installation;
459459
see [Release Notes](https://github.com/williamstosh/RenoDX-DLSSNR-Nexus/releases) for earlier stable and pre-release feature changes.
460-
[CI](.github/workflows/ci.yml) builds the source, and version tags trigger the
461-
[release workflow](.github/workflows/release.yml). Daily commits and Actions artifacts are development builds.
460+
[CI](.github/workflows/ci.yml) performs a clean build and core regression checks for development branches. `main` reuses successful core evidence only when the complete source tree, including dependency locks and workflows, matches. Version tags trigger the
461+
[release workflow](.github/workflows/release.yml), which verifies matching core evidence, rebuilds the source, and checks the version, development-diagnostic isolation, package and SHA-256. Daily commits and Actions artifacts are development builds.
462462
Starting with v0.2.1, Windows ZIPs include an automatically generated **NR-Nexus-Guide.html offline player guide**. Extract it and double-click to read the complete Chinese and English README and User Guide in a browser, without a connection or Markdown reader. Images are embedded, with approved static SDR previews for game scenes; online interactive comparisons, downloads and external references require a connection. The original README, User Guide, images and licenses remain included. The published v0.2.0 package is unchanged.
463463

464464
<a id="en-sources"></a>

‎docs/releases/v0.4.3.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
### 修复内容
2121

22-
- 修复 Render 路径准备备用档位和原生帧生成颜色处理切换描述符堆时遗留旧资源绑定的问题。
22+
- 修复 Render 路径准备备用档位、原生帧生成颜色处理及 pre-FG 合成切换描述符堆时遗留旧资源绑定的问题。
23+
- 修复已有手动工作集切入双颜色自适应时,默认档数误报资源预算不足的问题。
24+
- 修复复制链跟踪将运行时的嵌套转发重复记为独立生产者、错误拒绝同队列有序输出的问题;对应混合链实验继续默认关闭。
2325
- 必需的 HUDless 输入持续缺失时暂停自动调节,避免永久停在准备状态;输入恢复后重置相应历史再恢复。
2426
- 修复 NR 关闭时私有 FG 记录阻挡资源退休的问题,保留 GPU 完成及外部资源安全条件。
2527
- 改进阶段设置错误提示、准备中关闭和重新启用的恢复路径,并扩展相应自动回归。
@@ -30,7 +32,7 @@
3032

3133
《巫师 3》DX12 的游戏内验证使用 **6 档固定静态场景**,覆盖准备就绪、有限阶段往返、关闭释放,以及准备中关闭后重新启用。**未进行游戏内 15 档或动态画质验收**。真实宿主的确认弹窗 Cancel 点击未完成,现有 ImGui/配置事务测试覆盖其取消语义;该宿主输入触发问题尚未定位。
3234

33-
v0.4.3 Tag 流程重新执行 Publishing 构建、软件自动测试、PE 版本及打包检查;最终附件在公开前核对源码身份、诊断隔离和 SHA-256。此前实机证据对应开发候选,最终发布附件不另计为已完成游戏验收。
35+
发布前保留完整本地预检,并由远端核心回归独立复核。v0.4.3 Tag 流程校验同一源码树的成功核心记录,重新执行 Publishing 构建、PE 版本、诊断隔离及打包检查;最终附件在公开前核对源码身份和 SHA-256。此前实机证据对应开发候选,最终发布附件不另计为已完成游戏验收。
3436

3537
### 已知限制
3638

@@ -57,7 +59,9 @@ Adaptive resolution now offers Default or 2–15 levels. It prepares the selecte
5759

5860
### Fixes
5961

60-
- Fixed stale resource bindings when preparing standby levels in the Render path and switching descriptor heaps for native frame-generation color processing.
62+
- Fixed stale resource bindings when preparing standby levels in the Render path and switching descriptor heaps for native frame-generation color processing and pre-FG composition.
63+
- Fixed a false resource-budget pause when existing manual worksets enter dual-color adaptive preparation with the Default level count.
64+
- Fixed copy-chain tracking treating nested runtime forwarding as an independent producer and incorrectly rejecting ordered output on the same queue. The corresponding mixed-chain experiment remains off by default.
6165
- Sustained loss of required HUDless input pauses automatic adjustment instead of leaving preparation pending indefinitely. Recovery resets the relevant history before resuming.
6266
- Fixed private FG recordings blocking resource retirement when NR is disabled, while retaining GPU-completion and external-resource safety requirements.
6367
- Improved stage-setting error messages and recovery when disabling NR during preparation and enabling it again, with corresponding automated regression coverage.
@@ -68,7 +72,7 @@ Affected CPU, strictly software WARP / MOCK, configuration transaction, real ImG
6872

6973
In-game Witcher 3 DX12 checks used **six levels in a fixed static scene**, covering readiness, limited stage round trips, resource release, and disabling NR during preparation followed by recovery. **Fifteen levels in game and dynamic image quality were not tested.** The confirmation dialog's Cancel click was not completed in the real host; existing ImGui and configuration transaction tests cover cancellation semantics. The host input-trigger issue remains unlocated.
7074

71-
The v0.4.3 tag workflow reruns the Publishing build, software automated tests, PE version and packaging checks. Final assets are checked for source identity, diagnostic isolation and SHA-256 before publication. Earlier in-game evidence belongs to development candidates; the final release assets do not receive an additional in-game acceptance claim.
75+
Full local preflight is retained, with independent core regression checks on CI. The v0.4.3 tag workflow verifies successful core evidence for the same source tree, then rebuilds Publishing and checks the PE version, diagnostic isolation and package. Final assets are checked for source identity and SHA-256 before publication. Earlier in-game evidence belongs to development candidates; the final release assets do not receive an additional in-game acceptance claim.
7276

7377
### Known Limitations
7478

‎fg_native.hpp‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,12 @@ inline fg::Result Record(Stream* stream, Slot* slot, ID3D12GraphicsCommandList*
496496
bool selection_pending = false;
497497
for (uint32_t i = 0; i < 2; ++i) {
498498
const auto feature = features.find(stream->roles[i].Handle());
499-
if (feature == features.end() || feature->second.adaptive_cache == nullptr
500-
|| !feature->second.adaptive_cache->resident) continue;
499+
if (feature == features.end()) continue;
500+
if (feature->second.adaptive_cache == nullptr) {
501+
selection_pending |= (required_model_roles & (1u << i)) != 0;
502+
continue;
503+
}
504+
if (!feature->second.adaptive_cache->resident) continue;
501505
auto& cache = *feature->second.adaptive_cache;
502506
if ((required_model_roles & (1u << i)) == 0) {
503507
if (stream->adaptive_session->settings.selected_levels == 0) {
@@ -528,13 +532,14 @@ inline fg::Result Record(Stream* stream, Slot* slot, ID3D12GraphicsCommandList*
528532
}
529533
if (selection_pending) {
530534
// A role's normal ProcessInline advances preparation before Record
531-
// reaches the next role. Reconcile the shared selection first, so an
532-
// intermediate old/new count can never latch a false budget failure.
535+
// reaches the next role. Adopt existing manual roles and reconcile the
536+
// shared selection first, so their old scratch is not counted outside
537+
// the group and an intermediate count cannot latch a false budget failure.
533538
for (uint32_t i = 0; i < 2; ++i) {
534539
if ((required_model_roles & (1u << i)) == 0) continue;
535540
const auto feature = features.find(stream->roles[i].Handle());
536-
if (feature == features.end() || feature->second.adaptive_cache == nullptr
537-
|| !feature->second.adaptive_cache->resident) continue;
541+
if (feature == features.end() || (feature->second.adaptive_cache != nullptr
542+
&& !feature->second.adaptive_cache->resident)) continue;
538543
auto selected = stream->adaptive_frame;
539544
selected.role = 1u << i;
540545
selected.slot = 0;

‎present_path.hpp‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ inline constexpr uint32_t kPresentPreFgCleanFrames = 30;
331331
// recycled game-resource addresses never retain a stale descriptor.
332332
inline constexpr uint32_t kPresentPreFgComposeSets = 16;
333333
inline constexpr uint32_t kPresentPreFgComposeDescriptors = 6;
334+
inline constexpr uint32_t kPresentPreFgComposeDepthNullSrv = kPresentPreFgComposeSets * kPresentPreFgComposeDescriptors;
335+
inline constexpr uint32_t kPresentPreFgComposeMotionNullSrv = kPresentPreFgComposeDepthNullSrv + 1;
334336
// Per slot: [HUD pixels, serial, grain-sized pixels] (the shader's Stats).
335337
inline constexpr uint32_t kPresentPreFgStatsWords = 3;
336338
// Under runtime_mutex. The composite's objects, made in the world (device
@@ -1618,14 +1620,26 @@ inline uint32_t ComposePresentPreFg(ID3D12GraphicsCommandList* command_list,
16181620
if (compose.heap == nullptr) {
16191621
D3D12_DESCRIPTOR_HEAP_DESC heap_desc{};
16201622
heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
1621-
heap_desc.NumDescriptors = kPresentPreFgComposeSets * kPresentPreFgComposeDescriptors;
1623+
heap_desc.NumDescriptors = kPresentPreFgComposeMotionNullSrv + 1;
16221624
heap_desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
16231625
if (FAILED(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&compose.heap)))) {
16241626
compose.heap = nullptr;
16251627
} else {
16261628
compose.heap->SetName(L"" NR_NEXUS_NAME " pre-FG compose descriptors");
16271629
compose.descriptor_size =
16281630
device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
1631+
D3D12_SHADER_RESOURCE_VIEW_DESC null_guide{};
1632+
null_guide.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
1633+
null_guide.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
1634+
null_guide.Texture2D.MipLevels = 1;
1635+
null_guide.Format = DXGI_FORMAT_R32_FLOAT;
1636+
device->CreateShaderResourceView(nullptr, &null_guide,
1637+
DescriptorHeapSlot(compose.heap->GetCPUDescriptorHandleForHeapStart(),
1638+
kPresentPreFgComposeDepthNullSrv, compose.descriptor_size));
1639+
null_guide.Format = DXGI_FORMAT_R16G16_FLOAT;
1640+
device->CreateShaderResourceView(nullptr, &null_guide,
1641+
DescriptorHeapSlot(compose.heap->GetCPUDescriptorHandleForHeapStart(),
1642+
kPresentPreFgComposeMotionNullSrv, compose.descriptor_size));
16291643
}
16301644
}
16311645
if (compose.heap == nullptr || !SupportsCodecFormat(device, format)
@@ -1843,6 +1857,10 @@ inline uint32_t ComposePresentPreFg(ID3D12GraphicsCommandList* command_list,
18431857
0, DescriptorHeapSlot(gpu_start, base, compose.descriptor_size));
18441858
command_list->SetComputeRootDescriptorTable(
18451859
1, DescriptorHeapSlot(gpu_start, base + 4, compose.descriptor_size));
1860+
command_list->SetComputeRootDescriptorTable(
1861+
3, DescriptorHeapSlot(gpu_start, kPresentPreFgComposeDepthNullSrv, compose.descriptor_size));
1862+
command_list->SetComputeRootDescriptorTable(
1863+
4, DescriptorHeapSlot(gpu_start, kPresentPreFgComposeMotionNullSrv, compose.descriptor_size));
18461864
// The shader's ComposeConstants (9 of the codec signature's 28 dwords).
18471865
// Difference-mask mode needs stage 0's current-frame count before stage 1;
18481866
// exact UI-alpha modes have no statistics dependency and run stage 1 once.
@@ -2821,15 +2839,27 @@ inline MixedCopyRegionFn real_mixed_copy_region = nullptr;
28212839
inline std::shared_mutex mixed_copy_hook_mutex;
28222840
inline bool mixed_copy_hooks_installed = false;
28232841

2842+
// Runtime/debug-layer forwarding can call a second hooked copy method on an
2843+
// internal list. It belongs to the outer API operation, not another producer.
2844+
inline thread_local uint32_t mixed_copy_forward_depth = 0;
2845+
struct MixedCopyForwardScope {
2846+
const bool outermost = (mixed_copy_forward_depth++ == 0);
2847+
~MixedCopyForwardScope() { --mixed_copy_forward_depth; }
2848+
};
2849+
28242850
inline void STDMETHODCALLTYPE HookedMixedCopyResource(ID3D12GraphicsCommandList* list,
28252851
ID3D12Resource* destination, ID3D12Resource* source) {
2852+
const MixedCopyForwardScope copy_scope;
28262853
real_mixed_copy_resource(list, destination, source);
2854+
if (!copy_scope.outermost) return;
28272855
GuardHook([&] { ObserveMixedPresentCopy(list, source, destination); });
28282856
}
28292857
inline void STDMETHODCALLTYPE HookedMixedCopyRegion(ID3D12GraphicsCommandList* list,
28302858
const D3D12_TEXTURE_COPY_LOCATION* destination, UINT x, UINT y, UINT z,
28312859
const D3D12_TEXTURE_COPY_LOCATION* source, const D3D12_BOX* box) {
2860+
const MixedCopyForwardScope copy_scope;
28322861
real_mixed_copy_region(list, destination, x, y, z, source, box);
2862+
if (!copy_scope.outermost) return;
28332863
if (source == nullptr || destination == nullptr) return;
28342864
const bool full = x == 0 && y == 0 && z == 0 && box == nullptr
28352865
&& source->Type == D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX && source->SubresourceIndex == 0

0 commit comments

Comments
 (0)