PC optimization: add DLSS, low-VRAM/RAM scaling, borderless/tearing s… #481

Closed
github-bot wants to merge 7 commits from github-bot/gh-481 into a-publier AGit
Owner

@⁠akshai000777 on GitHub · 2026-11-27 05:59 UTC · original
akshai000777:arena/f425375b-victory-belobug-nvak → a-publier · +3063 −285 · 28 files · 7 commits · closed without merging

…wap chain, and launcher presets

**@⁠akshai000777** on GitHub · 2026-11-27 05:59 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/481) `akshai000777:arena/f425375b-victory-belobug-nvak` → `a-publier` · +3063 −285 · 28 files · 7 commits · closed without merging …wap chain, and launcher presets
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:03:34 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 07:01 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at e240064. victory-hle 164 passed, victory-loader 56 passed, victory-core 13 passed, but victory-gpu has one deterministic failure that a-publier 4eb6cfd does not have:

indirect::tests::host_list_budget_starts_empty_at_each_submission ... FAILED
assertion `left == right` failed: round 0: the spent budget empties the record after it
  left: 1
 right: 0

It fails 10 of 10 runs alone on this PR, and 0 of 10 on the base. The cause is the change to rest() in indirect.rs: the default goes from on (map_or(true, |v| v != "0")) to off (is_ok_and(|v| v == "1")). So a record that does not fit in what is left of its list's budget no longer takes the rest, and the small record after the spent ones runs. With VICTORY_INDIRECT_REST=1 set, the test passes again.

That is a change of default behaviour in the indirect clamp, and nothing in the description mentions it. If it is intended, the description should say so and the test should be updated. If not, keeping the old default fixes the test.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 07:01 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/481#issuecomment-7212067306) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `e240064`. `victory-hle` 164 passed, `victory-loader` 56 passed, `victory-core` 13 passed, but `victory-gpu` has one **deterministic** failure that `a-publier` `4eb6cfd` does not have: ``` indirect::tests::host_list_budget_starts_empty_at_each_submission ... FAILED assertion `left == right` failed: round 0: the spent budget empties the record after it left: 1 right: 0 ``` It fails 10 of 10 runs alone on this PR, and 0 of 10 on the base. The cause is the change to `rest()` in `indirect.rs`: the default goes from on (`map_or(true, |v| v != "0")`) to off (`is_ok_and(|v| v == "1")`). So a record that does not fit in what is left of its list's budget no longer takes the rest, and the small record after the spent ones runs. With `VICTORY_INDIRECT_REST=1` set, the test passes again. That is a change of default behaviour in the indirect clamp, and nothing in the description mentions it. If it is intended, the description should say so and the test should be updated. If not, keeping the old default fixes the test. AI-assisted (Claude Code); no game data.
github-bot closed this pull request 2026-11-27 07:19:55 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 10:06 UTC · original

A wider review of the current head b75eaf0, by reading the diff. The rest() flip from my comment above is not repeated here. I checked items 1, 2, 4 (spin), 5 (BUFFERS) and 7 against the base myself; the rest is from reading, with file:line so they can be checked.

Defaults that change for users who opt into nothing

  1. residency.rs:20: residency budgets go from opt-in (== "1" on a-publier) to on by default (is_none_or(|v| v != "0")). Since limited_host_ram() only checks on() and total RAM ≤ 32 GiB, every 16 and 32 GB PC runs the low-spec path without asking. That means the texture budget capped at 128 MiB (draw.rs:2281), fewer spare and idle lists, 4 to 6 pipeline workers (pipeline/make.rs:660), and prefetch capped at 32 MiB (texture/ahead.rs:108). The README and play.ps1 -LowSpec present this as opt-in, and the module doc still says "Only with VICTORY_RESIDENCY=1".
  2. tiles.rs:76 + resource.rs:1251: levels-on-demand turns on for every tiled-resources tier 2+ card. The guard that kept it apart from held levels (held_only() = … && !tiles::wanted(), base 8d79927) is removed, so both run together for the first time on most cards. docs/README-fxceless.md calls levels-on-demand "off by default" and says it "has not run on a card yet".
  3. resource.rs:1858, pool.rs:42-52: the "low-VRAM" scaling also reaches 16 GB cards. Their WDDM budget is below 16 GiB, so targets_room_kept drops from 3072 to 2048 MiB, and spare_cap_for_vram caps texture-pool spares at 24 instead of 64, even with residency off. A check of spare_cap_for_vram(Some(15.2 GiB)) == SPARE_KEPT fails with left: 24, right: 64.
  4. frame.rs:160: the frame pacing spin is on by default (VICTORY_PACE_SPIN unset means spin). Every frame-tick wait busy-spins its last ~1.5 ms. play.ps1 sets it only for -LosslessScaling.
  5. host.rs:9248: BUFFERS goes from 2 to 3 for every swap chain. That is one more back buffer and a frame more of queueing for everyone, unrelated to tearing.
  6. list.rs:243-258: the idle host-list pool shrinks from 512 lists / 256 MiB to 32, 64 or 192 lists by RAM. The comment it replaces says 128 "were too few" (12 % of the submitting thread).
  7. xmem.rs:1933-1942: XMemGetWorkingSetStatistics subtracts host_overhead_bytes(). That includes shadow::live_span_bytes(), which counts card-side copies in video memory, not process commit, plus 2 MiB per live list. So the title can be told far less memory is used than really is (floor raw/8). It is always on, and the title's memory decisions use this number.

Opt-in paths
8. dlss.rs:356, :374: enableSharpening and reset are C bools in the FFX upscale dispatch description, but they are read as whole u32s (settings[0] != 0, settings[4] != 0), so padding bytes count. Garbage there would reset DLSS history every frame or turn sharpening on. Comparing only the low byte avoids it.
9. dlss.rs:479-575: after a successful NGX init, any later failure (a missing symbol, GetCapabilityParameters, SuperSampling.Available == 0, e.g. a GTX 16xx card) drops the library (FreeLibrary) with no NVSDK_NGX_D3D12_Shutdown1. The run then goes on with FSR on the same device.
10. indirect.rs:343-473, the NVIDIA wide-indirect probe:
- early returns after ExecuteCommandLists (Signal, CreateEventW, the wait) drop objects the GPU may still be using;
- it dispatches 65,536 groups, one past D3D12's 65,535 per-dimension limit, on the real device;
- VICTORY_INDIRECT_WIDE=1 now also forces wide mode on Intel and WARP.

Tests on an RX 6950 XT at b75eaf0: victory-gpu, victory-hle and victory-loader lib suites, 395 passed and 1 failed. The failure is the known host_list_budget_starts_empty_at_each_submission. Items 1 to 7 would read better as separate opt-in switches, or as a PR of their own with measurements, rather than inside a DLSS/borderless PR.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 10:06 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/481#issuecomment-7215481378) A wider review of the current head `b75eaf0`, by reading the diff. The `rest()` flip from my comment above is not repeated here. I checked items 1, 2, 4 (spin), 5 (`BUFFERS`) and 7 against the base myself; the rest is from reading, with file:line so they can be checked. **Defaults that change for users who opt into nothing** 1. **`residency.rs:20`: residency budgets go from opt-in (`== "1"` on `a-publier`) to on by default (`is_none_or(|v| v != "0")`).** Since `limited_host_ram()` only checks `on()` and total RAM ≤ 32 GiB, every 16 and 32 GB PC runs the low-spec path without asking. That means the texture budget capped at 128 MiB (`draw.rs:2281`), fewer spare and idle lists, 4 to 6 pipeline workers (`pipeline/make.rs:660`), and prefetch capped at 32 MiB (`texture/ahead.rs:108`). The README and `play.ps1 -LowSpec` present this as opt-in, and the module doc still says "Only with `VICTORY_RESIDENCY=1`". 2. **`tiles.rs:76` + `resource.rs:1251`: levels-on-demand turns on for every tiled-resources tier 2+ card.** The guard that kept it apart from held levels (`held_only() = … && !tiles::wanted()`, base 8d79927) is removed, so both run together for the first time on most cards. `docs/README-fxceless.md` calls levels-on-demand "off by default" and says it "has not run on a card yet". 3. **`resource.rs:1858`, `pool.rs:42-52`: the "low-VRAM" scaling also reaches 16 GB cards.** Their WDDM budget is below 16 GiB, so `targets_room_kept` drops from 3072 to 2048 MiB, and `spare_cap_for_vram` caps texture-pool spares at 24 instead of 64, even with residency off. A check of `spare_cap_for_vram(Some(15.2 GiB)) == SPARE_KEPT` fails with `left: 24, right: 64`. 4. **`frame.rs:160`: the frame pacing spin is on by default** (`VICTORY_PACE_SPIN` unset means spin). Every frame-tick wait busy-spins its last ~1.5 ms. `play.ps1` sets it only for `-LosslessScaling`. 5. **`host.rs:9248`: `BUFFERS` goes from 2 to 3 for every swap chain.** That is one more back buffer and a frame more of queueing for everyone, unrelated to tearing. 6. **`list.rs:243-258`: the idle host-list pool shrinks** from 512 lists / 256 MiB to 32, 64 or 192 lists by RAM. The comment it replaces says 128 "were too few" (12 % of the submitting thread). 7. **`xmem.rs:1933-1942`: `XMemGetWorkingSetStatistics` subtracts `host_overhead_bytes()`.** That includes `shadow::live_span_bytes()`, which counts card-side copies in video memory, not process commit, plus 2 MiB per live list. So the title can be told far less memory is used than really is (floor `raw/8`). It is always on, and the title's memory decisions use this number. **Opt-in paths** 8. **`dlss.rs:356`, `:374`: `enableSharpening` and `reset` are C `bool`s in the FFX upscale dispatch description, but they are read as whole `u32`s** (`settings[0] != 0`, `settings[4] != 0`), so padding bytes count. Garbage there would reset DLSS history every frame or turn sharpening on. Comparing only the low byte avoids it. 9. **`dlss.rs:479-575`:** after a successful NGX init, any later failure (a missing symbol, `GetCapabilityParameters`, `SuperSampling.Available == 0`, e.g. a GTX 16xx card) drops the library (`FreeLibrary`) with no `NVSDK_NGX_D3D12_Shutdown1`. The run then goes on with FSR on the same device. 10. **`indirect.rs:343-473`, the NVIDIA wide-indirect probe:** - early returns after `ExecuteCommandLists` (Signal, CreateEventW, the wait) drop objects the GPU may still be using; - it dispatches 65,536 groups, one past D3D12's 65,535 per-dimension limit, on the real device; - `VICTORY_INDIRECT_WIDE=1` now also forces wide mode on Intel and WARP. Tests on an RX 6950 XT at `b75eaf0`: `victory-gpu`, `victory-hle` and `victory-loader` lib suites, 395 passed and 1 failed. The failure is the known `host_list_budget_starts_empty_at_each_submission`. Items 1 to 7 would read better as separate opt-in switches, or as a PR of their own with measurements, rather than inside a DLSS/borderless PR. AI-assisted (Claude Code); no game data.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.