fix(vk): a DLSS feature refused for want of video memory is retried, not latched off #2247

Merged
HumanBean merged 3 commits from dazemc/Longshot:fix/dlss-oom-retry into main 2026-11-23 00:14:07 +00:00
Contributor

Summary

A DLSS feature creation that fails with NGX's out-of-video-memory result was kept refused for the rest of the run: prepare() stored s.refused = key, and only a DLSS, resolution or model row (dlss_retry(), #2658) or release() cleared it. That failure is often temporary — a menu switch's old feature and its memory may still be waiting to be let go — so the player silently stayed on the game's own upscale after one transient OOM, though the next few seconds had the memory.

This keeps the refusal's key, number of attempts and due frame in dlss_checks::retry. An out-of-video-memory failure is tried again after 600 frames, at most three creations; then the refusal stays and is logged once. Any other result is final at once, as before, and a different key (output size, quality mode, preset or HDR) is tried at once. A feature made, release() and dlss_retry() clear it. The diagnostic switch RX_VK_DLSS_FAIL_CREATE=<result>[:<times>] makes the next creations return a chosen NGX result, so the out-of-video-memory path can be run on any GPU; it is off by default.

To see the bug on main, force NGX's creation to return NVSDK_NGX_Result_FAIL_OutOfGPUMemory for the current output, mode and preset (a card at its limit, or the issue's test hook): the log says NVIDIA DLSS: its feature was not made (...) once and DLSS never comes back. With this change the next line after 600 frames is its feature is tried again (2 of 3), and the feature is made if the memory is back.

Read first: gpu/vk/dlss_checks.h (the rule), gpu/vk/vk_dlss.cpp prepare() / release() / dlss_retry(), and tests/dlss_feature_size_test.cpp.

Fixes #1612.

Testing

Tested: Linux (Arch, kernel 7.3.4), NVIDIA RTX 4070 Ti, driver 620.70.06. The branch's pack over main a2dc5385, Kokiri Forest child, DLSS on at 2560x1440 output (1707x960 render), through the PC's queue: feature 1 made (the first; frame 31, 54.4 ms of CPU): 2560x1440 ... mode 2, preset K, then 600/600 frames drawn, 0 made; no its feature was not made, no FATAL, crash or device-lost line. The forced out-of-video-memory path is the L3 run below.

Tested, in game (L3 forced OOM): head 4639280b, shared game run under abrun (one owner), ticket 2247-l3-oom, run l3-2247-oom-20261122-144220, 2560x1440 output / 1707x960 render, DLSS on, RX_VK_DLSS_FAIL_CREATE=0xBAD0000D:1:
vk: NVIDIA DLSS: its feature was not made (0xbad0000d) for 2560x1440 -> 2560x1440
vk: NVIDIA DLSS: its feature is tried again (2 of 3) after it was refused for want of video memory
vk: NVIDIA DLSS: feature 1 made (the first; frame 5911, 41.9 ms of CPU): 1707x960 (1280x720 to 2560x1440) -> 2560x1440, mode 2, preset K
Playable afterwards: state play, frame 6125, 55.1 fps, KokiriForest_Child; the 600-frame status has 90 frames drawn and 1 made. Log sha256 1f109a98bf91734faffcabe7065e78b09abb0d17f2ecabf1147018855d6f8e7a. The script exited 1 only because its log --expect calls lacked --since; the game run and these lines are complete.

Tested, game-free: python -I -B tests/test_dlss_feature_size.py on the test-only commit db882519 (on main 753fb5af) aborts at tests/dlss_feature_size_test.cpp:311, the frame-600 retry assertion (creations == 2); at head 4639280b it prints DLSS recommended feature sizes, dynamic ranges, native AA, failure handling and the failure hook pass, including separate behavioral cases for dlss_retry() and release() and one for RX_VK_DLSS_FAIL_CREATE. tests/test_dlss_checks.py (the pure rule and separate source checks for both reset paths) passes with g++ and clang++. tests/run_all.py --changed origin/main --jobs 4: 29 passed, 0 failed, 3 skipped (Vulkan headers not set in that run). vk_dlss.cpp passes clang++ -fsyntax-only with the build's real flags and -DLONGSHOT_NGX.

Full suite — settled against main. The light2 run at head 4639280b (log header head: 4639280bd19551a4155c243702abcc6e19bd9d7e; queue-light, systemd-run -p MemoryMax=12G -p MemorySwapMax=0, mise run test -- --jobs 5, header deps, no abrun) gave 934 passed, 5 failed, 18 skipped in 424 s (exit 1). The clean main 753fb5af baseline gives the same 934 passed, 5 failed, 18 skipped in 416 s, and the same five fail in both: test_cpm_discovery, test_dev_packs, test_mise_build, test_pipeline_state_computes, test_saveload_warm_cache. No DLSS check failed. Earlier 4a22570d runs were process-suspect or lacked headers; the c3edeba6 run was cancelled as 10 behind and a first 4639280b run was killed mid-run by the harness parent timeout — light2 is the settled result. Log: head-2247-4639280b-queued-light2.log.

Still to test:

  • Windows, any NVIDIA GPU: the requested DLSS smoke run at head 4639280b, expecting a feature made and 600/600 frames drawn (by hand or @Beanstalk; the corrected farm request is on the PR and needs a BigBean).

Measurements

None: a behaviour fix, not a speed change. The game-free before/after is in Testing, and the in-game run above is a smoke test of the DLSS path, not a timing comparison.

Risks

A permanent out-of-video-memory failure now pays up to two extra creation attempts (tens of milliseconds each, 600 frames apart) before the final log; a transient one recovers instead of losing DLSS for the run. Any other NGX result is unchanged, and so is the setting-change retry. The only switch is RX_VK_DLSS_FAIL_CREATE, a diagnostic one off by default, with its row in switches.def; unset it does nothing. No default, save, cache format or translator-stamp change: dlss_checks.h and vk_dlss.cpp are not in the translator's hashed files, so no player re-prepares shaders. A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). Light2 at 4639280b: 934 passed, 5 failed, 18 skipped in 424 s; the clean main 753fb5af baseline is 934 passed, 5 failed, 18 skipped in 416 s, with the same five: test_cpm_discovery, test_dev_packs, test_mise_build, test_pipeline_state_computes, test_saveload_warm_cache. No DLSS check failed. The light2 log is kept at head-2247-4639280b-queued-light2.log; the baseline's raw log is no longer on disk (its shell output was pruned with the reboot), so its numbers stand as recorded in comment 74919.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def. (RX_VK_DLSS_FAIL_CREATE is a diagnostic, off by default; its row and a fixture case are in.)
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (The changed renderer file passes the Windows-target -fsyntax-only check above; no host/ file changes.)
  • Docs updated. (docs/dev/reference/upscalers.md now documents the bounded out-of-video-memory retry and the unchanged other failures.)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary A DLSS feature creation that fails with NGX's out-of-video-memory result was kept refused for the rest of the run: `prepare()` stored `s.refused = key`, and only a DLSS, resolution or model row (`dlss_retry()`, #2658) or `release()` cleared it. That failure is often temporary — a menu switch's old feature and its memory may still be waiting to be let go — so the player silently stayed on the game's own upscale after one transient OOM, though the next few seconds had the memory. This keeps the refusal's key, number of attempts and due frame in `dlss_checks::retry`. An out-of-video-memory failure is tried again after 600 frames, at most three creations; then the refusal stays and is logged once. Any other result is final at once, as before, and a different key (output size, quality mode, preset or HDR) is tried at once. A feature made, `release()` and `dlss_retry()` clear it. The diagnostic switch `RX_VK_DLSS_FAIL_CREATE=<result>[:<times>]` makes the next creations return a chosen NGX result, so the out-of-video-memory path can be run on any GPU; it is off by default. To see the bug on main, force NGX's creation to return `NVSDK_NGX_Result_FAIL_OutOfGPUMemory` for the current output, mode and preset (a card at its limit, or the issue's test hook): the log says `NVIDIA DLSS: its feature was not made (...)` once and DLSS never comes back. With this change the next line after 600 frames is `its feature is tried again (2 of 3)`, and the feature is made if the memory is back. Read first: `gpu/vk/dlss_checks.h` (the rule), `gpu/vk/vk_dlss.cpp` `prepare()` / `release()` / `dlss_retry()`, and `tests/dlss_feature_size_test.cpp`. Fixes #1612. ## Testing **Tested:** Linux (Arch, kernel 7.3.4), NVIDIA RTX 4070 Ti, driver 620.70.06. The branch's pack over main `a2dc5385`, Kokiri Forest child, DLSS on at 2560x1440 output (1707x960 render), through the PC's queue: `feature 1 made (the first; frame 31, 54.4 ms of CPU): 2560x1440 ... mode 2, preset K`, then `600/600 frames drawn, 0 made`; no `its feature was not made`, no FATAL, crash or device-lost line. The forced out-of-video-memory path is the L3 run below. **Tested, in game (L3 forced OOM):** head `4639280b`, shared game run under `abrun` (one owner), ticket `2247-l3-oom`, run `l3-2247-oom-20261122-144220`, 2560x1440 output / 1707x960 render, DLSS on, `RX_VK_DLSS_FAIL_CREATE=0xBAD0000D:1`: `vk: NVIDIA DLSS: its feature was not made (0xbad0000d) for 2560x1440 -> 2560x1440` `vk: NVIDIA DLSS: its feature is tried again (2 of 3) after it was refused for want of video memory` `vk: NVIDIA DLSS: feature 1 made (the first; frame 5911, 41.9 ms of CPU): 1707x960 (1280x720 to 2560x1440) -> 2560x1440, mode 2, preset K` Playable afterwards: `state play`, frame 6125, 55.1 fps, `KokiriForest_Child`; the 600-frame status has 90 frames drawn and 1 made. Log sha256 `1f109a98bf91734faffcabe7065e78b09abb0d17f2ecabf1147018855d6f8e7a`. The script exited 1 only because its `log --expect` calls lacked `--since`; the game run and these lines are complete. **Tested, game-free:** `python -I -B tests/test_dlss_feature_size.py` on the test-only commit `db882519` (on main `753fb5af`) aborts at `tests/dlss_feature_size_test.cpp:311`, the frame-600 retry assertion (`creations == 2`); at head `4639280b` it prints `DLSS recommended feature sizes, dynamic ranges, native AA, failure handling and the failure hook pass`, including separate behavioral cases for `dlss_retry()` and `release()` and one for `RX_VK_DLSS_FAIL_CREATE`. `tests/test_dlss_checks.py` (the pure rule and separate source checks for both reset paths) passes with `g++` and `clang++`. `tests/run_all.py --changed origin/main --jobs 4`: 29 passed, 0 failed, 3 skipped (Vulkan headers not set in that run). `vk_dlss.cpp` passes `clang++ -fsyntax-only` with the build's real flags and `-DLONGSHOT_NGX`. **Full suite — settled against main.** The light2 run at head `4639280b` (log header `head: 4639280bd19551a4155c243702abcc6e19bd9d7e`; queue-light, `systemd-run -p MemoryMax=12G -p MemorySwapMax=0`, `mise run test -- --jobs 5`, header deps, no `abrun`) gave **934 passed, 5 failed, 18 skipped in 424 s** (exit 1). The clean main `753fb5af` baseline gives the same **934 passed, 5 failed, 18 skipped in 416 s**, and the same five fail in both: `test_cpm_discovery`, `test_dev_packs`, `test_mise_build`, `test_pipeline_state_computes`, `test_saveload_warm_cache`. No DLSS check failed. Earlier `4a22570d` runs were process-suspect or lacked headers; the `c3edeba6` run was cancelled as 10 behind and a first `4639280b` run was killed mid-run by the harness parent timeout — light2 is the settled result. Log: `head-2247-4639280b-queued-light2.log`. **Still to test:** - Windows, any NVIDIA GPU: the requested DLSS smoke run at head `4639280b`, expecting a feature made and 600/600 frames drawn (by hand or @Beanstalk; the corrected farm request is on the PR and needs a BigBean). ## Measurements None: a behaviour fix, not a speed change. The game-free before/after is in Testing, and the in-game run above is a smoke test of the DLSS path, not a timing comparison. ## Risks A permanent out-of-video-memory failure now pays up to two extra creation attempts (tens of milliseconds each, 600 frames apart) before the final log; a transient one recovers instead of losing DLSS for the run. Any other NGX result is unchanged, and so is the setting-change retry. The only switch is `RX_VK_DLSS_FAIL_CREATE`, a diagnostic one off by default, with its row in `switches.def`; unset it does nothing. No default, save, cache format or translator-stamp change: `dlss_checks.h` and `vk_dlss.cpp` are not in the translator's hashed files, so no player re-prepares shaders. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). Light2 at `4639280b`: **934 passed, 5 failed, 18 skipped in 424 s**; the clean main `753fb5af` baseline is **934 passed, 5 failed, 18 skipped in 416 s**, with the same five: `test_cpm_discovery`, `test_dev_packs`, `test_mise_build`, `test_pipeline_state_computes`, `test_saveload_warm_cache`. No DLSS check failed. The light2 log is kept at `head-2247-4639280b-queued-light2.log`; the baseline's raw log is no longer on disk (its shell output was pruned with the reboot), so its numbers stand as recorded in comment 74919. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. (`RX_VK_DLSS_FAIL_CREATE` is a diagnostic, off by default; its row and a fixture case are in.) - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (The changed renderer file passes the Windows-target `-fsyntax-only` check above; no `host/` file changes.) - [x] Docs updated. (`docs/dev/reference/upscalers.md` now documents the bounded out-of-video-memory retry and the unchanged other failures.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
The real prepare() is cut from vk_dlss.cpp and linked against a fake NGX
that now returns a chosen result. With the out-of-video-memory result it
expects a retry 600 frames later, a second and third attempt, then the
refusal kept; another result is never retried by time, and another key is
tried at once.

Fails on main at the first retry (frame 600, creations == 2): main sets
s.refused = key and nothing clears it until a DLSS setting changes (#1612).
fix(vk): a DLSS feature refused for want of video memory is retried, not latched off
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 13s
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
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (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
4a22570d6a
prepare() kept s.refused = key after every failed creation, and only a
DLSS, resolution or model row (dlss_retry, #2658) or release() cleared
it. NGX's out-of-video-memory result is often temporary, while a menu
switch's old feature and its memory are still being let go: the run then
kept the game's upscale with one log line.

The refusal now records its key, try count and due frame
(dlss_checks::retry): out of video memory is tried again after 600
frames, at most three creations, then the refusal stays and is logged
once. Any other result is final at once, as before, and a different key
is tried at once. A feature made, release() and dlss_retry() clear it.

Tests: the real prepare() cut in tests/dlss_feature_size.py now drives
the retry (it failed on main at the first retry, frame 600); the pure
rule has its own cases in test_dlss_checks.cpp, and that check's source
assertions follow the new lines.

Assisted-by: DeepSeek V4.1 Flash
Author
Contributor

Tested in game: Linux, RTX 4070 Ti, Kokiri Forest: DLSS feature made, 600/600 frames drawn, no feature-creation failure; the OOM retry path itself is proven game-free

Tested in game: Linux, RTX 4070 Ti, Kokiri Forest: DLSS feature made, 600/600 frames drawn, no feature-creation failure; the OOM retry path itself is proven game-free
Author
Contributor

Testing: added the Windows-target syntax check of vk_dlss.cpp (x86_64-w64-mingw32-clang++ -fsyntax-only, pass) and the host-build box. No code change; head 4a22570d.

Testing: added the Windows-target syntax check of vk_dlss.cpp (x86_64-w64-mingw32-clang++ -fsyntax-only, pass) and the host-build box. No code change; head 4a22570d.
Author
Contributor

@Beanstalk two runs for this WIP: (1) Windows 11, any NVIDIA RTX, DLSS on in Kokiri Forest, expecting the feature made and 600/600 frames drawn with no 'its feature was not made' line; (2) if a 6-8 GB card is free, hold video memory with another program before the game starts, turn DLSS on, and expect either the feature made or the lines 'its feature is tried again (2 of 3)' after 600 frames and a feature made when the memory returns, with no crash.

@Beanstalk two runs for this WIP: (1) Windows 11, any NVIDIA RTX, DLSS on in Kokiri Forest, expecting the feature made and 600/600 frames drawn with no 'its feature was not made' line; (2) if a 6-8 GB card is free, hold video memory with another program before the game starts, turn DLSS on, and expect either the feature made or the lines 'its feature is tried again (2 of 3)' after 600 frames and a feature made when the memory returns, with no crash.
Member

@dazemc only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for 4a22570, and the PR has changed since (c3edeba), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@dazemc only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `4a22570`, and the PR has changed since (`c3edeba`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

Full suite rerun at head 4a22570d: 911 passed, 23 failed, 18 skipped in 543 s; log head-2247-4a22570d.log, the same 23 pre-existing main a2dc5385 names and no DLSS check failed. The description now names the head. No code change.

Full suite rerun at head 4a22570d: 911 passed, 23 failed, 18 skipped in 543 s; log head-2247-4a22570d.log, the same 23 pre-existing main a2dc5385 names and no DLSS check failed. The description now names the head. No code change.
Author
Contributor

Suite result marked SUSPECT: the first --jobs 4 run at 4a22570d was outside abrun/the queue and without the 12G cap, overlapping fs-orphan-kill (04:48:43-05:01:34) and 2207-unc-suite (04:42:44-05:04:42). The suite box is unticked. fs-orphan-kill's own failure was its script's 'FAIL: kill-run launch', not this suite. A clean abrun + MemoryMax=12G + --jobs 5 rerun is queued behind the current owner.

Suite result marked SUSPECT: the first --jobs 4 run at 4a22570d was outside abrun/the queue and without the 12G cap, overlapping fs-orphan-kill (04:48:43-05:01:34) and 2207-unc-suite (04:42:44-05:04:42). The suite box is unticked. fs-orphan-kill's own failure was its script's 'FAIL: kill-run launch', not this suite. A clean abrun + MemoryMax=12G + --jobs 5 rerun is queued behind the current owner.
Author
Contributor

Suite status: the queued abrun + 12G + jobs 5 rerun at 4a22570d completed process-clean but without the test header deps: 825 passed, 109 failed, 18 skipped; all 109 are --strict 'not found: spirv_headers/vulkan_headers', not code. The suite box stays unticked. A header-deps rerun under the same abrun/12G/jobs 5 rule is queued (head-2247-4a22570d-queued-headers.log). No code change.

Suite status: the queued abrun + 12G + jobs 5 rerun at 4a22570d completed process-clean but without the test header deps: 825 passed, 109 failed, 18 skipped; all 109 are --strict 'not found: spirv_headers/vulkan_headers', not code. The suite box stays unticked. A header-deps rerun under the same abrun/12G/jobs 5 rule is queued (head-2247-4a22570d-queued-headers.log). No code change.
Owner
@review
BeanBot left a comment

Recommendation: Approve. The game-free test demonstrates the retry, but the actual NGX out-of-video-memory recovery has not been exercised in game, and the Windows DLSS run remains outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

A DLSS feature refused for insufficient video memory is retried twice at 600-frame intervals instead of remaining disabled immediately. This can restore DLSS after temporary memory pressure, at the cost of up to two additional feature-creation stalls when memory remains unavailable.

Should fix (2): not blocking, but worth doing before merging.

  • L1 docs/dev/reference/upscalers.md:207: The upscaler reference still says every failed DLSS feature creation waits for a setting change before retrying. When: After an out-of-video-memory failure, prepare now retries after 600 frames, contrary to the documented rule. Do: Document the bounded out-of-video-memory retries and the unchanged behavior for other failures.
  • L2 tests/test_dlss_checks.py:55: The source check claims to cover both reset paths but accepts a reset in either one alone. (more on the line) Do: Check release and dlss_retry separately, preferably with a behavioral test that exercises each reset.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3 gpu/vk/vk_dlss.cpp:449: The actual NGX out-of-video-memory recovery and retry cost remain untested in game. (more on the line) Do: Run the failure and recovery scenario on an NVIDIA GPU, record the retry and successful creation, and observe the frame stalls during failed attempts.
  • L4 gpu/vk/vk_dlss.cpp:408: The changed DLSS path has not been run on Windows. (more on the line) Do: Run the requested Windows NVIDIA DLSS smoke test and record feature creation and sustained drawing.

@fix can do L1 and L2.

Checks: Still running: 9 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven in game for the reported failure: the fixture fails on main at the frame-600 retry and passes at head, but the Linux RTX 4070 Ti smoke run did not produce an out-of-video-memory result.

Other systems: The changed path is NVIDIA NGX DLSS on Linux and Windows, including DLAA and the temporal chain's prewarm and gameplay calls. The recorded Linux smoke run covers ordinary creation; Windows and actual memory-pressure recovery remain untested. Non-NGX builds retain their existing stubs; AMD and Intel upscaler implementations are unchanged.

Switches: None added, changed or removed.

Reviewed: 4a22570d6a against a2dc538590: Read AGENTS.md, CONTRIBUTING.md, the pull request template, docs/dev/standards.md, the complete diff and commit messages, and all six changed files. Traced prepare, release, retry, temporal-chain callers and frame numbering; skimmed the surrounding DLSS frame-generation code and upscaler reference. docs/review-checklist.md and ../Tooling/AGENTS.md were absent from the checkout.; nothing run (a code review).

Checked and fine:

  • The retry state is accessed under the temporal chain lock at prepare and setting reset; release clears it.
  • A different key starts a new failure count, a successful creation clears it, and other NGX failures remain final.
  • The diff adds no game-derived files, generated files, API changes or switches.
  • The implementation commit records AI assistance.

Testing: Read-only review; no commands from the project, builds or tests were run. The reported full-suite rerun with header dependencies and several CI checks remain pending.

Overlaps and merge order: Not established from the supplied checkout and review context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The game-free test demonstrates the retry, but the actual NGX out-of-video-memory recovery has not been exercised in game, and the Windows DLSS run remains outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. A DLSS feature refused for insufficient video memory is retried twice at 600-frame intervals instead of remaining disabled immediately. This can restore DLSS after temporary memory pressure, at the cost of up to two additional feature-creation stalls when memory remains unavailable. **Should fix (2)**: not blocking, but worth doing before merging. - **L1** `docs/dev/reference/upscalers.md:207`: The upscaler reference still says every failed DLSS feature creation waits for a setting change before retrying. *When:* After an out-of-video-memory failure, prepare now retries after 600 frames, contrary to the documented rule. **Do:** Document the bounded out-of-video-memory retries and the unchanged behavior for other failures. - **L2** `tests/test_dlss_checks.py:55`: The source check claims to cover both reset paths but accepts a reset in either one alone. (more on the line) **Do:** Check release and dlss_retry separately, preferably with a behavioral test that exercises each reset. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `gpu/vk/vk_dlss.cpp:449`: The actual NGX out-of-video-memory recovery and retry cost remain untested in game. (more on the line) **Do:** Run the failure and recovery scenario on an NVIDIA GPU, record the retry and successful creation, and observe the frame stalls during failed attempts. - **L4** `gpu/vk/vk_dlss.cpp:408`: The changed DLSS path has not been run on Windows. (more on the line) **Do:** Run the requested Windows NVIDIA DLSS smoke test and record feature creation and sustained drawing. `@fix` can do L1 and L2. **Checks:** Still running: 9 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven in game for the reported failure: the fixture fails on main at the frame-600 retry and passes at head, but the Linux RTX 4070 Ti smoke run did not produce an out-of-video-memory result. **Other systems:** The changed path is NVIDIA NGX DLSS on Linux and Windows, including DLAA and the temporal chain's prewarm and gameplay calls. The recorded Linux smoke run covers ordinary creation; Windows and actual memory-pressure recovery remain untested. Non-NGX builds retain their existing stubs; AMD and Intel upscaler implementations are unchanged. **Switches:** None added, changed or removed. **Reviewed:** 4a22570d6a22 against a2dc53859018: Read AGENTS.md, CONTRIBUTING.md, the pull request template, docs/dev/standards.md, the complete diff and commit messages, and all six changed files. Traced prepare, release, retry, temporal-chain callers and frame numbering; skimmed the surrounding DLSS frame-generation code and upscaler reference. docs/review-checklist.md and ../Tooling/AGENTS.md were absent from the checkout.; nothing run (a code review). **Checked and fine:** - The retry state is accessed under the temporal chain lock at prepare and setting reset; release clears it. - A different key starts a new failure count, a successful creation clears it, and other NGX failures remain final. - The diff adds no game-derived files, generated files, API changes or switches. - The implementation commit records AI assistance. **Testing:** Read-only review; no commands from the project, builds or tests were run. The reported full-suite rerun with header dependencies and several CI checks remain pending. **Overlaps and merge order:** Not established from the supplied checkout and review context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -405,2 +406,3 @@
(hdr ? 1 : 0) ^ 1ull << 63;
if (s.refused == key) return *fail = "its feature was not made", 0;
// (a refusal for this key: kept, unless it was out of video memory and its retry is due)
const dlss_checks::retry::Verdict refused = dlss_checks::retry::verdict(s.refusal, key, texture_frame_no());
Member

L4 (should fix): The changed DLSS path has not been run on Windows.

When: The Windows-target syntax check cannot show that NGX creates and draws a feature successfully with this change on Windows.

Do: Run the requested Windows NVIDIA DLSS smoke test and record feature creation and sustained drawing.

**L4** (should fix): The changed DLSS path has not been run on Windows. *When:* The Windows-target syntax check cannot show that NGX creates and draws a feature successfully with this change on Windows. **Do:** Run the requested Windows NVIDIA DLSS smoke test and record feature creation and sustained drawing.
@ -441,0 +446,4 @@
// again after a bounded interval. Any other failure, or the last of them, keeps the game's upscale until a DLSS
// setting changes)
const bool out_of_memory = r == NVSDK_NGX_Result_FAIL_OutOfGPUMemory;
if (dlss_checks::retry::failed(s.refusal, key, out_of_memory, texture_frame_no()) && out_of_memory)
Member

L3 (should fix): The actual NGX out-of-video-memory recovery and retry cost remain untested in game.

When: When NGX refuses creation under video-memory pressure, the fixture supplies a simulated result, but no recorded game run shows that the real failure is retried and DLSS returns after memory is freed.

Do: Run the failure and recovery scenario on an NVIDIA GPU, record the retry and successful creation, and observe the frame stalls during failed attempts.

**L3** (should fix): The actual NGX out-of-video-memory recovery and retry cost remain untested in game. *When:* When NGX refuses creation under video-memory pressure, the fixture supplies a simulated result, but no recorded game run shows that the real failure is retried and DLSS returns after memory is freed. **Do:** Run the failure and recovery scenario on an NVIDIA GPU, record the retry and successful creation, and observe the frame stalls during failed attempts.
@ -49,0 +52,4 @@
"NVSDK_NGX_Result_FAIL_OutOfGPUMemory" in prepare, \
"prepare: an out-of-video-memory creation is recorded for a retry"
assert "dlss_checks::retry::made(s.refusal)" in prepare, "prepare: a made feature clears the refusal"
assert "s.refusal = {}" in dlss, "release() and dlss_retry() clear the refusal"
Member

L2 (should fix): The source check claims to cover both reset paths but accepts a reset in either one alone.

When: Removing the reset from dlss_retry leaves the release reset matching this assertion, so the check passes even though changing a DLSS setting no longer clears a final refusal.

Do: Check release and dlss_retry separately, preferably with a behavioral test that exercises each reset.

**L2** (should fix): The source check claims to cover both reset paths but accepts a reset in either one alone. *When:* Removing the reset from dlss_retry leaves the release reset matching this assertion, so the check passes even though changing a DLSS setting no longer clears a final refusal. **Do:** Check release and dlss_retry separately, preferably with a behavioral test that exercises each reset.
fix(vk): review: document the OOM retry, check both resets, and add the failure hook
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 5s
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
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (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
Website / Website on Cloudflare (pull_request) Has been cancelled
c3edeba6f9
L1: docs/dev/reference/upscalers.md said every failed DLSS feature
creation waits for a setting change; it now says out-of-video-memory is
retried after 600 frames, three creations at most, and other results stay
final.

L2: tests/test_dlss_checks.py checked release() and dlss_retry() with one
substring that either reset satisfied. It now reads each function's body
separately, and tests/dlss_feature_size_test.cpp cuts both real functions
and checks their behavior: dlss_retry() and release() each clear a final
refusal and the next prepare() creates at once.

L3: RX_VK_DLSS_FAIL_CREATE=<result>[:<times>] makes the next <times>
creations return the chosen NGX result, so the out-of-video-memory retry
can be run on any GPU. Off by default; its row is in switches.def and the
fixture checks one forced failure then a real creation.
Author
Contributor

Review answers (head c3edeba6): L1 fixed in docs/dev/reference/upscalers.md (the OOM retry and the unchanged other results); L2 fixed with separate source checks and behavioral tests for release() and dlss_retry(); L3 added RX_VK_DLSS_FAIL_CREATE and the forced OOM/recovery run is queued; L4 still needs the Windows/Test Farm run. The header-deps suite at c3edeba6 is queued under abrun + MemoryMax=12G + --jobs 5; the suite box stays unticked until it finishes. No ready flip.

Review answers (head c3edeba6): L1 fixed in docs/dev/reference/upscalers.md (the OOM retry and the unchanged other results); L2 fixed with separate source checks and behavioral tests for release() and dlss_retry(); L3 added RX_VK_DLSS_FAIL_CREATE and the forced OOM/recovery run is queued; L4 still needs the Windows/Test Farm run. The header-deps suite at c3edeba6 is queued under abrun + MemoryMax=12G + --jobs 5; the suite box stays unticked until it finishes. No ready flip.
Author
Contributor

Checklist: added the Docs updated box (upscalers.md) and named the forced OOM run as by hand on this RTX 4070 Ti. The suite box stays unticked pending the abrun/12G/jobs 5 header-deps run at c3edeba6. No code change.

Checklist: added the Docs updated box (upscalers.md) and named the forced OOM run as by hand on this RTX 4070 Ti. The suite box stays unticked pending the abrun/12G/jobs 5 header-deps run at c3edeba6. No code change.
Author
Contributor

Suite wrapper fixed: the old light ticket that retried abrun inside the queue-light slot was cancelled (it could deadlock a timing runner that holds abrun and waits for a queued timing job). The new ticket 2247-suite-c3edeba6-light is queue-light + systemd-run -p MemoryMax=12G -p MemorySwapMax=0 + mise run test --jobs 5 with header deps, no abrun inside. Log head-2247-c3edeba6-queued-light.log. The suite box stays unticked and the PR stays WIP.

Suite wrapper fixed: the old light ticket that retried abrun inside the queue-light slot was cancelled (it could deadlock a timing runner that holds abrun and waits for a queued timing job). The new ticket 2247-suite-c3edeba6-light is queue-light + systemd-run -p MemoryMax=12G -p MemorySwapMax=0 + mise run test --jobs 5 with header deps, no abrun inside. Log head-2247-c3edeba6-queued-light.log. The suite box stays unticked and the PR stays WIP.
dazemc force-pushed fix/dlss-oom-retry from c3edeba6f9
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 5s
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
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (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
Website / Website on Cloudflare (pull_request) Has been cancelled
to 4639280bd1
Some checks are pending
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
CI / Website build and checks (pull_request) Blocked by required conditions
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
Guide screenshots / Guide images and local UI source review (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
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
beanstalk/approval changed since the request: ask again
2026-11-22 20:43:06 +00:00
Compare
Author
Contributor

Rebased onto current main 753fb5af: new head 4639280b (test db882519, fix 2901d54b). The c3edeba6 suite was cancelled because it was 10 commits behind and could not settle the box. The test commit still fails on 753fb5af at the frame-600 retry, and the rebased head passes the DLSS checks. The clean suite will be queued as 2247-suite-4639280b only when the queue is empty, as one queue-light ticket with systemd-run MemoryMax=12G and no abrun. Suite box unticked; PR WIP.

Rebased onto current main 753fb5af: new head 4639280b (test db882519, fix 2901d54b). The c3edeba6 suite was cancelled because it was 10 commits behind and could not settle the box. The test commit still fails on 753fb5af at the frame-600 retry, and the rebased head passes the DLSS checks. The clean suite will be queued as 2247-suite-4639280b only when the queue is empty, as one queue-light ticket with systemd-run MemoryMax=12G and no abrun. Suite box unticked; PR WIP.
Author
Contributor

The first 4639280b queue-light run was killed mid-run by the harness parent timeout (partial head-2247-4639280b-queued-light.log, no result). Replacement ticket 2247-suite-4639280b-light2 is queued only when the queue is empty: queue-light + systemd-run MemoryMax=12G + jobs 5, no abrun, longer parent timeout, log head-2247-4639280b-queued-light2.log. The direct-abrun alternative was evaluated and blocked by the safety gate, so it is not used. Suite box unticked; PR WIP.

The first 4639280b queue-light run was killed mid-run by the harness parent timeout (partial head-2247-4639280b-queued-light.log, no result). Replacement ticket 2247-suite-4639280b-light2 is queued only when the queue is empty: queue-light + systemd-run MemoryMax=12G + jobs 5, no abrun, longer parent timeout, log head-2247-4639280b-queued-light2.log. The direct-abrun alternative was evaluated and blocked by the safety gate, so it is not used. Suite box unticked; PR WIP.
Author
Contributor

Suite box settled from the light2 run at 4639280b: 934 passed, 5 failed, 18 skipped in 424 s; the clean main 753fb5af baseline is the same 934/5/18 in 416 s with the same five failures (test_cpm_discovery, test_dev_packs, test_mise_build, test_pipeline_state_computes, test_saveload_warm_cache). No DLSS check failed. The box is ticked; L3 forced-OOM and L4 Windows remain Still to test. The PR state will be checked before any ready flip.

Suite box settled from the light2 run at 4639280b: 934 passed, 5 failed, 18 skipped in 424 s; the clean main 753fb5af baseline is the same 934/5/18 in 416 s with the same five failures (test_cpm_discovery, test_dev_packs, test_mise_build, test_pipeline_state_computes, test_saveload_warm_cache). No DLSS check failed. The box is ticked; L3 forced-OOM and L4 Windows remain Still to test. The PR state will be checked before any ready flip.
dazemc changed title from WIP: fix(vk): a DLSS feature refused for want of video memory is retried, not latched off to fix(vk): a DLSS feature refused for want of video memory is retried, not latched off 2026-11-22 22:14:51 +00:00
Author
Contributor

@Beanstalk Windows 11, any NVIDIA RTX, PR head 4639280b (rebased since the earlier request): DLSS on in Kokiri Forest, expecting feature 1 made and 600/600 frames drawn, no its feature was not made line, no crash. This is the L4 Windows check only; the forced out-of-video-memory recovery (L3) is being run on the author Linux RTX 4070 Ti. No game files, keys or derived data.

@Beanstalk Windows 11, any NVIDIA RTX, PR head 4639280b (rebased since the earlier request): DLSS on in Kokiri Forest, expecting feature 1 made and 600/600 frames drawn, no its feature was not made line, no crash. This is the L4 Windows check only; the forced out-of-video-memory recovery (L3) is being run on the author Linux RTX 4070 Ti. No game files, keys or derived data.
Member

@dazemc only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@dazemc only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
Contributor

L3 forced OOM/recovery, head 4639280b, shared game run under abrun, ticket 2247-l3-oom, run l3-2247-oom-20261122-144220, 2560x1440 output / 1707x960 render, DLSS on, RX_VK_DLSS_FAIL_CREATE=0xBAD0000D:1.

vk: NVIDIA DLSS: its feature was not made (0xbad0000d) for 2560x1440 -> 2560x1440
vk: NVIDIA DLSS: its feature is tried again (2 of 3) after it was refused for want of video memory
vk: NVIDIA DLSS: feature 1 made (the first; frame 5911, 41.9 ms of CPU): 1707x960 (1280x720 to 2560x1440) -> 2560x1440, mode 2, preset K

Playable afterwards: state play, frame 6125, 55.1 fps, KokiriForest_Child; the 600-frame status has 90 frames drawn and 1 made. Log sha256 1f109a98bf91734faffcabe7065e78b09abb0d17f2ecabf1147018855d6f8e7a. The script exited 1 only because its log --expect calls lacked --since; the game run and these lines are complete.

L3 forced OOM/recovery, head 4639280b, shared game run under abrun, ticket 2247-l3-oom, run l3-2247-oom-20261122-144220, 2560x1440 output / 1707x960 render, DLSS on, RX_VK_DLSS_FAIL_CREATE=0xBAD0000D:1. vk: NVIDIA DLSS: its feature was not made (0xbad0000d) for 2560x1440 -> 2560x1440 vk: NVIDIA DLSS: its feature is tried again (2 of 3) after it was refused for want of video memory vk: NVIDIA DLSS: feature 1 made (the first; frame 5911, 41.9 ms of CPU): 1707x960 (1280x720 to 2560x1440) -> 2560x1440, mode 2, preset K Playable afterwards: state play, frame 6125, 55.1 fps, KokiriForest_Child; the 600-frame status has 90 frames drawn and 1 made. Log sha256 1f109a98bf91734faffcabe7065e78b09abb0d17f2ecabf1147018855d6f8e7a. The script exited 1 only because its log --expect calls lacked --since; the game run and these lines are complete.
Author
Contributor

L3 evidence added to Tested: head 4639280b, ticket 2247-l3-oom, run l3-2247-oom-20261122-144220; forced create failure (0xbad0000d), retry (2 of 3), feature 1 made, then state play at frame 6125, 55.1 fps, KokiriForest_Child. Log sha256 1f109a98... The L3 Still-to-test line is removed; only the Windows L4/farm run remains. Suite box stays ticked; Ready-to-merge remains 0/4. No code change.

L3 evidence added to Tested: head 4639280b, ticket 2247-l3-oom, run l3-2247-oom-20261122-144220; forced create failure (0xbad0000d), retry (2 of 3), feature 1 made, then state play at frame 6125, 55.1 fps, KokiriForest_Child. Log sha256 1f109a98... The L3 Still-to-test line is removed; only the Windows L4/farm run remains. Suite box stays ticked; Ready-to-merge remains 0/4. No code change.
Author
Contributor

Head 4639280b is still ready and waits only on fork CI: its pull_request jobs are "Blocked by required conditions" and the PR has no ci: approved label. No earlier fork-CI ask names this head.

@HumanBean: please approve this head's fork CI runs (the Actions jobs, and the ci: approved label for the fork project) and review #2247 — a DLSS feature refused for want of video memory retried rather than latched off.

Evidence is in the thread: the suite at 4639280b (934/5/18, equal to the main baseline) and the forced-OOM recovery run at 4639280b (feature made, then play).

Head `4639280b` is still ready and waits only on fork CI: its `pull_request` jobs are "Blocked by required conditions" and the PR has no `ci: approved` label. No earlier fork-CI ask names this head. @HumanBean: please approve this head's fork CI runs (the Actions jobs, and the `ci: approved` label for the fork project) and review #2247 — a DLSS feature refused for want of video memory retried rather than latched off. Evidence is in the thread: the suite at 4639280b (934/5/18, equal to the main baseline) and the forced-OOM recovery run at 4639280b (feature made, then play).
HumanBean deleted branch fix/dlss-oom-retry 2026-11-23 00:14:07 +00:00
Some checks are pending
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
CI / Website build and checks (pull_request) Blocked by required conditions
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
Guide screenshots / Guide images and local UI source review (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
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
beanstalk/approval changed since the request: ask again
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!2247
No description provided.