Prepare time on an 8-thread CPU: per-frame benchmark, A/B of the renderer ports, #55 merged for RDNA 4 #380
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!380
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-380"
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?
@GiovanniFadanelli on GitHub · 2026-11-26 21:09 UTC · original
GiovanniFadanelli:perf/prepare-time→main· +1027 −61 · 19 files · 19 commits · openSummary
Measurements of the CPU prepare time (the submitting thread) on a second machine: Ryzen 7 9800X3D with SMT off (8 logical CPUs), RX 9070 XT 16 GB (RDNA 4), 31 GB, Windows 11, Series X profile,
play.ps1settings, diagnostics build. Upstream's figures are from a 24-thread i9-12900K, so this checks them on a smaller CPU and adds the tooling to measure per frame.No defaults change. The result is a recommended pair of existing switches, measured as a whole:
VICTORY_PORT_JOURNAL=1 VICTORY_PORT_CONSTANTS=14 runs per arm, interleaved, same build, warm caches, the same scripted scene (the first mission's intro), window 90-190 s, frames with ≥ 100 draws. Values are the mean (min..max) of the runs' medians. The baseline's run-to-run spread is ~8 %, so differences under ~5 % are read as noise.
Full report with every number:
docs/prepare-time.md.What is in the branch
amdxc64.dll, read of 0x8) andsize_testscrashed the shader suite. Its record counts collided with main's view addresses in the slot table; they now follow them (SLOT_COUNTS_AT = (VIEW_ADDRESSES + SLOT_STRIDES_COUNT * 8) / 4,SLOT_STRIDES_BYTESgrows to match).view_addresses_follow_the_stridesadapted: red before ("left: [305419776, 66, 3735928559, ...]"), green after. If #55 is merged on its own first, this merge commit drops out.VICTORY_FRAME_CSV=<file>: one line per present (frame ms, prepare ms, copies, texture refreshes, copy-back, write-tracker lock waits, draws). Running totals beside the existing per-line counters (tally), including thefetch_subthat replaces threads' summed time. Test:a_line_holds_what_each_counter_grew_by.scripts/bench.ps1(one run: scripted keys, stops only the processes it started, by id),bench-parts.ps1(the 5 s counters averaged over world blocks),bench-ab.ps1(per-arm summary).VICTORY_TITLE_DIR: the package folder when the executable is kept outside the dump (the dump is then only read).#[ignore]d because each switch is read once per process. Without the switch they are red, with it green:port::tests::the_constants_heap_is_used_in_place_with_the_switch: "the title's constants heap is not used in place (a host copy is tracked)"watch::port7_tests::an_asking_notes_its_pages_under_the_shared_lock_with_the_switch: "the asking took the journal alone to note its pages (not shared)"The history also holds
VICTORY_REFRESH_PIECE_KBand its revert (see below). They are kept rather than squashed so the record is honest.A/B of the renderer ports on this machine (n=4 per arm)
PORT_JOURNALPORT_CONSTANTSPORT_GUARDPORT_DESCRIPTORSMeasured and not worth it
VICTORY_REFRESH_PIECE_KB(mine: long refresh spans cut into pieces): 4 of 4 runs crashed in the title (write to 0x0) within 46 s, against 0 of 8 for the other arms. Pieces of one span put several threads in one host copy at once; before, every span of a flush was its own copy (3,424 spans in 3,424 copies). Reverted.Not tested
VICTORY_PORT_CBV(it needs its own translate and warm run), the Series S profile with FidelityFX, other scenes, longer sessions, other CPUs or GPUs. No on-CPU sampler was available. Attribution is from the runtime's own counters and oneVICTORY_TIMELINEtrace. Avenue 5 of the work (guard rest against protection changes) is still being measured and will be added here.Suites:
cargo test -p victory-gpu --release --lib382 passed, 0 failed, 36 ignored.cargo test -p victory-shader --release --lib302 passed, 0 failed (no more access violation insize_tests).🤖 Generated with Claude Code
@UwUCammie on GitHub · 2026-11-26 21:20 UTC · original · edited 2026-11-26 22:14 UTC
I’m seeing a visual issue worth checking alongside the
PORT_CONSTANTSresults. On an RX 7900 XT with Wine 11.22, RADV 26.3.1 and vkd3d-proton GE buildcae8353e(reported version 3.2.0), I loaded a waterfront save with the constants heap in place. The HUD came up over a black world, including at 155 s. The in-place indirect path was active and reached 5,536 executions per frame. I testedPORT_CONSTANTSalone on our AMD branch. The journal-plus-constants pair on your Windows build is a different configuration. I have a same-binary port-off control queued. AMD run details@GiovanniFadanelli on GitHub · 2026-11-26 21:30 UTC · original
Two updates (also in
docs/prepare-time.md):@UwUCammie, picture check. Thanks for flagging it. I re-ran base and journal + constants once each on this Windows build (RX 9070 XT) and saved frames in the world. With the pair on, the world draws as it does in base: frame 3000 shows the lit street with the credits, frame 3400 the car's interior. That covers only the intro cutscene. It doesn't rule out your case: Wine/RADV/vkd3d-proton, constants without journal, and a waterfront save are all different, and I couldn't test them here. Your same-binary port-off control will tell more. Until then, read the result as "faster and the picture holds on Windows in this scene", not as a general recommendation.
Avenue 5 (kernel and OS calls), measured. On this machine, per frame: 316
GetWriteWatchaskings (2.8 ms over all threads, about 9 µs each), 0VirtualQuery, 759 blocks made read-only (4.4 ms ofVirtualProtect), and 378 guard faults. The log's "moves" counter iscopy_mapped's kernel read of title memory, not remapping. I triedVICTORY_GUARD_REST=10000on top of journal + constants (4 interleaved runs each):GUARD_REST=10000That's noise, so I dropped it. The journal + constants arm repeated its earlier 48.6 ms in this separate batch.
@GiovanniFadanelli on GitHub · 2026-11-26 21:31 UTC · original
Scope of the recommendation, so nobody turns on something that hasn't been checked:
VICTORY_PORT_JOURNAL=1 VICTORY_PORT_CONSTANTS=1VICTORY_PORT_JOURNAL=1alonePORT_CONSTANTSis reported above to draw a black world there; I have no Wine setup to check either way. Journal alone measured prepare −6.0 %, frame −3.5 % on WindowsI'll treat UwUCammie's same-binary port-off control as the deciding run for constants under Wine.
docs/prepare-time.mdsays the same.@GiovanniFadanelli on GitHub · 2026-11-26 21:36 UTC · original
One more check toward the black-world report: I ran
VICTORY_PORT_CONSTANTS=1alone, which is the configuration that was reported, on Windows (RX 9070 XT), with frames saved in the world. The world draws: frame 2600 shows the street with the police officer, and the frame median is 48.4 ms. So on Windows this switch doesn't black out the world, either alone or with journal. What's left points to Wine/RADV/vkd3d-proton, or to that waterfront save, and I can't run either here. The Windows / Wine split in my previous comment stands.@GiovanniFadanelli on GitHub · 2026-11-26 21:45 UTC · original
Wine guard added (
9aa4d94). Instead of leaving the black-world risk to the docs, the code now refuses it:VICTORY_PORT_CONSTANTS=1stays off under Wine, detected by ntdll'swine_get_version, unlessVICTORY_PORT_CONSTANTS_WINE=1is also set. A warning says so in the log. One rule,constants_switch, serves both halves of port #1 (the GPU side and xmem).port::tests::the_constants_port_stays_off_under_wine_unless_asked_for_there: red against the old rule ("on under Wine without VICTORY_PORT_CONSTANTS_WINE=1"), green after. The GPU suite passes (383), and so does the HLE suite (155).So the recommended
VICTORY_PORT_JOURNAL=1 VICTORY_PORT_CONSTANTS=1is safe to set everywhere: on Wine it acts as journal alone until someone opts in. @UwUCammie, your port-off control can still run withVICTORY_PORT_CONSTANTS_WINE=1.@UwUCammie on GitHub · 2026-11-26 21:48 UTC · original
@GiovanniFadanelli The port-off control finished. With
VICTORY_PORT_CONSTANTS=0, the character, porch and waterfront were visible at 125, 135, 145 and 155 seconds. WithPORT_CONSTANTS=1and indirect ordering off, the same four captures had a HUD over a black world. The same executable loaded copies of the same save with the same starting caches and timed inputs. Both runs finished, and neither overlapped another GPU client. The stock run recorded zero in-place indirect draws, against a peak of 5,536 per frame with constants on.I’d keep constants off for this Wine/RADV configuration. The journal was off in both runs. Your Windows result and the combined journal-plus-constants setting under Wine are separate cases. Comparison and capture method
@UwUCammie on GitHub · 2026-11-26 21:58 UTC · original
I can now reproduce a buffer read mismatch without the game on the RX 7900 XT. Under Wine 11.22 / vkd3d-proton / RADV 26.3.1, the reserved-section heap opens and the buffer is placed. A GPU copy from that buffer then reads back different bytes from the pattern the CPU wrote through the original two views. The first assertion fails before the test reaches the GPU-write direction. I’ve added an opt-in test for the selected adapter so the same case can be run on Windows. Standalone test and command
@UwUCammie on GitHub · 2026-11-26 22:23 UTC · original
I narrowed the buffer mismatch down to the CPU/GPU boundary. A second CPU mapping matched all 320 KiB that the CPU wrote. The GPU read zeros over that whole range. It could read back its own 256-byte write, but neither CPU mapping saw it. Filling every page before the import made no difference. I got the same result with GE
cae8353eand upstream71cae091on the 7900 XT, withdescriptor_heapenabled. The updated fixture runs on the renderer’s preferred adapter if someone can compare native Windows. Test and results@GiovanniFadanelli on GitHub · 2026-11-27 02:40 UTC · original
@UwUCammie I ran your fixture on native Windows at af245c3 with your command (debug build). Both
preferred_adapter_reserved_section_round_tripandpreferred_adapter_prefilled_reserved_section_round_trippass:VICTORY_D3D12_ADAPTER=RX 9070 XT;VICTORY_D3D12_ADAPTER=AMD Radeon(TM) Graphics.The GPU reads the CPU's bytes across both views, and its own 256-byte write shows up in the original view, in the second mapping and on the GPU. That matches the game on Windows, where the world draws with constants on, and it points to the shared memory under Wine/vkd3d-proton/RADV. The Wine guard in
9aa4d94stays as it is.@UwUCammie on GitHub · 2026-11-27 02:41 UTC · original
Thanks for running both fixtures on both adapters. I’ve added your native Windows passes to the notes for the RX 7900 XT Wine test so the two results stay together. The tested Windows configurations share bytes in both directions, while the two vkd3d-proton builds here on RADV still saw separate CPU and GPU backing. I’ve queued the placed-memory route from #420 on this 7900 XT as a separate test.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.