Repository navigation
Conversation
…SECTION_MB, off by default) After RyanCase94's idea and first patch in fxceless#1089. With VICTORY_SECTION_MB=2 a request is backed by sections of at most 2 MiB instead of one section per request, so a remap touches small sections; 0 or unset keeps one section per request. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
An in-game data point on NVIDIA for the same idea, though not this PR's port: we applied the original 2 MiB section patch from #1089 alone on our fork-based stack (RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, Windows 11 build 26200, Series S).
Like your 3070 table, the clear change was in the long frames. This is from a few runs, so scene variance is possible, and it was on Windows only. |
|
Data point from an RTX 3080 10 GB (Series X,
So the remapping cost drops about 8x here too, but on this tree and card the long freezes while driving stay: the texture refresh's "waiting for title memory to hold still" reads 0 ms with or without the switch, and |
|
Thank you both for running it, and on the fork's own code, which I had not done. It is the same shape as on the 3070: the remapping cost drops by a large factor and the frame rate by itself does not move. What went away here were the 0.3-0.8 s stalls while driving, which on my tree were the texture refresh waiting for the title's remaps; on a tree where that wait already reads 0 ms, as in the RTX 3080 run, there is nothing for it to remove, and the long frames there have another cause. I would leave the switch off by default as proposed. |
…xceless#1276 on top What the ten commits bring (two changes of the translator with no switch, the six-line box, seven switches off by default), and what one session measured here on build 73df053 with the ten switches of Status and the usual manoeuvre, its shader cache warm but for 380 programs: 1,794 frames, 6.41 fps, median frame 146 ms, 95th percentile 218; all 28 scripted presses read; the same room with the faults it had; no error line, no device loss. Before the merge: 6.52 to 6.67 fps, 143 to 147 ms, in five sessions. Private memory peaked at 16.5 GB (17.9 before). Rows for the skin bake's own textures (fxceless#1264, in with the merge and off by default; measured here with this tree's port: 185 wrong reads to none), for the sections of 2 MiB (fxceless#1274) and for the buffer copies let go with their view heap (fxceless#1276). Tests on the merged tree: victory-shader 258, victory-gpu 281 with diagnostics, victory-hle 128, the asset policy passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
A synthetic reproduction of #1089's stall, without the game. It shows the same effect, and it can be rerun on any machine. The method is what the title does to its physical pages. A 4 GiB pagefile-backed section ( i7-14650HX, 32 GB, Windows 11 26200, release build, median of 5 rounds, going through VIctory's own
The same change with the benchmark is up for upstream as Marvisak/VIctory#3177 (on by default there, since main has no in-place heap census), and for AnyXboxX as LooperSalty/AnyXboxX#352 (off by default, like here). For this PR, @CuteBooty: the benchmark is a self-contained AI use: Claude Code (Claude Opus 5.5) wrote the benchmark and ran it on my machine. No game files or game data. |
…ions An ignored test, physical_remap_bench, by KainanP (Marvisak/VIctory PR 3177), adapted to VICTORY_SECTION_MB: a 4 GiB allocation mapped one 64 KiB view per page, then 10 s of random single-page remaps while another thread makes, touches and frees 2 GiB, for one section per allocation and for 2 MiB sections over 3 rounds. The sections are chosen per run through a test-only override of section_pages, so the switch's value does not matter. cargo test --release -p victory-hle physical_remap_bench -- --ignored --nocapture Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@KainanP thank you for the benchmark. I have ported the test to this branch ( One change from yours: a drop guard stops the pressure thread, so a failed assertion in the timed loop cannot leave the test hanging. One run here (Ryzen 5 3600, 32 GB, Windows 11; the machine was not quiet, so read it as shape, not as numbers):
Medians of 3 rounds. In one of the three rounds the one-section case was as fast as the 2 MiB one, so the stall comes and goes, as it does in the game. AI-assisted (Claude Code). |
RTX 4080 / i5-13600K (Win10) 10-minute verification — 66× smaller worst frame stall (
|
…, off by default) XMemAllocatePhysicalPages made one pagefile-backed section per request (6.1 GiB at once for GTA VI), mapped a 64 KiB view at a time. Windows' large-page rebuild worker walks every view of a section under its lock for each page it trades, so the title's map and unmap calls wait behind it (fxceless/victory-fork#1089). VICTORY_SECTION_MB=2 backs a request with sections of at most 2 MiB; unset or 0 keeps one section per request. GPU side: sections and our own views of them (VICTORY_QUIET_BACK) are kept by handle in maps instead of vectors scanned linearly, a closed section's own view is unmapped at once (title_memory_section_closed), and the census groups sections by size. Synthetic benchmark included (ignored test physical_remap_bench). Source: fxceless/victory-fork#1274 (CuteBooty), idea and first patch from fxceless/victory-fork#1089 (RyanCase94) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Summary of the confirmations so far: the remapping cost drops on every machine that tried it; the stalls go away where the remaps were their cause @Proudnoob4 thank you for the 10-minute pass and for porting it to a different tree, and thanks again to everyone who ran it. Collected in one place, as reported by each tester (their trees and scenes differ, so the rows do not compare with each other):
What I read from it:
Limits, as the testers stated them: mostly one run each; Proudnoob4's pass with the switch also had On the default: I proposed leaving it off. With these reports I would be equally comfortable with it on by default if you prefer that, @fxceless; that is your call. The ignored benchmark on the branch ( |
At
46bf5351, each physical-page request creates one Windows section. Fork run 307 measured 45 ms per usual frame and 197 ms per streaming frame in remapping, mostly in the system's own calls; run 308 found no redundant mapping among 103,024 pages. This ports RyanCase94's idea and first patch from #1089: a request is backed by sections of at most 2 MiB, so a remap touches small sections.Switch.
VICTORY_SECTION_MB=2turns it on. Unset or0keeps one section per request, as now. It is off by default here on purpose: with it on, a large request has several section handles, which matters to code that opens a whole allocation as one heap, and it has not been run under Wine. In my own tree it has been on by default for about fifteen runs.Measured (my tree, not this tip: Ryzen 5 3600, RTX 3070 8 GB, Windows 11, Series S; 5-second log lines):
The lower waits held in every run since. Frame time itself did not get shorter. In play, the half-second freezes while driving were gone.
What changed.
xmem.rs:XMemAllocatePhysicalPagesandSection::drop(the cap and the cleanup).inplace.rs:title_memory_section,title_memory_section_closed,write_own,census_oftrack individual sections. One test checks page numbering and a two-byte write across the 2 MiB boundary, with the switch off and on.State. Ported by hand onto this tip.
cargo clippy --workspace --all-targets -- -D warningsis clean,cargo test --workspacepasses (617), the asset policy passes. Not yet run in the game on this tip; the numbers above are from my tree (CuteBooty/victory-8gb), where the same change isVICTORY_SECTION_MB, default 2.Credit: RyanCase94 (#1089) for the idea and the first patch.
🤖 Generated with Claude Code