Three performance changes: binary-search the write-watch ahead ranges; opt-in descriptor copies as bytes and command-list reuse #469

Closed
HungrySharkNet wants to merge 3 commits from upstream-pr/469 into main
HungrySharkNet commented 2026-11-27 22:59:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HungrySharkNet on 2026-11-27T22:59:07Z.


What

  1. writes() searched the submission's "asked ahead" page ranges linearly on every
    refresh, so a submission's cost grew with the square of its range count. The
    ranges are now sorted and merged once and looked up by binary search. Always on,
    no behaviour change.
  2. VICTORY_DESC_MEMCPY=1 (off by default): a descriptor is copied as step bytes
    of CPU-visible descriptor memory instead of CopyDescriptorsSimple(1, ...). The
    world's draws do tens of thousands of these a frame.
  3. VICTORY_LIST_CACHE=1 and VICTORY_LIST_CACHE_FULL=1 (off by default): a list
    whose recorded stream was seen before is run again from its recorded host list
    instead of being translated. The full variant holds the stream to the list's
    close, so identical lists are found even when another list object recorded them.

Measurements

Ryzen 5 5600X (6c/12t), RTX 4070, 1080p, no DLSS, dense scene (~5k draws/frame):

  • ahead lookup: "waiting for the write watch" fell from ~21-37 ms to ~18-22 ms per
    frame (all threads).
  • descriptor copies as bytes: the descriptor-slot work fell from 6.3-6.4 ms to
    5.4-6.0 ms per sampled sixteenth of the slots (about 10-15%).
  • list cache (full): 41-58 of ~207 lists a frame were reused (20-28%). No visual
    artifacts in testing; the card stayed 61-65% busy and the submission queue did
    not stall. The frame-time gain is limited: the repeated lists are mostly small,
    so the translated call count barely moves.

The two switches default off; the default build is unchanged.

Notes

The command-list cache is the most experimental of the three. It reuses a closed
host list whose deferred steps run again on resubmission; it was tested on this
scene only. Happy to split it into its own PR if that is easier to review.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5534177731 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/469). Originally posted by [HungrySharkNet](https://github.com/HungrySharkNet) on 2026-11-27T22:59:07Z. --- ## What 1. `writes()` searched the submission's "asked ahead" page ranges linearly on every refresh, so a submission's cost grew with the square of its range count. The ranges are now sorted and merged once and looked up by binary search. Always on, no behaviour change. 2. `VICTORY_DESC_MEMCPY=1` (off by default): a descriptor is copied as `step` bytes of CPU-visible descriptor memory instead of `CopyDescriptorsSimple(1, ...)`. The world's draws do tens of thousands of these a frame. 3. `VICTORY_LIST_CACHE=1` and `VICTORY_LIST_CACHE_FULL=1` (off by default): a list whose recorded stream was seen before is run again from its recorded host list instead of being translated. The full variant holds the stream to the list's close, so identical lists are found even when another list object recorded them. ## Measurements Ryzen 5 5600X (6c/12t), RTX 4070, 1080p, no DLSS, dense scene (~5k draws/frame): - ahead lookup: "waiting for the write watch" fell from ~21-37 ms to ~18-22 ms per frame (all threads). - descriptor copies as bytes: the descriptor-slot work fell from 6.3-6.4 ms to 5.4-6.0 ms per sampled sixteenth of the slots (about 10-15%). - list cache (full): 41-58 of ~207 lists a frame were reused (20-28%). No visual artifacts in testing; the card stayed 61-65% busy and the submission queue did not stall. The frame-time gain is limited: the repeated lists are mostly small, so the translated call count barely moves. The two switches default off; the default build is unchanged. ## Notes The command-list cache is the most experimental of the three. It reuses a closed host list whose deferred steps run again on resubmission; it was tested on this scene only. Happy to split it into its own PR if that is easier to review.

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!469
No description provided.