fix(vk): support PsychoV35 HDR with DLSS and NVIDIA frame generation #108

Open
futondestroyer wants to merge 2 commits from futondestroyer/Longshot:codex/psychov35-dlss-hdr into main
First-time contributor

Why

Selecting PsychoV35 with Native HDR silently leaves DLSS/DLAA and NVIDIA frame generation using the game's fallback methods. The scene and network output become RGBA16F, which the temporal chain currently rejects.

What changed

  • Adapt Hookshot #2707, head f1d654ce6f841fd4ce5bcbbe8900629a5394e484, by nooblikejagger, to Longshot.
  • Share one narrow scene-format policy across camera collection, skinned actor motion and the optional reactive-mask copy. Accept matching RGBA16F input/output only for Native PsychoV35 with DLSS/DLAA and the opt-in switch. Keep the packed route and reject mixed/unrelated formats.
  • Bind matching sampled/storage views for translated and rejected networks. Lazily create a typed RGBA16F output pipeline, regenerated with glslang 16.6.0 and carrying the source SHA-256.
  • Preserve the HDR perceptual-to-linear decode and linear output. Require an HDR DLSS feature, and reset history when the tone mapper or input format changes. Successful evaluation restores the existing depth/motion/camera handoff to NVIDIA FG.
  • Add the production-policy regression fixture and update existing HDR/reactive checks. No renderer API change or translator/cache-stamp change.

Flags and settings

Flag What it does Default now Recommendation Helps on Doesn't help on Untested on
RX_VK_PSYCHOV35_DLSS=1 Enables Native PsychoV35 RGBA16F scenes for DLSS/DLAA Off Keep opt-in pending broader testing Measured RTX 4070, Windows, HDR DLSS/DLAA and NVIDIA FG FSR, TAAU and Upscaler Off; not a general DLSS speed improvement Linux, other NVIDIA GPUs/drivers

The existing RX_VK_DLSS_HDR=0 comparison override prevents this route, which requires an HDR feature. Upscaler Off with PsychoV35 still falls back to the game's network; supporting that existing limitation is outside this DLSS fix.

Measurements

main: b9cdc432 (2026-11-12)
this PR: codex/psychov35-dlss-hdr @ d22f0a4e

Baseline: measured port @ d4a69456, source 878c957c, switch off.
The same renderer was used with the switch off/on to isolate the format-policy change. Off retains main's packed-only rejection. The host was unchanged 7afe6ae1, version v2.1.0-rc.3-328-g7afe6ae1 (source 7cfff061). These are the builds actually measured, not a claim that the rebased binary was measured. The last rebase from 2a2da67f to b9cdc432 changes only CI workflows and CONTRIBUTING.md; no runtime, renderer or test code changed, so the existing validation still applies. On the 2a2da67f base, the renderer rebuilt with NGX (207 files, zero failures; source 4255c3b1), the four focused checks pass, and the complete suite was rerun as recorded below.

Hardware: RTX 4070 12 GB, NVIDIA 621.01, i7-13700F, 32 GB RAM, Windows 11 Home build 26300.
Scene: copied child Hyrule Field save outside Lon Lon Ranch, 2560x1440 output, DLSS Quality 1707x960, preset K, sharpness 0, Native HDR PsychoV35, paper white 200 / peak 400 nits, NVIDIA FG 2x.
Method: cold starts on/off/off/on, 30 seconds standing after settling per run. Counts below are repeated complete 600-frame gameplay reporting intervals, excluding title/loading intervals. They are correctness measurements, not FPS claims. The median of both off runs is 0 made FG sets and both on runs is 600.
How to reproduce: start cold in Native HDR + PsychoV35 with DLSS or DLAA, a locally installed NGX SDK/runtime and a supported fixed NVIDIA FG multiplier. Compare RX_VK_PSYCHOV35_DLSS=0 and =1; verify actual engine/FG counts in the log, not just the selected menu rows.

Steady interval measured port @ d4a69456, source 878c957c, switch off measured port @ d4a69456, source 878c957c, switch on
HDR DLSS feature Not made Made, HDR linear colour
Network input/output RGBA16F rejected RGBA16F accepted, format 97
DLSS evaluations per complete interval Game's network runs 600
NVIDIA FG sets made per 600 presents, median of two runs 0 600
Missing-input fallbacks, median of two runs 600 0
PsychoV35 DLSS: enabled; scene format 122, network input 97, output 97; HDR linear input/output
NVIDIA DLSS: 600 frames drawn
DLSS Frame Gen (NGX): of the last 600 presents 600 made by DLSS-G
... 0 without new inputs (no DLSS/DLAA this frame)

Switch off:
DLSS Frame Gen (NGX): of the last 600 presents 0 made by DLSS-G
... 600 without new inputs (no DLSS/DLAA this frame)

A further DLAA cold start at 2560x1440 also repeatedly reports 600/600 DLAA evaluations and NVIDIA FG sets. Live Vanilla/PsychoV35 changes recover with history resets. The player visually tested the build and reported it working well. This PR makes no DLSS performance-optimization claim.

Testing

Tested: renderer built with llvm-mingw and NGX: 207 translation units, zero compiler failures. Four focused checks (test_psychov35_dlss, test_temporal_history, test_hdr_encode, test_reactive_mask) pass on the rebased branch. The new fixture compiles the real format policy and exercises 3,670,016 combinations, history transitions, HDR guards, typed output, consistent consumers and the FG input handoff. It fails on the original source. The packed shader regenerates byte-for-byte identically. Hyrule Field cold-start and tone-mapper-switch results are above; local screenshots were reviewed and the player supplied the HDR visual assessment.

Refreshed complete suite on this rebased branch: 492 passed, 4 failed, 35 skipped (bundled Python, llvm-mingw, --jobs 6 --timeout 180). All four failures also reproduce on unchanged current main 2a2da67f: nx2/test_nup_paths.py (Windows symlink privilege), tests/test_check_third_party.py (Windows output handling), tests/test_setup_runtime.py (Windows path handling), and tests/test_release.py (missing OpenSSL and Windows newlines). No test was weakened or skipped to obtain this result. This is not a clean full-suite pass.

Not tested: Linux; other NVIDIA GPUs/drivers; live DLSS/DLAA switching (the bridge cannot select the Native step); optional reactive-mask runtime behaviour. No controlled FPS improvement, broad HDR-tracking fix or default-on rollout is claimed.

Needs other testers:

  • Linux with NVIDIA RTX and an HDR-capable surface: cold PsychoV35 + DLSS/DLAA and fixed NVIDIA FG, expecting RGBA16F input/output and sustained engine/FG counts (T-TTAF).
  • Other NVIDIA generations/drivers with an HDR display: tone-mapper switching, image quality and sustained engine/FG counts (T-TU8K).

Both test requests are posted and await a maintainer's testing wanted label before testers can claim them; the author is not an upstream collaborator.

Screenshots

Same Hyrule Field save and viewpoint; measured port @ d4a69456, source 878c957c. These are raw HDR PQ screenshots, so an SDR viewer cannot judge absolute HDR brightness. The screenshots are hosted on a dedicated branch of the author's fork and do not enter this PR's code diff.

Packed-only policy, switch off (game's network and built-in FG) RGBA16F path, switch on (DLSS and NVIDIA FG verified in logs)
PsychoV35 with fix off PsychoV35 with fix on

Risk and rollback

The new path runs only when explicitly enabled with Native HDR, PsychoV35 and DLSS/DLAA. Unusual scene/view combinations, colour encoding and history transitions are the risks; keep existing camera/depth/size/generation/age checks and fall back if an HDR feature is unavailable. RX_VK_PSYCHOV35_DLSS=0 restores the packed-only behaviour. FSR/TAAU/Off support is deliberately left for separate work.

Reviewer notes

Start with temporal_scene_format, temporal_colour_pair and the HDR feature guard/output selection in vk_temporal.cpp, then view binding in vk_draw.cpp. Storage precision must not remove the network's perceptual-to-linear decode. Related Hookshot context: #2481 introduced the deliberate format gate, #2243 established native-HDR linear input/output, and merged #2118 supplies the NGX FG input handoff.

Issues

Related upstream: https://github.com/NotRexed/Hookshot/pull/2707 and https://github.com/NotRexed/Hookshot/pull/2481.

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Flags noted, and the switch reference updated (docs/development.md, the README).
  • Screenshots for a change that shows on screen.
  • A row in docs/tested-configurations.md for each measured run.
  • The SPIR-V headers regenerated with glslang (a shader changed).
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
## Why Selecting PsychoV35 with Native HDR silently leaves DLSS/DLAA and NVIDIA frame generation using the game's fallback methods. The scene and network output become RGBA16F, which the temporal chain currently rejects. ## What changed - Adapt [Hookshot #2707](https://github.com/NotRexed/Hookshot/pull/2707), head `f1d654ce6f841fd4ce5bcbbe8900629a5394e484`, by nooblikejagger, to Longshot. - Share one narrow scene-format policy across camera collection, skinned actor motion and the optional reactive-mask copy. Accept matching RGBA16F input/output only for Native PsychoV35 with DLSS/DLAA and the opt-in switch. Keep the packed route and reject mixed/unrelated formats. - Bind matching sampled/storage views for translated and rejected networks. Lazily create a typed RGBA16F output pipeline, regenerated with glslang 16.6.0 and carrying the source SHA-256. - Preserve the HDR perceptual-to-linear decode and linear output. Require an HDR DLSS feature, and reset history when the tone mapper or input format changes. Successful evaluation restores the existing depth/motion/camera handoff to NVIDIA FG. - Add the production-policy regression fixture and update existing HDR/reactive checks. No renderer API change or translator/cache-stamp change. ## Flags and settings | Flag | What it does | Default now | Recommendation | Helps on | Doesn't help on | Untested on | |---|---|---|---|---|---|---| | `RX_VK_PSYCHOV35_DLSS=1` | Enables Native PsychoV35 RGBA16F scenes for DLSS/DLAA | Off | Keep opt-in pending broader testing | Measured RTX 4070, Windows, HDR DLSS/DLAA and NVIDIA FG | FSR, TAAU and Upscaler Off; not a general DLSS speed improvement | Linux, other NVIDIA GPUs/drivers | The existing `RX_VK_DLSS_HDR=0` comparison override prevents this route, which requires an HDR feature. Upscaler Off with PsychoV35 still falls back to the game's network; supporting that existing limitation is outside this DLSS fix. ## Measurements main: b9cdc432 (2026-11-12) this PR: codex/psychov35-dlss-hdr @ d22f0a4e Baseline: measured port @ d4a69456, source 878c957c, switch off. The same renderer was used with the switch off/on to isolate the format-policy change. Off retains main's packed-only rejection. The host was unchanged `7afe6ae1`, version `v2.1.0-rc.3-328-g7afe6ae1 (source 7cfff061)`. These are the builds actually measured, not a claim that the rebased binary was measured. The last rebase from 2a2da67f to b9cdc432 changes only CI workflows and CONTRIBUTING.md; no runtime, renderer or test code changed, so the existing validation still applies. On the 2a2da67f base, the renderer rebuilt with NGX (207 files, zero failures; source 4255c3b1), the four focused checks pass, and the complete suite was rerun as recorded below. Hardware: RTX 4070 12 GB, NVIDIA 621.01, i7-13700F, 32 GB RAM, Windows 11 Home build 26300. Scene: copied child Hyrule Field save outside Lon Lon Ranch, 2560x1440 output, DLSS Quality 1707x960, preset K, sharpness 0, Native HDR PsychoV35, paper white 200 / peak 400 nits, NVIDIA FG 2x. Method: cold starts on/off/off/on, 30 seconds standing after settling per run. Counts below are repeated complete 600-frame gameplay reporting intervals, excluding title/loading intervals. They are correctness measurements, not FPS claims. The median of both off runs is 0 made FG sets and both on runs is 600. How to reproduce: start cold in Native HDR + PsychoV35 with DLSS or DLAA, a locally installed NGX SDK/runtime and a supported fixed NVIDIA FG multiplier. Compare `RX_VK_PSYCHOV35_DLSS=0` and `=1`; verify actual engine/FG counts in the log, not just the selected menu rows. | Steady interval | measured port @ d4a69456, source 878c957c, switch off | measured port @ d4a69456, source 878c957c, switch on | |---|---|---| | HDR DLSS feature | Not made | Made, HDR linear colour | | Network input/output | RGBA16F rejected | RGBA16F accepted, format 97 | | DLSS evaluations per complete interval | Game's network runs | 600 | | NVIDIA FG sets made per 600 presents, median of two runs | 0 | 600 | | Missing-input fallbacks, median of two runs | 600 | 0 | ```text PsychoV35 DLSS: enabled; scene format 122, network input 97, output 97; HDR linear input/output NVIDIA DLSS: 600 frames drawn DLSS Frame Gen (NGX): of the last 600 presents 600 made by DLSS-G ... 0 without new inputs (no DLSS/DLAA this frame) Switch off: DLSS Frame Gen (NGX): of the last 600 presents 0 made by DLSS-G ... 600 without new inputs (no DLSS/DLAA this frame) ``` A further DLAA cold start at 2560x1440 also repeatedly reports 600/600 DLAA evaluations and NVIDIA FG sets. Live Vanilla/PsychoV35 changes recover with history resets. The player visually tested the build and reported it working well. This PR makes no DLSS performance-optimization claim. ## Testing **Tested:** renderer built with llvm-mingw and NGX: 207 translation units, zero compiler failures. Four focused checks (`test_psychov35_dlss`, `test_temporal_history`, `test_hdr_encode`, `test_reactive_mask`) pass on the rebased branch. The new fixture compiles the real format policy and exercises 3,670,016 combinations, history transitions, HDR guards, typed output, consistent consumers and the FG input handoff. It fails on the original source. The packed shader regenerates byte-for-byte identically. Hyrule Field cold-start and tone-mapper-switch results are above; local screenshots were reviewed and the player supplied the HDR visual assessment. Refreshed complete suite on this rebased branch: **492 passed, 4 failed, 35 skipped** (bundled Python, llvm-mingw, `--jobs 6 --timeout 180`). All four failures also reproduce on unchanged current main `2a2da67f`: `nx2/test_nup_paths.py` (Windows symlink privilege), `tests/test_check_third_party.py` (Windows output handling), `tests/test_setup_runtime.py` (Windows path handling), and `tests/test_release.py` (missing OpenSSL and Windows newlines). No test was weakened or skipped to obtain this result. This is not a clean full-suite pass. **Not tested:** Linux; other NVIDIA GPUs/drivers; live DLSS/DLAA switching (the bridge cannot select the Native step); optional reactive-mask runtime behaviour. No controlled FPS improvement, broad HDR-tracking fix or default-on rollout is claimed. **Needs other testers:** - Linux with NVIDIA RTX and an HDR-capable surface: cold PsychoV35 + DLSS/DLAA and fixed NVIDIA FG, expecting RGBA16F input/output and sustained engine/FG counts ([T-TTAF](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/108)). - Other NVIDIA generations/drivers with an HDR display: tone-mapper switching, image quality and sustained engine/FG counts ([T-TU8K](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/108)). Both test requests are posted and await a maintainer's `testing wanted` label before testers can claim them; the author is not an upstream collaborator. ## Screenshots Same Hyrule Field save and viewpoint; measured port @ d4a69456, source 878c957c. These are raw HDR PQ screenshots, so an SDR viewer cannot judge absolute HDR brightness. The screenshots are hosted on a dedicated branch of the author's fork and do not enter this PR's code diff. | Packed-only policy, switch off (game's network and built-in FG) | RGBA16F path, switch on (DLSS and NVIDIA FG verified in logs) | |---|---| | ![PsychoV35 with fix off](https://git.magicbean.dev/futondestroyer/Longshot/raw/branch/codex/pr108-screenshots/pr-screenshots/psychov35-off-pq.png) | ![PsychoV35 with fix on](https://git.magicbean.dev/futondestroyer/Longshot/raw/branch/codex/pr108-screenshots/pr-screenshots/psychov35-on-pq.png) | ## Risk and rollback The new path runs only when explicitly enabled with Native HDR, PsychoV35 and DLSS/DLAA. Unusual scene/view combinations, colour encoding and history transitions are the risks; keep existing camera/depth/size/generation/age checks and fall back if an HDR feature is unavailable. `RX_VK_PSYCHOV35_DLSS=0` restores the packed-only behaviour. FSR/TAAU/Off support is deliberately left for separate work. ## Reviewer notes Start with `temporal_scene_format`, `temporal_colour_pair` and the HDR feature guard/output selection in `vk_temporal.cpp`, then view binding in `vk_draw.cpp`. Storage precision must not remove the network's perceptual-to-linear decode. Related Hookshot context: #2481 introduced the deliberate format gate, #2243 established native-HDR linear input/output, and merged #2118 supplies the NGX FG input handoff. ## Issues Related upstream: https://github.com/NotRexed/Hookshot/pull/2707 and https://github.com/NotRexed/Hookshot/pull/2481. ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Flags noted, and the switch reference updated (docs/development.md, the README). - [x] Screenshots for a change that shows on screen. - [x] A row in `docs/tested-configurations.md` for each measured run. - [x] The SPIR-V headers regenerated with glslang (a shader changed). - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated.
Adapt Hookshot PR #2707 with shared scene format gates, typed RGBA16F output and history resets. Record local HDR/DLSS/DLAA/NGX FG validation and retain opt-in rollout.

Assisted-by: OpenAI Codex
docs(vk): record rebased PsychoV35 checks and scope
Some checks failed
Linux AppImage / appimage (pull_request) Blocked by required conditions
Windows builder / Longshot Builder zip (pull_request) Blocked by required conditions
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Blocked by required conditions
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Blocked by required conditions
Vulkan back end with NVIDIA DLSS / Windows Vulkan back end with NVIDIA DLSS and AMD FSR 4 (llvm-mingw, link check) (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
6a4215c820
Document the existing Upscaler Off fallback and current-main baseline failures without adding the separate DLSS performance investigation.

Assisted-by: OpenAI Codex
futondestroyer force-pushed codex/psychov35-dlss-hdr from 6a4215c820
Some checks failed
Linux AppImage / appimage (pull_request) Blocked by required conditions
Windows builder / Longshot Builder zip (pull_request) Blocked by required conditions
Windows builder / Windows Vulkan back end (llvm-mingw) (pull_request) Blocked by required conditions
Windows builder / dav1d for Windows (llvm-mingw) (pull_request) Blocked by required conditions
Vulkan back end with NVIDIA DLSS / Windows Vulkan back end with NVIDIA DLSS and AMD FSR 4 (llvm-mingw, link check) (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to d22f0a4e8a
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 2s
2026-11-13 03:47:02 +00:00
Compare
Author
First-time contributor

Rebased onto b9cdc432 (the additional commit changes CI workflows and CONTRIBUTING only; runtime/renderer/tests unchanged). Added the refreshed 492-pass / 4-baseline-failure / 35-skip suite result, successful NGX renderer rebuild, paired screenshots, and test requests T-TTAF/T-TU8K. The PR remains limited to the opt-in PsychoV35 compatibility fix; DLSS/DLAA performance investigation is paused and excluded. No merge is requested from automation; maintainers will review and merge.

Rebased onto b9cdc432 (the additional commit changes CI workflows and CONTRIBUTING only; runtime/renderer/tests unchanged). Added the refreshed 492-pass / 4-baseline-failure / 35-skip suite result, successful NGX renderer rebuild, paired screenshots, and test requests T-TTAF/T-TU8K. The PR remains limited to the opt-in PsychoV35 compatibility fix; DLSS/DLAA performance investigation is paused and excluded. No merge is requested from automation; maintainers will review and merge.
futondestroyer changed title from WIP: fix(vk): support PsychoV35 HDR with DLSS and NVIDIA frame generation to fix(vk): support PsychoV35 HDR with DLSS and NVIDIA frame generation 2026-11-13 03:48:25 +00:00
HumanBean left a comment

Read through the code change, rebuilt both SPIR-V headers and ran the suite on an export of this branch. I didn't find a bug that blocks the opt-in path. The gate is narrow: enabled is checked first, so nobody pays for it on the default path. FSR 3.1, TAAU and Off still reject RGBA16F (fsr3_upscale and stretch keep their own B10G11R11 checks). scene_tonemap_on() already requires Native HDR. The reactive copy remakes its image when the format changes.

What I checked:

  • dlss_out_rgba_comp_spv.h regenerates byte-for-byte with glslang 16.6.0 (-V --target-env vulkan1.3 -DDLSS_RGBA16F=1), and the SHA-256 in its first line matches dlss_out.comp. dlss_out_comp_spv.h also still regenerates identically from the changed source.
  • No change to vk_api.h, the translator or Shader::Info, so no API bump or cache invalidation is needed.
  • The edits to test_hdr_encode.py and test_reactive_mask.py replace the old strings with the new ones. Neither check is weakened.
  • Base: this is one commit behind main (6c904189, docs only, AGENTS.md). No conflict, but rebase before merge.
  • Tests: python -I -B tests/run_all.py on Linux (export of this branch, no Vulkan headers): 451 passed, 11 failed, 69 skipped. The 11 failures are this PC's environment and fail on main the same way (test_linux_update, byte-compile, test_bake_portability, test_builder_log_read_only, test_program_cache_cleanup, test_check_third_party, test_control, test_longshot_ctl, test_longshot_launch, test_program_cache_one_variant, test_vram_budget_row). The checks this PR touches pass here too: test_psychov35_dlss, test_psychov35, test_hdr_encode, test_reactive_mask, test_temporal_history and test_dlss_actor. So the new fixture also builds with g++ on Linux.

What I'd still want before merge:

  1. A run of the default path on this code. The PR changes temporal_upscale for everyone, not only behind the switch. Known networks now get an input-format check they didn't have before, and the history-reset block and its log line run for every DLSS/DLAA/FSR 4 user (inline comment). The measurements only cover PsychoV35 with the switch off and on, so nothing shows Vanilla (SDR or HDR) with DLSS and FSR 4 still drawing their upscale. One short before/after of Vanilla + DLSS would cover it.
  2. The measured build isn't this PR or main. It's "measured port @ d4a69456, source 878c957c", which is older than the base. The Measured box asks for main and this PR at named commits. For a correctness fix like this, a cold start at the PR head with the switch on, showing the same 600 made by DLSS-G / NVIDIA DLSS: 600 frames drawn lines, would close that gap.
  3. Linux and other NVIDIA GPUs/drivers are still open (T-TTAF, T-TU8K, which need the testing wanted label to be picked up). That's fine while the switch stays opt-in, as the PR proposes.
Read through the code change, rebuilt both SPIR-V headers and ran the suite on an export of this branch. I didn't find a bug that blocks the opt-in path. The gate is narrow: `enabled` is checked first, so nobody pays for it on the default path. FSR 3.1, TAAU and Off still reject RGBA16F (`fsr3_upscale` and `stretch` keep their own B10G11R11 checks). `scene_tonemap_on()` already requires Native HDR. The reactive copy remakes its image when the format changes. What I checked: - `dlss_out_rgba_comp_spv.h` regenerates byte-for-byte with glslang 16.6.0 (`-V --target-env vulkan1.3 -DDLSS_RGBA16F=1`), and the SHA-256 in its first line matches `dlss_out.comp`. `dlss_out_comp_spv.h` also still regenerates identically from the changed source. - No change to `vk_api.h`, the translator or `Shader::Info`, so no API bump or cache invalidation is needed. - The edits to `test_hdr_encode.py` and `test_reactive_mask.py` replace the old strings with the new ones. Neither check is weakened. - Base: this is one commit behind `main` (6c904189, docs only, AGENTS.md). No conflict, but rebase before merge. - Tests: `python -I -B tests/run_all.py` on Linux (export of this branch, no Vulkan headers): 451 passed, 11 failed, 69 skipped. The 11 failures are this PC's environment and fail on `main` the same way (test_linux_update, byte-compile, test_bake_portability, test_builder_log_read_only, test_program_cache_cleanup, test_check_third_party, test_control, test_longshot_ctl, test_longshot_launch, test_program_cache_one_variant, test_vram_budget_row). The checks this PR touches pass here too: test_psychov35_dlss, test_psychov35, test_hdr_encode, test_reactive_mask, test_temporal_history and test_dlss_actor. So the new fixture also builds with g++ on Linux. What I'd still want before merge: 1. **A run of the default path on this code.** The PR changes `temporal_upscale` for everyone, not only behind the switch. Known networks now get an input-format check they didn't have before, and the history-reset block and its log line run for every DLSS/DLAA/FSR 4 user (inline comment). The measurements only cover PsychoV35 with the switch off and on, so nothing shows Vanilla (SDR or HDR) with DLSS and FSR 4 still drawing their upscale. One short before/after of Vanilla + DLSS would cover it. 2. **The measured build isn't this PR or main.** It's "measured port @ d4a69456, source 878c957c", which is older than the base. The *Measured* box asks for main and this PR at named commits. For a correctness fix like this, a cold start at the PR head with the switch on, showing the same `600 made by DLSS-G` / `NVIDIA DLSS: 600 frames drawn` lines, would close that gap. 3. Linux and other NVIDIA GPUs/drivers are still open (T-TTAF, T-TU8K, which need the `testing wanted` label to be picked up). That's fine while the switch stays opt-in, as the PR proposes.
@ -970,1 +1008,4 @@
if (ready == 0) return fail(why ? why : "not this frame");
if (psycho && (!engine.e->hdr || !engine.e->hdr()))
return fail("PsychoV35 waits for the native HDR DLSS feature");
if (s.psycho_last != psycho || s.history_input != in->format) {
Owner

This block runs on every path, not just the PsychoV35 one. history_input starts as VK_FORMAT_UNDEFINED, so the first successful evaluation for every DLSS/DLAA/FSR 4 user (switch unset, Vanilla, SDR) logs vk: PsychoV35 DLSS: disabled; scene format 122, network input 122, output 122; HDR linear input/output. That line is wrong on an SDR or FSR 4 run, and it will confuse anyone reading a log for an unrelated bug. The reset itself does no harm there, since last_frame is already 0. With the switch on and a packed scene it also says "enabled ... HDR linear input/output" while the colour goes through the packed out_hdr route. Suggestion: log only when the switch is on (or when psycho or the RGBA16F format is involved on either side of the change), and print the real route (rgba) rather than a fixed "HDR linear input/output".

This block runs on every path, not just the PsychoV35 one. `history_input` starts as `VK_FORMAT_UNDEFINED`, so the first successful evaluation for every DLSS/DLAA/FSR 4 user (switch unset, Vanilla, SDR) logs `vk: PsychoV35 DLSS: disabled; scene format 122, network input 122, output 122; HDR linear input/output`. That line is wrong on an SDR or FSR 4 run, and it will confuse anyone reading a log for an unrelated bug. The reset itself does no harm there, since `last_frame` is already 0. With the switch on and a packed scene it also says "enabled ... HDR linear input/output" while the colour goes through the packed `out_hdr` route. Suggestion: log only when the switch is on (or when `psycho` or the RGBA16F format is involved on either side of the change), and print the real route (`rgba`) rather than a fixed "HDR linear input/output".
@ -0,0 +128,4 @@
import math
prep=(ROOT/'gpu/vk/shaders/dlss_prep.comp').read_text()
assert 'kSquare ? e * e : e' in prep
for linear in (0.0, 0.001, 0.02, 0.18, 0.5, 1.0, 2.0, 6.5):
Owner

Nit: this loop checks that sqrt(x)**2 == x in Python, which is always true and doesn't exercise anything in the shader or the C++. The string check above it (kSquare ? e * e : e) is what actually guards the decode. I'd drop the loop, or replace it with a check that make_pipelines still gives prep_hdr kSquare on (prep_hdr_data{16384.0f, VK_TRUE} is already asserted, so dropping it is enough).

Nit: this loop checks that `sqrt(x)**2 == x` in Python, which is always true and doesn't exercise anything in the shader or the C++. The string check above it (`kSquare ? e * e : e`) is what actually guards the decode. I'd drop the loop, or replace it with a check that `make_pipelines` still gives `prep_hdr` `kSquare` on (`prep_hdr_data{16384.0f, VK_TRUE}` is already asserted, so dropping it is enough).
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 2s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/psychov35-dlss-hdr:futondestroyer-codex/psychov35-dlss-hdr'
git switch 'futondestroyer-codex/psychov35-dlss-hdr'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!108
No description provided.