Descriptors: per-thread copies of the placed-view shapes (VICTORY_SHAPE_CACHE) #2804

Manually merged
github merged 1 commit from github-bot/gh-2804 into gh-pr/2804/base 2026-11-30 14:16:35 +00:00 AGit
Owner

@⁠Demos974 on GitHub · 2026-11-29 17:30 UTC · original
Demos974:view-shape-cache → main · +114 −8 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

What it changes

The table of placed-view shapes (ViewShapes) only ever grows and a shape keeps its number, yet every lookup took its RwLock: when a view is written (shape to number) and when a record is read back (number to shape, with_view_at). In a sampled kernel trace with the executable's symbols, taking that lock (shapes_read) was 8-11 % of each list translator's time, the eight of them reading it at once.

With VICTORY_SHAPE_CACHE=1 each thread keeps 1024 shapes by number and 1024 numbers by shape, direct-mapped, and takes the lock only on a miss. A copy is never stale. Off by default: the gain is not yet clear of the noise (below).

How it was tested

  • GPU and profile: RTX 5070 Ti 16 GB (driver 621.40), Core Ultra 7 265KF (8 fast + 12 slow cores), 64 GB; Series S, 720p, DLSS Quality, DLSS frame generation x4, no ray tracing
  • Before / after: two in-run A/B runs of 5 minutes (VICTORY_AB=10,VICTORY_SHAPE_CACHE, the opening's house). Each phase with the switch against the two around it: frame time -9.1 % in the median of 21 pairs, but only 13 of 21 faster; the process's processor time the same (8.56 and 8.59 cores busy). In a run of four combinations with a scripted walk: -2.5 % against the cycle's mean, p90 -13 %.
  • For shader changes, the wave sizes tested: not a shader change
  • cargo test passed for the crates it touches: yes (victory-gpu 916 passed, one new test: the copies answer as the table does past their size, twice). Clippy: nothing in the changed lines.

Checked for overlap

  • I searched the open pull requests for shapes and placed views. Related: #2174 (a lock-free placed address table for view_address_at in sync_heaps; this covers the shape lookups of words_for and with_view_at)

🤖 Generated with Claude Code

**@⁠Demos974** on GitHub · 2026-11-29 17:30 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2804) `Demos974:view-shape-cache` → `main` · +114 −8 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC ## What it changes The table of placed-view shapes (`ViewShapes`) only ever grows and a shape keeps its number, yet every lookup took its `RwLock`: when a view is written (shape to number) and when a record is read back (number to shape, `with_view_at`). In a sampled kernel trace with the executable's symbols, taking that lock (`shapes_read`) was 8-11 % of each list translator's time, the eight of them reading it at once. With `VICTORY_SHAPE_CACHE=1` each thread keeps 1024 shapes by number and 1024 numbers by shape, direct-mapped, and takes the lock only on a miss. A copy is never stale. Off by default: the gain is not yet clear of the noise (below). ## How it was tested - GPU and profile: RTX 5070 Ti 16 GB (driver 621.40), Core Ultra 7 265KF (8 fast + 12 slow cores), 64 GB; Series S, 720p, DLSS Quality, DLSS frame generation x4, no ray tracing - Before / after: two in-run A/B runs of 5 minutes (`VICTORY_AB=10,VICTORY_SHAPE_CACHE`, the opening's house). Each phase with the switch against the two around it: frame time -9.1 % in the median of 21 pairs, but only 13 of 21 faster; the process's processor time the same (8.56 and 8.59 cores busy). In a run of four combinations with a scripted walk: -2.5 % against the cycle's mean, p90 -13 %. - For shader changes, the wave sizes tested: not a shader change - `cargo test` passed for the crates it touches: yes (victory-gpu 916 passed, one new test: the copies answer as the table does past their size, twice). Clippy: nothing in the changed lines. ## Checked for overlap - [x] I searched the open pull requests for shapes and placed views. Related: #2174 (a lock-free placed address table for `view_address_at` in `sync_heaps`; this covers the shape lookups of `words_for` and `with_view_at`) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The table of placed-view shapes only ever grows and a shape keeps its
number, yet every lookup took its RwLock: with the eight list translators
reading it at once, taking that lock was 8-11 % of their time in a sampled
kernel trace.

With VICTORY_SHAPE_CACHE=1 each thread keeps 1024 shapes by number and
1024 numbers by shape, direct-mapped, and takes the lock only on a miss. A
copy can never be stale. Off by default: the in-run A/B gain is not yet
clear of the noise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:33:30 +00:00
Author
Owner

@⁠mrDeShock on GitHub · 2026-11-30 00:38 UTC · original

<html>

Thanks for this optimization! I independently tested your patch (a6d8835) on a different hardware configuration as part of an extended VIctory-NVIDIA performance investigation.

Test system:

  • Intel Core i7-11700KF (8C/16T)

  • RTX 4070 SUPER 12 GB

  • 32 GB DDR4-2666

  • Windows 11, driver 610.88

  • Series S, DLSS Quality, native DLSS FG 2X

  • 8 THIN translator threads

  • Base commit: f889bb07

Both runs used the same locally compiled executable and configuration, with VICTORY_SHAPE_CACHE=0 and VICTORY_SHAPE_CACHE=1 requested respectively.

Metric | OFF | ON -- | -- | -- Average base FPS | 13.05 | 13.52 Median interval frame time | 73.10 ms | 73.15 ms Frames over 100 ms | 7.01% | 6.04% Maximum frame time | 535.5 ms | 508.9 ms Submission preparation | 69.95 ms | 69.70 ms Descriptor processing | 19.01 ms | 19.06 ms THIN time per call | 5.212 µs | 5.206 µs Analyzed frames | 1740 | 1722 New pipelines created | 7 | 7

Both sessions completed normally.

The results show a modest improvement in frame pacing, but no meaningful improvement in typical frame time or per-call THIN translation cost.

These were separate gameplay runs rather than alternating in-run A/B phases. Memory pressure and scene workload may have differed. Cache activation and hit rates were not independently instrumented, so the results should be considered preliminary.

Overall, my observations are consistent with your conclusion that the performance gain is not yet clearly distinguishable from measurement noise.

Additional cache hit/miss counters and measurements of time spent waiting for the ViewShapes lock could be useful for further investigation.

Thanks for your contribution!

</html>
**@⁠mrDeShock** on GitHub · 2026-11-30 00:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2804#issuecomment-7265454310) <html> <body> <!--StartFragment--><p><span>Thanks for this optimization! I independently tested your patch (</span><code><span>a6d8835</span></code><span>) on a different hardware configuration as part of an extended VIctory-NVIDIA performance investigation.</span></p><p><strong><span>Test system:</span></strong></p><ul><li><p><span>Intel Core i7-11700KF (8C/16T)</span></p></li><li><p><span>RTX 4070 SUPER 12 GB</span></p></li><li><p><span>32 GB DDR4-2666</span></p></li><li><p><span>Windows 11, driver 610.88</span></p></li><li><p><span>Series S, DLSS Quality, native DLSS FG 2X</span></p></li><li><p><span>8 THIN translator threads</span></p></li><li><p><span>Base commit: </span><code><span>f889bb07</span></code></p></li></ul><p><span>Both runs used the same locally compiled executable and configuration, with </span><code><span>VICTORY_SHAPE_CACHE=0</span></code><span> and </span><code><span>VICTORY_SHAPE_CACHE=1</span></code><span> requested respectively.</span></p> Metric | OFF | ON -- | -- | -- Average base FPS | 13.05 | 13.52 Median interval frame time | 73.10 ms | 73.15 ms Frames over 100 ms | 7.01% | 6.04% Maximum frame time | 535.5 ms | 508.9 ms Submission preparation | 69.95 ms | 69.70 ms Descriptor processing | 19.01 ms | 19.06 ms THIN time per call | 5.212 µs | 5.206 µs Analyzed frames | 1740 | 1722 New pipelines created | 7 | 7 <p><span>Both sessions completed normally.</span></p><p><span>The results show a modest improvement in frame pacing, but no meaningful improvement in typical frame time or per-call THIN translation cost.</span></p><p><span>These were separate gameplay runs rather than alternating in-run A/B phases. Memory pressure and scene workload may have differed. Cache activation and hit rates were not independently instrumented, so the results should be considered preliminary.</span></p><p><span>Overall, my observations are consistent with your conclusion that the performance gain is not yet clearly distinguishable from measurement noise.</span></p><p><span>Additional cache hit/miss counters and measurements of time spent waiting for the ViewShapes lock could be useful for further investigation.</span></p><p><span>Thanks for your contribution!</span></p><!--EndFragment--> </body> </html>
github-bot changed target branch from main to gh-pr/2804/base 2026-11-30 14:16:06 +00:00
github manually merged commit a6d883525a into gh-pr/2804/base 2026-11-30 14:16:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

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