Skip to content

perf(gpu): shard RETIRED resource queue 16-way and add VICTORY_WIDE_THREADS - #139

Open
dcastell1 wants to merge 1 commit into
trustno1-coder:mainfrom
dcastell1:perf/sharded-retired-wide-threads
Open

dcastell1 wants to merge 1 commit into
trustno1-coder:mainfrom
dcastell1:perf/sharded-retired-wide-threads

Conversation

@dcastell1

Copy link
Copy Markdown
Contributor

Summary

  1. Shard RETIRED 16-way (crates/victory-gpu/src/host.rs):

    • retire_resource and retire previously pushed ~20,000 items per frame across recording, descriptor-sync, and submitting threads onto a single global Mutex<VecDeque<(u64, Retired)>> (noted as ~2.9% of submitting-thread wall-time mutex contention in Host lists: pool the copy sources; memory pressure trims spares down to 128 MiB instead of to nothing #57's samply profile).
    • Replaces the single lock with 16 round-robin thread-indexed Mutex<VecDeque<(u64, Retired)>> shards. Within each thread's shard, started timestamps arrive monotonically; bury(finished) drains all 16 shards and drops retired COM objects outside the locks, preserving identical bury_lag lifetime semantics.
  2. Cache wide_threads() and expose VICTORY_WIDE_THREADS (crates/victory-gpu/src/shadow.rs):

    • wide_threads() was queried on every wide() invocation (~95 calls/frame) and hard-clamped to 2..=6.
    • Caches the result in a OnceLock (preserving the existing 2..=6 default when unset) and honours VICTORY_WIDE_THREADS (1..=16) so high-core CPUs (for example 16 P-core logical processors on i9-12900K/13900K/14900K or 16-core Ryzen) can widen parallel refresh batches without oversubscribing.

Verification

  • Hardware: Windows 11 (build 26300), i9-12900K (8P+8E / 24 threads), 64 GB RAM, GeForce RTX 5090 32 GB (driver 621.40), Series X profile, --res 4k --dlss quality --framegen 4.
  • cargo test --locked -p victory-gpu --lib wide_threads_tests: 1 passed, 0 failed.
  • cargo test --locked -p xtask: 6 passed, 0 failed (asset policy green).

Note: Made with AI assistance and reviewed, built, and tested by a human.

MrSquirrel489 pushed a commit to MrSquirrel489/VIctory-NVIDIA that referenced this pull request Nov 27, 2026
MrSquirrel489 pushed a commit to MrSquirrel489/VIctory-NVIDIA that referenced this pull request Nov 27, 2026
…k when its submission lands

Conflict with PR trustno1-coder#57 (upload pool) in host.rs: both additions kept. The
memory bench counts RETIRED over its shards (PR trustno1-coder#139).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant