victory-gpu: Lazy host list reset allocator retirement and bounded/t… #335

Closed
github-bot wants to merge 1 commit from github-bot/gh-335 into a-publier AGit
Owner

@⁠g-a-l-a-x-i-a on GitHub · 2026-11-26 20:36 UTC · original
g-a-l-a-x-i-a:fix/memory-usage → a-publier · +135 −42 · 7 files · 1 commits · closed without merging

…rimmed pools

**@⁠g-a-l-a-x-i-a** on GitHub · 2026-11-26 20:36 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/335) `g-a-l-a-x-i-a:fix/memory-usage` → `a-publier` · +135 −42 · 7 files · 1 commits · closed without merging …rimmed pools
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:38:39 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 22:31 UTC · original

Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at 2559ee6: cargo test --release -p victory-gpu --lib 387 passed, 1 failed, 34 ignored. The one failure, descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in, fails the same way on cd8dfc0 on this card (#288 fixes it). Not run in the game. Since #306 reports device losses on RDNA 2 tied to the list pool, this change may matter there, but I have no game run of it.

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

**@⁠MamaLeVrai** on GitHub · 2026-11-26 22:31 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/335#issuecomment-7204760667) Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `2559ee6`: `cargo test --release -p victory-gpu --lib` 387 passed, 1 failed, 34 ignored. The one failure, `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in`, fails the same way on `cd8dfc0` on this card (#288 fixes it). Not run in the game. Since #306 reports device losses on RDNA 2 tied to the list pool, this change may matter there, but I have no game run of it. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠gw1337x on GitHub · 2026-11-26 23:09 UTC · original · edited 2026-11-27 04:32 UTC

Tested in the title on an RX 7800 XT 16 GB (RDNA 3, driver 32.0.32015.7029), Ryzen 7 9800X3D, 32 GB RAM, 48 GB page file, Windows 11 26200 (Memory Integrity off). Diagnostics build (--profile diag --features diagnostics) of 2559ee6 against its base cd8dfc0, same boot.

Settings: scripts/play.ps1 settings at cd8dfc0 plus VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1, Series X profile, ray tracing off. Method: 270 s hands-off from a Chapter I boat save with scripted presses; fps from the 5 s host lines with 1000+ draws (45-265 s), "steady" is 205 s on; VICTORY_TIMELINE windows of 30 frames at 200 s and 240 s.

cd8dfc0 2559ee6 run 1 2559ee6 run 2
median fps 26.1 11.9 11.9
steady fps 28.7 13.6 12.2
5 s samples under 15 fps 5 / 42 36 / 37 38 / 40
peak commit 33.0 GB 30.5 GB 31.6 GB
lowest free RAM 0.62 GB 2.04 GB 2.63 GB
host lists made (last line) 2,875 116,159 141,931

Timeline, per frame (200 s and 240 s windows):

cd8dfc0 2559ee6
frame 33.4-33.8 ms 74.0-82.8 ms
card idle between submissions 2.1-2.3 ms 38.3-46.4 ms
landed lists reset and given back on victory-submit 1.5-1.6 ms (longest 4.5) 31-44 ms (longest 87-128)
helper: landed lists reset and given back 12.8-13.9 ms 51-55 ms

The 40-49 ms a frame added is card idle time between submissions; in the same windows the submit thread spends 31-44 ms a frame in landed lists reset and given back (1.5 ms on the base). Host lists made rise from about 2.9 thousand to 116-142 thousand in a run. VICTORY_RESIDENCY was not set, so limited_host_ram() was false here (idle list cap 256; the pool limit unchanged). Peak commit is 1.4-2.5 GB lower. The baseline's own commit varies by about 1.5 GB between runs, so that drop is at the edge of what this test can show.

Caveats: one baseline run in this boot, two runs of the PR; picture not compared.

**@⁠gw1337x** on GitHub · 2026-11-26 23:09 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/335#issuecomment-7205298123) · edited 2026-11-27 04:32 UTC Tested in the title on an RX 7800 XT 16 GB (RDNA 3, driver 32.0.32015.7029), Ryzen 7 9800X3D, 32 GB RAM, 48 GB page file, Windows 11 26200 (Memory Integrity off). Diagnostics build (`--profile diag --features diagnostics`) of `2559ee6` against its base `cd8dfc0`, same boot. Settings: `scripts/play.ps1` settings at `cd8dfc0` plus `VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1`, Series X profile, ray tracing off. Method: 270 s hands-off from a Chapter I boat save with scripted presses; fps from the 5 s host lines with 1000+ draws (45-265 s), "steady" is 205 s on; `VICTORY_TIMELINE` windows of 30 frames at 200 s and 240 s. | | `cd8dfc0` | `2559ee6` run 1 | `2559ee6` run 2 | |---|---|---|---| | median fps | 26.1 | 11.9 | 11.9 | | steady fps | 28.7 | 13.6 | 12.2 | | 5 s samples under 15 fps | 5 / 42 | 36 / 37 | 38 / 40 | | peak commit | 33.0 GB | 30.5 GB | 31.6 GB | | lowest free RAM | 0.62 GB | 2.04 GB | 2.63 GB | | host lists made (last line) | 2,875 | 116,159 | 141,931 | Timeline, per frame (200 s and 240 s windows): | | `cd8dfc0` | `2559ee6` | |---|---|---| | frame | 33.4-33.8 ms | 74.0-82.8 ms | | card idle between submissions | 2.1-2.3 ms | 38.3-46.4 ms | | `landed lists reset and given back` on `victory-submit` | 1.5-1.6 ms (longest 4.5) | 31-44 ms (longest 87-128) | | `helper: landed lists reset and given back` | 12.8-13.9 ms | 51-55 ms | The 40-49 ms a frame added is card idle time between submissions; in the same windows the submit thread spends 31-44 ms a frame in `landed lists reset and given back` (1.5 ms on the base). Host lists made rise from about 2.9 thousand to 116-142 thousand in a run. `VICTORY_RESIDENCY` was not set, so `limited_host_ram()` was false here (idle list cap 256; the pool limit unchanged). Peak commit is 1.4-2.5 GB lower. The baseline's own commit varies by about 1.5 GB between runs, so that drop is at the edge of what this test can show. Caveats: one baseline run in this boot, two runs of the PR; picture not compared.
Author
Owner

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

Tested on an RX 7900 XT 20 GB (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, Rust 1.98.1. 2559ee6 merged onto a-publier 4eb6cfd (merges cleanly) vs plain 4eb6cfd. victory-gpu lib tests, --test-threads=1, in a diag build (--profile diag --features diagnostics) and a dev (debug) build.

Pass / fail / ignored, base vs PR:

  • diag, hardware: 444 / 1 / 34 vs 445 / 1 / 34

  • diag, VICTORY_D3D12_WARP=1: 444 / 1 / 34 vs 445 / 1 / 34

  • dev, hardware: 396 / 0 / 34 vs 397 / 0 / 34

  • diag, VICTORY_THIN=1, hardware, list:: queue:: thin:: texture:: pool:: send::: 29 / 0 / 3 vs 30 / 0 / 3

  • diag, VICTORY_LIST_POOL=1 VICTORY_THIN=1, WARP, list:: queue:: thin::: 15 / 0 / 0 in both

  • In the first four sets the only difference is the new pool::tests::staging_pool_reuses_piece_after_staging_rest (ok). The last set has no difference.

  • The one diag failure is the same on both sides and comes from my setup, not the PR. It is timeline::report::tests::real_waits_are_recorded_with_who_ended_them, which needs symbols, and the test exe was copied away from its .pdb.

  • No test in the suite covers should_retire, the IDLE/BACKS/card-step caps or the trims. So this only shows that nothing else broke.

About the in-game run above: limited_host_ram() is only true with VICTORY_RESIDENCY=1. It is on() && (... || total RAM <= 32 GiB) (residency.rs:116-121), and on() reads VICTORY_RESIDENCY, which is off by default. scripts/play.ps1 does not set it, and it clears inherited VICTORY_* values that are not passed with -More. So with the settings listed there, the 128 idle / pool 4 / 192 MiB / 128 MiB limits most likely were not in force. These were:

  • idle host lists capped at 256 (base 512)
  • a host list not reused after 256 resets
  • BACKS capped at 64 (play.ps1 sets VICTORY_THIN=1)
  • card-step pool capped at 16
  • send spare memory kept at 512 MiB (base 768)
  • staging pieces reused after 250 ms (base 2500 ms)
  • no host list taken at detach, one taken in reset() instead

So the host-list churn (2.9k to 116-142k made) comes from the parts of the PR that apply on every machine, not from the 32 GB path. The sweep() trims (trim_idle(32), trim_backs(16), ...) run only while residency::pressured() is set. That is never set without VICTORY_RESIDENCY=1, because refresh() returns early (residency.rs:133-136). So the trims did not run in that run either.

Not tested: in-game, VICTORY_RESIDENCY=1.

**@⁠adrianmjim** on GitHub · 2026-11-27 06:27 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/335#issuecomment-7211542152) Tested on an RX 7900 XT 20 GB (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, Rust 1.98.1. `2559ee6` merged onto `a-publier` `4eb6cfd` (merges cleanly) vs plain `4eb6cfd`. victory-gpu lib tests, `--test-threads=1`, in a diag build (`--profile diag --features diagnostics`) and a dev (debug) build. Pass / fail / ignored, base vs PR: - diag, hardware: 444 / 1 / 34 vs 445 / 1 / 34 - diag, `VICTORY_D3D12_WARP=1`: 444 / 1 / 34 vs 445 / 1 / 34 - dev, hardware: 396 / 0 / 34 vs 397 / 0 / 34 - diag, `VICTORY_THIN=1`, hardware, `list:: queue:: thin:: texture:: pool:: send::`: 29 / 0 / 3 vs 30 / 0 / 3 - diag, `VICTORY_LIST_POOL=1 VICTORY_THIN=1`, WARP, `list:: queue:: thin::`: 15 / 0 / 0 in both - In the first four sets the only difference is the new `pool::tests::staging_pool_reuses_piece_after_staging_rest` (ok). The last set has no difference. - The one diag failure is the same on both sides and comes from my setup, not the PR. It is `timeline::report::tests::real_waits_are_recorded_with_who_ended_them`, which needs symbols, and the test exe was copied away from its .pdb. - No test in the suite covers `should_retire`, the IDLE/BACKS/card-step caps or the trims. So this only shows that nothing else broke. About the in-game run above: `limited_host_ram()` is only true with `VICTORY_RESIDENCY=1`. It is `on() && (... || total RAM <= 32 GiB)` (residency.rs:116-121), and `on()` reads `VICTORY_RESIDENCY`, which is off by default. `scripts/play.ps1` does not set it, and it clears inherited `VICTORY_*` values that are not passed with `-More`. So with the settings listed there, the 128 idle / pool 4 / 192 MiB / 128 MiB limits most likely were not in force. These were: - idle host lists capped at 256 (base 512) - a host list not reused after 256 resets - `BACKS` capped at 64 (`play.ps1` sets `VICTORY_THIN=1`) - card-step pool capped at 16 - send spare memory kept at 512 MiB (base 768) - staging pieces reused after 250 ms (base 2500 ms) - no host list taken at detach, one taken in `reset()` instead So the host-list churn (2.9k to 116-142k made) comes from the parts of the PR that apply on every machine, not from the 32 GB path. The `sweep()` trims (`trim_idle(32)`, `trim_backs(16)`, ...) run only while `residency::pressured()` is set. That is never set without `VICTORY_RESIDENCY=1`, because `refresh()` returns early (residency.rs:133-136). So the trims did not run in that run either. Not tested: in-game, `VICTORY_RESIDENCY=1`.
github-bot closed this pull request 2026-11-27 13:46:48 +00:00

Pull request closed

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