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#650
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?
@maplerouteadmin-dev on GitHub · 2026-11-25 04:00 UTC · original
On
310c6ebwithVICTORY_TEXTURE_NO_WAIT=1(see #612), the world runs at 0.8-1.1 s a frame on a Ryzen 5 5600X + RTX 5070 12 GB, and "copying back" is now one of the two largest parts of it: 125-660 ms a frame (typically 125-400), next to 350-480 ms on the GPU.The host's comparison list says where it goes (one frame-rate period, world, prison yard):
The first one is the title's 174 MB GPU-heap buffer: 365 MB compared a frame for 2.3 MB written back (99.4 % unchanged). Over the top eight, about 730 MB is compared a frame for about 36 MB that changed.
Upstream fixed exactly this last night:
I tried cherry-picking them onto
310c6eb: about 85 conflict hunks in 20 files, because they build on two upstream rewrites the fork does not have,27c3dc9(title memory at raw addresses through a page table) andc75fdba(views the shaders pick from the heap, one change journal). So it is not a drop-in; flagging it in case it fits the next upstream merge, or the idea is worth redoing on the fork's own copy-back path. Happy to measure a build that has it on this machine (12 GB NVIDIA, 6-core).@MrEjecutor on GitHub · 2026-11-25 04:24 UTC · original
A data point for this on an RTX 5060 Ti (Blackwell, driver 621.24, Windows 11 26200, Intel Core Ultra 5 225F, 32 GB, Series X profile), the mean of 60 world samples of the frame-rate line in each run:
70564ae(+ two NVIDIA boot fixes, three compute programs skipped, see Marvisak/VIctory#1968)940d32f(same, so withcd94d35)310c6eb,VICTORY_TEXTURE_GUARD=0So on this card too,
cd94d35takes copying back from the largest part of a frame to a small one, while this fork's GPU part is about three times shorter than upstream's (upstream draws a black scene here, with three programs skipped, so its GPU number is not a like-for-like comparison). Bringing the page marks over would matter more here than anything else in the frame outside the GPU.Not tested: the cherry-pick itself; the same scene in all three (different runs, different places in the prologue).
AI-assisted (Claude Code); checked by mrejecutor. No game data attached.
@firefloc on GitHub · 2026-11-25 09:56 UTC · original
Linux/RADV data point on this, plus a reachability problem for the fix.
Run:
origin/main9376fd6(merged today),VICTORY_NO_WATCHDOG=1,VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024,VICTORY_GPU_TIMING=1, title 1.0.2.1 (b99f876b74d4a77f), Proton Experimental 11.0-100 (d3d12,d3d12core,dxgi=n, vkd3d-proton), RX 7900 XTX (RADV, Mesa), 30 GB RAM.Frame line in the world:
Same shape as the report above, an order of magnitude larger:
copying back2.6 s a frame,
copies3.7 s, the card 6 % busy.Counters grow during the run (two minutes, world, uninterrupted): texture
slots placed 232 426 -> 286 489,
textures picked by index: 24 600 uploaded (9 160 MB), 17 411 waiting->waiting 22 263.Measured and rejected on this box:
VICTORY_RELAY=2(median frame 1826 ->1883 ms),
VICTORY_JOIN_COPIES=1(title buffer copies recorded per frame: 73/ 94, of them 0 continue, no effect),VICTORY_TEXTURE_NO_WAIT=1+VICTORY_WIDE_TEXTURES=1(6732 ms median in the world window, worse than 1826).The problem: the fix you name is unreachable from any ref.
cd94d35and940d32fresolve by SHA, but their parentccfb0299is not inmain, so replaying the API patch on9376fd6fails atapps/victory/src/translate.rs:568,crates/victory-gpu/src/copystat.rs:85andcrates/victory-gpu/src/descriptor/host.rs:44.Could you push that chain as a branch (or land it on
main)? It is exactly thebill we pay on Linux, and we can measure any build you publish the same day.
One question, since #821 and #676 point at the same counters: with ~20 000
textures waiting, is the intended reading that the card is full (so
VICTORY_CARD_BUFFERS_MBis the lever) or that the queue never drains?@CLHelper on GitHub · 2026-11-25 10:01 UTC · original
Is anyone porting this? If not, I'd like to take it: port cd94d35 + 940d32f (with what they need from
27c3dc9/c75fdba) ontomain9376fd6as one pull request, and measure copy-back before and after on an RTX 4060 Laptop 8 GB (on9376fd6today, in the world:copying back170 ms a frame for 64 MB).@firefloc on reaching the commits: both are on upstream
marvisak/VIctorymain(940d32f is its head as of this morning), sogit fetch https://github.com/marvisak/VIctory maingets the whole chain includingccfb029. AI-assisted.@firefloc on GitHub · 2026-11-25 10:14 UTC · original
Thanks @CLHelper — the pointer to
marvisak/VIctorymainworked:git fetch https://github.com/marvisak/VIctory mainbringsccfb029,cd94d35and940d32finto a fresh clone.And your reading of the job is right: this is not a cherry-pick. Here,
cd94d353sits 318 commits off
main9376fd6, its parentccfb0299is not an ancestorof
main, and replaying the commit conflicts in 20 files — four of them testfiles that
mainhas since removed (memory_tests.rs,semantics_tests.rs,synthetic_tests.rs,stride_tests.rs). So please take it: one integration onmainis worth more than each of us resolving the same 20 files.We will measure whatever build lands, on the machine in my comment above
(Linux/RADV, RX 7900 XTX), with the same launcher and the same
VICTORY_GPU_TIMING=1line. Todaycopying backis 2 606 ms of an 8 423 msframe with the card at 6 % busy, so a copy-back fix shows up there immediately
and unambiguously.
One note for the integration: our branch carries two loader-only patches (the
#454 watchdog hook and a
VICTORY_PATCH=<rva>:<hex>switch). They touch no GPUor shader file, so rebasing on your PR will be clean on our side.
@iGoldenNinja on GitHub · 2026-11-25 10:45 UTC · original · edited 2026-11-25 11:21 UTC
Current-main baseline for the copy-back work on an RTX 5080 16 GB, driver 617.14, Windows 11 Pro 25H2 (26200.9974), Ryzen 9 5900X and 32 GB RAM. Both Series X runs reached controllable prison using the same 90-second route and cache seed. The new copy queue and async submit were left at defaults.
At
9376fd6I measured 175.50 ms median copy-back and 136.25 ms median card fetch wait. Atf85101b6095e8cf3cecf8f0647cc7f5428daa177I measured 170.90 ms and 131.20 ms, with 5,845 median draws per frame. Displayed FPS was 3.56 and 3.86 respectively. This is one run per revision and a baseline for future copy-back comparisons. Both runs had the same eight distinct pipeline refusals and no logged device removal. Pinned reportSame-executable follow-up on
f85101bwith onlyVICTORY_QUEUE2=1added and the same verified cache seed. The copy queue was active in the prison route (median 14.5 fetch jobs and 74.9 MiB per frame, zero upload jobs). Median relay fetch wait dropped from 131.20 to 11.00 ms and median copy-back from 170.90 to 79.60 ms. In this one fixed-order pair, displayed FPS went 3.86 → 3.41 and displayed P99 376.31 → 540.96 ms. Mean GPU busy went 195.54 → 230.36 ms per displayed frame, with similar draw counts and matching pipeline refusals. Both reached controllable prison with similar rooms and the same visible courtyard tile band. Same-build comparisonI also tested
VICTORY_ASYNC_SUBMIT=1by itself on the samef85101bexecutable and cache seed. Median copy-back in the 90-second prison route was 176.55 ms with async submission, compared with 170.90 and 172.10 ms in two default runs. Displayed FPS was 3.63 vs 3.86 and 3.84. All three completed the route with the same pipeline refusals and similar visual output. Early async captures showed a performance overlay, which was absent in the post-retreat captures. This series has one async run. Three-run comparison@Proudnoob4 on GitHub · 2026-11-25 11:34 UTC · original
The same
VICTORY_QUEUE2=1pair on an RTX 4080, where it goes the other way for frame rate.Machine: RTX 4080 16 GB (driver 621.01), i5-13600K, 32 GB, Windows 10 Pro 22H2 (19045), 2560x1440, Series X. Tree:
f85101bplus the Agility SDK exports for Windows 10 (nothing else), diagnostics build (for the scripted menu keys), its own cache warmed withtranslate --warm. Common switches:VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_PIPELINE_WORKERS=8 VICTORY_GROUP_SYNC=2 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MB=1024 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_REHASH_RUNS=1 VICTORY_JOIN_COPIES=1 VICTORY_SHADER_LOOP_LIMIT=1024, noVICTORY_GPU_TIMING. 600 s into the cell; medians over the 5-second frame lines with more than 1,000 draws.f85101bVICTORY_QUEUE2=1, run 1VICTORY_QUEUE2=1, run 2ASYNC_SUBMITINDIRECT_WINDOWTEXTURE_NO_WAITSo here the copy queue is about +10-24% on its own (two runs each), where @iGoldenNinja's 5080 pair above went 3.86 -> 3.41. On this card the copy-back thread was on the critical path; with the copy queue it is no longer the longest thread. For scale, skornuta's tree with the same switches gives 5.3 fps in two runs.
Picture: as in your pair, a band shows with and without the copy queue (mine is in the cell, along the bottom of the screen, so it may or may not be your courtyard one).
f85101bdraws a blocky band there (grey blocks at the left, a broken band from the middle to the right): 4 of 5 world frames at defaults (frames 4096-4600 of one run; frame 4096 of another run is clean) and 5 of 5 withQUEUE2(four withQUEUE2alone, one with all the switches; light-blue blocks along the very bottom are stronger). So it is not the copy queue. For comparison,skornuta/victory-forkat9292987with the same switches, same machine and same scene has no band in 5 of 5 world frames (4096-4800), so on this card it is somethingf85101bdraws and that tree does not, if anyone wants to bisect it. No device loss in any of these runs.If it helps I can run
QUEUE2withVICTORY_FILL_WAIT=1, or with anything you want logged, on this machine.Runs, captures and numbers from my machine; analysis and write-up with Claude Code (Claude Opus 5.5) at my request. No game files attached.
@chazi123 on GitHub · 2026-11-25 13:23 UTC · original
Adding a measurement from the same lineage on a different card, because your number and mine line up and that may say something about where the copy-back time actually goes.
RTX 3060 Laptop 12 GB, Windows 10 19045,
victory-amd(the sibling fork, not this one) — world, 2560x1440, one frame line at 1540 draws:Your 4060 Laptop 8 GB on
9376fd6: 170 ms / 64 MB. Mine: 178.9 ms / 47.8 MB. Same order, and in both cases the MB written back is far smaller than the MB examined — so this is not a bandwidth problem on either machine.The part that may matter for your port: in victory-amd the comparison is not done on the CPU at all. Its per-frame lines say
So of the 178.9 ms, the CPU-side compare accounts for 29.6 MB in 288 ranges, and the rest runs as 303 hash passes over 1,104 pieces in card memory, plus 81 compare passes — and the log itself notes that
VICTORY_CARD_REHASH_RUNS=1would join the hash passes, but it is off by default.The relay breakdown, same frame:
That is, most of the 178.9 ms is 79.3 ms waiting for fetches of the card copies' pieces plus 53.8 ms idle waiting on the card, not comparing.
Two things I would ask before you measure, and they are the reason I am writing rather than just +1:
cd94d35aimed at the CPU-side compare, or at the card-side hash? If the mark is per 64 KiB title page set by the translation, then in a tree that compares on the card it would cut the "pieces" that get hashed (1,104 a frame here) rather than the 288 CPU ranges. If it only cuts the CPU compare, a tree like this one would keep its 303 hash passes and your before/after on9376fd6may not transfer.VICTORY_RELAY? In victory-amd the copy-back is done by a landing thread beside the submitting thread, and the flights are sent ahead. A page-marking scheme that assumes every submission has completed (the way the current compare does) may need to be kept in step with the flights.inplace.rsthere has the same warning for a different reason ("do not combine 2 with late wait").If you want a second absolute number to check against, the same tree with relay off is 289-437 ms on the GPU and 504-1300 ms a frame, so copy-back is roughly a third of the frame in both configurations here; it is not a RELAY artefact.
Practical note on your plan: measuring copy-back before/after on an 8 GB 4060 Laptop is worth doing with a fixed scene (a checkpointed interior frame) and the median of 10 frame lines, not the first line after the world loads — in this tree the frame time swings between 160 and 2,013 ms in the same run depending on what the title is streaming, so a single line can look like a 3x win or a 3x loss.
Patch/notes for the tree I am on, if it is useful for comparison: https://github.com/chazi123/xcl-chazi/tree/main/victory-amd-win10-nvidia
@CLHelper on GitHub · 2026-11-25 13:25 UTC · original
Measured before starting the port, and it changes what the port is worth on current
main.Setup:
main0b0074e0, RTX 4060 Laptop 8 GB (NVIDIA 576.80), Windows 11, Series X, release build, defaults (relay on) plusVICTORY_SHADER_LOOP_LIMIT=256 VICTORY_CAPPED_DYNAMIC=262144 VICTORY_D3D12_DRED=1, warm cache, a person walking the first rooms. 37 world samples of the frame line (>= 3,000 draws):Where the copy-back goes here: the big buffers are copies in the card's memory (
host copies in the card's memory: 97 copies 941 MB; the first such line,1 copies 174 MB, is the GPU-heap buffer of this issue), compared on the card: 13,000-20,000 pieces a frame, of which 750-1,400 are fetched (49-92 MB) with 5-7.5 more waits for the card (119-266 ms). The relay line splits the landing thread's 126-185 ms into 100-155 ms waiting for fetches of card copies' pieces and 19-65 ms waiting with nothing to land. The CPU-sidecomparedlist is small: the largest range is 5 MB a frame, the rest under 2 MB (312 ranges).So: cd94d35's marks replace the snapshot-and-compare of the declared ranges. With the copies on the card, that compare already runs on the card and is not the cost here; the fetch and merge of the pieces that did change stay the same with marks. On this configuration the port would save little; the lever is the fetch waits (
VICTORY_QUEUE2/VICTORY_CARD_FETCH_INFLIGHT, which iGoldenNinja and Proudnoob4 are measuring above).It matters where copies are in the PC's memory, as in the original report (
310c6eb, 365 MB compared a frame) and maybe in @firefloc's run (2.6 s copying back on RADV). @firefloc: does your log have ahost copies in the card's memoryline, and what are the largestcomparedranges? If the big ones are compared on the CPU there, a first increment is worth doing: marks for root UAVs only (host words instead of a heap table), used to shrink whatrelay_hand_backcompares, with the snapshot kept as the merge reference. A literal port is out: cd94d35 sits on five upstream commits fxceless does not have (0b35b7fe,d71c3889,6d021fe3,27c3dc9,c75fdba), each conflicting on its own (9-28 files). I'll hold the port until that answer; on a card-copy configuration I would rather not land 1,000 lines that do not move the frame. AI-assisted.@fubukiclears on GitHub · 2026-11-25 16:53 UTC · original
That 174 MB buffer is three things glued together, and only one of them changes per frame. From the exe
(
0x1e86440): it's windows 2+3+4 of the 185 MiB 32-bit pool. Window 2 (27 MiB) is the per-frame constant/upload ring (216 x 128 KiB chunks); windows 3 and 4 (47 + 100 MiB) are shader/PSO/command-stream heaps
that barely ever change. The ring allocates downward from each chunk's top, and chunks are fence-stampe
d on submit, so only
[write pointer .. chunk top]of the chunks a submission touched can have changed.Allocator entry points, cursor fields, the chunk queue and the stamps are all in Marvisak/VIctory#2609 (
section 2), in case it helps whoever ends up doing the page-mark port.