Reduce CPU frame-preparation allocations and shadow lock contention #850

Closed
t90 wants to merge 1 commit from upstream-pr/850 into main
t90 commented 2026-11-28 07:43:25 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by t90 on 2026-11-28T07:43:25Z.


Draw submission allocates a temporary descriptor-heap vector, constant-buffer fill planning repeatedly builds temporary ranges, and independent title-shadow allocations hold the shared registration lock. These add CPU work and can serialize unrelated refreshes during streaming.

This change binds descriptor heaps from stack storage, plans constant-buffer fills with fewer temporary collections, batches small refresh jobs and their accounting, and performs independent shadow allocations outside the shared table lock. Allocation publication revalidates the live registration, and existing placed-read ordering guards remain intact.

Validation:

  • Used in a combined RTX 5070 build where @t90 reported stutter was seriously less prominent. This was not a controlled comparison and does not establish the gain from an individual optimization.
  • Regression coverage exercises descriptor ordering, fill planning, refresh merging, pending-allocation concurrency, registration replacement, and allocation retry.
  • 15 focused tests passed (descriptor bindings, fill planning, grouped refresh work, and pending shadow allocations); one existing isolated-process test was ignored. Asset policy:295 files passed.

This PR excludes newer early command-list recycling and texture-readback reuse experiments, lighting workarounds, typed-half changes, and local launch settings.

Local check detail: both workspace Clippy configurations (--all-targets, with and without --all-features) pass with command-line allowances for three lint classes already failing in unchanged upstream code: manual_is_multiple_of (descriptor.rs and shadow.rs), let_and_return (shader emit tests), and some_filter (gameinput.rs). No lint allowances were added to source or CI. Strict upstream CI can still report those existing failures. The complete workspace test suite was not run locally; the listed focused correctness tests were run on this isolated branch.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5538004858 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/850). Originally posted by [t90](https://github.com/t90) on 2026-11-28T07:43:25Z. --- Draw submission allocates a temporary descriptor-heap vector, constant-buffer fill planning repeatedly builds temporary ranges, and independent title-shadow allocations hold the shared registration lock. These add CPU work and can serialize unrelated refreshes during streaming. This change binds descriptor heaps from stack storage, plans constant-buffer fills with fewer temporary collections, batches small refresh jobs and their accounting, and performs independent shadow allocations outside the shared table lock. Allocation publication revalidates the live registration, and existing placed-read ordering guards remain intact. Validation: - Used in a combined RTX 5070 build where @t90 reported stutter was seriously less prominent. This was not a controlled comparison and does not establish the gain from an individual optimization. - Regression coverage exercises descriptor ordering, fill planning, refresh merging, pending-allocation concurrency, registration replacement, and allocation retry. - 15 focused tests passed (descriptor bindings, fill planning, grouped refresh work, and pending shadow allocations); one existing isolated-process test was ignored. Asset policy:295 files passed. This PR excludes newer early command-list recycling and texture-readback reuse experiments, lighting workarounds, typed-half changes, and local launch settings. Local check detail: both workspace Clippy configurations (--all-targets, with and without --all-features) pass with command-line allowances for three lint classes already failing in unchanged upstream code: manual_is_multiple_of (descriptor.rs and shadow.rs), let_and_return (shader emit tests), and some_filter (gameinput.rs). No lint allowances were added to source or CI. Strict upstream CI can still report those existing failures. The complete workspace test suite was not run locally; the listed focused correctness tests were run on this isolated branch.
trustno1-coder commented 2026-11-28 19:23:10 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:23:10Z.


Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7244504474 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/850#issuecomment-7244504474). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T19:23:10Z. --- Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!850
No description provided.