Streamline: break optimal-size ties by render ratio instead of DLAA (#4779) #4787

Open
github-bot wants to merge 1 commit from github-bot/gh-4786 into main AGit
Owner

@⁠dheerajc8073 on GitHub · 2026-12-01 08:15 UTC · original
dheerajc8073:fix/dlss-pick-mode-tiebreak → main · +50 −3 · 1 files · 1 commits · open

Fixes #4780

What it changes

In crates/victory-gpu/src/streamline/plan.rs, pick_mode broke optimal-area ties using Iterator::min_by_key over MODES, which puts DLSS_DLAA first. When slDLSSGetOptimalSettings returns the same optimal render size across modes (for instance [1707, 960] for every mode on RTX 5080 / driver 621.24 in the #4780 logs), pick_mode always chose DLSS_DLAA even when the scene was rendered at Performance ([1280, 720] -> [2560, 1440]), misreporting mode=DLAA in logs / F3 and resolving auto preset to k instead of m.

  • Adds tie-breaking (tie_rank / sl_mode_scale) in plan::pick_mode: smallest optimal area fitting render still wins; ties prefer Mode::of_size(render, output), then the smallest nominal DLSS scale covering the actual render / output ratio (falling back to MODES order only if everything else ties).
  • Updates one_size_for_every_mode_is_told_with_its_mode so a [640, 360] render into [1920, 1080] expects DLSS_ULTRA_PERFORMANCE rather than DLAA, and adds uniform_optimal_sizes_pick_mode_for_render_ratio_instead_of_dlaa covering uniform [1707, 960] answers at [2560, 1440] for all modes, intermediate sub-native ratios ([1600, 900]), and native [2560, 1440] (DLAA).

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): not run in-game
  • Before: pick_mode([1280, 720], [2560, 1440], |_| Some([1707, 960])) returned DLSS_DLAA (verified against the attached #4780 play log slDLSSGetOptimalSettings sizes).
  • After: cargo test --locked -p victory-gpu streamline (55 passed, 0 failed), cargo test --locked -p victory-gpu --features diagnostics --test replay --test replay_big (replay: 1 passed; replay_big: 1 ignored), and cargo xtask policy --staged (ok). Note: full cargo test --locked -p victory-gpu had 1168 passed / 1 pre-existing failure in compose::tests::bgrx_plane_selects_a_typed_view, and cargo clippy --locked -p victory-gpu --all-targets -- -D warnings showed 0 errors in streamline/plan.rs and only the 5 pre-existing main errors in host/{font,menu,panel}.rs (#4708).
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a
  • cargo test passed for the crates it touches: yes (victory-gpu streamline suite: 55/55; replay test: 1/1)

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3632 (launcher override logging only), #4708 (main Clippy fixes)
**@⁠dheerajc8073** on GitHub · 2026-12-01 08:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4786) `dheerajc8073:fix/dlss-pick-mode-tiebreak` → `main` · +50 −3 · 1 files · 1 commits · open Fixes #4780 ## What it changes In `crates/victory-gpu/src/streamline/plan.rs`, `pick_mode` broke optimal-area ties using `Iterator::min_by_key` over `MODES`, which puts `DLSS_DLAA` first. When `slDLSSGetOptimalSettings` returns the same optimal render size across modes (for instance `[1707, 960]` for every mode on RTX 5080 / driver 621.24 in the #4780 logs), `pick_mode` always chose `DLSS_DLAA` even when the scene was rendered at `Performance` (`[1280, 720]` -> `[2560, 1440]`), misreporting `mode=DLAA` in logs / F3 and resolving `auto` preset to `k` instead of `m`. - Adds tie-breaking (`tie_rank` / `sl_mode_scale`) in `plan::pick_mode`: smallest optimal area fitting `render` still wins; ties prefer `Mode::of_size(render, output)`, then the smallest nominal DLSS scale covering the actual `render / output` ratio (falling back to `MODES` order only if everything else ties). - Updates `one_size_for_every_mode_is_told_with_its_mode` so a `[640, 360]` render into `[1920, 1080]` expects `DLSS_ULTRA_PERFORMANCE` rather than `DLAA`, and adds `uniform_optimal_sizes_pick_mode_for_render_ratio_instead_of_dlaa` covering uniform `[1707, 960]` answers at `[2560, 1440]` for all modes, intermediate sub-native ratios (`[1600, 900]`), and native `[2560, 1440]` (`DLAA`). ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): not run in-game - Before: `pick_mode([1280, 720], [2560, 1440], |_| Some([1707, 960]))` returned `DLSS_DLAA` (verified against the attached #4780 play log `slDLSSGetOptimalSettings` sizes). - After: `cargo test --locked -p victory-gpu streamline` (55 passed, 0 failed), `cargo test --locked -p victory-gpu --features diagnostics --test replay --test replay_big` (`replay`: 1 passed; `replay_big`: 1 ignored), and `cargo xtask policy --staged` (ok). Note: full `cargo test --locked -p victory-gpu` had 1168 passed / 1 pre-existing failure in `compose::tests::bgrx_plane_selects_a_typed_view`, and `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` showed 0 errors in `streamline/plan.rs` and only the 5 pre-existing `main` errors in `host/{font,menu,panel}.rs` (#4708). - For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a - `cargo test` passed for the crates it touches: yes (`victory-gpu` `streamline` suite: 55/55; `replay` test: 1/1) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3632 (launcher override logging only), #4708 (`main` Clippy fixes)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 08:21:28 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 08:28 UTC · original

I extracted the six Streamline query results from the public #4780 log. At 2560×1440, all six modes returned optimal 1707×960 and an input range of 1280×720 through 2560×1440. The actual Performance evaluation recorded DLAA with preset k.

I replayed the exact pick_mode implementations from main 5fabb46 and this head 86f9863 with those answers. Main selected DLAA for both 1280×720 and 1706×960. This PR selected Performance and Quality respectively. Both inputs are within the reported range.

The Ultra Performance case selects Ultra Performance with this PR, but its 853×480 input is below the minimum returned by all six queries on this run. The chooser test establishes the selected mode there. DLSS evaluation and image quality below the reported minimum still need a device run. NVIDIA Streamline guide

@⁠ums121, could you retry Performance on the same RTX 5080 with 86f9863 and share the new upscaling recorded line and the failed-evaluation count? If you also retry Ultra Performance, please include the minimum sizes Streamline reports for that run.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 08:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4786#issuecomment-7305360528) I extracted the six Streamline query results from the public #4780 log. At 2560×1440, all six modes returned optimal 1707×960 and an input range of 1280×720 through 2560×1440. The actual Performance evaluation recorded DLAA with preset `k`. I replayed the exact `pick_mode` implementations from main `5fabb46` and this head `86f9863` with those answers. Main selected DLAA for both 1280×720 and 1706×960. This PR selected Performance and Quality respectively. Both inputs are within the reported range. The Ultra Performance case selects Ultra Performance with this PR, but its 853×480 input is below the minimum returned by all six queries on this run. The chooser test establishes the selected mode there. DLSS evaluation and image quality below the reported minimum still need a device run. [NVIDIA Streamline guide](https://github.com/NVIDIA-RTX/Streamline/blob/main/docs/ProgrammingGuideDLSS.md#30-check-dlss-settings-and-setup-viewport-rendering-size) @⁠ums121, could you retry Performance on the same RTX 5080 with `86f9863` and share the new `upscaling recorded` line and the failed-evaluation count? If you also retry Ultra Performance, please include the minimum sizes Streamline reports for that run.
Author
Owner

@⁠ums121 on GitHub · 2026-12-01 15:30 UTC · original

Correcting my own numbers first, then the results on 86f9863.
The line in the issue body came from a run before the fix, and I mixed the wrong
preset into it. This is the same line, unedited, from the old binary:
render=[1280, 720] output=[2560, 1440] mode="DLAA" asked="performance"
preset="k" optimal=Some([1707, 960]) ... evaluations=1
So optimal there is 1707x960, not 1280x720. Sorry for the noise.
Before the fix every asked mode came back as DLAA. All three of these are from my
own logs of the old binary, in game:
asked="quality" render=[1706, 960] mode="DLAA" (4 runs)
asked="performance" render=[1280, 720] mode="DLAA" (1 run)
asked="ultraperformance" render=[853, 480] mode="DLAA" (1 run)
The render sizes are right in all three, because the title sets them through the
FidelityFX path. Only the mode name was wrong, and it was wrong the same way no
matter what was asked, which is what pointed at the tie.
Built 86f9863 (GNU toolchain, mingw dlltool) and ran the same title on it. Same
output size, same picture setting, same upscaler asked for; only the binary
differs:
render=[1280, 720] output=[2560, 1440] mode="performance" asked="performance"
preset="m" optimal=Some([1707, 960]) ... evaluations=1
mode now equals asked, and that is the only record line written in an 18.5
minute session, so the mode is picked once and not re-evaluated per frame.
Samples taken from that same run:
DLSS per frame: 1.00 upscalings by DLSS, 0.00 failed, 0.00 left to the title's
FidelityFX (183 by DLSS so far)
DLSS Frame Generation: 27 presents with it on, 0 off, 108 frames shown by it
(status 0x0)
26.4 fps, 37.8 ms/frame VRAM 12976 / 14520 MB
failed is 0.00 in every sample of the run.
Direct A/B with the probe in this build, --validate, at 2560x1440:
Validated SR: mode=performance render=[1707, 960] output=[2560, 1440] iterations=12
Validated SR: mode=ultraperformance render=[1707, 960] output=[2560, 1440] iterations=12
Readback PASS: 3686400 finite RGB pixels; blake3=fb4b49f4...; tolerance=0.02
Streamline shut down: ok (0)
12 iterations each, readback PASS, output bit-identical to the reference. Both
asked modes report what was asked, and no upscale is refused.
What the commit does not change: optimal is still [1707, 960] for every asked
mode, as both probe lines show. So a caller that takes its size from optimal -
the probe, or a title that lets the layer pick - still renders Ultra Performance
at the quality ratio. In game this does not show, because the title asks for its
own size. The tie in the sizes is therefore still there; the commit decides which
name to report when the sizes are equal, which is exactly what was broken.
Environment: RTX 5080 16 GB, driver 621.24.0, Windows 11 26300.9711, Streamline
2.14.16, NGX 310.9.16, retail game_scarlett_master.exe v1.0.2.1 unmodified. The
full log of the run is attached.
I compiled this build once to answer your question and I am not set up to iterate
on source, but I can run other probes on this binary if it helps.
victory-log-86f9863-20261201.zip
help of Doubao

**@⁠ums121** on GitHub · 2026-12-01 15:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4786#issuecomment-7316019665) Correcting my own numbers first, then the results on 86f9863. The line in the issue body came from a run before the fix, and I mixed the wrong preset into it. This is the same line, unedited, from the old binary: render=[1280, 720] output=[2560, 1440] mode="DLAA" asked="performance" preset="k" optimal=Some([1707, 960]) ... evaluations=1 So optimal there is 1707x960, not 1280x720. Sorry for the noise. Before the fix every asked mode came back as DLAA. All three of these are from my own logs of the old binary, in game: asked="quality" render=[1706, 960] mode="DLAA" (4 runs) asked="performance" render=[1280, 720] mode="DLAA" (1 run) asked="ultraperformance" render=[853, 480] mode="DLAA" (1 run) The render sizes are right in all three, because the title sets them through the FidelityFX path. Only the mode name was wrong, and it was wrong the same way no matter what was asked, which is what pointed at the tie. Built 86f9863 (GNU toolchain, mingw dlltool) and ran the same title on it. Same output size, same picture setting, same upscaler asked for; only the binary differs: render=[1280, 720] output=[2560, 1440] mode="performance" asked="performance" preset="m" optimal=Some([1707, 960]) ... evaluations=1 mode now equals asked, and that is the only record line written in an 18.5 minute session, so the mode is picked once and not re-evaluated per frame. Samples taken from that same run: DLSS per frame: 1.00 upscalings by DLSS, 0.00 failed, 0.00 left to the title's FidelityFX (183 by DLSS so far) DLSS Frame Generation: 27 presents with it on, 0 off, 108 frames shown by it (status 0x0) 26.4 fps, 37.8 ms/frame VRAM 12976 / 14520 MB failed is 0.00 in every sample of the run. Direct A/B with the probe in this build, --validate, at 2560x1440: Validated SR: mode=performance render=[1707, 960] output=[2560, 1440] iterations=12 Validated SR: mode=ultraperformance render=[1707, 960] output=[2560, 1440] iterations=12 Readback PASS: 3686400 finite RGB pixels; blake3=fb4b49f4...; tolerance=0.02 Streamline shut down: ok (0) 12 iterations each, readback PASS, output bit-identical to the reference. Both asked modes report what was asked, and no upscale is refused. What the commit does not change: optimal is still [1707, 960] for every asked mode, as both probe lines show. So a caller that takes its size from optimal - the probe, or a title that lets the layer pick - still renders Ultra Performance at the quality ratio. In game this does not show, because the title asks for its own size. The tie in the sizes is therefore still there; the commit decides which name to report when the sizes are equal, which is exactly what was broken. Environment: RTX 5080 16 GB, driver 621.24.0, Windows 11 26300.9711, Streamline 2.14.16, NGX 310.9.16, retail game_scarlett_master.exe v1.0.2.1 unmodified. The full log of the run is attached. I compiled this build once to answer your question and I am not set up to iterate on source, but I can run other probes on this binary if it helps. [victory-log-86f9863-20261201.zip](https://github.com/user-attachments/files/35690228/victory-log-86f9863-20261201.zip) help of Doubao
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4787/head:github-bot/gh-4786'
git switch 'github-bot/gh-4786'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4786'
git switch 'github-bot/gh-4786'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4786'
git switch 'github-bot/gh-4786'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4786'
git switch 'main'
git merge --squash 'github-bot/gh-4786'
git switch 'main'
git merge --ff-only 'github-bot/gh-4786'
git switch 'main'
git merge 'github-bot/gh-4786'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
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
github/trustno1-coder--VIctory-NVIDIA!4787
No description provided.