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

+90
View File
@@ -1,5 +1,95 @@
# Native RR D3D12/Vulkan bridge gate
## Current output coverage: RGBA16F and RGBA32F
Native RR now accepts `DXGI_FORMAT_R32G32B32A32_FLOAT` output as well as the
existing RGBA16F output. Model inference remains unchanged. A same-size nearest
Vulkan image blit widens the model's half output on the GPU, then copies the
float32 image through the shared packet into the borrowed D3D12 output texture.
The backend checks source/destination blit support and allocates a private
device-local conversion image only when needed. Packet output space reserves
the largest supported texel size. No CPU tensor conversion enters production.
Output format may change between frames without feature/model recreation or
history reset. The conversion image is retained, with explicit transfer
read/write barriers. Output dimensions remain fixed. Other encodings, external
exposure conversion and game/reference-quality validation remain open.
Synthetic D: eight frames across dynamic dimensions, two live features,
creation-sized input resources, optional guides and enhanced/inherited states
pass all 16 evaluations. Every RGBA32F component matches the independently
widened standalone half reference exactly. Synthetic E: six inverted D32S8
frames alternate half/float32 output without losing temporal consistency or
changing stencil. Packaged v8 loader/INI with two live E features passes all 12
evaluations. Final handles/parameters are released before queued submission.
This establishes output conversion and engine consistency, not NVIDIA reference
quality, game RR or a performance improvement.
Evidence: `build/rr-ngx-output32-d-v1/summary.json`,
`build/rr-ngx-output-switch-e-v1/summary.json`, and
`build/rr-ngx-local-v8-output-switch-e-v1/summary.json`. Prior baseline binaries
remain in `build/rr-output32-baseline-v1/`; older ZIPs remain unchanged.
## Current native RR coverage: dynamic render sizes and two live features
Native NGX feature 13 accepts per-frame render dimensions from 64 pixels through
the feature's creation dimensions. Output size remains fixed. Each queued frame
owns its render dimensions alongside the existing resource/scalar/matrix
snapshot. Dimension changes rebuild size-dependent views, descriptors and
temporal history only after prior GPU work retires. Vulkan model pipelines,
uploaded weights, the creation-sized shared packet and timeline fence survive.
History resets implicitly on a size change, even without a caller Reset flag.
Unchanged dimensions preserve history. Invalid dimensions fail before recording
or submission; failed reconfiguration poisons the backend rather than allowing
partially rebuilt history to run.
`prepare_rr_dynamic_fixture.py` generates independent standalone segment
references and combines them into an NGX sequence with no explicit reset at size
changes. The sequence is 96x96 twice, 64x64 twice, 96x96 twice, and 72x80 twice,
with fixed 192x192 output and alternating absent/present optional guides.
The 48x48 first fixture failed at the engine's existing 64-pixel minimum before
NGX testing; it remains preserved. Corrected D/E fixtures each pass eight exact
frames. D passes without SR dependencies; E passes player INI selection.
`test_rr_ngx.py --dynamic-extents` checks every size/output and the exact resize
diagnostic sequence. `--two-features` evaluates two live RR features with separate
Vulkan devices on each game command list. It reads back both outputs separately
and releases both handles/parameters before final submission. Packaged v7 E
passes all 16 evaluations with enhanced/inherited access, optional guides and
owned geometry. `--max-resources` retains creation-sized D3D12 input textures
while the render rectangles change; that path also passes 16 exact evaluations.
This tests multiple live handles and ordered delayed submission, not parallel
GPU inference, threaded submission or asynchronous throughput.
Six static D frames still pass inverted D32S8 depth, unchanged stencil,
RGBA32/RG32/scalar-R16 guide switching and AutoExposure. All comparisons are
against the same standalone engine, not NVIDIA quality-reference frames or game
RR. No performance gain is claimed for resize support or model reuse.
Evidence: `build/rr-ngx-dynamic-d-v2/summary.json`,
`build/rr-ngx-dynamic-e-v2/summary.json`,
`build/rr-ngx-dynamic-two-features-d-v1/summary.json`,
`build/rr-ngx-local-v7-dynamic-two-e-v1/summary.json`,
`build/rr-ngx-local-v7-max-dynamic-two-e-v1/summary.json`, and
`build/rr-ngx-local-v7-static-regression-v2/summary.json`.
The first E wrapper run completed all exact GPU outputs but failed its diagnostic
check because player mode redirects stderr to d4r_nvngx.log. The verifier now
reads that log in player mode; the corrected run passes. Earlier artifacts and
baseline shim/probe copies remain intact under build/rr-dynamic-baseline-v1/.
The first v7 static regression invoked the target DLL directly beside its
player INI while requesting an environment-only/no-SR test. Player configuration
correctly overrode those environment settings and rejected missing local SR
dependencies before GPU evaluation. The corrected packaged-loader/player-INI
fixture supplies pinned dependencies and passes all six frames; no policy block
or bypass occurred.
Other existing native coverage includes optional guides, float/UNORM inputs,
typed/typeless D32/D32S8 depth, preserved stencil and creation-flag validation.
Guide encodings, external exposure conversion, output-format conversion, output
size changes, broader concurrency, game/reference-quality validation and FSR
execution remain incomplete. Older sections below describe earlier milestones;
the newest checklist entries supersede those earlier limitations.
## Runtime extraction in progress (2026-10-16)
The packet layout now has a geometry-only constructor with no fixture I/O.