Skip to content

Skip unused raw twins for cached list views - #3833

Open
andrewpozdnakov7-jpg wants to merge 1 commit into
trustno1-coder:mainfrom
andrewpozdnakov7-jpg:fix/3807-unused-list-view-twins
Open

andrewpozdnakov7-jpg wants to merge 1 commit into
trustno1-coder:mainfrom
andrewpozdnakov7-jpg:fix/3807-unused-list-view-twins

Conversation

@andrewpozdnakov7-jpg

@andrewpozdnakov7-jpg andrewpozdnakov7-jpg commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3807.

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

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

The Windows CI job is still blocked by the unwind_copy warning reproduced on base 41adb551. CI diagnosis

Prepared with Codex.

@github-actions github-actions Bot added the pr-performance Pull request: makes it faster or use less memory label Nov 30, 2026
@github-actions github-actions Bot changed the title [pr-performance] Skip unused raw twins for cached list views Skip unused raw twins for cached list views Nov 30, 2026
@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor Author

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.

@Robotniq

Copy link
Copy Markdown

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 (41adb55 + local commits that do not touch descriptor/) same + this PR (6cf5ea7)
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.

@akimfomin

Copy link
Copy Markdown

@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.

moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…ed list views), test kept on HEAD's uint_uav

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-performance Pull request: makes it faster or use less memory

Projects

None yet

3 participants