Repository navigation
Reduce descriptor contention during parallel command-list recording on macOS - #169
Merged
pragyaangaur merged 3 commits intoNov 26, 2026
Merged
Conversation
Adapt Marvisak/VIctory#2821 for the Mac test branch. Revalidate the title slot under the materialization lock and serialize eviction with slot rebinding.
Owner
|
Thanks, the lock changes look careful. This now conflicts with #165 (both change |
Owner
|
I merged main into this branch. The conflicts were in descriptor.rs, where I kept the read-write lock on SHADER_HEAPS and used main's register_heap and unregister_heap (registration now happens after the heap is handed out), and in shadow.rs, where find now uses main's enclosing lookup with the longest-span bound on both the read and the write path, so the old innermost helper is gone. CI passed and the PR is merged. |
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the generated command-list recording benchmark and descriptor contention fixes by 0xkn0wh3r3. The benchmark records real host draws and dispatches from five threads using hand-assembled shaders. It runs as an ignored test. Upstream benchmark #2820 · Upstream optimization #2821
Descriptor writers can share registry lookups. A per-slot atomic record lets the common case reuse a materialized descriptor. It costs eight additional bytes per title slot. The slow path re-reads the guest slot after acquiring the materialization lock, and eviction takes that lock before selecting the slots to clear.
Measurements on an M5 Max
On a macOS integration branch using CrossOver Preview and D3DMetal, five alternating pairs of release benchmark runs reduced median wall time for all recording threads from 18.82 to 11.48 ms per fixture frame. Each run executed 19,200 draws and 600 dispatches with zero drops (five threads, 640 draws per thread per frame, six frames). The candidate was faster in all five pairs.
A separate checkpoint comparison used one instrumented game run per variant, with the same starting checkpoint, cache and settings at 720p output. Across world frames +8 to +90, throughput went from 0.76 to 1.08 FPS. Over +48 to +90 it went from 0.60 to 0.87 FPS. The median of the reported per-frame aggregate descriptor-writer wait fell from 209.2 ms to 0.1 ms (19 control samples and 13 candidate samples). The scene still exhibited the existing overexposure. Run-to-run streaming and shader work can vary.
Verification on this PR branch
cargo xtask policypassed for 217 files.