TL;DR: Add an experimental FSR Ray Regeneration backend on Windows, run the K

network natively on HIP with Vulkan->HIP shared memory, extend K kernels to
gfx11 (RDNA3), and add dependency/packaging/test tooling around them.

Windows: FSR RR backend, native HIP K runner, gfx11 K kernels, tooling

FSR Ray Regeneration (experimental)
- Add fsr_rr_backend.{h,cpp}, fsr_rr_passes.h and the fsr_rr/ prepare and
  compose compute shaders. They run AMD's FidelityFX denoiser
  (amd_fidelityfx_denoiser_dx12.dll, SDK 2.3, not bundled) on a private
  vkd3d-proton device.
- Add the amdxc64 shim (tools/windows/amdxc64_shim) and two vkd3d-proton
  patches for libcxx includes. AMD's amdxc64.dll is never loaded.
- d4r_nvngx_windows: RrFeature now selects between the native DLSS RR
  backend and the FSR backend (D4R_RR_BACKEND=fsr). After the denoiser it
  runs an internal Super Sampling stage (feature 1) to upscale. If SR is
  unavailable and output != render size, the frame fails; it is never
  returned noisy.
- d4r.ini / player_config: new [RayReconstruction] FsrDenoiser,
  FsrStabilityBias (auto or >= 0) and FsrDetail (0-1), with validation, and
  matching D4R_FSR_* environment variables.
- Add the FSR RR fixture, output-check and ngx test scripts, and a shader
  compile script.

Native HIP K runner (Windows)
- CMake: add d4r_engine_k_hip (d4r-k-hip) plus separate volk/engine copies,
  because VK_USE_PLATFORM_WIN32_KHR changes volk's entry points.
- Share Vulkan memory with HIP via Win32 opaque handles on Windows
  (VK_KHR_external_memory_win32) and via fds on Linux. Handle types are now
  intptr_t, and the platform choice is in D4R_EXT_MEMORY_* macros.
- HipNetwork: add debugRepeatHashes and debugNodeMicros, exposed as
  D4R_HIP_REPEAT_CHECK, D4R_HIP_REPEAT_ALL and D4R_HIP_NODE_PROFILE in
  replay.cpp.
- replay.cpp: display-resolution-motion frames (FrameFlagDisplayMotion) no
  longer require near2rnd == out2rnd. Both values must still be in (0, 1].

K kernels on gfx11
- Allow position-token and enc1 tiling on __GFX11__ as well as gfx12.
- Add an opt-in ds_bpermute cross-half exchange
  (D4R_WINDOWS_GFX11_DS_EXCHANGE, enabled for K on Windows gfx11). M keeps
  its LDS path.
- Fix a block-barrier race in the position layer. Without POS_VSHARE a fast
  wave could overwrite its hb rows while a slower wave still read them for a
  later head, giving rare wrong results on gfx1101 (enc0 outputs differing
  between identical launches).

Packaging and install
- install.bat, d4r.ini, WINDOWS_README: FSR option, and
  install_dependencies.py to install pinned NVIDIA dependencies with staged,
  hash-verified replacement and rollback.
- Update the release package, local package refresh and test scripts.
- Add the InteropBatchInputCopies option (default false). Batching is faster
  on some synthetic runs, but player temporal exactness is unresolved.

Tooling and tests
- K model: capture_k_weights, build_k_model, compare_k_outputs,
  benchmark_k_hip, build_capture_runtime, test_k_model and the
  zluda-k-output-capture patch. Captured weights and models are private
  local assets and must not enter release archives.
- Synthetic probes: test_m_ngx, test_sr_dynamic,
  prepare_rr_dynamic_fixture and the d3d12/rr_ngx probe updates.
- Add tests/windows/test_install_dependencies.py.

Docs
- Update the windows-fsr-rr, k-performance, local-package, rr-interop and
  rr-model-cache docs. Add windows-parity-handoff.md and
  windows-parity-continuation-prompt.md.
This commit is contained in:
ayo committed 2026-10-17 01:43:06 -04:00
1 parent 247fe1092d
commit a617c818de
62 files changed
+5894 -89

No files matched your search

+33 -6
View File
@@ -29,8 +29,12 @@ Install
2. Run install.bat and accept the download prompt. Existing d4r DLLs are backed up outside the game
folder with their original paths and SHA256 hashes. Verified downloads are cached in
%LOCALAPPDATA%\d4r\cache.
The Ray Reconstruction DLL alone does not enable RR. Experimental native RR requires a locally
generated D/E model and explicit d4r.ini selection; game compatibility remains unverified.
Bundled isolated Python runs the installer; system Python, PowerShell and Git Bash are not required.
Choose N to keep RR off, or D/E to build and enable an experimental private native RR model.
Automatic RR building currently requires the gfx1101-only package. Model tools run from the
external cache. Existing models remain intact; d4r.ini receives an exact external backup before
selecting the new relative model path. Game compatibility and reference quality remain unverified.
A model-build failure leaves the verified NVIDIA DLLs installed and does not enable the model.
3. Optional: check the install. In the game folder, open PowerShell and run
powershell -ExecutionPolicy Bypass -File d4r\d4r-check.ps1
4. Start the game from Steam, Epic or a shortcut as usual. In its graphics settings choose DLSS
@@ -48,8 +52,27 @@ Edit d4r\d4r.ini (it is commented) and restart the game. Each game has its own c
- AsyncInterop, ValidateOutput, Log: for testing and bug reports; the defaults are the tested setting.
- RayReconstruction/Backend: off by default. native selects experimental native D3D12/Vulkan RR;
ModelDir selects your locally generated D/E model (auto: d4r\engine\rr-d). Relative paths resolve
beside d4r.ini. No model is bundled or automatically generated by install.bat yet.
fsr currently rejects RR requests because native Windows FSR RR execution is unavailable.
beside d4r.ini. No model is bundled; install.bat can optionally generate and select D/E locally.
fsr (experimental) answers the game's DLSS RR request with AMD's FSR Ray Regeneration denoiser,
then DLSS Super Sampling upscales the result. AMD does not support FSR RR on RDNA3, so d4r runs
AMD's unmodified denoiser DLL on a private vkd3d-proton device (d4r\fsr, built by d4r, LGPL; see
d4r\fsr\SOURCE.txt) that emulates the FP8 math on RDNA3. AMD's amd_fidelityfx_denoiser_dx12.dll is
not bundled: install.bat [F] downloads the pinned file (SHA256 48f1e588...), or set FsrDenoiser.
FsrStabilityBias (default auto = AMD's 1; 0 is much sharper without upscaling, see d4r.ini) and
FsrDetail (0-1) tune the denoiser.
The first RR start compiles AMD's shaders and can freeze the game for about a minute; they are
cached in %LOCALAPPDATA%\d4r\cache\vkd3d. Synthetic validation only: guides must be HDR with
render-resolution, unjittered motion vectors; diffuse hit distance is not used. The exposure texture
goes only to Super Sampling. Dynamic render sizes must stay within creation dimensions and the
Super Sampling library's queried range; unsupported sizes fail before submission.
Game compatibility and image quality against DLSS RR are unverified.
FSR-only output accepts RGBA16F or RGBA32F, including format changes between frames. RGBA32F
widens the completed half result on the GPU; it does not change denoiser arithmetic or produce alpha.
Native RR accepts per-frame render dimensions from 64 pixels up to the feature's creation size.
Changing dimensions resets temporal history and retains the loaded model and shared GPU packet.
Output dimensions remain fixed. This behavior has synthetic D/E coverage only.
RR accepts RGBA16F and RGBA32F output textures, including temporal format changes;
float32 output is widened on the GPU. Other output encodings remain unsupported.
OptiScaler's own settings (overlay, render ratios) are in OptiScaler.ini.
If something goes wrong
@@ -60,12 +83,14 @@ If something goes wrong
- For a bug report run d4r\d4r-check.ps1 -Report and send the ZIP it puts on your Desktop,
with your GPU, the game, the model and what the image looked like. Logs can contain folder names.
- Not supported: frame generation, standalone inference engine selection in the game, DirectX 11,
Vulkan game integration, or FSR RR. Native DLSS RR has synthetic feature-13 validation only;
Vulkan game integration, or supported FSR RR (the fsr backend is experimental). Native DLSS RR and
FSR RR have synthetic feature-13 validation only;
it does not establish game compatibility or NVIDIA reference quality. E/L hints do not establish full parity.
Uninstall
---------
Delete dxgi.dll, OptiScaler.ini, OptiScaler.log (if present), WINDOWS_README.txt and the d4r folder
Delete dxgi.dll, OptiScaler.ini, OptiScaler.log (if present), WINDOWS_README.txt, install.bat,
install-dependencies.py, install-dlss.ps1 and the d4r folder
from the game folder. The cache in %LOCALAPPDATA%\d4r can be deleted too. Nothing else was changed.
Licenses
@@ -74,3 +99,5 @@ d4r is GNU General Public License, version 3 only (GPL-3.0-only). This ZIP also
patched; the patches are in the source repository), and AMD's HIP runtime. d4r\licenses has the
texts. d4r is not affiliated with NVIDIA, AMD or the OptiScaler project. NVIDIA's files are yours
to supply, under NVIDIA's terms.
Portable model tools include Python, NumPy and glslang; their license texts are under
d4r\model-tools\licenses, with additional dependency notices in the tool directories.