RTX 4090: ~70 ms of a 153 ms frame is the submitting thread waiting, from the skinning passes' whole-heap declaration (frame critical path, three failed fixes) #1253
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?
Imported from fxceless/victory-fork. Originally posted by Yorivel on 2026-11-26T03:16:38Z.
AI-assisted (Claude Code). Numbers and log lines only, no game data.
RTX 4090: ~70 ms of a 153 ms frame is the submitting thread waiting for flights, and almost all of it traces back to one thing. The skinning passes' view covers the title's whole 174 MB heap, so every CPU-side fill, copy and refresh in that heap waits for them. Three cheaper fixes tried here failed; numbers below so nobody repeats them.
Setup. RTX 4090 24 GB (32-lane waves), driver 621.40, i9-14900K, 64 GB, Windows 11, Series X profile, diagnostics build, the barracks after the hand-off, settled. Tree:
main085ee7c+ #994 (with #854/#993) + #346 (named windows declared only when marked) + #500 + #501 + #1188. Structure builder on,RELAY=2,VICTORY_BACK_QUIET=1+VICTORY_BACK_OWN_VIEW=1and the README's speed set. 153-168 ms a frame (6.0-6.4 fps), 0 exceptions.The frame, from the frame log's "usual frame" line
The submitting thread and the card take turns, and each waits for the other.
Why the thread waits ("of the waiting for the card in settles, by what settled")
What they read, from
fill_check:0xdc07ea300/0xdc07eab00) to a new place in a ring (0xd1f3…) every frame. Every check found 1-7 source bytes changed by the flights and 0 destination bytes, so the wait was needed for its source.fill_aheadturned itself off for good at frame 1127, on that same block: "a fill of upload memory read 2048 bytes at 0xdc07eab00 … ahead of a flight whose shaders changed them … Fills wait for good."17af15c4015cb4b6,55679a0547649d0b, … through the view at offset 5920 of the bindless table). Every fill, copy or refresh anywhere in the heap collides with them.Tried and failed (all local experiments, off by default)
VICTORY_CB_DIRECT, afterroot_viewandcopy_on_card). The read settles fell 49.9 → 21.2 ms. But "changed under shader writes" rose 21.1 → 40.1 and preparing 71 → 87: each constant now needs a refresh of the title's CPU-written bytes, under the same declaration. Frame 153 → 171-184 ms.VICTORY_MERGE_RUNS=8192. "Changed under" went to 0, but "title memory read" rose to 274 ms; frames of 390 ms to 2 s.VICTORY_NARROW, with 64 frames of learning first and a safety net). The safety net fired every time narrowing came on (frames 3148 and 3212, new pages each time). The passes' writes move through the heap, so recent pages don't predict the next frame. A GPU-side page mask would only say where writes landed after the fact, so it would not help either.What that leaves
The bytes that cause the waits are pure card-to-card data: shaders write them, and a constant buffer and a copy that later shaders read take them in. The title's CPU never reads them. Only taking those steps off the CPU removes the wait: running them on the card in queue order, as avatarmanz/VIctory-7900XTX's
VICTORY_CARD_STEPSdoes (its notes measured the same wait at 25-30 ms of a 105 ms frame on AMD). Its version depends on much of that fork's submission pipeline. On this 4090, that tree with card steps on and gomeaw's descriptor fixes ran 203-245 ms a frame without the builder, so card steps alone don't close the gap on NVIDIA either.What I can provide: the frame logs, and the three experiments as patches, if any of it helps.
Imported from fxceless/victory-fork. Originally posted by HLVM04 on 2026-11-26T03:25:59Z.
One data point on the "changed under shader writes" part (your 21.1 ms row and experiment 2), from an RTX 5070 Ti, Ryzen 7 9800X3D, Windows 11, Series S profile, on a local stack based on fork main
0b0074eplus several open PRs (not your tree):VICTORY_MERGE_RUNSto 65536 was slower for us too (119 ms median against 101), which matches what you saw with 8192.Limits: a handful of runs, a different scene and card, and it does nothing for your larger 49.9 ms "title memory read" row. The change is not a PR.
Edit (2026-11-26), correction on the merge deferral: the local "defer merges past the run cap to the next submission" change above made draws read stale bytes: over-budget title changes under shader-written ranges landed a submission late (with ray tracing on, the main character's skin draw lost its geometry). Please don't copy it as described. Our replacement merges every run at once and joins nearby runs (gap of 64 bytes); it is as fast on our stack (in-world ~45–46 ms) and the skin draw is back with ray tracing on. Exact merging without the gap was ~300 ms a frame. The 101 → 91 ms figure above was for the old, deferring version.
Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-26T23:07:23Z.
Same block, same waits, on another card, plus two more fixes that failed and one measurement of what the waits cost. In case it saves someone the runs.
Setup. RTX 3090 Ti 24 GB, Ryzen 9 9950X3D, 64 GB, Windows 11 26200. Tree: #994's head (with #854/#993) + #911 + #868 + the descriptor part of #1117 and some changes of ours (
integration/v8). Series S profile, the ray-tracing resolve shaders skipped (thert_off_hashes.txtlist of #1268), structure builder off,RELAY=2,JOIN_PARTS=1, small buffers on the card. Prologue cell, hands-off, 5 to 6 minute runs, one run per row.What the waits cost here. 53 ms a frame. The submitting thread prepares for about 32 ms and stands waiting for the card 15 ms; the card runs about 38 ms a frame (the title's lists 28, our send-and-hash lists 4.5, our compare lists 5.5) and is idle 14 to 17 ms "behind us". A counter on the submissions that wait says where that idle time is:
So the frame is about the card's work plus the preparing of those two submissions, during which the card has just finished everything.
The block. As you describe:
fill_aheadturns itself off on a fill of 2,048 bytes of write-combining memory that shaders rewrite (first changed byte at offset 4 or 16), and from then on the title's 2 KiB copy from the same place into a ring waits, twice a frame ("title memory read: by a buffer copy 1.9, by a fill 0.2").VICTORY_FILL_WAIT=never)VICTORY_JOIN_MOST=1(parts not joined)VICTORY_JOIN_MOST=8 VICTORY_JOIN_LISTS=96VICTORY_WIDE_REFRESH=1VICTORY_SKIP_WC_COMPARE=1with copies under 1 MiB left aloneThe 45.5 ms row is what a fix that keeps those bytes on the card could gain on this card; nothing cheaper worked here either.
A side finding from the unjoined run: on our tree the print on the back of the shirt is missing in the cell with parts joined and there with
JOIN_MOST=1. Joined parts are prepared together, so a later part's texture refresh reads title memory before an earlier part's texture read-back has landed. Not joining a part behind parts whose shader-declared ranges or texture read-back ranges it reads on the CPU brings the print back for one more submission a frame (53.3 → 55 ms): f420f2a. Declared buffer ranges alone did not; the read-back ranges did. Whether fork main loses the print the same way withJOIN_PARTS=1I have not checked.Numbers and text only. AI-assisted (Claude Code, Claude Fable 5.2).