Repository navigation
Conversation
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 48 tests in �ictory-gpu passed cleanly, including all 5 new unit tests in descriptor::lease::tests and draw::tests. Reclaiming dynamic descriptor slots from the oldest completed command lists cleanly prevents GPU view heap exhaustion (65536 drop threshold) during world loading.
0a146af to
bf4e37e
Compare
|
Independent Windows + NVIDIA Ampere verification for
No game data used. AI-assisted; tests run on my machine. |
|
Tested PR #688 ( Test results (
|
|
Independent Windows + AMD RDNA4 verification of
AI-assisted; synthetic tests only, no game files. |
|
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, Base
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: Across the five runs the fault lands inside a freed host texture: 1024x1024 f98/f99, 2048x2048 f98, 512x512 f29 (flags 0x1), 256x256 f99, always 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. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested bf4e37e on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu -- --test-threads=1 54 passed. cargo clippy -p victory-gpu --all-targets is clean. Not exercised against a title here.
- Locking:
Lease::startandreclaimshare theFINISHEDlock, so a list is never taken back between being chosen and starting to run. EveryHost::executewaits on its fence, so once a list is inFINISHEDthe GPU really has stopped reading its slots. Correct as long as submission stays synchronous. - Semantics, as you already note: D3D12 allows a closed list to be executed again without
Reset. Under heap pressure, a reclaimed list that is submitted again now drops all of its draws, where today only the draws whose tables can't be made are dropped. That isn't worse than the current exhaustion behaviour, but the "submitted again … not run" warning is the only signal. It's worth keeping that warning atwarn, outsidediagnostics, so a title that relies on re-execution shows up in a normal log. - If #595 (async submit) lands first,
finishmust move to fence completion, notexecutereturn. Adebug_assert!or a comment at thefinished(this)call site would stop that from being missed.
AI-assisted (Claude Code).
…arvisak#493) A root SRV is an unbounded GPU address: mesh shader vertex fetch read past a buffer copy's end into freed GPU memory, causing a page fault. Bind each root SRV as a one-descriptor raw table sized to the host copy (`raw_at`), wired through `State::take_dynamic` so slots participate in lease reclamation (Marvisak#688).
|
Automated triage for the maintainers. This pull request no longer merges cleanly into Generated by Claude Code |
…heap runs short 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 (Marvisak#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>
…n for the slot list compiles 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>
…issions 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>
2e42e8b to
39e68e2
Compare
…r-high-half-111a Shaders: keep d16 format-load high halves and saturate integer channels (Marvisak#440)
…n a heap runs short) Conflicts in list.rs and queue.rs: main now queues a submission's host lists (segments) behind held work (crate::hold, decision 0007) and runs them later from pump, instead of executing them in ExecuteCommandLists. Marvisak#688's lease is carried onto that: - list::start takes the list's segments (not one host list) and starts its lease; a lost list is skipped with Marvisak#688's one-time warning; - queue::Segment pairs a held host list with the lease, on the list's last segment, and pump's run finishes it after host.execute, before the host list is recycled. So a list's slots cannot be taken back while its host lists are held or running. Lease, list, hold and queue tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd views held whole) descriptor.rs is fork/main's but for Marvisak#688's lease module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous renderer (old upstream base 940d32f) is the first parent and is also kept as the branch renderer-2026-11-25-oldbase; the second parent is the rebuild: fork main (upstream main 63bcca4 + our pull requests) with the renderer stack merged on it: Marvisak#439 (on main: update/439-main's resolution), Marvisak#2309, Marvisak#2167, Marvisak#2118, Marvisak#2311, Marvisak#1722, Marvisak#1751, Marvisak#688, Marvisak#1872, Marvisak#2292, Marvisak#2310, Marvisak#2112 (opt-in), Marvisak#2230 (latch on by default), Marvisak#2389, Marvisak#2088 (small windows opt-in), Marvisak#2099's new head, and tonight's Marvisak#491 journal fixes. Merged upstream since: Marvisak#2143, Marvisak#2162, Marvisak#158, Marvisak#1906, Marvisak#1152; superseded by main: Marvisak#1769, Marvisak#1763, Marvisak#2366. The picture on this base still shows the overlay that plain upstream main shows too; that is being looked into. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 resetThe 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.
In this PR's
All of this happens under the 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.
The release pathThis PR's Related
Our commitsThey don't apply to this branch. Ours is a separate implementation: the lease lives in AI-assisted |
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=1gives 54 passed, 1 ignored. Clippy-D warningsis clean, with and without diagnostics, andcargo xtask policyis ok.A list holds the dynamic descriptor slots its draws took until the title resets it. Submissions are waited for (
Host::executewaits on its fence withINFINITE), 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 seedropped=65536andno 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
HostHeap::dynamichas no room,State::take_dynamictakes 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.Lease::startandreclaimshare one lock.On the GPU (RTX 4070, driver 32.0.16.2101, base main
d2a4bae+ #493 + #483, default loop limit, 300 s, two runs):Risks
Tests: 5 new unit tests (without
reclaim2 fail; withstartdisabled 3 fail).cargo test -p victory-gpu -- --test-threads=1: 47 passed, 1 ignored (plus the load-flakyframetest, see the separate PR). Clippy-D warningsis clean;cargo xtask policyis ok.No game data used. AI-assisted.