Skip unused raw twins for cached list views #3833

Open
github-bot wants to merge 3 commits from github-bot/gh-3833 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-30 08:45 UTC · original
andrewpozdnakov7-jpg:fix/3807-unused-list-view-twins → main · +10 −2 · 1 files · 3 commits · open

Fixes #3807.

CI status. The current red check stops at the same five Clippy findings as clean main. The standalone fix #4708 passed the full Windows check. Both strict Clippy steps also passed locally with #4708 and the current changes from #3833 and #4018 applied together. Verification

What it changes

make_listed creates a raw twin for each buffer view even when the shader translator is using the ordinary indices. On a capped view heap where raw_views() == 0, that twin never reaches a slot the shader reads.

Skip the scratch twin when the shader translator has no twin region. Use the translator's setting because the list cache can supply a record to more than one heap. The existing stride-table test now checks the cache entry's twin flag as well as the ordinary stride for the first copy and the cache hit.

How it was tested

  • Windows with Rust 1.98.1, Agility SDK 1.620.2 and WARP 1.0.22. Synthetic typed UAV and SRV records only.
  • The same fixture creates two records and reuses each once through HostHeap::make_listed. With twins disabled, main 41adb551 created two scratch twins and failed the new zero-count assertion. This patch created zero and passed. The ordinary descriptor strides matched in both runs.
  • With scratch twins enabled in the isolated fixture, both versions created two scratch twins. This checks that the scratch path is still available. Reads from a hardware twin heap still need a hardware run.
  • Staged asset policy and git diff --check passed.

Checked for overlap

  • Checked open PRs for #3807 and the list-view creation path. #3102 reuses list views across recordings. #3396 handles constant buffers on capped heaps. This patch affects list-view construction only.

Hardware follow-up

Robotniq ran two five-minute passes from the same save on an RTX 3070 Ti 8 GB with a 1M-view heap and raw_twins=false. The baseline reported a median 7,708 twins per frame. With 6cf5ea7 the counter never printed. All 80 descriptor-host tests passed on that system. The measured frame-rate difference was within run-to-run noise. Hardware report

akimfomin backported the same change onto a pinned test control and repeated the same route on an RTX 4070 Ti SUPER with a 1M-view heap. Their baseline reported about 25,000 scratch twins per frame near the end. The patched run reported none, and all 71 enabled descriptor-host tests passed. Both runs reached the route and exited normally. The single 15-second pair does not establish a frame-rate change. Ada hardware report

Prepared with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-30 08:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833) `andrewpozdnakov7-jpg:fix/3807-unused-list-view-twins` → `main` · +10 −2 · 1 files · 3 commits · open Fixes #3807. > **CI status.** The current red check stops at the same five Clippy findings as [clean main](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539). The standalone fix [#4708](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4708) passed the full Windows check. Both strict Clippy steps also passed locally with #4708 and the current changes from #3833 and #4018 applied together. [Verification](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4708) ## What it changes `make_listed` creates a raw twin for each buffer view even when the shader translator is using the ordinary indices. On a capped view heap where `raw_views() == 0`, that twin never reaches a slot the shader reads. Skip the scratch twin when the shader translator has no twin region. Use the translator's setting because the list cache can supply a record to more than one heap. The existing stride-table test now checks the cache entry's twin flag as well as the ordinary stride for the first copy and the cache hit. ## How it was tested - Windows with Rust 1.98.1, Agility SDK 1.620.2 and WARP 1.0.22. Synthetic typed UAV and SRV records only. - The same fixture creates two records and reuses each once through `HostHeap::make_listed`. With twins disabled, main `41adb551` created two scratch twins and failed the new zero-count assertion. This patch created zero and passed. The ordinary descriptor strides matched in both runs. - With scratch twins enabled in the isolated fixture, both versions created two scratch twins. This checks that the scratch path is still available. Reads from a hardware twin heap still need a hardware run. - Staged asset policy and `git diff --check` passed. ## Checked for overlap - [x] Checked open PRs for #3807 and the list-view creation path. #3102 reuses list views across recordings. #3396 handles constant buffers on capped heaps. This patch affects list-view construction only. ## Hardware follow-up Robotniq ran two five-minute passes from the same save on an RTX 3070 Ti 8 GB with a 1M-view heap and `raw_twins=false`. The baseline reported a median 7,708 twins per frame. With `6cf5ea7` the counter never printed. All 80 descriptor-host tests passed on that system. The measured frame-rate difference was within run-to-run noise. [Hardware report](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3833) akimfomin backported the same change onto a pinned test control and repeated the same route on an RTX 4070 Ti SUPER with a 1M-view heap. Their baseline reported about 25,000 scratch twins per frame near the end. The patched run reported none, and all 71 enabled descriptor-host tests passed. Both runs reached the route and exited normally. The single 15-second pair does not establish a frame-rate change. [Ada hardware report](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3833) Prepared with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 08:49:52 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-30 09:01 UTC · original

The Windows CI job stopped at the first Clippy step with unwind_copy unused in victory-loader/src/crash.rs:804. I reproduced that diagnostic on the unmodified base 41adb551 with Rust 1.98.1/MSVC and cargo clippy --locked -p victory-loader --all-targets -- -D warnings. The CI diagnostics build and workspace tests were skipped after that first failure. CI job

The focused WARP comparison and staged asset policy passed. The upstream loader warning is already covered by #3785 and #2019.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-30 09:01 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833#issuecomment-7273643947) The Windows CI job stopped at the first Clippy step with `unwind_copy` unused in `victory-loader/src/crash.rs:804`. I reproduced that diagnostic on the unmodified base `41adb551` with Rust 1.98.1/MSVC and `cargo clippy --locked -p victory-loader --all-targets -- -D warnings`. The CI diagnostics build and workspace tests were skipped after that first failure. [CI job](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46384494414/job/141731297141) The focused WARP comparison and staged asset policy passed. The upstream loader warning is already covered by #3785 and #2019.
Author
Owner

@⁠Robotniq on GitHub · 2026-11-30 09:33 UTC · original

Tested on the setup #3807 came from: RTX 3070 Ti 8 GB, driver 621.40, Windows 11, views=1000000 raw_twins=false. Two automated 5-minute runs from the same save (boat scene, Series S, DLSS Quality, diagnostics build), with nobody at the controls:

our main (41adb551 + local commits that do not touch descriptor/) same + this PR (6cf5ea7d)
raw twins of buffer views made per frame lines 281 (median 7,708 twins and 326.5 null a frame, max 828.1 null) 0: the line never printed, so no twin was made
list calls translated, all threads, median of frames with >1,000 calls 112.8 ms 111.6 ms
world fps, median of the 5 s lines with ≥500 draws 24.0 24.9
errors only the usual Streamline presentCommon() line same

So the count goes away, as expected. There is no measurable change in list-thread time or fps in this scene; the fps gap is within run-to-run noise here. cargo test --locked -p victory-gpu --lib descriptor::host: 80 passed.

Not checked: anything visual, since nobody was watching the screen, and the city, where the list threads do more work.

**@⁠Robotniq** on GitHub · 2026-11-30 09:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833#issuecomment-7274362320) Tested on the setup #3807 came from: RTX 3070 Ti 8 GB, driver 621.40, Windows 11, `views=1000000 raw_twins=false`. Two automated 5-minute runs from the same save (boat scene, Series S, DLSS Quality, diagnostics build), with nobody at the controls: | | our main (41adb551 + local commits that do not touch `descriptor/`) | same + this PR (6cf5ea7d) | |---|---|---| | `raw twins of buffer views made per frame` lines | 281 (median 7,708 twins and 326.5 null a frame, max 828.1 null) | **0**: the line never printed, so no twin was made | | list calls translated, all threads, median of frames with >1,000 calls | 112.8 ms | 111.6 ms | | world fps, median of the 5 s lines with ≥500 draws | 24.0 | 24.9 | | errors | only the usual Streamline `presentCommon()` line | same | So the count goes away, as expected. There is no measurable change in list-thread time or fps in this scene; the fps gap is within run-to-run noise here. `cargo test --locked -p victory-gpu --lib descriptor::host`: 80 passed. Not checked: anything visual, since nobody was watching the screen, and the city, where the list threads do more work.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 10:51 UTC · original

@⁠andrewpozdnakov7-jpg @⁠Robotniq I reproduced the descriptor result on Windows with RTX 4070 Ti SUPER (617.14) and the 1M-view heap reporting raw_twins=false. I backported 6cf5ea7d onto the pinned Lab control. All 71 enabled descriptor-host tests passed. In the same native 2560×1440 Series X moving route with full stock RT, no DLSS/FG, and the same prepared cache, the baseline printed ~25k scratch twins per frame near the end, while the patched build printed none across the whole session. One 15 s pass each gave 13.42 → 13.38 median rendered FPS and 12.27 → 12.64 average. The graphics checks reached the route and normal exit. That corroborates the eliminated descriptor work on Ada. Frame pacing and FPS would need paired repeats for a performance claim.

**@⁠akimfomin** on GitHub · 2026-11-30 10:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833#issuecomment-7276175840) @⁠andrewpozdnakov7-jpg @⁠Robotniq I reproduced the descriptor result on Windows with RTX 4070 Ti SUPER (617.14) and the 1M-view heap reporting raw_twins=false. I backported `6cf5ea7d` onto the pinned Lab control. All 71 enabled descriptor-host tests passed. In the same native 2560×1440 Series X moving route with full stock RT, no DLSS/FG, and the same prepared cache, the baseline printed ~25k scratch twins per frame near the end, while the patched build printed none across the whole session. One 15 s pass each gave 13.42 → 13.38 median rendered FPS and 12.27 → 12.64 average. The graphics checks reached the route and normal exit. That corroborates the eliminated descriptor work on Ada. Frame pacing and FPS would need paired repeats for a performance claim.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-30 15:27 UTC · original · edited 2026-11-30 15:36 UTC

The existing PR branch now contains the current release main c71899d in b4575c7. This merge keeps the original fix commit and GitHub still shows one changed file.

I repeated the same fixture on WARP 1.0.22 with Agility 1.620.2. With raw twins disabled, the two synthetic records and their cache hits made two scratch twins on release main and zero with this PR. With the scratch path enabled in the fixture, both sides made two. The ordinary descriptor strides matched in all cases. The rest of the descriptor-host suite passed 84 tests on each side with one benchmark ignored.

Both local test builds included the #4018 unit-test build fix. The outgoing change passed staged asset policy. The current-base Windows CI job stopped at Clippy on unused loop_caps, unused Shadow::ranged, and the two missing card_pass arguments. The clean-main CI job reports the same four errors. The automated test step is pending those baseline fixes.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-30 15:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833#issuecomment-7283043041) · edited 2026-11-30 15:36 UTC The existing PR branch now contains the current release main `c71899d` in [`b4575c7`](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/b4575c7f6b98ecefadcfa5432fa795124f1d0761). This merge keeps the original fix commit and GitHub still shows one changed file. I repeated the same fixture on WARP 1.0.22 with Agility 1.620.2. With raw twins disabled, the two synthetic records and their cache hits made two scratch twins on release main and zero with this PR. With the scratch path enabled in the fixture, both sides made two. The ordinary descriptor strides matched in all cases. The rest of the descriptor-host suite passed 84 tests on each side with one benchmark ignored. Both local test builds included the [#4018](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4018) unit-test build fix. The outgoing change passed staged asset policy. The [current-base Windows CI job](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46450522152/job/141959457322) stopped at Clippy on unused `loop_caps`, unused `Shadow::ranged`, and the two missing `card_pass` arguments. The [clean-main CI job](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46436299889/job/141909075238) reports the same four errors. The automated test step is pending those baseline fixes.
Author
Owner

@⁠mia03ther on GitHub · 2026-11-30 16:37 UTC · original

Follow-up from #3909: I tested a local release build on top of c71899d (v2026.11.30.01) with #3833 applied on the same laptop and settings (Ryzen 9 8940HX, RTX 5070 Ti Laptop 12 GB driver 621.24, 16 GB DDR5, Windows 11 26300, console=series-s, DLSS Performance, 1M-view heap with raw_twins=false).

Startup heap line (patched run):

2026-11-30T16:08:32.783887Z  INFO victory_gpu::descriptor::host: host view heaps hold 1000000 views; view indices are clamped to the null slot at the end from the first shader on views=1000000 raw_twins=false
Metric (in-world intervals: >=1500 draws/frame / active world 12-250 ms medians) Earlier v2026.11.29.05 (89 5s blocks, 484 1s intervals) c71899d + #3833 build (224 5s blocks, 1,180 1s intervals)
raw twins of buffer views made per frame lines 484 lines (13,236–13,258 twins/frame, ~594 null late-run) 0 lines (0 raw twins made across all 56,348 frames / 22 min)
descriptor records sync ms (1s world median) 13.54 ms (279.8 pages, 241,304 slots) 12.34 ms (291.2 pages, 261,881 slots)
Late-run sample descriptor breakdown 05:37:58: 13.60 ms (3.89 asking, 6.60 reading, 2.22 making, 263.9 pages, 212,197 slots) 16:22:00: 12.04 ms (4.64 asking, 4.41 reading, 2.35 making, 285.5 pages, 256,142 slots)
World host_perf FPS median (p10 / p90) 14.9 fps (8.4 / 18.1), 67.0 ms 19.4 fps (15.7 / 21.7), 51.5 ms
frame_times p99 (world intervals) / >100 ms total frames 141.8 ms / 694 of 10,933 (6.35%) 77.3 ms / 398 of 56,348 (0.71%)

Disclosure on comparability: because the patched run moved from v2026.11.29.05 to v2026.11.30.01 (c71899d) and also included local cherry-picks (#4006, #3881, #3904, #4025) plus VICTORY_KEEP_RAM_GB=8 / VICTORY_SLOT_EVICT_PERCENT=94 (which cut eviction look time from 20.69 ms to 3.27 ms), the overall FPS and hitch gains reflect the full stack, while the complete disappearance of raw twins of buffer views made per frame lines (484 -> 0 over 22 min of city/open-world play) cleanly confirms #3833 on Blackwell with raw_twins=false. Clean exit with zero crashes.

**@⁠mia03ther** on GitHub · 2026-11-30 16:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833#issuecomment-7284964046) Follow-up from #3909: I tested a local release build on top of `c71899d` (`v2026.11.30.01`) with #3833 applied on the same laptop and settings (`Ryzen 9 8940HX`, `RTX 5070 Ti Laptop 12 GB` driver `621.24`, `16 GB DDR5`, Windows 11 `26300`, `console=series-s`, `DLSS Performance`, `1M`-view heap with `raw_twins=false`). Startup heap line (patched run): ```text 2026-11-30T16:08:32.783887Z INFO victory_gpu::descriptor::host: host view heaps hold 1000000 views; view indices are clamped to the null slot at the end from the first shader on views=1000000 raw_twins=false ``` | Metric (in-world intervals: `>=1500 draws/frame` / active world `12-250 ms` medians) | Earlier `v2026.11.29.05` (`89` 5s blocks, `484` 1s intervals) | `c71899d` + #3833 build (`224` 5s blocks, `1,180` 1s intervals) | |---|---|---| | `raw twins of buffer views made per frame` lines | `484` lines (`13,236–13,258` twins/frame, `~594` null late-run) | **`0` lines (`0` raw twins made across all `56,348` frames / 22 min)** | | `descriptor records` sync ms (1s world median) | `13.54 ms` (`279.8` pages, `241,304` slots) | `12.34 ms` (`291.2` pages, `261,881` slots) | | Late-run sample `descriptor` breakdown | `05:37:58`: `13.60 ms` (`3.89 asking, 6.60 reading, 2.22 making`, `263.9` pages, `212,197` slots) | `16:22:00`: `12.04 ms` (`4.64 asking, 4.41 reading, 2.35 making`, `285.5` pages, `256,142` slots) | | World `host_perf` FPS median (`p10` / `p90`) | `14.9 fps` (`8.4` / `18.1`), `67.0 ms` | `19.4 fps` (`15.7` / `21.7`), `51.5 ms` | | `frame_times` p99 (world intervals) / `>100 ms` total frames | `141.8 ms` / `694` of `10,933` (`6.35%`) | `77.3 ms` / `398` of `56,348` (`0.71%`) | Disclosure on comparability: because the patched run moved from `v2026.11.29.05` to `v2026.11.30.01` (`c71899d`) and also included local cherry-picks (#4006, #3881, #3904, #4025) plus `VICTORY_KEEP_RAM_GB=8` / `VICTORY_SLOT_EVICT_PERCENT=94` (which cut eviction look time from `20.69 ms` to `3.27 ms`), the overall FPS and hitch gains reflect the full stack, while the complete disappearance of `raw twins of buffer views made per frame` lines (`484` -> `0` over 22 min of city/open-world play) cleanly confirms #3833 on Blackwell with `raw_twins=false`. Clean exit with zero crashes.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 06:34 UTC · original · edited 2026-12-01 06:40 UTC

Thanks @⁠mia03ther for the laptop follow-up. The raw-twin counter went from 13,236–13,258 per frame in the earlier build to no reports across 56,348 frames in the tested build. The FPS and frame-time figures cover the release change and the other cherry-picks too. Field report

I merged current upstream main 5fabb46 into this PR at 7fa2234. On WARP 1.0.22, the same two generated records and their cache hits created 2 scratch twins on main and 0 with this PR when raw twins were disabled. With raw twins enabled in the fixture, both built 2. The expected descriptor strides matched in each case. Both revisions also passed 84 descriptor-host tests, with one benchmark ignored. The one-file staged asset check passed.

If you cherry-pick the fix, please retain its Git author. If you fold it into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

The new PR CI check and CI on clean main both stopped at Clippy with the same five diagnostics, before running tests. The descriptor results above come from the separate WARP runs.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 06:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3833#issuecomment-7303038250) · edited 2026-12-01 06:40 UTC Thanks @⁠mia03ther for the laptop follow-up. The raw-twin counter went from 13,236–13,258 per frame in the earlier build to no reports across 56,348 frames in the tested build. The FPS and frame-time figures cover the release change and the other cherry-picks too. [Field report](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3833) I merged current upstream main `5fabb46` into this PR at `7fa2234`. On WARP 1.0.22, the same two generated records and their cache hits created 2 scratch twins on main and 0 with this PR when raw twins were disabled. With raw twins enabled in the fixture, both built 2. The expected descriptor strides matched in each case. Both revisions also passed 84 descriptor-host tests, with one benchmark ignored. The one-file staged asset check passed. If you cherry-pick the fix, please retain its Git author. If you fold it into another commit, please retain `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. The [new PR CI check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46591494854/job/142450175668) and [CI on clean main](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) both stopped at Clippy with the same five diagnostics, before running tests. The descriptor results above come from the separate WARP runs.
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 origin '+refs/pull/3833/head:github-bot/gh-3833'
git switch 'github-bot/gh-3833'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3833'
git switch 'github-bot/gh-3833'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3833'
git switch 'github-bot/gh-3833'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3833'
git switch 'main'
git merge --squash 'github-bot/gh-3833'
git switch 'main'
git merge --ff-only 'github-bot/gh-3833'
git switch 'main'
git merge 'github-bot/gh-3833'
git push origin 'main'
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!3833
No description provided.