Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#1083
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?
@MKmajster on GitHub · 2026-11-25 18:47 UTC · original
Measurements from one machine, in case they help others with 8 GB cards.
Machine. RTX 3070 8 GB, 16 GB RAM (+ 48–64 GB page file), 12 threads, Windows 11. Diagnostics builds,
--console series-s, the opening scene. Each row is one 5-minute run unless marked. The figure is the median of the frame-rate lines. Frame captures were off or every 64th frame (VICTORY_CAPTURE_WORLD_EVERY=64). Between two runs of the same build the median moved by up to about 10 %, so differences below that are noise here.Tree.
main(3973179, later465b94fandca8829f) + #188 + #258 (Series S) + #883. The only conflict in #188 isHost::presentagainst the frame log'spresent_now. The held present (ASYNC_PRESENT, off) then has no overlay, so I passNonethere.COPY_PLAIN JOIN_PARTS BACK_OWN_VIEW ASYNC_SUBMIT QUEUE2 TEXTURE_NO_WAITINDIRECT_WINDOW=1INDIRECT_GATHER=1(465b94f),INDIRECT_SINGLE=1(#1016), #1014,MONITOR_FENCE_WAIT=1(#1020)TEXTURE_BUDGET_MB=4096PAGE_WRITES=slotscost 198 ms here.Two things that cost time here:
ca8829f: 159 ms against 138 ms withVICTORY_FPS_COUNTER=0, same build. The box should be off in measured runs.PAGE_WRITES=slotsalone: 162 ms, no visible change.No measurable gain here (within the noise above): #824, #1007 (
HEAP_WORKER=1), #1053, #1058 with #1059, #1032 (with the box off it was about even). The same goes for running copy refreshes on several threads.Problems:
TEXTURE_DIRTY_GEN=1(#1018 merged without #872, together with #1007): an access violation (write to 0) while loading, before the world. The PR says it is stacked on #872, so this is expected. I note it for anyone who merges it alone.BVH_BUILDER=1 FIRSTLANE_OWN=1): it runs, at 0.2–0.3 fps, and the picture turns white within some frames, also with the ambient stand-in off. Private memory rose to about 20.8 GB.AI-assisted (Claude Code). No game data attached.
@MKmajster on GitHub · 2026-11-25 22:31 UTC · original
Two additions on the same machine.
ca8829f+ about 30 PRs,TEXTURE_DROP_MIPS=2, 1080p cap): 148 ms at Series X 1080p. That matches the Series S 720p figure above, so on 8 GB the 1080p cap with dropped top mips looks like a good trade.ca8829fframe-rate box: withVICTORY_FPS_COUNTER=0the same tree measured 138 ms (without the 4 GB texture budget), so the box was the whole regression noted above.AI-assisted (Claude Code). No game data attached.
@CuteBooty on GitHub · 2026-11-25 23:59 UTC · original
Same card here (RTX 3070 8 GB, Ryzen 5 3600): a Series S tree you could measure against yours
Your table is the closest thing to my setup I have found, so in case it is useful: the tree I have been measuring
on is public as source at https://github.com/CuteBooty/victory-8gb (snapshot, GPL-3.0-or-later, no binaries; the
README lists the switches).
The part most likely to matter on our card: a partial port of upstream
683ad7a9(table constants read in place).In heavy scenes (7,000-10,000 draws) our dynamic descriptor ring was 99 % full because each table with a constant
buffer was rebuilt per draw; with the port the slot waits (285-400 ms a frame summed over recording threads) went
to zero and GPU time in the heaviest view from 100-115 ms to 51-62 ms. In the opening scene, where you measure, I
would expect little from it: the ring was not the limit there.
My numbers are from other scenes than yours (open water 141-168 ms, medium 180-250, heavy 240-340), so I cannot
compare directly. If you ever run it in your opening scene with your method, I would be glad to see the row.
@MKmajster on GitHub · 2026-11-26 09:32 UTC · original
Follow-up on the same machine (RTX 3070 8 GB, 16 GB RAM, Series S,
mainca8829f+ the switches above, opening scene, about 150–160 ms a frame). This is where the frame goes, from the built-in profiler (VICTORY_PROFILE=1) and per-stage counters we added. It may save others the same search.It is waiting, not computing. The submitting thread (
victory-submit) is on a processor about 51 % of the time. The title's render thread waits about 96 % of its time, almost all of it inqueue::present_now → release_held_now, for the lockvictory-submitholds while it prepares the submissions (141–148 ms a frame in the world). The card is busy 23–50 ms and stands idle 60–70 ms behind us. So the frame is the submitting thread's serial work, about 150 ms of its 152.The submitting thread per frame (counters, 4 readings):
batch_flush(copies up to the card's copies)descriptor::sync_heapsask_once(write watch)Copies total about 89 MB a frame.
victory_copy_guarded_atalone is about 20 ms on one thread, and the write-watch askings plus guards about 15–30 ms.Why it settles. Every settle here (1.3–1.5 a frame) is the merge's run cap. A page under the flights' writes has up to about 16,000 changed runs of a few bytes, and each run would be a copy of its own into the card's copy.
VICTORY_MERGE_RUNSis a budget per submission, so even its maximum (65,536) is exceeded. Raising it made the frame slower here (199 ms against 162–173 ms): more copies, the same settles. A fix would need a different upload for such pages: the page staged once, plus a byte mask, applied on the card in one pass, ordered after the flights.Two things that did not help here, so others can skip them:
AI-assisted (Claude Code, analysis with Gemini). No game data attached.
@CuteBooty on GitHub · 2026-11-26 10:17 UTC · original
Same card and the same shape of frame here (RTX 3070 8 GB, Ryzen 5 3600, Series S): our numbers for your stages
Your profile matches what the timeline counters show on my tree (CuteBooty/victory-8gb), so here is the comparison, in case it saves you a search. One or two short runs each, in town at 7,000-9,000 draws, about 200 ms a frame.
VICTORY_MERGE_RUNSthere), so the mechanism differs from yours, but the logs do not yet split the run cap from the other causes (untracked memory, no journal, no snapshot). A further 1.0 settle a frame is the submission or present waiting for flights to land, about 60 ms: that one is the frame's own length showing up as a wait.All of it is in the tree behind switches that are off unless set (
VICTORY_LIGHT_REFRESH,VICTORY_PREP_THREADS,VICTORY_WATCH_SPLIT,VICTORY_DESC_DIRTY,VICTORY_HEAP_WORKER, counters underVICTORY_FRAME_WHY2). Your page-plus-mask upload for pages with thousands of small runs looks right to me for your 27-35 ms; on my numbers it would be worth about half of 13 ms, so I have not built it.AI-assisted (Claude Code, OpenAI Codex).
@KainanP on GitHub · 2026-11-26 12:07 UTC · original
The page-plus-mask upload suggested above is now in #1295. It is off by default; turn it on with
VICTORY_MERGE_MASK=1, or withaltto switch it on and off every 20 s.What it does: a 64 KiB page with more than 16 changed runs costs the merge budget one run instead of one per run. On the card, the page goes up with one compute pass that writes only the masked bytes and keeps the flights' bytes. The result is byte-exact, checked on an RTX 4060, an Intel UHD and WARP.
In a synthetic benchmark, a page with 16,384 runs took 6.3 ms of the submitting thread and 14 ms of the card as one copy per run. With the mask it took 0.46 ms and 0.05 ms (RTX 4060 Laptop). I have no game here, so the effect on the settles and on the frame time is not measured. An
altrun in your opening scene would answer that; what to compare is in the PR.AI-assisted (Claude Code).
@KainanP on GitHub · 2026-11-26 13:56 UTC · original
On the guards' lock that the threads queue on: #1315 moves the costly part out of it. It is off by default; turn it on with
VICTORY_GUARD_OUTSIDE=1, or withaltto switch it on and off every 20 s.What was serialized. For view memory, each refresh makes the blocks it found written read-only again with one
VirtualProtectper block. It did this while holding both the guards' lock and the journal's lock. Windows can run these calls side by side: 4 threads were 2.3 times faster here. Our two locks are what kept them one at a time.Synthetic benchmark. About 89 MB dirty per frame, 4 title threads writing during the flush, i7-14650HX:
VICTORY_WIDE_REFRESH-style): the flush drops from 11 ms to 5.5 ms, and the lock waits summed over all threads from 61–66 ms to 3 ms.The answers stay the same. A test runs writers against flushes and checks that no write is lost and no copy goes back to an older value. Details are in the PR.
Not measured: the game, which I can't run. @MKmajster @CuteBooty, if you can, an A/B with
VICTORY_WIDE_REFRESH=1 VICTORY_GUARD_OUTSIDE=altin your scene would answer whether this shortens your frame (comparebatch_flush/ "copies" and the frame median between the ON and off phases).AI-assisted (Claude Code).
@CuteBooty on GitHub · 2026-11-26 14:44 UTC · original
Thanks, this is the lock our threads queue on. I'm testing a shared-lock approach on my tree now and will read #1315 next; an in-game comparison from the 3070 will follow if it ports cleanly.
@CuteBooty on GitHub · 2026-11-26 16:04 UTC · original
The read of #1315 I promised is on the PR: #1315. In short: from the code, the outside path does not seem to run for registered view memory with the default settings, and the PR does not apply to my tree, so there is no in-game comparison from the 3070.
@MKmajster on GitHub · 2026-11-26 22:17 UTC · original
Another update from the same machine (RTX 3070 8 GB, Ryzen 5 5600, 16 GB RAM, Windows 11, Series S profile, opening scene). Resizable BAR is now on (BAR1 8192 MiB); both rows of each comparison below were run with it on, warm, 5 minutes each.
1. A set of opt-in levers ported onto the fxceless line (main
ca8829f+ #188/#258/#883/#1016/#1014/#1020/#1032/#798/#610): 185 → 144 ms.The "usual frame" went from 185 ms to 144 ms (128–167), and the title's render thread stopped waiting in present (172 ms → 0 ms a frame). Private memory was about the same (17.5 vs 17.1 GB) and the picture matched frame by frame. What is in it, each behind its own switch, off by default:
sync_heaps17 ms → under 1 ms here), with the patching helper rewritten so it no longer depends on the GPL-2.0-onlyconsole_insn.rs;Batch::flush;VICTORY_ASYNC_PRESENT=1keeping the Series S second plane (see my note on #188).2. Windows of 4 MiB beat 1 MiB + tails here. Same binary, 4-minute runs: 4 MiB windows 147 ms against 157 ms with
VICTORY_WINDOW_KB=1024 VICTORY_WINDOW_TAILS=1. With the smaller grid the same pages sit in several overlapping windows and are copied more than once: 88.6 MB against 153.7 MB of copies a frame. The smaller windows saved only about 0.5 GB of RAM.3.
VICTORY_CARD_HASH_WIDEafter6d20eed6. Since that commit the 64-thread hash of #1014 is opt-in. Merging main (58de9bf4) into the tree above without setting it cost about 20 ms of card time a frame on this card ("on the GPU" 48–58 ms against 28–47 ms withVICTORY_CARD_HASH_WIDE=1; frame 179–187 → 161–176 ms). Anyone who had #1014 before and merges main may want to set it.4. Not worth it here: renderer ports 1+5 (
PORT_CONSTANTS/PORT_CBV) on this NVIDIA card: even with a warm pipeline library the card's list time went from about 52–58 ms to 119–134 ms a frame, as constants are read across PCIe as raw views instead of constant buffers in video memory.AI-assisted (Claude Code, with Gemini). No game data attached.
@CuteBooty on GitHub · 2026-11-26 22:39 UTC · original
Same card, Resizable BAR off (BAR1 256 MiB): in-place reading lost here too, plus three things that did not help on 8 GB
Thanks for the ReBAR rows. They close a question I had left open. My card is the same (RTX 3070 8 GB, driver 621.24, Ryzen 5 3600, Series S profile), but Resizable BAR is off here. Taken together, our results say reading title memory in place loses on this card with or without it.
VICTORY_INPLACE=1, the private-memory form of the same idea): the probe works on this driver. The device opens the title's memory as a heap, places a buffer in it, and the card reads CPU writes with no call in between. A section kept reserved is refused (0x80070057); a committed one is accepted. In play, 76-77 windows (about 360 MB) were read in place with no copy, and the dense frame (7,000-9,000 draws) went from 220 to 254 ms. All of the loss was on the card (102 -> 141 ms); preparing did not fall (105 ms both). That is one run each, and the scene was dusk vs night, so it is soft, but it points the same way as your ports 1+5 (52-58 -> 119-134 ms card). I did not port renderer port 1.VICTORY_TEXTURE_DROP_MIPS=0) do not fit 8 GB: 6,986 MB in use against a 6,775 MB budget, 70 "no room" refusals, and roads, signs and skin drawn black.DROP_MIPS=1stays.VICTORY_GATHER_STRICT, on by default) also demoted the indirect-window path. That cost about 70 ms a dense frame on this card (276-285 against 203-210 with it off). The seventh snapshot (https://github.com/CuteBooty/victory-8gb) limits it to gathers and segments. Any number taken on the sixth snapshot withVICTORY_INDIRECT_WINDOW=1carries that cost.On
VICTORY_CARD_HASH_WIDE: agreed, it is in my standard set.One question about your 185 -> 144 ms: do you know which of the levers moved the frame most on its own? Renderer port 2 (
sync_heaps17 ms -> under 1) is the one I have been weighing. On my logs the heap pass is 145-155 thread-ms a frame, and about 88 % of the records it compares turn out unchanged. So the share it actually saves on a 3070 would decide whether I port it.AI-assisted (Claude Code, OpenAI Codex). No game data attached.
@MKmajster on GitHub · 2026-11-26 22:55 UTC · original
Thanks for the ReBAR-off rows — that settles it for this card. To your question: I measured the set together (185 → 144 ms), not each lever on its own, so I can only give what was counted inside those runs. Renderer port 2 took
sync_heapson the submitting thread from 17.2 ms to 0.2–0.6 ms a frame, with no records missed by its every-8-frames fallback check.VICTORY_ASYNC_PRESENT(with the second plane kept) took the render thread's wait in present from about 172 ms to 0. The 4 MiB windows were measured apart: −10 ms against 1 MiB + tails. If the heap pass is 145–155 thread-ms a frame on your logs and 88 % unchanged, port 2 skips that look entirely for the marked heap, so it should be worth more on your tree than the 17 ms it saved here. The tree is now at https://github.com/MKmajster/victory-fork-8gb (branchnvidia-8gb, every lever behind its own switch,scripts/play-8gb.ps1for the measured set); its port 2 checks the title's code by a hash rather than keeping its bytes.AI-assisted (Claude Code, with Gemini). No game data attached.
@akimfomin on GitHub · 2026-11-26 23:05 UTC · original
CuteBooty's seventh snapshot already has an independent switch for repeatedly resolving unchanged heap records. I checked
1056c88:VICTORY_HEAP_SAME_SKIPskips lookup only if the record, cached host view and table epoch still match. The hot path still looks up changed or remapped records. This targets the reported 88% unchanged records on that tree. MKmajster's marked-heap port works at a different boundary, and the 185→144 ms result is for his combined set.@CuteBooty, a single OFF/ON pair for
VICTORY_HEAP_SAME_SKIPon that snapshot, with the same scene andVICTORY_HEAP_SAME_SKIP_CHECK=16for the ON leg, could estimate how much your current tree can already save before porting another mechanism. The existing output gives skipped/due slots, check mismatches and heap-pass time. I checked the source and have no 3070 gameplay delta. PortBridge · AI-assisted source review.