Commit Graph
58 Commits
Author SHA1 Message Date
ayo a617c818de 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.
2026-10-17 01:43:06 -04:00
ayo 247fe1092d Advance native Windows RR integration, kernel tooling and local packaging
Implement native NGX feature-13 RR through a LUID-matched D3D12/Vulkan
shared-memory and timeline-fence bridge. Add owned parameter snapshots,
GPU resource lifetime handling, inherited/enhanced barriers, optional
guides, sampled input formats and depth-plane support with stencil
preservation. Separate RR initialization from the SR CUDA runtime and
expose explicit backend/model selection through player configuration.

Add synthetic bridge, snapshot and NGX lifecycle harnesses covering
camera/history/reset, parameter mutation, delayed submission, early
release, capability gating and unsupported-input rejection.

Add exact gfx11 D/E model generation, verified caches, versioned local
deployment with configuration backups, and isolated portable model
tools with pinned Python, NumPy and glslang dependencies.

Extend Windows K benchmarking and private native-cache selection.
Fix LLVM 22 emitter/helper compatibility and preserve exact-output
validation for local output-kernel optimization.

Add native FSR RR provider diagnostics, local development package
refresh tooling, installer/checker updates, FidelityFX headers and
Windows parity documentation.

Keep NVIDIA binaries, derived models and private optimized kernels out
of distributable packages. Native RR evidence remains synthetic;
game validation, FSR RR dispatch, installer integration and Linux
performance parity remain incomplete.
2026-10-16 12:53:26 -04:00
ayo 7c5d3c9157 feat: add d4r inference engines and Windows parity tooling
Add native K/M/RR inference engines, HIP kernels, replay and validation
harnesses, and Windows DLSS setup and runtime support. Include GPU
profiling tools, build and packaging scripts, platform integration
patches, and implementation documentation.
2026-10-16 08:54:47 -04:00
ayo 73994d4634 Clear windows branch; preserve previous contents in win-old 2026-10-16 05:20:08 -04:00
ayo 774efac524 Windows: DLSS watermark off, check script, 310.7.0 pair, shorter docs
- Set Disable.Watermark on the game path (the Linux shim already does);
  [DLSS] ShowWatermark = true keeps NVIDIA's stamp.

- Always write d4r\d4r_nvngx.log in player mode. It was skipped when the
  launcher gave the game a valid stderr pipe, e.g. Steam.

- Accept NVIDIA's 310.7.0 + _nvngx 32.0.15.9636 as "less tested" pins.
  Native kernels are still gated by PTX identity, so a different DLL
  falls back to translated kernels.

- Add d4r-check.ps1 (ok/MISSING/note lines with a fix for each; -Report
  writes a bug-report ZIP) with 15 fixture tests.

- package-windows-release.ps1: -Architectures subset, ships the check
  script, GPU registry and one GPU-query tool.

- Add a shorter WINDOWS_README.txt; trim README's Windows section and
  merge in the RX 9060 XT / distributor-DLL notes.

- Diagnostic probe accepts preset 12 (L).

Tested on RX 7700 XT without a game: loader and shim start-up, K and M
synthetic NGX frames with both DLL pairs (finite output, native kernels
used). Not tested in a game.
2026-10-03 04:58:05 -04:00
xdfnx-dev df415ec828 Support distributor DLL packages and validate Windows player mode 2026-10-03 11:28:21 +03:00
ayo 65ab1460a8 Windows: drag-in install with a per-game d4r.ini
Players extract one ZIP into the game folder, copy their two NVIDIA
DLLs, and start the game from Steam, Epic or a shortcut. No launcher
script is needed; settings live in d4r\d4r.ini.

- Shim player mode: when the launcher has not set D4R_HIP_ROOT and
  d4r.ini sits beside the shim, derive the backend environment from it.
  Codegen flags stay at the Windows-validated values. NVIDIA DLLs must
  match an exact SHA256 in dll-pins.txt, with "you have X, you need Y"
  errors. Rejects a vkd3d/Wine d3d12.dll and code objects built for
  another GPU. [DLSS] Model accepts K or M and is applied by rewriting
  the render preset hints.

- d4r.ini exposes only options that exist on Windows: Model, AsyncInterop,
  ValidateOutput, Log, CacheDir. Invalid values fall back with a note in
  d4r_nvngx.log.

- d4r_nvngx_loader: one _nvngx.dll for all GPUs. It matches the game's
  adapter by LUID and loads _nvngx_<arch>.dll from the same folder.

- OptiScaler patch 0006: relative NvngxPath/NvngxDlssPath/
  NvngxFeaturePath resolve against OptiScaler's folder.

- package-windows-release.ps1 builds the release from the per-target
  game packages and refuses mixed targets or differing shared runtimes.

- Tests: test-player-config.ps1 (ini and DLL-pin decisions, loader
  selection on the local GPU) and test-windows-release-package.ps1.
2026-10-03 03:10:19 -04:00
xdfnx-dev bea15d3754 Record issue 10 regression results and use the Windows fixture host 2026-10-02 23:36:02 +03:00
xdfnx-dev 17121ccbf6 Fix Windows numeric NGX feature discovery and quick-test launches 2026-10-02 23:36:02 +03:00
xdfnx-dev 21ed0a8c88 Add automatic native Windows GPU quick-test packaging 2026-10-02 18:19:15 +03:00
xdfnx-dev 3d5f42865f Backport gfx1154 support into ZLUDA's Windows LLVM compiler
Adapt official LLVM 7a0829e41228 to the pinned LLVM 22 parser and ELF structures. Apply and audit the complete source delta before building, export its provenance, and package the source patch. Add 33 offline public PTX compilation checks across all eleven GPU targets without hardware execution. Preserve strict arithmetic and document RX9070XT K/M regressions.
2026-10-02 17:45:41 +03:00
xdfnx-devandrealdody 3fa963fd1b Enable experimental native Windows RDNA3 and RDNA4 targets
Share explicit target metadata across build/runtime/package guards, preserve native gfx11 WMMA with a Windows LDS lane exchange, select HIP devices by D3D12 LUID, and reject wrong-target/vkd3d installations before changing game files. Review all issue #10 logs and document compile-only coverage plus RX9070XT regressions.

Co-authored-by: realdody <[email protected]>
2026-10-02 17:10:42 +03:00
xdfnx-devandrealdody 98de8e3a3e Build native Windows packages for both RDNA4 targets
Add explicit gfx1200/gfx1201 builds, runtime selection and per-target
code objects. Guard staging, packaging and installation against mixed
architectures; retain gfx1201 compatibility and strict K/M arithmetic.

Adapt realdody's target configuration and MSVC binary16/BOOL portability
fixes from ae530b0. Do not import its forced gfx12 layout on RDNA3.
Add exhaustive binary16 and C++/PowerShell target contract regressions.

Validation: 20 CTest gates on RX 9070 XT; four software-only gfx1200 gates;
MSVC portability compile checks; exact 4K K async and M control outputs;
isolated package install/restore and mixed-target rejection tests.
No physical gfx1200 validation is claimed.

Co-authored-by: realdody <[email protected]>
2026-10-02 16:18:18 +03:00
xdfnx-dev 8f7058d2ba Add exact input-kernel experiments and preserve translated controls 2026-10-02 15:34:22 +03:00
xdfnx-dev 96650ed29d Add private WGP output validation and record measured K experiments 2026-10-02 15:03:32 +03:00
xdfnx-dev a2a4a7e765 Share gfx12 K enc0 V tiles while preserving strict FP16 arithmetic 2026-10-02 15:03:32 +03:00
xdfnx-dev 28832eef6c Guard paired GPU replay timings and normalize Windows diagnostic environments 2026-10-02 15:03:32 +03:00
xdfnx-dev bf4923aa4c Reproduce gfx12 FP16 accumulator differences and preserve K baseline 2026-10-02 13:03:19 +03:00
xdfnx-dev 9dece89599 Record controlled K timings and add read-only AMD GPU telemetry 2026-10-02 12:39:14 +03:00
xdfnx-dev 973eb5ecd2 Batch Windows DLSS GPU inputs and add deferred kernel diagnostics 2026-10-02 12:06:15 +03:00
Codex 7eaeb8c3db Capture PresentMon metrics and record Windows release validation 2026-10-02 10:44:09 +03:00
Codex 541c9838f7 Merge upstream lifecycle fixes into native Windows RDNA4 port 2026-10-02 10:11:10 +03:00
Codex caecad0897 Measure Windows interop GPU boundaries without added completion waits 2026-10-02 10:08:47 +03:00
Codex 0b471be024 Queue native Windows DLSS asynchronously and drain feature consumers 2026-10-02 10:00:26 +03:00
ayo f66cccaf28 Add experimental preset L and fix DLSS resource lifetimes and waits
- Build L texture variants and complete older release kernel bundles.
- Add selective Swin encoder fallback to reduce L/M motion trails.
- Add opt-in GPU motion-vector dilation for thin geometry and sky gaps.
- Replace GPU input waits with cancellable readiness polling and use
  sleeping event queries for completion.
- Retain recorded resources through command allocator completion, defer
  shutdown until cleanup, and preserve unfinished output synchronization.
- Extend lifecycle harness checks and add event, model and motion tests.
- Update configuration defaults, build scripts and release documentation.
2026-10-02 00:30:46 -04:00
Codex 0c18df6253 Validate Windows native M FP8 and reduce operand packing cost 2026-10-01 21:16:28 +03:00
Codex 74aad12938 Cache D3D12 recording lookups without retaining game resources 2026-10-01 20:23:08 +03:00
Codex 73ee2e5ecc Measure Windows submission costs and validate faster private K output stores 2026-10-01 19:54:41 +03:00
Codex d556747bad Merge upstream accuracy mode and artifact fixes into Windows RDNA4 2026-10-01 18:37:14 +03:00
Codex 40d9a55e10 Remove game log backpressure and measure Windows K/M kernels 2026-10-01 18:37:14 +03:00
Codex 74395b6aef Validate native Windows DLSS output on GPU and record actual M gameplay 2026-10-01 17:54:24 +03:00
Codex 5d33bddcd0 Fix game startup resource lifetime and D32S8 depth-plane interop 2026-10-01 17:27:06 +03:00
Codex 19d859e43d Capture pre-NGX command signatures through early OptiScaler device discovery 2026-10-01 16:48:12 +03:00
Codex e4c1c87b66 Resolve texture states in queue order across DLSS command lists 2026-10-01 16:41:52 +03:00
Codex e14b4cb54c Run native Windows DLSS K and M through an explicit OptiScaler source backend 2026-10-01 16:13:07 +03:00
Codex 27d6a1230a Forward Windows NGX project identity and validate frontend native network use 2026-10-01 15:45:55 +03:00
Codex 6ddf740877 Preserve initial PSO and enhanced texture layouts in Windows interop 2026-10-01 15:04:58 +03:00
Codex e9eec6d4e0 Convert native Windows D3D12 formats on gfx1201 with GPU validation 2026-10-01 14:48:42 +03:00
Codex 312c6bb50d Track Windows D3D12 indirect state and newer command interfaces 2026-10-01 14:15:01 +03:00
ayo b645ef9096 Add DLSS accuracy mode and GLIBC 2.41 release builds
- Add default-off PreferAccuracy for all native kernel families,
  including RDNA4 FP8 variants.

- Restore intermediate FP8 quantization, per-MMA FP16 rounding,
  denormal handling and NGX synchronization in accuracy mode.

- Select separately marked accuracy kernels and use a separate JIT
  cache; reject mixed sets and never silently substitute fast kernels.

- Add a pinned GLIBC 2.41 build environment for ZLUDA/LLVM, the DLLs
  and both kernel sets, with ABI checks and toolchain provenance.

- Support parallel target builds and pre-extracted PTX; correct
  ROCm header paths and Clang-CL input handling.

- Bump to 0.1.3 and update release notes, documentation and tests.

Validation: 11 tests passed; all 912 kernels built; E/K/M GPU harness
runs completed with accuracy off/on. Packaged libraries loaded under
GLIBC 2.41 and require no GLIBC version newer than 2.38.

RTX image-quality parity remains unverified.

Fixes #6
Refs #6
2026-10-01 01:35:39 -04:00
ayo b2b3781aca Fix DLSS artifacts and improve synchronization diagnostics
- Fix Cyberpunk 2077 preset-K black artifacts by preserving FP16/FP64
  denormal requirements while limiting denormal suppression to FP32.

- Fix stale direct-output redirects after array destruction, preventing
  reused handles from inheriting an earlier feature's output buffer.

- Log rejected resource formats and dimensions, including failures after
  startup, with rate limiting for repeated errors.

- Add opt-in blocking output synchronization with a dedicated bridge
  export and fallback to context synchronization.

- Report output-wait CPU and wall time, and defer GPU timing queries
  until asynchronous evaluation has completed. The CPU-overhead
  mitigation for #7 still needs reporter confirmation.

- Reject release libraries requiring GLIBC newer than the configured
  baseline, defaulting to 2.41, and document compatible builds.

Validation: shim and bridge builds pass; targeted redirect-lifetime and
format-logging checks pass.

Fixes #5
Fixes #8
Refs #7
2026-09-30 23:17:25 -04:00
Codex 63607298ea Execute Windows DLSS K and M at recorded D3D12 command-list boundaries 2026-09-30 22:21:06 +03:00
Codex b8d801ae4c Correct M attention precision and validate every temporal transformer block 2026-09-30 21:30:05 +03:00
Codex e15f6a73a6 Run native Windows D3D12 DLSS K and M through shared VRAM 2026-09-30 20:22:03 +03:00
Codex 2db93adb1a Validate native Windows M against real PTX and correct patch-merge bounds 2026-09-30 19:01:18 +03:00
Codex 5592b7a921 Execute native Windows K DLSS and validate real transformer weights 2026-09-30 18:23:01 +03:00
Codex a0c36a6d6f Validate all eleven native gfx1201 K layers with Windows replay 2026-09-30 16:55:41 +03:00
Codex 3c28a82e34 Build patched Windows ZLUDA and execute native NGX DLSS diagnostics 2026-09-30 16:35:30 +03:00
Codex 64472e5a61 Merge upstream RDNA4 layouts and validate native Windows K integration 2026-09-30 14:54:38 +03:00
Codex 2dea066d6a Execute gfx1201 K enc2 and generalize layer reference diagnostics 2026-09-30 14:40:49 +03:00