[pr-performance][rendering] Skip cached raw descriptor writes when disabled #231

Open
andrewpozdnakov7-jpg wants to merge 1 commit from andrewpozdnakov7-jpg/Darner:port/3833-skip-disabled-raw-view-staging into main
First-time contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Cached list views still stage raw twins when DARNER_RAW_VIEWS=0. Use the process-wide switch on both creation and rebuild. When raw views are enabled, keep staging those views so that another destination heap can use the cached descriptor.

Restores locally saved VIctory-NVIDIA work from December 1, 2026. Previous review: CodeFloe #391. Adapted by andrewpozdnakov7-jpg (GitHub profile).

How it was tested

  • Tested revision: 097f80e on f3840d7.
  • Commands and results: A synthetic Windows D3D12 WARP fixture checked the current slot-selection branches and exercised both descriptor writes. Raw views off: two writes before and zero after. Raw views on: two writes on both revisions. cargo check --locked -p darner-gpu --lib, xtask policy, and git diff --check passed.
  • Changes a default: no.
  • Independent gameplay check: akimfomin ran an A–B–B–A comparison on an RTX 4070 Ti SUPER. With raw views off, median redundant raw twins fell from roughly 14.2–14.6k per frame to zero on both patched runs. Turning raw views on restored the writes. The scene did not establish a frame-rate gain.
  • Gates run on that revision: none of the three workspace-wide gates.
  • Coverage gaps: Local tests used synthetic descriptors on WARP. The independent gameplay check covered one save and hardware configuration.

Checklist

  • I ran this change in the game.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: None found.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: <!-- optional --> ## What it changes Cached list views still stage raw twins when DARNER_RAW_VIEWS=0. Use the process-wide switch on both creation and rebuild. When raw views are enabled, keep staging those views so that another destination heap can use the cached descriptor. Restores locally saved VIctory-NVIDIA work from December 1, 2026. Previous review: [CodeFloe #391](https://codefloe.com/TrustNo1/Darner/pulls/391). Adapted by [andrewpozdnakov7-jpg](https://git.gtahub.st/andrewpozdnakov7-jpg) ([GitHub profile](https://github.com/andrewpozdnakov7-jpg)). ## How it was tested - Tested revision: 097f80e on f3840d7. - Commands and results: A synthetic Windows D3D12 WARP fixture checked the current slot-selection branches and exercised both descriptor writes. Raw views off: two writes before and zero after. Raw views on: two writes on both revisions. cargo check --locked -p darner-gpu --lib, xtask policy, and git diff --check passed. - Changes a default: no. - Independent gameplay check: [akimfomin](https://git.gtahub.st/TrustNo1/Darner/pulls/231#issuecomment-862170) ran an A–B–B–A comparison on an RTX 4070 Ti SUPER. With raw views off, median redundant raw twins fell from roughly 14.2–14.6k per frame to zero on both patched runs. Turning raw views on restored the writes. The scene did not establish a frame-rate gain. - Gates run on that revision: none of the three workspace-wide gates. - Coverage gaps: Local tests used synthetic descriptors on WARP. The independent gameplay check covered one save and hardware configuration. ## Checklist - [ ] I ran this change in the game. - [x] This PR contains one change based on main. - [x] The diff follows docs/asset-policy.md. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: None found. - Replaces or overlaps: none found
Adapt the locally saved VIctory-NVIDIA follow-up from December 1, 2026 (6cf5ea7). Use the same process-wide switch when the staging cache creates and rebuilds a view.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
First-time contributor

Confirmed the work is skipped in real gameplay on an RTX 4070 Ti SUPER 16 GB (617.14), i5-13600KF, Windows 11. Compared release v2026.12.03.02 and an optimized build of 097f80e. Native 2560×1440, DLSS/FG/RT off, uncapped, stationary save. Each build started with the same warm cache and had one unscored warm-up. Scored 45 seconds starting 55 seconds after the first world frame, in A–B–B–A order.

Run, DARNER_RAW_VIEWS=0 Complete frame intervals Rendered FPS p99 frame time Median draws/frame Median raw twins/frame
Release A1 1,241 27.59 60.20 ms 6,192 14,618.5
PR B1 1,256 27.95 57.69 ms 5,809.5 0
PR B2 1,225 27.24 62.72 ms 6,334 0
Release A2 1,258 28.00 58.89 ms 6,092.5 14,223

Both release windows emitted 44 nonzero raw-twin reports. Both PR windows had regular frame reports and zero nonzero raw-twin reports (sync_line emits one only when the count is positive). Turning the switch back on in the PR restored 44 nonzero reports, median 14,091.5 twins/frame. Zero shader misses or pipeline builds in all five scored windows. All runs exited 0. The game-window images before and after each window show the same parked vehicle and viewpoint, with traffic and idle animation varying.

The redundant descriptor work disappears with the switch off. FPS moved +1.3% in one pair and −2.7% in the other, so this scene does not establish a speedup.

Confirmed the work is skipped in real gameplay on an RTX 4070 Ti SUPER 16 GB (617.14), i5-13600KF, Windows 11. Compared release v2026.12.03.02 and an optimized build of 097f80e. Native 2560×1440, DLSS/FG/RT off, uncapped, stationary save. Each build started with the same warm cache and had one unscored warm-up. Scored 45 seconds starting 55 seconds after the first world frame, in A–B–B–A order. | Run, DARNER_RAW_VIEWS=0 | Complete frame intervals | Rendered FPS | p99 frame time | Median draws/frame | Median raw twins/frame | | --- | ---: | ---: | ---: | ---: | ---: | | Release A1 | 1,241 | 27.59 | 60.20 ms | 6,192 | 14,618.5 | | PR B1 | 1,256 | 27.95 | 57.69 ms | 5,809.5 | 0 | | PR B2 | 1,225 | 27.24 | 62.72 ms | 6,334 | 0 | | Release A2 | 1,258 | 28.00 | 58.89 ms | 6,092.5 | 14,223 | Both release windows emitted 44 nonzero raw-twin reports. Both PR windows had regular frame reports and zero nonzero raw-twin reports (sync_line emits one only when the count is positive). Turning the switch back **on** in the PR restored 44 nonzero reports, median 14,091.5 twins/frame. Zero shader misses or pipeline builds in all five scored windows. All runs exited 0. The game-window images before and after each window show the same parked vehicle and viewpoint, with traffic and idle animation varying. The redundant descriptor work disappears with the switch off. FPS moved +1.3% in one pair and −2.7% in the other, so this scene does not establish a speedup.
Collaborator

Code-read review of 097f80e. I did not build or run it. akimfomin's A/B above already shows the staging work disappears with DARNER_RAW_VIEWS=0; this is only about when the gate applies.

The PR gates on raw_twins(), the env switch (descriptor/host.rs:3318). Whether twins exist at all is raw_twins() && fits(2 * RAW_TWINS) (:3392), and only then is darner_shader::emit::set_raw_views(RAW_TWINS) called (:3394). Heaps size their twin arrays from darner_shader::emit::raw_views() (:3547), and twins is empty when that is 0 (:3632). So on a host where heaps of 2^22 views do not fit (the code comments say NVIDIA caps view heaps at PORTABLE_VIEWS, :3365-3368), the default configuration (DARNER_RAW_VIEWS unset) still stages twins that no heap holds, and this PR leaves that in place.

Suggestion: gate on darner_shader::emit::raw_views() != 0 instead of (or in addition to) raw_twins(). probe_view_limit() is documented to run "before a shader is translated and before a view heap is made" (:3362-3363), so the value is settled by the time make_listed_inner runs. The host view heaps hold ... raw_twins = ... log line on akimfomin's RTX 4070 Ti SUPER would show whether this applies there: if twins did not fit, his "switch on" 14k twins per frame were all wasted and a wider gate would remove them by default.

This comment was written with AI assistance (Claude Code).

Code-read review of 097f80e. I did not build or run it. akimfomin's A/B above already shows the staging work disappears with `DARNER_RAW_VIEWS=0`; this is only about when the gate applies. The PR gates on `raw_twins()`, the env switch (`descriptor/host.rs:3318`). Whether twins exist at all is `raw_twins() && fits(2 * RAW_TWINS)` (`:3392`), and only then is `darner_shader::emit::set_raw_views(RAW_TWINS)` called (`:3394`). Heaps size their twin arrays from `darner_shader::emit::raw_views()` (`:3547`), and `twins` is empty when that is 0 (`:3632`). So on a host where heaps of 2^22 views do not fit (the code comments say NVIDIA caps view heaps at `PORTABLE_VIEWS`, `:3365-3368`), the default configuration (`DARNER_RAW_VIEWS` unset) still stages twins that no heap holds, and this PR leaves that in place. Suggestion: gate on `darner_shader::emit::raw_views() != 0` instead of (or in addition to) `raw_twins()`. `probe_view_limit()` is documented to run "before a shader is translated and before a view heap is made" (`:3362-3363`), so the value is settled by the time `make_listed_inner` runs. The `host view heaps hold ... raw_twins = ...` log line on akimfomin's RTX 4070 Ti SUPER would show whether this applies there: if twins did not fit, his "switch on" 14k twins per frame were all wasted and a wider gate would remove them by default. This comment was written with AI assistance (Claude Code).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'port/3833-skip-disabled-raw-view-staging:andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git switch 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git switch 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git rebase 'main'
git switch 'main'
git merge --ff-only 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git switch 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git rebase 'main'
git switch 'main'
git merge --no-ff 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git switch 'main'
git merge --squash 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git switch 'main'
git merge --ff-only 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git switch 'main'
git merge 'andrewpozdnakov7-jpg-port/3833-skip-disabled-raw-view-staging'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
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
TrustNo1/Darner!231
No description provided.