raw_twins=false hosts (NVIDIA, 1M view heap): list views still make a raw twin of each buffer view (~12k-18k a frame) that no shader reads; the frame line's ~500-650 "null" twins a frame are not a rendering bug there #3807
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#3807
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Robotniq on GitHub · 2026-11-30 07:43 UTC · original
System
--profile diag --features diagnostics) of41adb551(v2026.11.29.05), plus a few local commits that do not touch the code cited below (crates/victory-gpu/src/descriptor/is identical to41adb551)views=1000000 raw_twins=falseSummary
On this card the frame line says ~500-650 raw twins a frame (median) do not begin on 16 bytes, and that every one of them is null. That looks like what #2248 found on AMD: shaders reading zeros. On a 1M-capped heap it isn't that. Raw twins are off (
raw_twins=false), so the heap has no twin region and translated shaders read the title's slots in place. The twins being counted come frommake_listed, which always makes a twin for a list view, and they are never copied to a slot a shader reads.So on these hosts the line is misleading, and making the twins is wasted descriptor work: about 12,000-18,500 extra buffer views a frame here (session means), plus a null view for each unaligned one (about 3.5-4 % of them).
We found this by reading logs and code, not from a visual bug. We first read the line as a rendering bug, but the code says it is not one on this host.
Evidence
Example frame line:
The heap line is the same in every session:
The table covers four sessions with our usual launcher settings. None of
VICTORY_RAW_VIEWS,VICTORY_LIST_VIEWS,VICTORY_VIEW_COPYorVICTORY_PORT_CBVis set. Only frame lines with at least 5,000 twins a frame are counted, as a rough cut that drops menus and loading:Across all ten sessions that day (6,972 frame lines, some sessions with test switches), the "do not begin on 16 bytes" count equals the null count in every line. No twin was ever moved.
Where in the code (at
41adb551)crates/victory-gpu/src/descriptor/host.rs:2899:let twins = raw_twins() && fits(2 * RAW_TWINS);needs a shader-visible heap of 2^22 views (RAW_TWINS= 2^21). The driver caps heaps at 1,000,000, soset_raw_viewsis never called (:2901) andvictory_shader::emit::raw_views()stays 0. Withraw == 0the heap'stwinsvector is empty (:3136), soHostHeap::twin()(:5014) isNonefor every slot.crates/victory-shader/src/emit/lower.rs:8303-8315(raw_twin):let first = super::shader::raw_views(); ... if first == 0 || ... { return (index, false); }. Without raw views, shaders keep the title's index and never address a twin.host.rs:4973(inmake_listed):make_twinned(&view, views.slot(at), Some(views.slot(at + 1)))always passes a twin slot. At:4950-4957the twin is copied into the heap onlyif made.twin && twins. Heretwins(self.twins.get(index).is_some()) is false, so the code goes toclear_twininstead, which does nothing. The othermake_twinnedcallers (:4919,:5572) passself.twin(index), which isNonehere. So every twin counted on this host is a list view's.host.rs:6188(inbuffer_srv) and:6312(inbuffer_uav): A list view's twin is inviews.slot(at + 1), never in the staged slot, somove_rawis never tried for it, on any vendor.move_raw(:6044) also only recognises an AMD raw-buffer descriptor (address in words 0-1, size in word 2).TWINS,host.rs:6036) are printed bycrates/victory-gpu/src/descriptor.rs:971-978(sync_line) whenever any twin was made, whether or not the heap has twins. By the same code, the line's own label "(VICTORY_RAW_VIEWS=0: none)" is not right either. WithVICTORY_RAW_VIEWS=0the heap has no twins, as here, but list views still make and count them. We did not run with that switch.ListViews::SLOTS(8,192,host.rs:10349) slots; the second is for its twin.A possible change, not tried: in
make_listed, passNoneas the twin whenraw_views() == 0, and only count or print the twin line when raw views are on. The globalraw_views()looks safer thanself.twins.is_empty(). The list-view cache is per thread and keyed by the record, not by the heap, so an entry made for one heap can be copied into another. Hosts that do have twins would be unchanged. Optionally, list views could take one slot instead of two there.Related
move_rawfix unaligned list-view twins in place. It was tested on an RX 9070 XT (~870 null a frame down to 0), and #1165 confirms the AMD tree flicker is gone with it.move_rawnever applied. It was tested only on an RX 6800 (0 null and up to ~1,100 biased a frame); whether the flicker is gone was not confirmed.raw_twins=falsehost, because shaders there don't read twins. #3396 describes the sameraw_views() == 0state on NVIDIA for constant buffers. By this reading of the code, #2248's descriptor part should not change what is drawn on NVIDIA, so NVIDIA reports of the tree flicker (#1165 on an RTX 3080, #3142 on an RTX 5070 Ti) would need another cause. That is an inference from code; we did not test it.make_listedat 30.1 %,make_twinnedat 12.5 % andbuffer_srvat 8.1 % of the list threads' samples, with ~9.6k twins a frame. Those percentages are inclusive and cover the main views too, so the twins' share is not known. #3102 (open) reuses list views across recordings, which would cut the count, but it still makes a twin for each.What is not known
3711fdad456538a1reads as raw bytes, which theraw_twincomment names. That is a different path from the twins.move_rawwould recognise NVIDIA descriptors, or whether a recording ever fills the 8,192 list-view slots.