fix(vk): jump directly to projected DRS stop on severe overload and damp bounce ping-pong across GPUs #3095

Merged
HumanBean merged 3 commits from Jer9/Longshot:fix/vk-drs-responsiveness into main 2026-12-04 06:51:02 +00:00
Member

Summary

What a player notices: When Dynamic Resolution Scaling (Auto) is enabled and the GPU is heavily overloaded (for example, entering Market or Hyrule Field at 100% render scale), render resolution jumps directly to the stop that fits the GPU budget in ~2 s instead of crawling down one stop every ~3 s across 6 steps (~16–19 s), and stops ping-ponging between adjacent stops (such as 75% <-> 83%) without ever permanently locking out resolution recovery.

  • Helps: All GPUs using Auto Dynamic Resolution Scaling (resolution=0) when transitioning from light to heavy scenes or hovering near a stop boundary.
  • No measurable impact: Fixed render scale (100%, 67%, 50%), scenes already at the DRS floor (50%/42%/33%), or CPU-bound scenes.

Root Cause & Fix (gpu/vk/drs.h, mkwvk::drs::update called by menu_drs_tick() at gpu/vk/vk_menu.cpp:1251)

  1. Single-stop crawl on severe overload: mkwvk::drs::update previously waited kStepDownWindows = 3 (~3 s) and dropped only one stop (stops[idx - 1]) regardless of how far GPU time exceeded budget. Using a shared project_gpu_ms() helper (0.35 + 0.65 * scale^2, guarded for cur_pct <= 0), update now tracks severe_windows (consecutive windows >= 1.25 * budget) and sustained_gpu_ms (minimum GPU time across the consecutive overload streak):
    • Requires over_windows >= 3 || severe_windows >= 2 (preserving 1-window spike immunity even after a mild window, and keeping 3 windows when Auto Frame Generation is active so AutoGuard sheds excess FG passes first).
    • When sustained_gpu_ms >= 1.25 * budget, jumps directly to the highest stop whose projected GPU time fits <= 0.96 * budget (or the floor if none), while mild overloads (< 1.25 * budget) continue dropping 1 stop.
  2. Per-stop, per-budget bounce damping (75% <-> 83%): Adds bounce_stop_id, calm_windows, and last_budget_ms with reset_hysteresis():
    • Applies a single kBounceHeadroomStep (0.06, 62% / 79% projected) margin only while cur_id == bounce_stop_id, while keeping cooldown backoff up to bounce_level == 2 (40 windows).
    • Decays bounce_level after kBounceDecayWindows (80) calm post-cooldown windows, clears bounce on a further step-down to a lower stop, and resets hysteresis whenever the frame budget changes by > 0.05 ms (e.g. changing FPS cap 60 -> 30).

Testing

Tested: Windows 11, AMD Ryzen AI 7 350 / Radeon 860M (RDNA 3.5 iGPU, Adrenalin 26.10.1), windowed 1920x1080, FSR 3.1, Auto DRS (50% floor), 60 FPS cap (16.7 ms budget), n=4 interleaved ABBA runs per scene on forge/main 6318f4056 (+ local 1-line Windows builder compile fix for sandbox_windows.rs:1654 note_lines outside this PR).

  • How to test:
    1. Set Upscaler: FSR 3.1, Dynamic resolution: On (Auto, 50% floor), 1920x1080 (100% render scale start), 60 FPS cap.
    2. Load Market_Child or HyruleField_Adult and inspect vk: drs: transitions in longshot_log.txt.
  • Game-free test (tests/test_drs.py): Commit bc910b5dc adds 7 cases (severe 2-window jump, mild+severe spike immunity, 1.16x 1-stop hold, Auto FG 3-window vs Fixed FG 2-window, 75% <-> 83% ping-pong damping, bounce_level == 2 recovery in a 60% scene, and 60 -> 30 FPS cap budget reset); all 7 fail on forge/main (6318f4056), and 405/405 checks pass with 25e7988d5.
  • Additional live playtest (72a0bc8d4 + #3095 + #3096 combined, Radeon 860M, 1920x1080, FSR 3.1, Auto FG + Auto DRS across 60/40/30 FPS caps and 33%/50% floors): 17 live Auto DRS transitions with 0 75% <-> 83% ping-pong oscillations, 0 DEVICE_LOST, and 0 in-play shader waits — 60 FPS (16.7 ms budget) jumped straight 100% -> 33% / 100% -> 50% in 1 step; 40 FPS (25.0 ms budget) jumped 100% -> 67% and 67% -> 50%; 30 FPS (33.3 ms budget) stepped smoothly under mild < 1.25x load (32.3–36.3 ms).
  • Test suite: Rebased onto forge/main 08a57248f (ddb2cd013; gpu/vk/drs.h untouched between 6318f4056..08a57248f); tests/test_drs.py passed 405/405 checks (fsr3fi: 71/71), and python -I -B tests/run_all.py --changed forge/main --strict passed (7 passed, 0 failed, 3 skipped [Linux-only cmake/spirv-val]). Full tests/run_all.py --strict baseline on 6318f4056 ran (831 passed, 9 failed, 51 skipped — pre-existing Windows env/main failures: test_helpers_extract, test_longshot_builder, test_utf8_paths (CP_ACP at hos_file_windows.c:645), test_run_all_junit, test_coverage_run, test_native_zstd, test_fsr4_tune, test_lifter, test_float_add_subgroup).

Still to test:

  • Tier 1 discrete NVIDIA RTX (DLSS + Auto DRS + Auto FG on Windows/Linux) (@Beanstalk / by hand)
  • Tier 1 discrete AMD RX 6000–9000 (Windows + Linux RADV) and Steam Deck (30/45 FPS cap) (@Beanstalk / by hand)

Measurements

Verdict: Yes — cuts 100% render scale -> 50% render scale overload convergence from 6 steps to 2 steps, lifts Market_Child median FPS +9.7% / 1% low +5.3%, and lifts HyruleField_Adult 1% low +13.6% (>50 ms spikes -58%) across n=4 interleaved ABBA warm runs.

Setup: Windows 11, AMD Ryzen AI 7 350 / Radeon 860M (Adrenalin 26.10.1), windowed 1920x1080, FSR 3.1, Auto DRS (100% render scale start, 50% render scale floor), 60 FPS cap (16.7 ms budget), n=4 interleaved ABBA warm runs per variant (M P2 P3 P3 P2 M x2).

Where it makes a difference:

Metric Before: main @ 6318f4056 After: this PR @ 25e7988d5 Delta
DRS steps 100% render scale -> 50% render scale (Market / Hyrule) 6 2 -66.7%
Market_Child median FPS 34.36 FPS 37.70 FPS +9.7%
Market_Child median 1% low 28.14 FPS 29.63 FPS +5.3%
Market_Child median p99 frame time 33.9 ms 32.1 ms -5.3%
HyruleField_Adult median 1% low 17.63 FPS 20.03 FPS +13.6%
HyruleField_Adult median p99 frame time 54.0 ms 45.3 ms -16.1%
HyruleField_Adult median >50 ms spikes 16.5 7.0 -57.6%
dispatch vk: slow submit (Market / Hyrule) 1 / 1 0 / 0 -100%

Where it does NOT make a difference (within run-to-run variance):

Metric Before: main @ 6318f4056 After: this PR @ 25e7988d5 Delta
HyruleField_Adult median FPS 32.84 FPS 32.96 FPS +0.4%
Market_Child median max frame time 37.4 ms 37.5 ms +0.3%
# main @ 6318f4056 (Market_Child): 6 sequential steps (100->92->83->75->67->58->50), 32.4 fps (2343 frames)
# this PR @ 25e7988d5 (Market_Child): 2 steps, 35.9 fps (2531 frames)
vk: drs: 100% -> 58% (gpu 35.7 ms / budget 16.7 ms, native 19.4 fps)
vk: drs: 58% -> 50% (gpu 23.6 ms / budget 16.7 ms, native 29.6 fps)

Risks

  • project_gpu_ms() assumes 35% fixed + 65% pixel-rate GPU cost; scenes with higher fixed geometry/compute share may still need a follow-up 1-stop step-down (as seen in Market_Child: 100% -> 58% -> 50%), while pure fill-rate scenes may step slightly below optimal and recover after cooldown.
  • Complements merged #3096 (45d1863b2, which eliminates FSR 3.1 internal image reallocations on DRS steps); standalone main ABBA numbers below were measured on 6318f4056 before #3096 merged.
  • Kill switch: RX_VK_DRS=0 disables Auto DRS; reverting gpu/vk/drs.h restores previous single-stop behavior with no save/settings/cache impact.

Checklist

Ready for review

  • One topic, on current main (08a57248f, head ddb2cd013); 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 (tests/run_all.py --changed forge/main --strict: 7 passed, 0 failed; clean 6318f4056 baseline pre-existing Windows failures named in Testing).
  • 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 (tests/test_drs.py, commit bc910b5dc).
  • 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.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers on every commit.

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 **What a player notices:** When Dynamic Resolution Scaling (Auto) is enabled and the GPU is heavily overloaded (for example, entering Market or Hyrule Field at `100% render scale`), render resolution jumps directly to the stop that fits the GPU budget in ~2 s instead of crawling down one stop every ~3 s across 6 steps (~16–19 s), and stops ping-ponging between adjacent stops (such as `75% <-> 83%`) without ever permanently locking out resolution recovery. - **Helps:** All GPUs using Auto Dynamic Resolution Scaling (`resolution=0`) when transitioning from light to heavy scenes or hovering near a stop boundary. - **No measurable impact:** Fixed render scale (`100%`, `67%`, `50%`), scenes already at the DRS floor (`50%`/`42%`/`33%`), or CPU-bound scenes. ### Root Cause & Fix (`gpu/vk/drs.h`, `mkwvk::drs::update` called by `menu_drs_tick()` at `gpu/vk/vk_menu.cpp:1251`) 1. **Single-stop crawl on severe overload:** `mkwvk::drs::update` previously waited `kStepDownWindows = 3` (~3 s) and dropped only one stop (`stops[idx - 1]`) regardless of how far GPU time exceeded budget. Using a shared `project_gpu_ms()` helper (`0.35 + 0.65 * scale^2`, guarded for `cur_pct <= 0`), `update` now tracks `severe_windows` (consecutive windows `>= 1.25 * budget`) and `sustained_gpu_ms` (minimum GPU time across the consecutive overload streak): - Requires `over_windows >= 3 || severe_windows >= 2` (preserving 1-window spike immunity even after a mild window, and keeping 3 windows when Auto Frame Generation is active so `AutoGuard` sheds excess FG passes first). - When `sustained_gpu_ms >= 1.25 * budget`, jumps directly to the highest stop whose projected GPU time fits `<= 0.96 * budget` (or the floor if none), while mild overloads (`< 1.25 * budget`) continue dropping 1 stop. 2. **Per-stop, per-budget bounce damping (`75% <-> 83%`):** Adds `bounce_stop_id`, `calm_windows`, and `last_budget_ms` with `reset_hysteresis()`: - Applies a single `kBounceHeadroomStep` (`0.06`, `62%` / `79%` projected) margin only while `cur_id == bounce_stop_id`, while keeping cooldown backoff up to `bounce_level == 2` (`40` windows). - Decays `bounce_level` after `kBounceDecayWindows` (`80`) calm post-cooldown windows, clears bounce on a further step-down to a lower stop, and resets hysteresis whenever the frame budget changes by `> 0.05 ms` (e.g. changing FPS cap `60 -> 30`). ## Testing **Tested:** Windows 11, AMD Ryzen AI 7 350 / Radeon 860M (RDNA 3.5 iGPU, Adrenalin 26.10.1), windowed `1920x1080`, FSR 3.1, Auto DRS (`50%` floor), `60 FPS` cap (`16.7 ms` budget), `n=4` interleaved ABBA runs per scene on `forge/main` `6318f4056` (+ local 1-line Windows builder compile fix for `sandbox_windows.rs:1654` `note_lines` outside this PR). - **How to test:** 1. Set **Upscaler: FSR 3.1**, **Dynamic resolution: On** (`Auto`, `50%` floor), `1920x1080` (`100% render scale` start), `60 FPS` cap. 2. Load `Market_Child` or `HyruleField_Adult` and inspect `vk: drs:` transitions in `longshot_log.txt`. - **Game-free test (`tests/test_drs.py`):** Commit `bc910b5dc` adds 7 cases (severe 2-window jump, mild+severe spike immunity, `1.16x` 1-stop hold, Auto FG 3-window vs Fixed FG 2-window, `75% <-> 83%` ping-pong damping, `bounce_level == 2` recovery in a `60%` scene, and `60 -> 30 FPS` cap budget reset); all 7 fail on `forge/main` (`6318f4056`), and `405/405` checks pass with `25e7988d5`. - **Additional live playtest (`72a0bc8d4` + `#3095` + `#3096` combined, Radeon 860M, `1920x1080`, FSR 3.1, `Auto` FG + `Auto` DRS across `60`/`40`/`30 FPS` caps and `33%`/`50%` floors):** `17` live Auto DRS transitions with `0` `75% <-> 83%` ping-pong oscillations, `0` `DEVICE_LOST`, and `0` in-play shader waits — `60 FPS` (`16.7 ms` budget) jumped straight `100% -> 33%` / `100% -> 50%` in 1 step; `40 FPS` (`25.0 ms` budget) jumped `100% -> 67%` and `67% -> 50%`; `30 FPS` (`33.3 ms` budget) stepped smoothly under mild `< 1.25x` load (`32.3–36.3 ms`). - **Test suite:** Rebased onto `forge/main` `08a57248f` (`ddb2cd013`; `gpu/vk/drs.h` untouched between `6318f4056..08a57248f`); `tests/test_drs.py` passed `405/405` checks (`fsr3fi: 71/71`), and `python -I -B tests/run_all.py --changed forge/main --strict` passed (`7 passed, 0 failed, 3 skipped` [Linux-only `cmake`/`spirv-val`]). Full `tests/run_all.py --strict` baseline on `6318f4056` ran (`831 passed, 9 failed, 51 skipped` — pre-existing Windows env/main failures: `test_helpers_extract`, `test_longshot_builder`, `test_utf8_paths` (`CP_ACP` at `hos_file_windows.c:645`), `test_run_all_junit`, `test_coverage_run`, `test_native_zstd`, `test_fsr4_tune`, `test_lifter`, `test_float_add_subgroup`). **Still to test:** - Tier 1 discrete NVIDIA RTX (`DLSS` + `Auto DRS` + `Auto FG` on Windows/Linux) (`@Beanstalk` / by hand) - Tier 1 discrete AMD RX 6000–9000 (Windows + Linux RADV) and Steam Deck (`30`/`45` FPS cap) (`@Beanstalk` / by hand) ## Measurements **Verdict:** Yes — cuts `100% render scale -> 50% render scale` overload convergence from `6` steps to `2` steps, lifts `Market_Child` median FPS `+9.7%` / 1% low `+5.3%`, and lifts `HyruleField_Adult` 1% low `+13.6%` (`>50 ms` spikes `-58%`) across `n=4` interleaved ABBA warm runs. Setup: Windows 11, AMD Ryzen AI 7 350 / Radeon 860M (Adrenalin 26.10.1), windowed `1920x1080`, FSR 3.1, Auto DRS (`100% render scale` start, `50% render scale` floor), `60 FPS` cap (`16.7 ms` budget), `n=4` interleaved ABBA warm runs per variant (`M P2 P3 P3 P2 M` x2). **Where it makes a difference:** | Metric | Before: main @ 6318f4056 | After: this PR @ 25e7988d5 | Delta | |---|---:|---:|---:| | DRS steps `100% render scale -> 50% render scale` (`Market` / `Hyrule`) | 6 | **2** | **-66.7%** | | `Market_Child` median FPS | 34.36 FPS | **37.70 FPS** | **+9.7%** | | `Market_Child` median 1% low | 28.14 FPS | **29.63 FPS** | **+5.3%** | | `Market_Child` median p99 frame time | 33.9 ms | **32.1 ms** | **-5.3%** | | `HyruleField_Adult` median 1% low | 17.63 FPS | **20.03 FPS** | **+13.6%** | | `HyruleField_Adult` median p99 frame time | 54.0 ms | **45.3 ms** | **-16.1%** | | `HyruleField_Adult` median `>50 ms` spikes | 16.5 | **7.0** | **-57.6%** | | `dispatch` `vk: slow submit` (`Market` / `Hyrule`) | 1 / 1 | **0 / 0** | **-100%** | **Where it does NOT make a difference (within run-to-run variance):** | Metric | Before: main @ 6318f4056 | After: this PR @ 25e7988d5 | Delta | |---|---:|---:|---:| | `HyruleField_Adult` median FPS | 32.84 FPS | 32.96 FPS | +0.4% | | `Market_Child` median max frame time | 37.4 ms | 37.5 ms | +0.3% | ```text # main @ 6318f4056 (Market_Child): 6 sequential steps (100->92->83->75->67->58->50), 32.4 fps (2343 frames) # this PR @ 25e7988d5 (Market_Child): 2 steps, 35.9 fps (2531 frames) vk: drs: 100% -> 58% (gpu 35.7 ms / budget 16.7 ms, native 19.4 fps) vk: drs: 58% -> 50% (gpu 23.6 ms / budget 16.7 ms, native 29.6 fps) ``` ## Risks - `project_gpu_ms()` assumes `35%` fixed + `65%` pixel-rate GPU cost; scenes with higher fixed geometry/compute share may still need a follow-up 1-stop step-down (as seen in `Market_Child`: `100% -> 58% -> 50%`), while pure fill-rate scenes may step slightly below optimal and recover after cooldown. - Complements merged `#3096` (`45d1863b2`, which eliminates FSR 3.1 internal image reallocations on DRS steps); standalone `main` ABBA numbers below were measured on `6318f4056` before `#3096` merged. - Kill switch: `RX_VK_DRS=0` disables Auto DRS; reverting `gpu/vk/drs.h` restores previous single-stop behavior with no save/settings/cache impact. ## Checklist ### Ready for review - [x] One topic, on current `main` (`08a57248f`, head `ddb2cd013`); 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 (`tests/run_all.py --changed forge/main --strict`: `7 passed, 0 failed`; clean `6318f4056` baseline pre-existing Windows failures named in Testing). - [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 (`tests/test_drs.py`, commit `bc910b5dc`). - [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. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers on every commit. ### 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.
fix(drs): jump directly to projected stop on severe overload and damp bounce ping-pong
Some checks failed
PR description / Title and description (pull_request_target) Successful in 10s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
c9a3b5b416
Author
Member

Tested in game: Windows 11 Radeon 860M 1920x1080 FSR 3.1 Auto DRS: 6 steps -> 1 step, Market +13.5% Mean / +50.3% 1% low

Tested in game: Windows 11 Radeon 860M 1920x1080 FSR 3.1 Auto DRS: 6 steps -> 1 step, Market +13.5% Mean / +50.3% 1% low
Jer9 force-pushed fix/vk-drs-responsiveness from c9a3b5b416
Some checks failed
PR description / Title and description (pull_request_target) Successful in 10s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 25e7988d56
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-04 00:03:01 +00:00
Compare
Jer9 force-pushed fix/vk-drs-responsiveness from 25e7988d56
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to ddb2cd0131
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-04 02:22:15 +00:00
Compare
Jer9 changed title from WIP: fix(vk): jump directly to projected DRS stop on severe overload and damp bounce ping-pong across GPUs to fix(vk): jump directly to projected DRS stop on severe overload and damp bounce ping-pong across GPUs 2026-12-04 02:22:17 +00:00
BeanBot left a comment

Recommendation: Request changes. Bounce damping can permanently hold resolution below a recoverable stop after the cooldown backoff has decayed. The measured Radeon 860M runs show faster overload convergence, but the affected Tier 1 systems still need testing.

Auto DRS drops multiple resolution stops during sustained severe GPU overload and adds bounce damping. This improves convergence in the reported runs, at the cost of more controller state and a possible persistent loss of image resolution.

Blocking (1): must change before merging.

  1. L1 gpu/vk/drs.h:336: Decay reduces bounce_level but never clears bounce_stop_id, so the extra headroom requirement can remain indefinitely after the backoff has faded. (more on the line) Do: Expire or otherwise relax the stop's headroom restriction after a bounded calm period, and test recovery at a load between the old and tightened thresholds.

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

  • L2 gpu/vk/drs.h:297: The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Linux, including DLSS and Auto frame generation. (more on the line) Do: Run representative heavy-to-light transitions on Tier 1 NVIDIA hardware on both operating systems, recording resolution transitions, frame pacing and recovery against the base.
  • L3 gpu/vk/drs.h:297: The changed policy also needs the stated discrete AMD and Steam Deck runs. (more on the line) Do: Run severe transitions and recovery on Tier 1 AMD Windows and Linux RADV systems and Steam Deck, recording resolution, frame pacing and recovery against the base.

@fix can do L1.

Checks: Still running: 11 checks.

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

Does it help: Yes on the reported Radeon 860M: four interleaved runs per variant show Market median FPS up 9.7% and 1% low up 5.3%, and Hyrule Field 1% low up 13.6%. The comparison used earlier commits rather than the current base and head; broader hardware behavior remains unverified.

Other systems: The controller also affects DLSS, FSR, XeSS and the game's own upscaler, fixed and Auto frame generation, V-Sync modes, Windows, Linux and Steam Deck. The supplied live runs cover Windows Radeon 860M with FSR 3.1; the deterministic tests exercise controller inputs but cannot establish visual quality, frame pacing or GPU-specific behavior.

Switches: No switches added, changed or removed. Existing RX_VK_DRS defaults to enabled and disables Auto DRS when set to 0.

Reviewed: ddb2cd0131 against 08a57248f6: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the diff, commits, gpu/vk/drs.h and tests/test_drs.py; inspected the menu and replay callers and their locking. The named docs/review-checklist.md and adjacent Tooling/AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review).

Checked and fine:

  • Both commits have AI-assistance trailers.
  • The changed files contain no game-derived assets, generated output, shader changes or renderer API changes.
  • The controller state is updated under the menu mutex and published through the existing atomic snapshot.
  • The new tests exercise severe and mild overload, frame generation, bounce damping and budget changes.

Testing: Read-only review; no builds, scripts or tests were run. The supplied CI checks are still running.

Overlaps and merge order: None identified; the description says complementary PR #3096 is already merged.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as Jer9 took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Bounce damping can permanently hold resolution below a recoverable stop after the cooldown backoff has decayed. The measured Radeon 860M runs show faster overload convergence, but the affected Tier 1 systems still need testing. Auto DRS drops multiple resolution stops during sustained severe GPU overload and adds bounce damping. This improves convergence in the reported runs, at the cost of more controller state and a possible persistent loss of image resolution. **Blocking (1)**: must change before merging. 1. **L1** `gpu/vk/drs.h:336`: Decay reduces bounce_level but never clears bounce_stop_id, so the extra headroom requirement can remain indefinitely after the backoff has faded. (more on the line) **Do:** Expire or otherwise relax the stop's headroom restriction after a bounded calm period, and test recovery at a load between the old and tightened thresholds. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `gpu/vk/drs.h:297`: The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Linux, including DLSS and Auto frame generation. (more on the line) **Do:** Run representative heavy-to-light transitions on Tier 1 NVIDIA hardware on both operating systems, recording resolution transitions, frame pacing and recovery against the base. - **L3** `gpu/vk/drs.h:297`: The changed policy also needs the stated discrete AMD and Steam Deck runs. (more on the line) **Do:** Run severe transitions and recovery on Tier 1 AMD Windows and Linux RADV systems and Steam Deck, recording resolution, frame pacing and recovery against the base. `@fix` can do L1. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes on the reported Radeon 860M: four interleaved runs per variant show Market median FPS up 9.7% and 1% low up 5.3%, and Hyrule Field 1% low up 13.6%. The comparison used earlier commits rather than the current base and head; broader hardware behavior remains unverified. **Other systems:** The controller also affects DLSS, FSR, XeSS and the game's own upscaler, fixed and Auto frame generation, V-Sync modes, Windows, Linux and Steam Deck. The supplied live runs cover Windows Radeon 860M with FSR 3.1; the deterministic tests exercise controller inputs but cannot establish visual quality, frame pacing or GPU-specific behavior. **Switches:** No switches added, changed or removed. Existing RX_VK_DRS defaults to enabled and disables Auto DRS when set to 0. **Reviewed:** ddb2cd0131c4 against 08a57248f6bb: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the diff, commits, gpu/vk/drs.h and tests/test_drs.py; inspected the menu and replay callers and their locking. The named docs/review-checklist.md and adjacent Tooling/AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review). **Checked and fine:** - Both commits have AI-assistance trailers. - The changed files contain no game-derived assets, generated output, shader changes or renderer API changes. - The controller state is updated under the menu mutex and published through the existing atomic snapshot. - The new tests exercise severe and mild overload, frame generation, bounce damping and budget changes. **Testing:** Read-only review; no builds, scripts or tests were run. The supplied CI checks are still running. **Overlaps and merge order:** None identified; the description says complementary PR #3096 is already merged. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as Jer9 took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -248,0 +294,4 @@
const bool fast = !(s.framegen_active && s.fg_fixed_mult == 0) && st.severe_windows >= kSevereStepDownWindows;
if (++st.over_windows >= kStepDownWindows || fast) {
int next_idx = idx - 1;
if (st.sustained_gpu_ms >= kSevereOverloadGpuShare * budget) {
Member

L2 (should fix): The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Linux, including DLSS and Auto frame generation.

When: A severe transition can now skip multiple DLSS stops, and the fixed 35%/65% projection can choose a lower resolution than necessary; the supplied live results cover only a Radeon 860M with FSR 3.1.

Do: Run representative heavy-to-light transitions on Tier 1 NVIDIA hardware on both operating systems, recording resolution transitions, frame pacing and recovery against the base.

**L2** (should fix): The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Linux, including DLSS and Auto frame generation. *When:* A severe transition can now skip multiple DLSS stops, and the fixed 35%/65% projection can choose a lower resolution than necessary; the supplied live results cover only a Radeon 860M with FSR 3.1. **Do:** Run representative heavy-to-light transitions on Tier 1 NVIDIA hardware on both operating systems, recording resolution transitions, frame pacing and recovery against the base.
Member

L3 (should fix): The changed policy also needs the stated discrete AMD and Steam Deck runs.

When: Auto DRS can skip multiple stops on RX 6000–9000 GPUs and Steam Deck, including at the Deck's 30 and 45 FPS caps; the reported iGPU run does not cover those drivers or workloads.

Do: Run severe transitions and recovery on Tier 1 AMD Windows and Linux RADV systems and Steam Deck, recording resolution, frame pacing and recovery against the base.

**L3** (should fix): The changed policy also needs the stated discrete AMD and Steam Deck runs. *When:* Auto DRS can skip multiple stops on RX 6000–9000 GPUs and Steam Deck, including at the Deck's 30 and 45 FPS caps; the reported iGPU run does not cover those drivers or workloads. **Do:** Run severe transitions and recovery on Tier 1 AMD Windows and Linux RADV systems and Steam Deck, recording resolution, frame pacing and recovery against the base.
@ -265,0 +333,4 @@
st.severe_windows = 0;
st.sustained_gpu_ms = 0.0f;
// (the cooldown's backoff fades after a long calm stretch, so two old bounces never outlast the scene that caused them)
if (!cooling && st.bounce_level > 0 && ++st.calm_windows >= kBounceDecayWindows) {
Member

L1 (blocking): Decay reduces bounce_level but never clears bounce_stop_id, so the extra headroom requirement can remain indefinitely after the backoff has faded.

When: After a bounce to 75%, a scene at 65% of budget satisfies the old 68% step-up threshold but not the new 62% threshold. Even after 80 calm windows reduce bounce_level to zero, bounce_stop_id still matches 75%, so it stays there indefinitely unless the workload becomes lighter, the budget changes or the controller resets.

Do: Expire or otherwise relax the stop's headroom restriction after a bounded calm period, and test recovery at a load between the old and tightened thresholds.

**L1** (blocking): Decay reduces bounce_level but never clears bounce_stop_id, so the extra headroom requirement can remain indefinitely after the backoff has faded. *When:* After a bounce to 75%, a scene at 65% of budget satisfies the old 68% step-up threshold but not the new 62% threshold. Even after 80 calm windows reduce bounce_level to zero, bounce_stop_id still matches 75%, so it stays there indefinitely unless the workload becomes lighter, the budget changes or the controller resets. **Do:** Expire or otherwise relax the stop's headroom restriction after a bounded calm period, and test recovery at a load between the old and tightened thresholds.
fix(drs): clear bounce_stop_id when bounce_level decays to zero
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 5s
9b3ef63aa9
Assisted-by: Antigravity (Gemini 4 Neon)

Co-Authored-By: Antigravity <[email protected]>
Author
Member

Addressed L1 in 9b3ef63aa:

  • L1 (gpu/vk/drs.h): When calm_windows decays st.bounce_level down to 0, st.bounce_stop_id is now cleared (if (st.bounce_level == 0) st.bounce_stop_id = 0;) so the normal 68%/85% step-up thresholds resume after a bounded calm period instead of staying tightened indefinitely.
  • Test (tests/test_drs.py): Added a game-free reproduction case in test_bounce_damping_recovers_and_resets() (bounces at 75%, holds at 65% of budget between the 62% tightened and 68% normal thresholds, verifies it stays damped through cooldown + calm decay, then clears bounce_stop_id and recovers to 83%). Verified the new assertions failed before 9b3ef63aa and pass with it (drs controller: 510 checks, 0 failures; tests/run_all.py --changed forge/main --strict: 6 passed, 3 skipped [Linux-only cmake/spirv-val], with test_drs.py run directly via --cxx and --headers).

@Beanstalk Please run Tier 1 live comparisons of this branch against main for L2 and L3:

  • NVIDIA RTX (Windows & Linux) with DLSS and Auto Frame Generation (heavy-to-light transitions, recording resolution transitions, frame pacing, and recovery).
  • Discrete AMD RX 6000–9000 (Windows & Linux RADV) (severe transitions and recovery).
  • Steam Deck at 30 FPS and 45 FPS caps (severe transitions and recovery).
Addressed **L1** in `9b3ef63aa`: - **L1 (`gpu/vk/drs.h`):** When `calm_windows` decays `st.bounce_level` down to `0`, `st.bounce_stop_id` is now cleared (`if (st.bounce_level == 0) st.bounce_stop_id = 0;`) so the normal `68%`/`85%` step-up thresholds resume after a bounded calm period instead of staying tightened indefinitely. - **Test (`tests/test_drs.py`):** Added a game-free reproduction case in `test_bounce_damping_recovers_and_resets()` (bounces at `75%`, holds at `65%` of budget between the `62%` tightened and `68%` normal thresholds, verifies it stays damped through cooldown + calm decay, then clears `bounce_stop_id` and recovers to `83%`). Verified the new assertions failed before `9b3ef63aa` and pass with it (`drs controller: 510 checks, 0 failures`; `tests/run_all.py --changed forge/main --strict`: `6 passed, 3 skipped` [Linux-only `cmake`/`spirv-val`], with `test_drs.py` run directly via `--cxx` and `--headers`). @Beanstalk Please run Tier 1 live comparisons of this branch against `main` for **L2** and **L3**: - **NVIDIA RTX (Windows & Linux)** with **DLSS** and **Auto Frame Generation** (heavy-to-light transitions, recording resolution transitions, frame pacing, and recovery). - **Discrete AMD RX 6000–9000 (Windows & Linux RADV)** (severe transitions and recovery). - **Steam Deck** at **30 FPS** and **45 FPS** caps (severe transitions and recovery).
Member

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

@Jer9 only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Jer9 requested review from BeanBot 2026-12-04 04:46:52 +00:00
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The bounce margin now clears when its backoff decays, and the reported Radeon 860M measurements show faster overload convergence. The requested NVIDIA, discrete AMD and Steam Deck live runs are still outstanding. Recommend approval; not approved on the forge.

Auto DRS can jump down several resolution stops under sustained severe GPU load and damp repeated bouncing, with the bounce margin now expiring after calm play. The policy adds state and relies on an estimated GPU cost model.

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

  • L2 gpu/vk/drs.h:297: The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Linux, including DLSS and Auto frame generation. When: A severe transition can now skip multiple DLSS stops, and the fixed 35%/65% projection can choose a lower resolution than necessary; the supplied live results cover only a Radeon 860M with FSR 3.1. Do: Run representative heavy-to-light transitions on Tier 1 NVIDIA hardware on both operating systems, recording resolution transitions, frame pacing and recovery against the base.
  • L3 gpu/vk/drs.h:297: The changed policy also needs the stated discrete AMD and Steam Deck runs. When: Auto DRS can skip multiple stops on RX 6000–9000 GPUs and Steam Deck, including at the Deck's 30 and 45 FPS caps; the reported iGPU run does not cover those drivers or workloads. Do: Run severe transitions and recovery on Tier 1 AMD Windows and Linux RADV systems and Steam Deck, recording resolution, frame pacing and recovery against the base.

Since the last review (on ddb2cd0131)
Resolved: L1 (Decay reduces bounce_level but never clears bounce_stop_id, so the extra headroom requirem…)
Still open: L2 (The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Li…); L3 (The changed policy also needs the stated discrete AMD and Steam Deck runs.)

Checks: Still running: 11 checks.

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

Does it help: Yes on the tested Radeon 860M: the PR reports four interleaved warm runs per scene, with Market median FPS up 9.7% and 1% low up 5.3%, and Hyrule Field 1% low up 13.6%, against main. Other hardware remains untested.

Other systems: The controller affects Auto DRS across upscalers, frame-generation modes and supported platforms. The reported live runs cover Windows with Radeon 860M and FSR 3.1; NVIDIA RTX, discrete AMD and Steam Deck coverage remains outstanding.

Switches: No switches added, changed or removed. The existing RX_VK_DRS switch defaults to enabled and can disable Auto DRS.

Reviewed: 9b3ef63aa9 against 08a57248f6: Reviewed the PR diff and the changed controller and test logic; the full test file and repository rules output were truncated, so their complete contents were not verified.; nothing run (a code review).

Checked and fine:

  • The decay fix preserves the projected step-down and bounce damping policy.
  • The added recovery test checks both the cleared state and a subsequent step-up.

Testing: No commands that build or run tests were executed. The author reports 510 controller checks passing on the fixed head; CI is still running.

Overlaps and merge order: The description identifies merged PR #3096 as complementary.


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

**Recommendation: Approve.** The code is ready: only testing is left. The bounce margin now clears when its backoff decays, and the reported Radeon 860M measurements show faster overload convergence. The requested NVIDIA, discrete AMD and Steam Deck live runs are still outstanding. Recommend approval; not approved on the forge. Auto DRS can jump down several resolution stops under sustained severe GPU load and damp repeated bouncing, with the bounce margin now expiring after calm play. The policy adds state and relies on an estimated GPU cost model. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `gpu/vk/drs.h:297`: The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Linux, including DLSS and Auto frame generation. *When:* A severe transition can now skip multiple DLSS stops, and the fixed 35%/65% projection can choose a lower resolution than necessary; the supplied live results cover only a Radeon 860M with FSR 3.1. **Do:** Run representative heavy-to-light transitions on Tier 1 NVIDIA hardware on both operating systems, recording resolution transitions, frame pacing and recovery against the base. - **L3** `gpu/vk/drs.h:297`: The changed policy also needs the stated discrete AMD and Steam Deck runs. *When:* Auto DRS can skip multiple stops on RX 6000–9000 GPUs and Steam Deck, including at the Deck's 30 and 45 FPS caps; the reported iGPU run does not cover those drivers or workloads. **Do:** Run severe transitions and recovery on Tier 1 AMD Windows and Linux RADV systems and Steam Deck, recording resolution, frame pacing and recovery against the base. **Since the last review** (on ddb2cd0131c4) Resolved: L1 (Decay reduces bounce_level but never clears bounce_stop_id, so the extra headroom requirem…) Still open: L2 (The new projected jump and recovery policy needs a live NVIDIA RTX check on Windows and Li…); L3 (The changed policy also needs the stated discrete AMD and Steam Deck runs.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes on the tested Radeon 860M: the PR reports four interleaved warm runs per scene, with Market median FPS up 9.7% and 1% low up 5.3%, and Hyrule Field 1% low up 13.6%, against main. Other hardware remains untested. **Other systems:** The controller affects Auto DRS across upscalers, frame-generation modes and supported platforms. The reported live runs cover Windows with Radeon 860M and FSR 3.1; NVIDIA RTX, discrete AMD and Steam Deck coverage remains outstanding. **Switches:** No switches added, changed or removed. The existing RX_VK_DRS switch defaults to enabled and can disable Auto DRS. **Reviewed:** 9b3ef63aa9f3 against 08a57248f6bb: Reviewed the PR diff and the changed controller and test logic; the full test file and repository rules output were truncated, so their complete contents were not verified.; nothing run (a code review). **Checked and fine:** - The decay fix preserves the projected step-down and bounce damping policy. - The added recovery test checks both the cleared state and a subsequent step-up. **Testing:** No commands that build or run tests were executed. The author reports 510 controller checks passing on the fixed head; CI is still running. **Overlaps and merge order:** The description identifies merged PR #3096 as complementary. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by Jer9. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/vk-drs-responsiveness 2026-12-04 06:51:03 +00:00
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 5s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!3095
No description provided.