perf(um): VICTORY_LAZY_HIDDEN=1 maps lazily bound pages hidden from the card until it asks (only with VICTORY_BVH_HARDWARE=0; off by default) #639
No reviewers
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/lobomfz--VIctory-xmem!639
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-639"
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?
@Raptorbk45 on GitHub · 2026-12-05 22:37 UTC · original
Raptorbk45:perf/lazy-hidden→main· +43 −2 · 3 files · 1 commits · openThis only acts with
VICTORY_BVH_HARDWARE=0. Onmainthe hardware node test is on by default wherever the card and driver have it (VICTORY_BVH_HARDWAREunset;run.shexportsVICTORY_BVH_IN_PLACE=1), and then this switch does nothing but log that it is ignored. It is for people who run withVICTORY_BVH_HARDWARE=0(no hardware node test; note that the low–high presets setVICTORY_BVH_BUILDER=0but notVICTORY_BVH_HARDWARE=0, so they still need it set).8aec563(#38) made lazy binding show every page to the card at once, because the nodes of a hardware BVH64 hold addresses the card follows without anything asking for them. Without the hardware node test nothing reads that way, so withVICTORY_LAZY_HIDDEN=1a lazily bound page that nothing has pointed the card at yet is mappedHIDDENagain (as before8aec563) and shown when something does (want→reveal). Each page shown is an address-mapping call of about 40 µs on the submitting thread; in our streaming bursts a third to a half of the pages bound were never asked for.Off by default; with it off (or with
VICTORY_BVH_HARDWAREnot0) the protections passed are exactlymain's.How it was checked
Run after the final edit, on Linux (CachyOS), against
mainat8c4e6633:./build.sh check(release, MSVC target): passes; the one warning (room_latelynever used,resource.rs) is already onmaincargo xtask policy: passescargo test -p victory-core --lib menu: 18 passedNot run: the game, on this branch. The data below is from our fork.
Branch head:
d0b388b8.No unit test: the switch only changes the protection bits handed to the unified-memory driver path (
map/show_as), which needs RADV with the unified-memory patch and a card; the decision itself is two env reads.Data (from our fork, not re-measured on this branch)
Measured on our fork on 5 December 2026, the first 150 s of the world after loading the save where the arrest cinematic plays (the cinematic plays by itself; runs launched unattended), with a RADV build carrying extra counters. Conditions: RX 7700 XT 12 GB, Ryzen 5 5600X, 32 GB, CachyOS, RADV from
setup.sh's Mesa,CONSOLE=series-s, 1920x1080, no ray tracing (VICTORY_BVH_BUILDER=0 VICTORY_BVH_HARDWARE=0),VICTORY_FRAME_INTERVAL_MS=0,VICTORY_RECORD_PLACES=1 VICTORY_RECORD_RANGES=1and the rest of our fork'srun.shdefaults.VICTORY_PAGES=0alone (1 run)VICTORY_LAZY_HIDDEN=1alone (1 run)VICTORY_PAGES=0 VICTORY_LAZY_HIDDEN=1(6 runs)The median does not move; the bursts get shorter. Together the two halve the mapping calls in the bursts (about 7,300 → 3,200 a second) and the submitting thread's time applying the title's page mappings (about 20 → 12 ms a frame). Most of the gain is
VICTORY_PAGES=0(already onmain); this switch's own share is the difference between the second and fourth rows, with one run of the former. No broken image seen in those runs. More context in #636. Please measure on your own streaming scenes before trusting it.Checks
maindocs/SETTINGS.mdandrun.conf.default, both saying it only acts withVICTORY_BVH_HARDWARE=0um/residency.rs, not lazy binding; independentcargo xtask policy@Milkhaus-tech on GitHub · 2026-12-06 03:52 UTC · original
Test results on RDNA 4. With
VICTORY_LAZY_HIDDEN=1the frame rate goes up, but the world does not load, and 1 run of 3 crashed.Setup: RX 9060 XT 16 GB (Navi 44,
1002:7590), Ryzen 7 5800X, 32 GB RAM, Ubuntu 26.04 (kernel 7.0.0-44), repo Mesa 26.3.1 RADV, GE-Proton11-11, resizable BAR on. Build:main@8c4e663with #596, #637 and this PR merged, so the other switches were off unless listed. Series X profile, potato preset, 1920x1080 output,VICTORY_FSR_4K=balanced, ML frame generation (FRAMEGEN=4), ray tracing off (presetBVH_BUILDER=0).Method:
VICTORY_BENCH_ROUTE=downtownwith the same save restored before every run. I measured route start +30 s to +330 s from thestats: frame5 s windows (about 59 windows per run). I took a screenshot at +150 s.BVH_HARDWARE=0onlyLAZY_HIDDEN=1+BVH_HARDWARE=0lazy pages: the card is shown a mapping of the title's when something it runs reads the memory by address). At the +150 s point, where theBVH_HARDWARE=0-only run shows the bay, the island and the city, the lazy run shows a flat grey slab with water at one edge. The route car is a black silhouette: its body panels are missing, and only the chassis, wheels and frame bars draw. The cranes in the sky draw. So the ~25% fps gain comes from not drawing most of the world, not from cheaper mappings.first-chance exception 0xc0000005 at victory-image-…dll+0x50e732e (read 0x70: nothing mapped there), and then the title's breakpad report. None of the ~30 other runs on this build crashed.My guess, untested: on this card something reaches some of those pages without going through the path that shows them, so they stay hidden. I have the logs and screenshots, and can run a debug build or extra logging if that helps.
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.