GPU: take back the dynamic descriptor slots of lists that ran when a heap runs short #688

Open
github-bot wants to merge 3 commits from github-bot/gh-688 into main AGit
Owner

@⁠iurysf on GitHub · 2026-11-24 06:55 UTC · original
iurysf:dynamic-slot-reclaim → main · +504 −20 · 5 files · 3 commits · open

Rebased onto main 58fed37, which now includes #336, so this is a single commit on main. Tests after the rebase: cargo test -p victory-gpu -- --test-threads=1 gives 54 passed, 1 ignored. Clippy -D warnings is clean, with and without diagnostics, and cargo xtask policy is ok.

A list holds the dynamic descriptor slots its draws took until the title resets it. Submissions are waited for (Host::execute waits on its fence with INFINITE), so once a list has run, the GPU no longer reads those slots. On a capped view heap, though, the dynamic pool fills within seconds of entering the world and every further table is refused, so the draw or dispatch is dropped. On NVIDIA that cap is 1,000,000 slots, 65,536 of them dynamic (with #336). On an RTX 4070 we see dropped=65536 and no free dynamic descriptor slots.

Existing PRs enlarge the pool (#135, #336, now merged), fix the search (#251), share identical tables (#562) or drop the draw (#336). None gives back slots that are no longer read.

Change

  • When HostHeap::dynamic has no room, State::take_dynamic takes back the slots of the oldest list that already ran (descriptor::lease), one list at a time, and retries. Nothing changes while the heap has room.
  • The list taken back is marked lost. If it is submitted again without a reset, it is not run: its draws are dropped, just as a draw whose table could not be made is dropped today. It works again once the title resets it.
  • A list is never taken back while it runs, because Lease::start and reclaim share one lock.

On the GPU (RTX 4070, driver 32.0.16.2101, base main d2a4bae + #493 + #483, default loop limit, 300 s, two runs):

  • There was no device removal in either run.
  • Logged dynamic-slot drops (the log prints at doublings) peaked at 16,384 and 4,096. Without this change they reached 32,768 and 65,536 in the same configuration.
  • The "submitted again ... not run" warning, i.e. a reclaimed list being reused without a reset, never appeared. Only "taken back" appeared.
  • "dropped without a host pipeline" and refused pipelines are unchanged, as expected. World frames were still black, so no visual difference is shown. ms/frame is not comparable because the host CPU was busy with other jobs.

Risks

  • If a title re-submits static lists without resetting them, a reclaimed one stops drawing until its reset. We did not observe this in the runs above.
  • This relies on every submission being waited for, so it needs rework if #595 (asynchronous submissions) lands. Then a list should only be reclaimable once its submission's fence value has completed.
  • Expect textual conflicts with #562, #135 and #251.

Tests: 5 new unit tests (without reclaim 2 fail; with start disabled 3 fail). cargo test -p victory-gpu -- --test-threads=1: 47 passed, 1 ignored (plus the load-flaky frame test, see the separate PR). Clippy -D warnings is clean; cargo xtask policy is ok.

No game data used. AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 06:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/688) `iurysf:dynamic-slot-reclaim` → `main` · +504 −20 · 5 files · 3 commits · open Rebased onto main `58fed37`, which now includes #336, so this is a single commit on main. Tests after the rebase: `cargo test -p victory-gpu -- --test-threads=1` gives 54 passed, 1 ignored. Clippy `-D warnings` is clean, with and without diagnostics, and `cargo xtask policy` is ok. A list holds the dynamic descriptor slots its draws took until the title resets it. Submissions are waited for (`Host::execute` waits on its fence with `INFINITE`), so once a list has run, the GPU no longer reads those slots. On a capped view heap, though, the dynamic pool fills within seconds of entering the world and every further table is refused, so the draw or dispatch is dropped. On NVIDIA that cap is 1,000,000 slots, 65,536 of them dynamic (with #336). On an RTX 4070 we see `dropped=65536` and `no free dynamic descriptor slots`. Existing PRs enlarge the pool (#135, #336, now merged), fix the search (#251), share identical tables (#562) or drop the draw (#336). None gives back slots that are no longer read. **Change** - When `HostHeap::dynamic` has no room, `State::take_dynamic` takes back the slots of the **oldest list that already ran** (`descriptor::lease`), one list at a time, and retries. Nothing changes while the heap has room. - The list taken back is marked lost. If it is submitted again without a reset, it is not run: its draws are dropped, just as a draw whose table could not be made is dropped today. It works again once the title resets it. - A list is never taken back while it runs, because `Lease::start` and `reclaim` share one lock. **On the GPU** (RTX 4070, driver 32.0.16.2101, base main `d2a4bae` + #493 + #483, default loop limit, 300 s, two runs): - There was no device removal in either run. - Logged dynamic-slot drops (the log prints at doublings) peaked at 16,384 and 4,096. Without this change they reached 32,768 and 65,536 in the same configuration. - The "submitted again ... not run" warning, i.e. a reclaimed list being reused without a reset, **never appeared**. Only "taken back" appeared. - "dropped without a host pipeline" and refused pipelines are unchanged, as expected. World frames were still black, so no visual difference is shown. ms/frame is not comparable because the host CPU was busy with other jobs. **Risks** - If a title re-submits static lists without resetting them, a reclaimed one stops drawing until its reset. We did not observe this in the runs above. - This relies on every submission being waited for, so it needs rework if #595 (asynchronous submissions) lands. Then a list should only be reclaimable once its submission's fence value has completed. - Expect textual conflicts with #562, #135 and #251. Tests: 5 new unit tests (without `reclaim` 2 fail; with `start` disabled 3 fail). `cargo test -p victory-gpu -- --test-threads=1`: 47 passed, 1 ignored (plus the load-flaky `frame` test, see the separate PR). Clippy `-D warnings` is clean; `cargo xtask policy` is ok. No game data used. AI-assisted.
A list keeps the dynamic slots its draws took until the title resets it.
Every submission is waited for, so once a list has run the GPU no longer
reads them, but a capped view heap (NVIDIA: 1,000,000 slots, 65,536 of them
dynamic) is full within seconds of the world and every later table is
refused: the draw or dispatch is dropped (#336 drops it instead of reading
the title's slots).

When `HostHeap::dynamic` has no room, `State::take_dynamic` now takes back
the slots of the oldest list that already ran (`descriptor::lease`), one
list at a time, and retries. That list is marked lost; submitting it again
without a reset is refused (its draws are dropped, as a table that could not
be made already drops one) and it works again once the title resets it. A
list is not taken back while it runs: `start` and `reclaim` share one lock.
Nothing changes while the heap has room.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
A list's dynamic slots were a `Vec` field named `dynamic` that callers
pushed `(heap, first, n)` onto. The lease replaced it; keep the old name
and let `Lease::push` take the same tuple, so a change that still does
`self.dynamic.push((heap, first, 1))` (the root SRV one-view tables of

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Capturing a list's current Arc<Lease> before host.execute means queue execution never dereferences a command list or re-reads State::lease after bottom-of-pipe writes have allowed another thread to reset or release the list. Tracking an in-flight submission count on Lease under FINISHED (and checking in_flight == 0 in reclaim) also keeps dynamic descriptor slots pinned until every overlapping or duplicate submission of the list finishes.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:05 +00:00
Author
Owner

@⁠MartinIndra02 on GitHub · 2026-11-24 09:19 UTC · original

Independent Windows + NVIDIA Ampere verification for bf4e37e:

  • Setup: Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver 621.24), Ryzen 7 5800X3D, Rust 1.98.1 (x86_64-pc-windows-msvc).
  • cargo test -p victory-gpu --lib -- --test-threads=1: 54 passed, 0 failed, 1 ignored (all 5 new descriptor::lease::tests and draw::tests pass).

No game data used. AI-assisted; tests run on my machine.

**@⁠MartinIndra02** on GitHub · 2026-11-24 09:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7127263305) Independent Windows + NVIDIA Ampere verification for `bf4e37e`: - **Setup:** Windows 11 Pro 26200, NVIDIA GeForce RTX 3080 (10 GB, driver `621.24`), Ryzen 7 5800X3D, Rust 1.98.1 (`x86_64-pc-windows-msvc`). - `cargo test -p victory-gpu --lib -- --test-threads=1`: **54 passed, 0 failed, 1 ignored** (all 5 new `descriptor::lease::tests` and `draw::tests` pass). *No game data used. AI-assisted; tests run on my machine.*
Author
Owner

@⁠justr4mzi on GitHub · 2026-11-24 09:22 UTC · original

Tested PR #688 (bf4e37ed) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2) and Rust 1.98.1 (x86_64-pc-windows-msvc), compared against main (02f404e) as baseline.

Test results (victory-gpu)

  • main (02f404e, baseline): cargo test -p victory-gpu -- --test-threads=1 -> 49 passed, 0 failed, 1 ignored (with --features diagnostics: 52 passed, 0 failed, 1 ignored).
  • PR #688 (bf4e37ed):
    • cargo test -p victory-gpu -- --test-threads=1: 54 passed, 0 failed, 1 ignored (all 5 new tests in descriptor::lease::tests and draw::tests pass).
    • cargo test -p victory-gpu --features diagnostics -- --test-threads=1: 57 passed, 0 failed, 1 ignored.
    • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
    • cargo xtask policy: 153 files ok.
  • Note: bf4e37ed fast-forwards from 02f404e with #696 and #706 in its branch history; the 5 new GPU lease/draw tests are specific to #688.
  • Not run: runtime gameplay test (the title itself was not launched; no game data included).

AI-assisted test execution (reviewed locally).

**@⁠justr4mzi** on GitHub · 2026-11-24 09:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7127318881) Tested PR #688 (`bf4e37ed`) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2) and Rust 1.98.1 (`x86_64-pc-windows-msvc`), compared against `main` (`02f404e`) as baseline. ### Test results (`victory-gpu`) - `main` (`02f404e`, baseline): `cargo test -p victory-gpu -- --test-threads=1` -> `49 passed, 0 failed, 1 ignored` (with `--features diagnostics`: `52 passed, 0 failed, 1 ignored`). - PR #688 (`bf4e37ed`): - `cargo test -p victory-gpu -- --test-threads=1`: **54 passed, 0 failed, 1 ignored** (all 5 new tests in `descriptor::lease::tests` and `draw::tests` pass). - `cargo test -p victory-gpu --features diagnostics -- --test-threads=1`: **57 passed, 0 failed, 1 ignored**. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: `153 files ok`. - Note: `bf4e37ed` fast-forwards from `02f404e` with `#696` and `#706` in its branch history; the 5 new GPU lease/draw tests are specific to `#688`. - Not run: runtime gameplay test (the title itself was not launched; no game data included). *AI-assisted test execution (reviewed locally).*
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 09:24 UTC · original

Independent Windows + AMD RDNA4 verification of bf4e37ed9 merged with main (8e79c80, clean merge): PASS.

  • Setup: Windows 11 Pro (26100), AMD Radeon RX 9060 XT (driver 32.0.32029.2010), Rust 1.98.1 (x86_64-pc-windows-msvc).
  • cargo xtask policy → asset policy: 154 files ok
  • cargo clippy --workspace --all-targets --locked -- -D warnings → pass (0 warnings)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings → pass (0 warnings)
  • cargo test --workspace --locked → 316 passed, 0 failed, 6 ignored (all 5 new descriptor::lease::tests::* and draw::tests::* pass under default parallel test execution)
  • VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked → 55 passed, 0 failed, 1 ignored on RX 9060 XT (0.20s), zero debug-layer messages
  • VICTORY_D3D12_WARP=1 VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked → 55 passed, 0 failed, 1 ignored on WARP (0.20s), zero debug-layer messages
  • Diff review: lock ordering between FINISHED and Lease::ranges is consistent (FINISHED → ranges in reclaim and finish's prune path; finish's early emptiness check drops ranges before locking FINISHED), and take() ensures reset/dropped leases are never double-released.

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 09:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7127366545) Independent Windows + **AMD RDNA4** verification of `bf4e37ed9` merged with `main` (`8e79c80`, clean merge): **PASS**. - **Setup**: Windows 11 Pro (`26100`), **AMD Radeon RX 9060 XT** (driver `32.0.32029.2010`), Rust `1.98.1` (`x86_64-pc-windows-msvc`). - `cargo xtask policy` → `asset policy: 154 files ok` - `cargo clippy --workspace --all-targets --locked -- -D warnings` → **pass** (0 warnings) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` → **pass** (0 warnings) - `cargo test --workspace --locked` → **316 passed, 0 failed, 6 ignored** (all 5 new `descriptor::lease::tests::*` and `draw::tests::*` pass under default parallel test execution) - `VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked` → **55 passed, 0 failed, 1 ignored** on **RX 9060 XT** (`0.20s`), zero debug-layer messages - `VICTORY_D3D12_WARP=1 VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --locked` → **55 passed, 0 failed, 1 ignored** on **WARP** (`0.20s`), zero debug-layer messages - Diff review: lock ordering between `FINISHED` and `Lease::ranges` is consistent (`FINISHED` → `ranges` in `reclaim` and `finish`'s prune path; `finish`'s early emptiness check drops `ranges` before locking `FINISHED`), and `take()` ensures reset/dropped leases are never double-released. AI-assisted; synthetic tests only, no game files.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 11:48 UTC · original

In-game measurement. RTX 4070 (driver 32.0.16.2101, view heap capped at 1,000,000, so 2^16 dynamic slots). Base = main 58fed37 + #493 + #483, which keeps this GPU alive in the world. 300 s runs, warm cache, default loop limit, DRED=1 + GPU_TIMING=1, idle CPU, 2 runs per variant, interleaved.

Indirect draws/dispatches dropped because prepare fails, summed over each run's reports, mean of 2 runs:

A: base B: + this PR C: + this PR + #282
mesh (indirect kind 10: prepare failed) 11,048 6,130 (−45%) 4,415 (−60%)
compute (kind 2) 1,054 981 459
rectangle draws (kind 0, #255) 8,724 8,629 1,554 (+988 "rectangles not expanded")
no dynamic slots for its tables (last logged count) 65,536 / 65,536 32,768 / 65,536 16,384 / 32,768
  • Why these are the same problem: prepare → bind → tables sets table_failed when HostHeap::dynamic has no room (the #336 path), so "prepare failed" on indirect draws is largely dynamic-slot exhaustion. Reclaiming the slots of lists that already ran roughly halves the indirect mesh drops.
  • With #282: its expanded rectangle draws stop failing in prepare, and the two together remove most of #255's drops.
  • Safety: there was no device removal in any of the 6 runs, and the "submitted again ... not run" warning never appeared, so no reclaimed list was re-submitted without a reset.
  • Run-to-run variation is large, e.g. mesh drops of 4,940 and 7,319 with this PR against 8,224 and 13,872 without, so these are 2-run means. Longer runs to check what changes on screen are in progress.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 11:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7130579745) **In-game measurement.** RTX 4070 (driver 32.0.16.2101, view heap capped at 1,000,000, so 2^16 dynamic slots). Base = main `58fed37` + #493 + #483, which keeps this GPU alive in the world. 300 s runs, warm cache, default loop limit, `DRED=1` + `GPU_TIMING=1`, idle CPU, 2 runs per variant, interleaved. Indirect draws/dispatches dropped because `prepare` fails, summed over each run's reports, mean of 2 runs: | | A: base | B: + this PR | C: + this PR + #282 | |---|---:|---:|---:| | mesh (`indirect kind 10: prepare failed`) | 11,048 | **6,130 (−45%)** | **4,415 (−60%)** | | compute (`kind 2`) | 1,054 | 981 | 459 | | rectangle draws (`kind 0`, #255) | 8,724 | 8,629 | **1,554** (+988 "rectangles not expanded") | | `no dynamic slots for its tables` (last logged count) | 65,536 / 65,536 | 32,768 / 65,536 | 16,384 / 32,768 | - **Why these are the same problem:** `prepare` → `bind` → `tables` sets `table_failed` when `HostHeap::dynamic` has no room (the #336 path), so "prepare failed" on indirect draws is largely dynamic-slot exhaustion. Reclaiming the slots of lists that already ran roughly halves the indirect mesh drops. - **With #282:** its expanded rectangle draws stop failing in `prepare`, and the two together remove most of #255's drops. - **Safety:** there was no device removal in any of the 6 runs, and the "submitted again ... not run" warning never appeared, so no reclaimed list was re-submitted without a reset. - Run-to-run variation is large, e.g. mesh drops of 4,940 and 7,319 with this PR against 8,224 and 13,872 without, so these are 2-run means. Longer runs to check what changes on screen are in progress. AI-assisted.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 12:24 UTC · original

Two updates.

1. Compatibility with #493. #493 adds self.dynamic.push((key.0, index, 1)) in root_srv_table, which didn't compile against this PR's renamed field. The new commit 3eb8bd2 keeps the field named dynamic (now the Arc<Lease>) and gives Lease a push, so #493 merges and builds unchanged. Checked by merging pull/493/head onto this branch and running a diag build with diagnostics, which passes. Also cargo test -p victory-gpu -- --test-threads=1 gives 54 passed, and clippy -D warnings is clean.

2. What actually makes dynamic() fail on NVIDIA. I instrumented HostHeap::dynamic on main 58fed37 + #493 + #483 and ran it on the RTX 4070 for 300 s. Every failure was fragmentation, not exhaustion. The requested tables were 4–9 slots, with 325–2,217 slots free in total, but the longest contiguous free run was only 3–8 (range 65,536). No "exhausted" and no "refused outright" cases appeared. That explains why reclaiming lists here helps (−45% indirect mesh drops) but doesn't remove the drops. The bigger lever is the allocator itself: size-class free lists for small tables, or coalescing on release. #251 (searching across the cursor) may cover part of it, and I haven't measured it yet.

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 12:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7131394903) Two updates. **1. Compatibility with #493.** #493 adds `self.dynamic.push((key.0, index, 1))` in `root_srv_table`, which didn't compile against this PR's renamed field. The new commit `3eb8bd2` keeps the field named `dynamic` (now the `Arc<Lease>`) and gives `Lease` a `push`, so #493 merges and builds unchanged. Checked by merging `pull/493/head` onto this branch and running a diag build with diagnostics, which passes. Also `cargo test -p victory-gpu -- --test-threads=1` gives 54 passed, and clippy `-D warnings` is clean. **2. What actually makes `dynamic()` fail on NVIDIA.** I instrumented `HostHeap::dynamic` on main `58fed37` + #493 + #483 and ran it on the RTX 4070 for 300 s. **Every failure was fragmentation, not exhaustion.** The requested tables were 4–9 slots, with 325–2,217 slots free in total, but the longest contiguous free run was only 3–8 (range 65,536). No "exhausted" and no "refused outright" cases appeared. That explains why reclaiming lists here helps (−45% indirect mesh drops) but doesn't remove the drops. The bigger lever is the allocator itself: size-class free lists for small tables, or coalescing on release. #251 (searching across the cursor) may cover part of it, and I haven't measured it yet. AI-assisted.
Author
Owner

@⁠rpmaster2 on GitHub · 2026-11-24 09:32 UTC · original · edited 2026-11-24 12:31 UTC

Cross-check on Radeon RX 9070 XT 16 GB (RDNA4), Adrenalin 26.11.2 (32.0.32029.2010), Windows 11 26300, Ryzen 5 5600, 32 GB RAM, diag build, VICTORY_D3D12_DRED=1.

Base main @⁠58fed37 (already carries #336's 2^18 dynamic slots and the drop), this branch merged on top, 480 s per run, alternating:

run binary result max frame
1 main device removed (~4m40s after start) 1249
2 main + this PR device removed 1282
3 main device removed 1142
4 main + this PR device removed 1167
5 main device removed 1126

So on this host the change neither regresses nor prevents the removal; 5/5 runs die at frame 1100-1300. Earlier 200-240 s runs of both binaries survived only because they were shorter than the crash window - that was my mistake, not evidence of a fix.

The removal is also no longer about slots: no free dynamic descriptor slots appears 0 times in every run above, with or without this PR. DRED names a different cause:

host GPU device removed after a submission of 24 lists; page fault at 0x...; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)"]

Across the five runs the fault lands inside a freed host texture: 1024x1024 f98/f99, 2048x2048 f98, 512x512 f29 (flags 0x1), 256x256 f99, always type 34. In two runs the stopped list is 7d85c9cab3c80721, whose tables come from shader f0c7efd2aceb2aaa and name placed SRVs. The log also reports a title texture was released while a list not yet reset names its host copy before the removal.

That points at a stale descriptor / use-after-free on a released texture, which #609 targets; I am testing #609 on the same host and will report there. Nothing here needs a change from you - this is only to keep the slot-exhaustion theory from being credited with a fix it does not provide on RDNA4.

Separately, the world stays black for a different reason: 426 shaders refuse translation (354 compute, 38 pixel, 30 mesh, 4 vertex), so their draws are dropped.

No game data in this report: counts, formats, shader hashes and error strings only.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and observations; the hardware, the dump and the runs are mine.

**@⁠rpmaster2** on GitHub · 2026-11-24 09:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7127555458) · edited 2026-11-24 12:31 UTC Cross-check on Radeon RX 9070 XT 16 GB (RDNA4), Adrenalin 26.11.2 (32.0.32029.2010), Windows 11 26300, Ryzen 5 5600, 32 GB RAM, diag build, `VICTORY_D3D12_DRED=1`. Base `main` @⁠58fed37 (already carries #336's 2^18 dynamic slots and the drop), this branch merged on top, 480 s per run, alternating: | run | binary | result | max frame | | --- | --- | --- | --- | | 1 | main | device removed (~4m40s after start) | 1249 | | 2 | main + this PR | device removed | 1282 | | 3 | main | device removed | 1142 | | 4 | main + this PR | device removed | 1167 | | 5 | main | device removed | 1126 | So on this host the change neither regresses nor prevents the removal; 5/5 runs die at frame 1100-1300. Earlier 200-240 s runs of both binaries survived only because they were shorter than the crash window - that was my mistake, not evidence of a fix. The removal is also no longer about slots: `no free dynamic descriptor slots` appears **0 times** in every run above, with or without this PR. DRED names a different cause: ``` host GPU device removed after a submission of 24 lists; page fault at 0x...; inside freed ["texture 1024x1024 f98 flags 0x0 (type 34)"] ``` Across the five runs the fault lands inside a freed host texture: 1024x1024 f98/f99, 2048x2048 f98, 512x512 f29 (flags 0x1), 256x256 f99, always `type 34`. In two runs the stopped list is `7d85c9cab3c80721`, whose tables come from shader `f0c7efd2aceb2aaa` and name placed SRVs. The log also reports `a title texture was released while a list not yet reset names its host copy` before the removal. That points at a stale descriptor / use-after-free on a released texture, which #609 targets; I am testing #609 on the same host and will report there. Nothing here needs a change from you - this is only to keep the slot-exhaustion theory from being credited with a fix it does not provide on RDNA4. Separately, the world stays black for a different reason: 426 shaders refuse translation (354 compute, 38 pixel, 30 mesh, 4 vertex), so their draws are dropped. No game data in this report: counts, formats, shader hashes and error strings only. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs and observations; the hardware, the dump and the runs are mine.
Author
Owner

@⁠erLCoder on GitHub · 2026-11-24 13:08 UTC · original

Independent descriptor-lease tests on GTX 1660 Ti (6 GB), NVIDIA 581.42, Windows 10 22H2 19045.6466, Ryzen 5 3600, Rust 1.98.1 MSVC and Agility SDK 1.620.2. Base 58fed37 (includes #336), tested PR revision bf4e37e; the PR has since advanced. I added test-only checks requiring NVIDIA LUID 00000000:00017c52 so the two heap fixtures cannot silently skip device creation.

cargo test --offline --locked -p victory-gpu --features diagnostics --lib descriptor::lease -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored, 55 filtered. cargo test --offline --locked -p victory-gpu --features diagnostics --lib draw::tests -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored, 56 filtered. Both four-slot heap tests confirmed the NVIDIA LUID. They cover completed lease reclamation, running/reset lease protection and allocation retry. Actual GPU re-execution of a reclaimed title command list, real exhaustion, dropped commands and image quality remain untested.

Codex prepared the worktree, ran the tests and drafted this report.

**@⁠erLCoder** on GitHub · 2026-11-24 13:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7132398788) Independent descriptor-lease tests on GTX 1660 Ti (6 GB), NVIDIA 581.42, Windows 10 22H2 19045.6466, Ryzen 5 3600, Rust 1.98.1 MSVC and Agility SDK 1.620.2. Base 58fed37 (includes #336), tested PR revision bf4e37e; the PR has since advanced. I added test-only checks requiring NVIDIA LUID 00000000:00017c52 so the two heap fixtures cannot silently skip device creation. `cargo test --offline --locked -p victory-gpu --features diagnostics --lib descriptor::lease -- --nocapture --test-threads=1`: 3 passed, 0 failed, 0 ignored, 55 filtered. `cargo test --offline --locked -p victory-gpu --features diagnostics --lib draw::tests -- --nocapture --test-threads=1`: 2 passed, 0 failed, 0 ignored, 56 filtered. Both four-slot heap tests confirmed the NVIDIA LUID. They cover completed lease reclamation, running/reset lease protection and allocation retry. Actual GPU re-execution of a reclaimed title command list, real exhaustion, dropped commands and image quality remain untested. Codex prepared the worktree, ran the tests and drafted this report.
Author
Owner

@⁠erLCoder on GitHub · 2026-11-24 14:52 UTC · original

Retested updated head 3eb8bd287e949fb80d7d50233897474c4cfe6c70 against the earlier bf4e37e result. The one new commit renames the stored lease to dynamic and adds tuple-taking Lease::push, with add delegating to it; this preserves the calling shape needed by the root-SRV work.

On Windows 10 22H2, GTX 1660 Ti, NVIDIA 581.42, Rust 1.98.1 and Agility SDK 1.620.2: descriptor::lease passed 3/3; draw::tests passed 2/2; the full victory-gpu library suite with diagnostics passed 57, failed 0, ignored 1. The two heap fixtures were locally instrumented to require D3D12 adapter LUID 00000000:00017c52; both printed that LUID, matching the physical NVIDIA probe (software flag 0). This prevents a silent no-device pass. The tests show no regression in their coverage, not proof of real workload reclamation or image correctness. No title run or re-submitted GPU command-list validation was performed for this update.

Codex prepared the worktree, ran the tests and drafted this report.

**@⁠erLCoder** on GitHub · 2026-11-24 14:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7135092258) Retested updated head `3eb8bd287e949fb80d7d50233897474c4cfe6c70` against the earlier `bf4e37e` result. The one new commit renames the stored lease to `dynamic` and adds tuple-taking `Lease::push`, with `add` delegating to it; this preserves the calling shape needed by the root-SRV work. On Windows 10 22H2, GTX 1660 Ti, NVIDIA 581.42, Rust 1.98.1 and Agility SDK 1.620.2: `descriptor::lease` passed 3/3; `draw::tests` passed 2/2; the full `victory-gpu` library suite with diagnostics passed 57, failed 0, ignored 1. The two heap fixtures were locally instrumented to require D3D12 adapter LUID `00000000:00017c52`; both printed that LUID, matching the physical NVIDIA probe (software flag 0). This prevents a silent no-device pass. The tests show no regression in their coverage, not proof of real workload reclamation or image correctness. No title run or re-submitted GPU command-list validation was performed for this update. Codex prepared the worktree, ran the tests and drafted this report.
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 19:40 UTC · original

Update: two races in the reclaim, found in review, are fixed in 2e42e8b (main ffe310e merged in first, as de20aea; the old head built on a base with the lowers(&words) clippy error).

  • finished() re-read the list after it ran. ExecuteCommandLists called finished(l) after host.execute, which reads l.state.lease() again. If another thread saw the list's bottom-of-pipe write and reset it in between, the new, not yet submitted lease went into the finished queue and could have its slots taken back (or, after a Release, l was freed). Now list::start takes the list's Arc<Lease> before the execution, and only those leases are finished afterwards. Nothing reads lists or the list state after host.execute.
  • One list in two overlapping submissions. The first finish() put the lease in the queue while the second submission could still be running. Lease now counts submissions in flight (under the queue's lock), and reclaim only takes a lease with none.

Tests: overlapping_submissions_keep_slots_until_all_finish (fails on the old head: "still running in the second submission") and finishing_a_started_submission_does_not_reclaim_a_reset_lists_new_slots (reset and release after start). cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings clean, cargo test --workspace --locked passes (victory-gpu 57 + 1 ignored).

AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 19:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7142430953) Update: two races in the reclaim, found in review, are fixed in `2e42e8b` (main `ffe310e` merged in first, as `de20aea`; the old head built on a base with the `lowers(&words)` clippy error). - **`finished()` re-read the list after it ran.** `ExecuteCommandLists` called `finished(l)` after `host.execute`, which reads `l.state.lease()` again. If another thread saw the list's bottom-of-pipe write and reset it in between, the new, not yet submitted lease went into the finished queue and could have its slots taken back (or, after a `Release`, `l` was freed). Now `list::start` takes the list's `Arc<Lease>` before the execution, and only those leases are finished afterwards. Nothing reads `lists` or the list state after `host.execute`. - **One list in two overlapping submissions.** The first `finish()` put the lease in the queue while the second submission could still be running. `Lease` now counts submissions in flight (under the queue's lock), and `reclaim` only takes a lease with none. Tests: `overlapping_submissions_keep_slots_until_all_finish` (fails on the old head: "still running in the second submission") and `finishing_a_started_submission_does_not_reclaim_a_reset_lists_new_slots` (reset and release after `start`). `cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings` clean, `cargo test --workspace --locked` passes (victory-gpu 57 + 1 ignored). AI-assisted.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:35 UTC · original · edited 2026-11-25 16:00 UTC

Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-gpu/src/list.rs, crates/victory-gpu/src/queue.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (needs-work) was for an older state of main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7148665493) · edited 2026-11-25 16:00 UTC <!-- victory-triage v1 head=39e68e2c25766cb4d7ebab6b913d79f65025f893 verdict=needs-rebase at=2026-11-25T15:59:00Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-gpu/src/list.rs`, `crates/victory-gpu/src/queue.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (needs-work) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠r4tedx on GitHub · 2026-11-26 06:14 UTC · original

We ran a reclaim of our own on a capped NVIDIA view heap (1,000,000 views, 65,535 dynamic slots), built the way this PR describes. It hit the case the triage flagged, so here is what we found and the rule we settled on, in case it helps this PR along.

Lists submitted again before a reset

The title does submit lists again without resetting them. On our play build, the slot line counts "lists submitted again before a reset" every few seconds. In each 10-minute run it added up to 2,063-3,016 such submissions, about one a frame. In our first run with the reclaim (DP1), none of those lists had been taken back at the time, so nothing was lost: 0 lists not run across all 102 slot lines. That was luck. It held only because the take-backs happened to hit lists the title was done with.

Our rule: a list that the title has submitted again since it last ran, without a reset, is never taken back.

  • How we tell. A list's lease gets a ran flag, set when one of its submissions finishes. When the list is submitted again and ran is already set, the lease is marked again. A reset clears both, because the lease is emptied and starts over.
  • A lease marked again stays out of the queue of finished lists, and reclaim skips it. Its slots stay with it until the title resets it, as on main.
  • So a list is never lost, and no draws are dropped for a lost list. The lost path (refusing to run a list whose slots were taken back) is still there as a guard.

In this PR's descriptor/lease.rs, that would mean the following (a sketch, not tested on this head):

  • an again: AtomicBool and a ran: AtomicBool on Lease;
  • in start: if ran, set again;
  • in finish: set ran, and if again, don't push the lease onto FINISHED;
  • in reclaim: skip leases marked again;
  • in take: clear both flags.

All of this happens under the FINISHED lock that start and reclaim already share.

In-game counts (RTX 5070, our play build, 10 minutes a run)

Local title data was used for these runs; only counts and timings from the logs are given here.

The play build carries other unmerged changes. These counts are about the reclaim only.

run build slot lines lists submitted again before a reset (whole run) of them not run (slots taken back) dropped draws, last 61+ slot lines
DP1 reclaim, before the rule 102 2,812 0 0
N2U with the rule 101 2,910 0 0
N2P with the rule 106 2,401 0 0
N3A with the rule 106 2,689 0 0
N3B with the rule 106 2,781 0 0
N3C with the rule 101 2,063 0 0
OV0 with the rule 100 2,537 0 0
OV1 with the rule 108 3,016 0 0
  • Draws were still dropped for want of dynamic slots in each run, but only early on: in slot lines 11-41, depending on the run. From the 42nd line to the end (61-75 lines), every run logged 0. In DP1, those early drops came in bursts where one frame's lists held more than the whole pool, nearly all of it in fresh tables for title slots past the host's 934,464. Taking slots back can't help there, and we're looking at it separately.
  • Over those runs the reclaim took back 0-6,395 slots (0-12 lists) in the 8 frames of the last slot line.

The release path

This PR's HostHeap::release only clears the slots' flags (a fill over n). It doesn't walk the free run beside them, so the cost we bounded on our side doesn't apply here. Our walk came from our own bound on the longest free run (taken to skip searches that can't succeed), which this PR doesn't have.

  • Skipping a search after it fails, until a release frees slots, is #2394's change (bartikele, based on Belobug's 788ea467). Our version keeps the skip but leaves out the limit of eight failed walks a frame, because that limit refuses searches that would succeed. It fits next to this PR. We'll leave that to #2394 rather than open another PR.
  • We also give a root view a shorter run of dynamic slots when its 256-slot run isn't free, instead of dropping the draw. We can send that separately if it's wanted.

Our commits

They don't apply to this branch. Ours is a separate implementation: the lease lives in draw.rs on a later main. A merge-tree preview of each commit onto 39e68e2c conflicts in descriptor.rs, descriptor/host.rs, draw.rs, host.rs and queue.rs. So the rule above is the useful part, and we're glad to test a rebased head of this PR with it.

AI-assisted

**@⁠r4tedx** on GitHub · 2026-11-26 06:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/688#issuecomment-7184225199) We ran a reclaim of our own on a capped NVIDIA view heap (1,000,000 views, 65,535 dynamic slots), built the way this PR describes. It hit the case the triage flagged, so here is what we found and the rule we settled on, in case it helps this PR along. ### Lists submitted again before a reset The title does submit lists again without resetting them. On our play build, the slot line counts "lists submitted again before a reset" every few seconds. In each 10-minute run it added up to 2,063-3,016 such submissions, about one a frame. In our first run with the reclaim (DP1), none of those lists had been taken back at the time, so nothing was lost: 0 lists not run across all 102 slot lines. That was luck. It held only because the take-backs happened to hit lists the title was done with. Our rule: **a list that the title has submitted again since it last ran, without a reset, is never taken back.** - How we tell. A list's lease gets a `ran` flag, set when one of its submissions finishes. When the list is submitted again and `ran` is already set, the lease is marked `again`. A reset clears both, because the lease is emptied and starts over. - A lease marked `again` stays out of the queue of finished lists, and `reclaim` skips it. Its slots stay with it until the title resets it, as on main. - So a list is never lost, and no draws are dropped for a lost list. The `lost` path (refusing to run a list whose slots were taken back) is still there as a guard. In this PR's `descriptor/lease.rs`, that would mean the following (a sketch, not tested on this head): - an `again: AtomicBool` and a `ran: AtomicBool` on `Lease`; - in `start`: if `ran`, set `again`; - in `finish`: set `ran`, and if `again`, don't push the lease onto `FINISHED`; - in `reclaim`: skip leases marked `again`; - in `take`: clear both flags. All of this happens under the `FINISHED` lock that `start` and `reclaim` already share. ### In-game counts (RTX 5070, our play build, 10 minutes a run) Local title data was used for these runs; only counts and timings from the logs are given here. The play build carries other unmerged changes. These counts are about the reclaim only. | run | build | slot lines | lists submitted again before a reset (whole run) | of them not run (slots taken back) | dropped draws, last 61+ slot lines | |---|---|---:|---:|---:|---:| | DP1 | reclaim, before the rule | 102 | 2,812 | 0 | 0 | | N2U | with the rule | 101 | 2,910 | 0 | 0 | | N2P | with the rule | 106 | 2,401 | 0 | 0 | | N3A | with the rule | 106 | 2,689 | 0 | 0 | | N3B | with the rule | 106 | 2,781 | 0 | 0 | | N3C | with the rule | 101 | 2,063 | 0 | 0 | | OV0 | with the rule | 100 | 2,537 | 0 | 0 | | OV1 | with the rule | 108 | 3,016 | 0 | 0 | - Draws were still dropped for want of dynamic slots in each run, but only early on: in slot lines 11-41, depending on the run. From the 42nd line to the end (61-75 lines), every run logged 0. In DP1, those early drops came in bursts where one frame's lists held more than the whole pool, nearly all of it in fresh tables for title slots past the host's 934,464. Taking slots back can't help there, and we're looking at it separately. - Over those runs the reclaim took back 0-6,395 slots (0-12 lists) in the 8 frames of the last slot line. ### The release path This PR's `HostHeap::release` only clears the slots' flags (a `fill` over `n`). It doesn't walk the free run beside them, so the cost we bounded on our side doesn't apply here. Our walk came from our own bound on the longest free run (taken to skip searches that can't succeed), which this PR doesn't have. ### Related - Skipping a search after it fails, until a release frees slots, is #2394's change (bartikele, based on Belobug's 788ea467). Our version keeps the skip but leaves out the limit of eight failed walks a frame, because that limit refuses searches that would succeed. It fits next to this PR. We'll leave that to #2394 rather than open another PR. - We also give a root view a shorter run of dynamic slots when its 256-slot run isn't free, instead of dropping the draw. We can send that separately if it's wanted. ### Our commits They don't apply to this branch. Ours is a separate implementation: the lease lives in `draw.rs` on a later main. A merge-tree preview of each commit onto 39e68e2c conflicts in `descriptor.rs`, `descriptor/host.rs`, `draw.rs`, `host.rs` and `queue.rs`. So the rule above is the useful part, and we're glad to test a rebased head of this PR with it. AI-assisted
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/list.rs
  • crates/victory-gpu/src/queue.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-688'
git switch 'github-bot/gh-688'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-688'
git switch 'github-bot/gh-688'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-688'
git switch 'main'
git merge --squash 'github-bot/gh-688'
git switch 'main'
git merge --ff-only 'github-bot/gh-688'
git switch 'main'
git merge 'github-bot/gh-688'
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/Marvisak--VIctory!688
No description provided.